From 5629af179a8423adcae1ef249c2c5efe1ef3c71c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Jun 2005 11:02:44 -0700 Subject: [PATCH 001/144] Change error message when the amount of stack needed is not available to include how much stack space we need. (Bug #11213) sql/share/errmsg.txt: Add new error message sql/sql_parse.cc: Use new ER_STACK_OVERRUN_NEED_MORE, which includes information on how much room we need on the stack. --- sql/share/errmsg.txt | 2 ++ sql/sql_parse.cc | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index fcc04c950aa..7a380c453fd 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5358,3 +5358,5 @@ ER_STMT_HAS_NO_OPEN_CURSOR eng "The statement (%lu) has no open cursor." ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG eng "Explicit or implicit commit is not allowed in stored function or trigger." +ER_STACK_OVERRUN_NEED_MORE + eng "Thread stack overrun: %ld bytes used of a %ld byte stack, and %ld bytes needed. Use 'mysqld -O thread_stack=#' to specify a bigger stack." diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 33339cf0882..0e563c55585 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5094,8 +5094,9 @@ bool check_stack_overrun(THD *thd, long margin, if ((stack_used=used_stack(thd->thread_stack,(char*) &stack_used)) >= (long) (thread_stack - margin)) { - sprintf(errbuff[0],ER(ER_STACK_OVERRUN),stack_used,thread_stack); - my_message(ER_STACK_OVERRUN,errbuff[0],MYF(0)); + sprintf(errbuff[0],ER(ER_STACK_OVERRUN_NEED_MORE), + stack_used,thread_stack,margin); + my_message(ER_STACK_OVERRUN_NEED_MORE,errbuff[0],MYF(0)); thd->fatal_error(); return 1; } From d93705b83746b68d730e0c88bd3c21c58312fe6f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Jun 2005 12:46:21 -0700 Subject: [PATCH 002/144] Fix reporting of type for unique key on VARCHAR field. (Bug #11227) mysql-test/r/key.result: Add new results mysql-test/t/key.test: Add new regression test sql/table.cc: Use keyinfo->key_parts to determine if key is part of a multiple-field key or is unique. --- mysql-test/r/key.result | 25 +++++++++++++++++++++++++ mysql-test/t/key.test | 16 ++++++++++++++++ sql/table.cc | 7 +++---- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index 3ad8571aadd..bce02a1cb0f 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -354,3 +354,28 @@ t1 CREATE TABLE `t1` ( KEY `a` (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +create table t1 (a int not null primary key, b varchar(20) not null unique); +desc t1; +Field Type Null Key Default Extra +a int(11) NO PRI +b varchar(20) NO UNI +drop table t1; +create table t1 (a int not null primary key, b int not null unique); +desc t1; +Field Type Null Key Default Extra +a int(11) NO PRI +b int(11) NO UNI +drop table t1; +create table t1 (a int not null primary key, b varchar(20) not null, unique (b(10))); +desc t1; +Field Type Null Key Default Extra +a int(11) NO PRI +b varchar(20) NO UNI +drop table t1; +create table t1 (a int not null primary key, b varchar(20) not null, c varchar(20) not null, unique(b(10),c(10))); +desc t1; +Field Type Null Key Default Extra +a int(11) NO PRI +b varchar(20) NO MUL +c varchar(20) NO +drop table t1; diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 9db1523be51..96407a3d1bc 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -337,3 +337,19 @@ show create table t1; alter table t1 modify a varchar(20); show create table t1; drop table t1; + +# +# Bug #11227: Incorrectly reporting 'MUL' vs. 'UNI' on varchar +# +create table t1 (a int not null primary key, b varchar(20) not null unique); +desc t1; +drop table t1; +create table t1 (a int not null primary key, b int not null unique); +desc t1; +drop table t1; +create table t1 (a int not null primary key, b varchar(20) not null, unique (b(10))); +desc t1; +drop table t1; +create table t1 (a int not null primary key, b varchar(20) not null, c varchar(20) not null, unique(b(10),c(10))); +desc t1; +drop table t1; diff --git a/sql/table.cc b/sql/table.cc index 6677453969b..b8b13aaccd5 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -701,10 +701,9 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, key_part->key_part_flag|= HA_BIT_PART; if (i == 0 && key != primary_key) - field->flags |= - ((keyinfo->flags & HA_NOSAME) && - field->key_length() == - keyinfo->key_length ? UNIQUE_KEY_FLAG : MULTIPLE_KEY_FLAG); + field->flags |= ((keyinfo->flags & HA_NOSAME) && + (keyinfo->key_parts == 1)) ? + UNIQUE_KEY_FLAG : MULTIPLE_KEY_FLAG; if (i == 0) field->key_start.set_bit(key); if (field->key_length() == key_part->length && From 5841d70af8ea31288398229926dd647a7bacd852 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Jun 2005 20:00:21 -0700 Subject: [PATCH 003/144] Fix multiplication of abs() by a negative value. (Bug #11402) mysql-test/r/func_math.result: Add new results mysql-test/t/func_math.test: Add new regression test sql/item_func.cc: Don't set result of abs() to unsigned. Result should still be a signed value, even if always positive. --- mysql-test/r/func_math.result | 3 +++ mysql-test/t/func_math.test | 5 +++++ sql/item_func.cc | 3 --- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 9cb1e4a56d6..80b15d1d3c8 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -137,3 +137,6 @@ select * from t1; round(1, 6) 1.000000 drop table t1; +select abs(-2) * -2; +abs(-2) * -2 +-4 diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 4c24dae8c5d..11af874380e 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -71,3 +71,8 @@ create table t1 select round(1, 6); show create table t1; select * from t1; drop table t1; + +# +# Bug #11402: abs() forces rest of calculation to unsigned +# +select abs(-2) * -2; diff --git a/sql/item_func.cc b/sql/item_func.cc index 442ef15bba8..657eb374c6f 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -914,10 +914,7 @@ void Item_func_abs::fix_length_and_dec() max_length=args[0]->max_length; hybrid_type= REAL_RESULT; if (args[0]->result_type() == INT_RESULT) - { hybrid_type= INT_RESULT; - unsigned_flag= 1; - } } From f56dd2a0fa24b154aa71307e12283e43c7ff0914 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 24 Jun 2005 13:41:33 -0700 Subject: [PATCH 004/144] Add my_str_malloc and _free function pointers to strings library which will by default exit(1) if malloc() fails, but can be set to do something else by the calling program does, which mysqld does to use my_malloc(..., MYF(MY_FAE)) instead. Also checks allocation in conf_to_src utility program. (Bug #7003) strings/conf_to_src.c: if malloc() fails, just abort VC++Files/client/mysqlclient.dsp: Add str_alloc.c VC++Files/client/mysqlclient_ia64.dsp: Add str_alloc.c VC++Files/libmysql/libmysql.dsp: Add str_alloc.c VC++Files/libmysql/libmysql_ia64.dsp: Add str_alloc.c VC++Files/libmysqld/libmysqld.dsp: Add str_alloc.c VC++Files/libmysqld/libmysqld_ia64.dsp: Add str_alloc.c VC++Files/strings/backup/strings.dsp: Add str_alloc.c VC++Files/strings/noMASM/strings.dsp: Add str_alloc.c VC++Files/strings/strings.dsp: Add str_alloc.c VC++Files/strings/strings_ia64.dsp: Add str_alloc.c include/m_string.h: Add my_str_malloc/free function pointers. libmysql/Makefile.shared: Add str_alloc.lo sql/mysqld.cc: Reassign my_str_malloc/free pointers so they use my_malloc/free strings/Makefile.am: Add str_alloc.c strings/ctype-tis620.c: Use my_str_malloc/free --- VC++Files/client/mysqlclient.dsp | 4 +++ VC++Files/client/mysqlclient_ia64.dsp | 4 +++ VC++Files/libmysql/libmysql.dsp | 4 +++ VC++Files/libmysql/libmysql_ia64.dsp | 4 +++ VC++Files/libmysqld/libmysqld.dsp | 4 +++ VC++Files/libmysqld/libmysqld_ia64.dsp | 4 +++ VC++Files/strings/backup/strings.dsp | 7 +++++- VC++Files/strings/noMASM/strings.dsp | 4 +++ VC++Files/strings/strings.dsp | 4 +++ VC++Files/strings/strings_ia64.dsp | 4 +++ include/m_string.h | 7 ++++++ libmysql/Makefile.shared | 2 +- sql/mysqld.cc | 21 +++++++++++++++- strings/Makefile.am | 6 ++--- strings/conf_to_src.c | 2 ++ strings/ctype-tis620.c | 8 +++--- strings/str_alloc.c | 34 ++++++++++++++++++++++++++ 17 files changed, 113 insertions(+), 10 deletions(-) create mode 100644 strings/str_alloc.c diff --git a/VC++Files/client/mysqlclient.dsp b/VC++Files/client/mysqlclient.dsp index c0d891b1c9a..429a16073ee 100644 --- a/VC++Files/client/mysqlclient.dsp +++ b/VC++Files/client/mysqlclient.dsp @@ -571,6 +571,10 @@ SOURCE=..\strings\strxnmov.c # End Source File # Begin Source File +SOURCE=..\strings\str_alloc.c +# End Source File +# Begin Source File + SOURCE=..\mysys\thr_mutex.c # End Source File # Begin Source File diff --git a/VC++Files/client/mysqlclient_ia64.dsp b/VC++Files/client/mysqlclient_ia64.dsp index e38f37d61e6..aab436458c4 100644 --- a/VC++Files/client/mysqlclient_ia64.dsp +++ b/VC++Files/client/mysqlclient_ia64.dsp @@ -552,6 +552,10 @@ SOURCE=..\strings\strxnmov.c # End Source File # Begin Source File +SOURCE=..\strings\str_alloc.c +# End Source File +# Begin Source File + SOURCE=..\mysys\thr_mutex.c # End Source File # Begin Source File diff --git a/VC++Files/libmysql/libmysql.dsp b/VC++Files/libmysql/libmysql.dsp index 356aac3563f..34da02fa3c5 100644 --- a/VC++Files/libmysql/libmysql.dsp +++ b/VC++Files/libmysql/libmysql.dsp @@ -539,6 +539,10 @@ SOURCE=..\strings\strxnmov.c # End Source File # Begin Source File +SOURCE=..\strings\str_alloc.c +# End Source File +# Begin Source File + SOURCE=..\mysys\thr_mutex.c # End Source File # Begin Source File diff --git a/VC++Files/libmysql/libmysql_ia64.dsp b/VC++Files/libmysql/libmysql_ia64.dsp index 75586ef2cf6..d18db197ad1 100644 --- a/VC++Files/libmysql/libmysql_ia64.dsp +++ b/VC++Files/libmysql/libmysql_ia64.dsp @@ -526,6 +526,10 @@ SOURCE=..\strings\strxnmov.c # End Source File # Begin Source File +SOURCE=..\strings\str_alloc.c +# End Source File +# Begin Source File + SOURCE=..\mysys\thr_mutex.c # End Source File # Begin Source File diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp index 85bd8ca023e..76f1a28b5d0 100644 --- a/VC++Files/libmysqld/libmysqld.dsp +++ b/VC++Files/libmysqld/libmysqld.dsp @@ -600,6 +600,10 @@ SOURCE=..\strings\strxnmov.c # End Source File # Begin Source File +SOURCE=..\strings\str_alloc.c +# End Source File +# Begin Source File + SOURCE=..\sql\table.cpp # End Source File # Begin Source File diff --git a/VC++Files/libmysqld/libmysqld_ia64.dsp b/VC++Files/libmysqld/libmysqld_ia64.dsp index fe99ea480c7..b5223e38f2d 100644 --- a/VC++Files/libmysqld/libmysqld_ia64.dsp +++ b/VC++Files/libmysqld/libmysqld_ia64.dsp @@ -538,6 +538,10 @@ SOURCE=..\strings\strxnmov.c # End Source File # Begin Source File +SOURCE=..\strings\str_alloc.c +# End Source File +# Begin Source File + SOURCE=..\sql\table.cpp # End Source File # Begin Source File diff --git a/VC++Files/strings/backup/strings.dsp b/VC++Files/strings/backup/strings.dsp index a6be39b40ab..dcff9915f13 100644 --- a/VC++Files/strings/backup/strings.dsp +++ b/VC++Files/strings/backup/strings.dsp @@ -238,7 +238,12 @@ InputName=Strxmov # End Source File # Begin Source File -SOURCE=.\strxnmov.c +SOURCE=.\strxnmov.c +# End Source File +# Begin Source File + +SOURCE=.\str_alloc.c # End Source File + # End Target # End Project diff --git a/VC++Files/strings/noMASM/strings.dsp b/VC++Files/strings/noMASM/strings.dsp index ffec20f3a59..e7a0395c3df 100644 --- a/VC++Files/strings/noMASM/strings.dsp +++ b/VC++Files/strings/noMASM/strings.dsp @@ -256,6 +256,10 @@ SOURCE=.\strxnmov.c # End Source File # Begin Source File +SOURCE=.\str_alloc.c +# End Source File +# Begin Source File + SOURCE=.\xml.c # End Source File # End Target diff --git a/VC++Files/strings/strings.dsp b/VC++Files/strings/strings.dsp index 320cdaf2132..714359c5570 100644 --- a/VC++Files/strings/strings.dsp +++ b/VC++Files/strings/strings.dsp @@ -273,6 +273,10 @@ SOURCE=.\strxnmov.c # End Source File # Begin Source File +SOURCE=.\str_alloc.c +# End Source File +# Begin Source File + SOURCE=.\xml.c # End Source File # End Target diff --git a/VC++Files/strings/strings_ia64.dsp b/VC++Files/strings/strings_ia64.dsp index c0b7b9c292c..0ccb4f62928 100644 --- a/VC++Files/strings/strings_ia64.dsp +++ b/VC++Files/strings/strings_ia64.dsp @@ -272,6 +272,10 @@ SOURCE=.\strxnmov.c # End Source File # Begin Source File +SOURCE=.\str_alloc.c +# End Source File +# Begin Source File + SOURCE=.\xml.c # End Source File # End Target diff --git a/include/m_string.h b/include/m_string.h index d3465363beb..33ba9c155c2 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -88,6 +88,13 @@ extern "C" { #endif +/* + my_str_malloc() and my_str_free() are assigned to implementations in + strings/alloc.c, but can be overridden in the calling program. + */ +extern void *(*my_str_malloc)(size_t); +extern void (*my_str_free)(void *); + #if defined(HAVE_STPCPY) && !defined(HAVE_mit_thread) #define strmov(A,B) stpcpy((A),(B)) #ifndef stpcpy diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared index a2bfa616f6b..d006363a1d3 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -46,7 +46,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \ ctype-win1250ch.lo ctype-utf8.lo ctype-extra.lo \ ctype-ucs2.lo ctype-gb2312.lo ctype-gbk.lo \ ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo \ - ctype-uca.lo xml.lo my_strtoll10.lo + ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo mystringsextra= strto.c dbugobjects = dbug.lo # IT IS IN SAFEMALLOC.C sanity.lo diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 3e0b496f05f..143bea5902d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2304,6 +2304,19 @@ static int my_message_sql(uint error, const char *str, myf MyFlags) DBUG_RETURN(0); } + +static void *my_str_malloc_mysqld(size_t size) +{ + return my_malloc(size, MYF(MY_FAE)); +} + + +static void my_str_free_mysqld(void *ptr) +{ + my_free((gptr)ptr, MYF(MY_FAE)); +} + + #ifdef __WIN__ struct utsname @@ -3158,11 +3171,17 @@ we force server id to 2, but this MySQL server will not act as a slave."); } #endif + /* + Initialize my_str_malloc() and my_str_free() + */ + my_str_malloc= &my_str_malloc_mysqld; + my_str_free= &my_str_free_mysqld; + /* init signals & alarm After this we can't quit by a simple unireg_abort */ - error_handler_hook = my_message_sql; + error_handler_hook= my_message_sql; start_signal_handler(); // Creates pidfile if (acl_init((THD *)0, opt_noacl) || my_tz_init((THD *)0, default_tz_name, opt_bootstrap)) diff --git a/strings/Makefile.am b/strings/Makefile.am index a98908ad54a..309de8f8830 100644 --- a/strings/Makefile.am +++ b/strings/Makefile.am @@ -22,19 +22,19 @@ pkglib_LIBRARIES = libmystrings.a # Exact one of ASSEMBLER_X if ASSEMBLER_x86 ASRCS = strings-x86.s longlong2str-x86.s my_strtoll10-x86.s -CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c +CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c else if ASSEMBLER_sparc32 # These file MUST all be on the same line!! Otherwise automake # generats a very broken makefile ASRCS = bmove_upp-sparc.s strappend-sparc.s strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s strnmov-sparc.s strstr-sparc.s -CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c +CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c else #no assembler ASRCS = # These file MUST all be on the same line!! Otherwise automake # generats a very broken makefile -CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c +CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c endif endif diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c index d5ffa15ee0c..5a6adb398da 100644 --- a/strings/conf_to_src.c +++ b/strings/conf_to_src.c @@ -75,6 +75,8 @@ static int get_charset_number(const char *charset_name) char *mdup(const char *src, uint len) { char *dst=(char*)malloc(len); + if (!dst) + exit(1); memcpy(dst,src,len); return dst; } diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 4fe8bb4e349..e445fa90bd3 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -541,7 +541,7 @@ int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)), tc1= buf; if ((len1 + len2 +2) > (int) sizeof(buf)) - tc1= (uchar*) malloc(len1+len2+2); + tc1= (uchar*) my_str_malloc(len1+len2+2); tc2= tc1 + len1+1; memcpy((char*) tc1, (char*) s1, len1); tc1[len1]= 0; /* if length(s1)> len1, need to put 'end of string' */ @@ -551,7 +551,7 @@ int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)), thai2sortable(tc2, len2); i= strcmp((char*)tc1, (char*)tc2); if (tc1 != buf) - free(tc1); + my_str_free(tc1); return i; } @@ -572,7 +572,7 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), a= buf; if ((a_length + b_length +2) > (int) sizeof(buf)) - alloced= a= (uchar*) malloc(a_length+b_length+2); + alloced= a= (uchar*) my_str_malloc(a_length+b_length+2); b= a + a_length+1; memcpy((char*) a, (char*) a0, a_length); @@ -621,7 +621,7 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), ret: if (alloced) - free(alloced); + my_str_free(alloced); return res; } diff --git a/strings/str_alloc.c b/strings/str_alloc.c new file mode 100644 index 00000000000..158fa7e75bb --- /dev/null +++ b/strings/str_alloc.c @@ -0,0 +1,34 @@ +/* Copyright (C) 2000 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; either version 2 of the License, or + (at your option) any later version. + + 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 */ + +#include +#include + +static void *my_str_malloc_default(size_t size) +{ + void *ret= malloc(size); + if (!ret) + exit(1); + return ret; +} + +static void my_str_free_default(void *ptr) +{ + free(ptr); +} + +void *(*my_str_malloc)(size_t)= &my_str_malloc_default; +void (*my_str_free)(void *)= &my_str_free_default; From 8efb9a0180cad49815dab37ef24bf2cf031b6f00 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Jun 2005 18:03:14 -0700 Subject: [PATCH 005/144] Fix max_connections_per_hour handling when the global max_user_connections is also set. (Bug #9947) sql/sql_parse.cc: Don't cap max_connections_per_hour to the global max_user_connections, since the latter is a limit of concurrent connections. Also, count number of concurrent connections for a user correctly, instead of starting at 2. --- sql/sql_parse.cc | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2eeae8f7332..be5d6283d65 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -136,7 +136,7 @@ static int get_or_create_user_conn(THD *thd, const char *user, const char *host, USER_RESOURCES *mqh) { - int return_val=0; + int return_val= 0; uint temp_len, user_len; char temp_user[USERNAME_LENGTH+HOSTNAME_LENGTH+2]; struct user_conn *uc; @@ -144,7 +144,7 @@ static int get_or_create_user_conn(THD *thd, const char *user, DBUG_ASSERT(user != 0); DBUG_ASSERT(host != 0); - user_len=strlen(user); + user_len= strlen(user); temp_len= (strmov(strmov(temp_user, user)+1, host) - temp_user)+1; (void) pthread_mutex_lock(&LOCK_user_conn); if (!(uc = (struct user_conn *) hash_search(&hash_user_connections, @@ -156,25 +156,23 @@ static int get_or_create_user_conn(THD *thd, const char *user, MYF(MY_WME))))) { send_error(thd, 0, NullS); // Out of memory - return_val=1; + return_val= 1; goto end; } uc->user=(char*) (uc+1); memcpy(uc->user,temp_user,temp_len+1); uc->user_len= user_len; - uc->host=uc->user + uc->user_len + 1; - uc->len = temp_len; - uc->connections = 1; - uc->questions=uc->updates=uc->conn_per_hour=0; - uc->user_resources=*mqh; - if (max_user_connections && mqh->connections > max_user_connections) - uc->user_resources.connections = max_user_connections; - uc->intime=thd->thr_create_time; + uc->host= uc->user + uc->user_len + 1; + uc->len= temp_len; + uc->connections= 0; + uc->questions= uc->updates= uc->conn_per_hour=0; + uc->user_resources= *mqh; + uc->intime= thd->thr_create_time; if (my_hash_insert(&hash_user_connections, (byte*) uc)) { my_free((char*) uc,0); send_error(thd, 0, NullS); // Out of memory - return_val=1; + return_val= 1; goto end; } } From 875b0e6322df380b6fcd4bd4f66d0d3e0142039f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Jul 2005 10:55:40 -0500 Subject: [PATCH 006/144] initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h'' --- server-tools/instance-manager/IMService.cpp | 73 +++++ server-tools/instance-manager/IMService.h | 14 + .../instance-manager/WindowsService.cpp | 200 ++++++++++++ .../instance-manager/WindowsService.h | 44 +++ server-tools/instance-manager/commands.cc | 9 +- server-tools/instance-manager/guardian.cc | 12 +- server-tools/instance-manager/instance.cc | 212 ++++++++++--- server-tools/instance-manager/instance.h | 3 + server-tools/instance-manager/instance_map.cc | 13 +- .../instance-manager/instance_options.h | 1 + server-tools/instance-manager/listener.cc | 296 ++++++++++-------- server-tools/instance-manager/listener.h | 2 +- server-tools/instance-manager/log.cc | 2 +- server-tools/instance-manager/manager.cc | 95 ++++-- server-tools/instance-manager/manager.h | 2 +- server-tools/instance-manager/mysqlmanager.cc | 24 +- .../instance-manager/mysqlmanager.vcproj | 295 +++++++++++++++++ server-tools/instance-manager/options.cc | 91 +++++- server-tools/instance-manager/options.h | 13 +- server-tools/instance-manager/parse_output.cc | 1 + server-tools/instance-manager/port.h | 25 ++ server-tools/instance-manager/priv.cc | 2 + server-tools/instance-manager/priv.h | 6 + .../instance-manager/thread_registry.cc | 9 +- server-tools/instance-manager/user_map.cc | 12 +- 25 files changed, 1236 insertions(+), 220 deletions(-) create mode 100755 server-tools/instance-manager/IMService.cpp create mode 100755 server-tools/instance-manager/IMService.h create mode 100755 server-tools/instance-manager/WindowsService.cpp create mode 100755 server-tools/instance-manager/WindowsService.h create mode 100755 server-tools/instance-manager/mysqlmanager.vcproj create mode 100755 server-tools/instance-manager/port.h diff --git a/server-tools/instance-manager/IMService.cpp b/server-tools/instance-manager/IMService.cpp new file mode 100755 index 00000000000..920a0f3db0c --- /dev/null +++ b/server-tools/instance-manager/IMService.cpp @@ -0,0 +1,73 @@ +#include +#include "log.h" +#include "options.h" +#include "IMService.h" + +IMService::IMService(void) +{ + serviceName = "MySqlManager"; + displayName = "MySQL Manager"; +} + +IMService::~IMService(void) +{ +} + +void IMService::Stop() +{ + ReportStatus(SERVICE_STOP_PENDING); + // stop the IM work +} + +void IMService::Run() +{ + // report to the SCM that we're about to start + ReportStatus((DWORD)SERVICE_START_PENDING); + + // init goes here + + ReportStatus((DWORD)SERVICE_RUNNING); + + // wait for main loop to terminate +} + +void IMService::Log(const char *msg) +{ + log_info(msg); +} + +int HandleServiceOptions(Options options) +{ + int ret_val = 0; + + IMService winService; + + if (options.install_as_service) + { + if (winService.IsInstalled()) + log_info("Service is already installed\n"); + else if (winService.Install()) + log_info("Service installed successfully\n"); + else + { + log_info("Service failed to install\n"); + ret_val = -1; + } + } + else if (options.remove_service) + { + if (! winService.IsInstalled()) + log_info("Service is not installed\n"); + else if (winService.Remove()) + log_info("Service removed successfully\n"); + else + { + log_info("Service failed to remove\n"); + ret_val = -1; + } + } + else + return (int)winService.Init(); + return ret_val; +} + diff --git a/server-tools/instance-manager/IMService.h b/server-tools/instance-manager/IMService.h new file mode 100755 index 00000000000..60c202fc561 --- /dev/null +++ b/server-tools/instance-manager/IMService.h @@ -0,0 +1,14 @@ +#pragma once +#include "windowsservice.h" + +class IMService : public WindowsService +{ +public: + IMService(void); + ~IMService(void); + +protected: + void Log(const char *msg); + void Stop(); + void Run(); +}; diff --git a/server-tools/instance-manager/WindowsService.cpp b/server-tools/instance-manager/WindowsService.cpp new file mode 100755 index 00000000000..851ac9beac8 --- /dev/null +++ b/server-tools/instance-manager/WindowsService.cpp @@ -0,0 +1,200 @@ +#include +#include +#include ".\windowsservice.h" + +static WindowsService *gService; + +WindowsService::WindowsService(void) +: statusCheckpoint(0), serviceName(NULL), inited(false), + dwAcceptedControls(SERVICE_ACCEPT_STOP) +{ + gService = this; + status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; + status.dwServiceSpecificExitCode = 0; +} + +WindowsService::~WindowsService(void) +{ +} + +BOOL WindowsService::Install() +{ + bool ret_val=false; + SC_HANDLE newService; + SC_HANDLE scm; + + if (IsInstalled()) return true; + + // determine the name of the currently executing file + char szFilePath[_MAX_PATH]; + GetModuleFileName(NULL, szFilePath, sizeof(szFilePath)); + + // open a connection to the SCM + if (!(scm = OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE))) + return false; + + newService = CreateService(scm, serviceName, displayName, + SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, + SERVICE_ERROR_NORMAL, szFilePath, + NULL, NULL, NULL, username, password); + + if (newService) + { + CloseServiceHandle(newService); + ret_val = true; + } + + CloseServiceHandle(scm); + return ret_val; +} + +BOOL WindowsService::Init() +{ + assert(serviceName != NULL); + + if (inited) return true; + + SERVICE_TABLE_ENTRY stb[] = + { + { (LPSTR)serviceName, (LPSERVICE_MAIN_FUNCTION) ServiceMain}, + { NULL, NULL } + }; + inited = true; + return StartServiceCtrlDispatcher(stb); //register with the Service Manager +} + +BOOL WindowsService::Remove() +{ + bool ret_val = false; + + if (! IsInstalled()) + return true; + + // open a connection to the SCM + SC_HANDLE scm = OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE); + if (! scm) + return false; + + SC_HANDLE service = OpenService(scm, serviceName, DELETE); + if (service) + { + if (DeleteService(service)) + ret_val = true; + DWORD dw = ::GetLastError(); + CloseServiceHandle(service); + } + + CloseServiceHandle(scm); + return ret_val; +} + +BOOL WindowsService::IsInstalled() +{ + BOOL ret_val = FALSE; + + SC_HANDLE scm = ::OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); + SC_HANDLE serv_handle = ::OpenService(scm, serviceName, SERVICE_QUERY_STATUS); + + ret_val = serv_handle != NULL; + + ::CloseServiceHandle(serv_handle); + ::CloseServiceHandle(scm); + + return ret_val; +} + +void WindowsService::SetAcceptedControls(DWORD acceptedControls) +{ + dwAcceptedControls = acceptedControls; +} + + +BOOL WindowsService::ReportStatus(DWORD currentState, DWORD waitHint, DWORD dwError) +{ + if(debugging) return TRUE; + + if(currentState == SERVICE_START_PENDING) + status.dwControlsAccepted = 0; + else + status.dwControlsAccepted = dwAcceptedControls; + + status.dwCurrentState = currentState; + status.dwWin32ExitCode = dwError != 0 ? ERROR_SERVICE_SPECIFIC_ERROR : NO_ERROR; + status.dwWaitHint = waitHint; + status.dwServiceSpecificExitCode = dwError; + + if(currentState == SERVICE_RUNNING || currentState == SERVICE_STOPPED) + { + status.dwCheckPoint = 0; + statusCheckpoint = 0; + } + else + status.dwCheckPoint = ++statusCheckpoint; + + // Report the status of the service to the service control manager. + BOOL result = SetServiceStatus(statusHandle, &status); + if (!result) + Log("ReportStatus failed"); + + return result; +} + +void WindowsService::RegisterAndRun(DWORD argc, LPTSTR *argv) +{ + statusHandle = ::RegisterServiceCtrlHandler(serviceName, ControlHandler); + if (statusHandle && ReportStatus(SERVICE_START_PENDING)) + Run(); + ReportStatus(SERVICE_STOPPED); +} + +void WindowsService::HandleControlCode(DWORD opcode) +{ + // Handle the requested control code. + switch(opcode) + { + case SERVICE_CONTROL_STOP: + // Stop the service. + status.dwCurrentState = SERVICE_STOP_PENDING; + Stop(); + break; + + case SERVICE_CONTROL_PAUSE: + status.dwCurrentState = SERVICE_PAUSE_PENDING; + Pause(); + break; + + case SERVICE_CONTROL_CONTINUE: + status.dwCurrentState = SERVICE_CONTINUE_PENDING; + Continue(); + break; + + case SERVICE_CONTROL_SHUTDOWN: + Shutdown(); + break; + + case SERVICE_CONTROL_INTERROGATE: + ReportStatus(status.dwCurrentState); + break; + + default: + // invalid control code + break; + } +} + +void WINAPI WindowsService::ServiceMain(DWORD argc, LPTSTR *argv) +{ + assert(gService != NULL); + + // register our service control handler: + gService->RegisterAndRun(argc, argv); +} + +void WINAPI WindowsService::ControlHandler(DWORD opcode) +{ + assert(gService != NULL); + + return gService->HandleControlCode(opcode); +} + + diff --git a/server-tools/instance-manager/WindowsService.h b/server-tools/instance-manager/WindowsService.h new file mode 100755 index 00000000000..b266bbca533 --- /dev/null +++ b/server-tools/instance-manager/WindowsService.h @@ -0,0 +1,44 @@ +#pragma once + +class WindowsService +{ +protected: + bool inited; + const char *serviceName; + const char *displayName; + const char *username; + const char *password; + SERVICE_STATUS_HANDLE statusHandle; + DWORD statusCheckpoint; + SERVICE_STATUS status; + DWORD dwAcceptedControls; + bool debugging; + +public: + WindowsService(void); + ~WindowsService(void); + + BOOL Install(); + BOOL Remove(); + BOOL Init(); + BOOL IsInstalled(); + void SetAcceptedControls(DWORD acceptedControls); + void Debug(bool debugFlag) { debugging = debugFlag; } + +public: + static void WINAPI ServiceMain(DWORD argc, LPTSTR * argv); + static void WINAPI ControlHandler(DWORD CtrlType); + +protected: + virtual void Run() = 0; + virtual void Stop() {} + virtual void Shutdown() {} + virtual void Pause() {} + virtual void Continue() {} + virtual void Log(const char *msg) {} + + BOOL ReportStatus(DWORD currentStatus, DWORD waitHint=3000, DWORD dwError=0); + void HandleControlCode(DWORD opcode); + void RegisterAndRun(DWORD argc, LPTSTR *argv); +}; + diff --git a/server-tools/instance-manager/commands.cc b/server-tools/instance-manager/commands.cc index 2357f97fd93..3cc5039a59c 100644 --- a/server-tools/instance-manager/commands.cc +++ b/server-tools/instance-manager/commands.cc @@ -22,6 +22,7 @@ #include "mysql_manager_error.h" #include "protocol.h" #include "buffer.h" +#include "options.h" #include #include @@ -469,7 +470,7 @@ int Show_instance_log::execute(struct st_net *net, ulong connection_id) size_t buff_size; int read_len; /* calculate buffer size */ - struct stat file_stat; + MY_STAT file_stat; /* my_fstat doesn't use the flag parameter */ if (my_fstat(fd, &file_stat, MYF(0))) @@ -481,7 +482,7 @@ int Show_instance_log::execute(struct st_net *net, ulong connection_id) read_len= my_seek(fd, file_stat.st_size - size, MY_SEEK_SET, MYF(0)); char *bf= (char*) malloc(sizeof(char)*buff_size); - if ((read_len= my_read(fd, bf, buff_size, MYF(0))) < 0) + if ((read_len= my_read(fd, (byte*)bf, buff_size, MYF(0))) < 0) return ER_READ_FILE; store_to_protocol_packet(&send_buff, (char*) bf, &position, read_len); close(fd); @@ -604,7 +605,7 @@ int Show_instance_log_files::execute(struct st_net *net, ulong connection_id) store_to_protocol_packet(&send_buff, "", &position); store_to_protocol_packet(&send_buff, (char*) "0", &position); } - else if (S_ISREG(file_stat.st_mode)) + else if (MY_S_ISREG(file_stat.st_mode)) { store_to_protocol_packet(&send_buff, (char*) log_files->value, @@ -689,7 +690,7 @@ int Set_option::correct_file(int skip) { int error; - error= modify_defaults_file("/etc/my.cnf", option, + error= modify_defaults_file(Options::config_file, option, option_value, instance_name, skip); if (error > 0) return ER_OUT_OF_RESOURCES; diff --git a/server-tools/instance-manager/guardian.cc b/server-tools/instance-manager/guardian.cc index 404e9f34ab5..0d6ebfa8d79 100644 --- a/server-tools/instance-manager/guardian.cc +++ b/server-tools/instance-manager/guardian.cc @@ -25,6 +25,7 @@ #include "instance.h" #include "mysql_manager_error.h" #include "log.h" +#include "port.h" #include #include @@ -32,7 +33,6 @@ - C_MODE_START pthread_handler_decl(guardian, arg) @@ -426,11 +426,21 @@ int Guardian_thread::stop_instances(bool stop_instances_arg) int Guardian_thread::lock() { +#ifdef __WIN__ + pthread_mutex_lock(&LOCK_guardian); + return 0; +#else return pthread_mutex_lock(&LOCK_guardian); +#endif } int Guardian_thread::unlock() { +#ifdef __WIN__ + pthread_mutex_unlock(&LOCK_guardian); + return 0; +#else return pthread_mutex_unlock(&LOCK_guardian); +#endif } diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc index 2b25c74439e..5e3c07b9b31 100644 --- a/server-tools/instance-manager/instance.cc +++ b/server-tools/instance-manager/instance.cc @@ -18,14 +18,19 @@ #pragma implementation #endif +#ifdef __WIN__ +#include +#endif #include "instance.h" #include "mysql_manager_error.h" #include "log.h" #include "instance_map.h" #include "priv.h" - +#include "port.h" +#ifndef __WIN__ #include +#endif #include #include #include @@ -50,6 +55,16 @@ pthread_handler_decl(proxy, arg) C_MODE_END +void Instance::remove_pid() +{ + int pid; + if ((pid= options.get_pid()) != 0) /* check the pidfile */ + if (options.unlink_pidfile()) /* remove stalled pidfile */ + log_error("cannot remove pidfile for instance %i, this might be \ + since IM lacks permmissions or hasn't found the pidifle", + options.instance_name); +} + /* The method starts an instance. @@ -65,8 +80,6 @@ C_MODE_END int Instance::start() { - pid_t pid; - /* clear crash flag */ pthread_mutex_lock(&LOCK_instance); crashed= 0; @@ -75,11 +88,7 @@ int Instance::start() if (!is_running()) { - if ((pid= options.get_pid()) != 0) /* check the pidfile */ - if (options.unlink_pidfile()) /* remove stalled pidfile */ - log_error("cannot remove pidfile for instance %i, this might be \ - since IM lacks permmissions or hasn't found the pidifle", - options.instance_name); + remove_pid(); /* No need to monitor this thread in the Thread_registry, as all @@ -107,20 +116,21 @@ int Instance::start() return ER_INSTANCE_ALREADY_STARTED; } - -void Instance::fork_and_monitor() +#ifndef __WIN__ +int Instance::launch_and_wait() { - pid_t pid; - log_info("starting instance %s", options.instance_name); - switch (pid= fork()) { - case 0: - execv(options.mysqld_path, options.argv); - /* exec never returns */ - exit(1); - case -1: - log_info("cannot fork() to start instance %s", options.instance_name); - return; - default: + pid_t pid = fork(); + + switch (pid) + { + case 0: + execv(options.mysqld_path, options.argv); + /* exec never returns */ + exit(1); + case -1: + log_info("cannot fork() to start instance %s", options.instance_name); + return -1; + default: /* Here we wait for the child created. This process differs for systems running LinuxThreads and POSIX Threads compliant systems. This is because @@ -141,22 +151,89 @@ void Instance::fork_and_monitor() wait(NULL); /* LinuxThreads were detected */ else waitpid(pid, NULL, 0); - /* set instance state to crashed */ - pthread_mutex_lock(&LOCK_instance); - crashed= 1; - pthread_mutex_unlock(&LOCK_instance); - - /* - Wake connection threads waiting for an instance to stop. This - is needed if a user issued command to stop an instance via - mysql connection. This is not the case if Guardian stop the thread. - */ - pthread_cond_signal(&COND_instance_stopped); - /* wake guardian */ - pthread_cond_signal(&instance_map->guardian->COND_guardian); - /* thread exits */ - return; } + return 0; +} +#else +int Instance::launch_and_wait() +{ + STARTUPINFO si; + PROCESS_INFORMATION pi; + + ZeroMemory( &si, sizeof(si) ); + si.cb = sizeof(si); + ZeroMemory( &pi, sizeof(pi) ); + + int cmdlen = 0; + for (int i=1; options.argv[i] != 0; i++) + cmdlen += strlen(options.argv[i]) + 1; + cmdlen++; // we have to add a single space for CreateProcess (read the docs) + + char *cmdline = NULL; + if (cmdlen > 0) + { + cmdline = new char[cmdlen]; + cmdline[0] = 0; + for (int i=1; options.argv[i] != 0; i++) + { + strcat(cmdline, " "); + strcat(cmdline, options.argv[i]); + } + } + + // Start the child process. + BOOL result = CreateProcess(options.mysqld_path, // file to execute + cmdline, // Command line. + NULL, // Process handle not inheritable. + NULL, // Thread handle not inheritable. + FALSE, // Set handle inheritance to FALSE. + 0, // No creation flags. + NULL, // Use parent's environment block. + NULL, // Use parent's starting directory. + &si, // Pointer to STARTUPINFO structure. + &pi ); // Pointer to PROCESS_INFORMATION structure. + delete cmdline; + if (! result) + return -1; + + // Wait until child process exits. + WaitForSingleObject(pi.hProcess, INFINITE); + + DWORD exitcode; + ::GetExitCodeProcess(pi.hProcess, &exitcode); + + // Close process and thread handles. + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + + return exitcode; +} +#endif + + +void Instance::fork_and_monitor() +{ + log_info("starting instance %s", options.instance_name); + + int result = launch_and_wait(); + if (result == -1) return; + + /* set instance state to crashed */ + pthread_mutex_lock(&LOCK_instance); + crashed= 1; + pthread_mutex_unlock(&LOCK_instance); + + /* + Wake connection threads waiting for an instance to stop. This + is needed if a user issued command to stop an instance via + mysql connection. This is not the case if Guardian stop the thread. + */ + pthread_cond_signal(&COND_instance_stopped); + /* wake guardian */ + pthread_cond_signal(&instance_map->guardian->COND_guardian); + /* thread exits */ + return; + /* we should never end up here */ DBUG_ASSERT(0); } @@ -253,7 +330,6 @@ bool Instance::is_running() int Instance::stop() { - pid_t pid; struct timespec timeout; uint waitchild= (uint) DEFAULT_SHUTDOWN_DELAY; @@ -290,6 +366,68 @@ err: return ER_STOP_INSTANCE; } +#ifdef __WIN__ + +BOOL SafeTerminateProcess(HANDLE hProcess, UINT uExitCode) +{ + DWORD dwTID, dwCode, dwErr = 0; + HANDLE hProcessDup = INVALID_HANDLE_VALUE; + HANDLE hRT = NULL; + HINSTANCE hKernel = GetModuleHandle("Kernel32"); + BOOL bSuccess = FALSE; + + BOOL bDup = DuplicateHandle(GetCurrentProcess(), + hProcess, GetCurrentProcess(), &hProcessDup, PROCESS_ALL_ACCESS, FALSE, 0); + + // Detect the special case where the process is + // already dead... + if ( GetExitCodeProcess((bDup) ? hProcessDup : hProcess, &dwCode) && + (dwCode == STILL_ACTIVE) ) + { + FARPROC pfnExitProc; + + pfnExitProc = GetProcAddress(hKernel, "ExitProcess"); + + hRT = CreateRemoteThread((bDup) ? hProcessDup : hProcess, NULL, 0, + (LPTHREAD_START_ROUTINE)pfnExitProc, (PVOID)uExitCode, 0, &dwTID); + + if ( hRT == NULL ) + dwErr = GetLastError(); + } + else + { + dwErr = ERROR_PROCESS_ABORTED; + } + + if ( hRT ) + { + // Must wait process to terminate to + // guarantee that it has exited... + WaitForSingleObject((bDup) ? hProcessDup : hProcess, INFINITE); + + CloseHandle(hRT); + bSuccess = TRUE; + } + + if ( bDup ) + CloseHandle(hProcessDup); + + if ( !bSuccess ) + SetLastError(dwErr); + + return bSuccess; +} + +int kill(pid_t pid, int signum) +{ + HANDLE processhandle = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid); + if (signum == SIGTERM) + ::SafeTerminateProcess(processhandle, 0); + else + ::TerminateProcess(processhandle, -1); + return 0; +} +#endif void Instance::kill_instance(int signum) { diff --git a/server-tools/instance-manager/instance.h b/server-tools/instance-manager/instance.h index 39a2b8ee846..0ff5ecc179e 100644 --- a/server-tools/instance-manager/instance.h +++ b/server-tools/instance-manager/instance.h @@ -61,6 +61,9 @@ private: */ pthread_cond_t COND_instance_stopped; Instance_map *instance_map; + + void remove_pid(); + int launch_and_wait(); }; #endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_H */ diff --git a/server-tools/instance-manager/instance_map.cc b/server-tools/instance-manager/instance_map.cc index fa8a5d58114..2c7166c59f5 100644 --- a/server-tools/instance-manager/instance_map.cc +++ b/server-tools/instance-manager/instance_map.cc @@ -22,6 +22,7 @@ #include "buffer.h" #include "instance.h" +#include "options.h" #include #include @@ -138,13 +139,23 @@ Instance_map::~Instance_map() int Instance_map::lock() { +#ifdef __WIN__ + pthread_mutex_lock(&LOCK_instance_map); + return 0; +#else return pthread_mutex_lock(&LOCK_instance_map); +#endif } int Instance_map::unlock() { +#ifdef __WIN__ + pthread_mutex_unlock(&LOCK_instance_map); + return 0; +#else return pthread_mutex_unlock(&LOCK_instance_map); +#endif } @@ -245,7 +256,7 @@ int Instance_map::load() else argv_options[1]= '\0'; - if (my_search_option_files("my", &argc, (char ***) &argv, &args_used, + if (my_search_option_files(Options::config_file, &argc, (char ***) &argv, &args_used, process_option, (void*) this) || complete_initialization()) return 1; diff --git a/server-tools/instance-manager/instance_options.h b/server-tools/instance-manager/instance_options.h index 9dac8b39bdc..a5a38ff1221 100644 --- a/server-tools/instance-manager/instance_options.h +++ b/server-tools/instance-manager/instance_options.h @@ -19,6 +19,7 @@ #include #include #include "parse.h" +#include "port.h" #ifdef __GNUC__ #pragma interface diff --git a/server-tools/instance-manager/listener.cc b/server-tools/instance-manager/listener.cc index 4aed18c753d..a161fc9730b 100644 --- a/server-tools/instance-manager/listener.cc +++ b/server-tools/instance-manager/listener.cc @@ -19,11 +19,13 @@ #endif #include "listener.h" - +#include "priv.h" #include #include #include +#ifndef __WIN__ #include +#endif #include #include "thread_registry.h" @@ -31,7 +33,7 @@ #include "instance_map.h" #include "log.h" #include "mysql_connection.h" -#include "priv.h" +#include "port.h" /* @@ -47,10 +49,17 @@ public: private: ulong total_connection_count; Thread_info thread_info; + + int sockets[2]; + int num_sockets; + fd_set read_fds; private: void handle_new_mysql_connection(Vio *vio); + int create_tcp_socket(); + int create_unix_socket(struct sockaddr_un &unix_socket_address); }; +const int LISTEN_BACK_LOG_SIZE = 5; // standard backlog size Listener_thread::Listener_thread(const Listener_thread_args &args) : Listener_thread_args(args.thread_registry, args.options, args.user_map, @@ -58,6 +67,7 @@ Listener_thread::Listener_thread(const Listener_thread_args &args) : ,total_connection_count(0) ,thread_info(pthread_self()) { + num_sockets= 0; } @@ -78,30 +88,134 @@ Listener_thread::~Listener_thread() void Listener_thread::run() { - enum { LISTEN_BACK_LOG_SIZE = 5 }; // standard backlog size - int flags; - int arg= 1; /* value to be set by setsockopt */ - int unix_socket; - uint im_port; /* we use this var to check whether we are running on LinuxThreads */ pid_t thread_pid; + int n; thread_pid= getpid(); + +#ifndef __WIN__ + struct sockaddr_un unix_socket_address; /* set global variable */ linuxthreads= (thread_pid != manager_pid); +#endif thread_registry.register_thread(&thread_info); my_thread_init(); + FD_ZERO(&read_fds); + /* I. prepare 'listen' sockets */ + if (create_tcp_socket()) + goto err; + +#ifndef __WIN__ + if (create_unix_socket(unix_socket_address)) + goto err; +#endif + + /* II. Listen sockets and spawn childs */ + for (int i=0; i < num_sockets; i++) + n = max(n, sockets[i]); + n++; + + while (thread_registry.is_shutdown() == false) + { + fd_set read_fds_arg= read_fds; + + /* + When using valgrind 2.0 this syscall doesn't get kicked off by a + signal during shutdown. This results in failing assert + (Thread_registry::~Thread_registry). Valgrind 2.2 works fine. + */ + int rc= select(n, &read_fds_arg, 0, 0, 0); + + + if (rc == -1 && errno != EINTR) + { + log_error("Listener_thread::run(): select() failed, %s", + strerror(errno)); + continue; + } + + + for (int socket_index=0; socket_index < num_sockets; socket_index++) + { + /* Assuming that rc > 0 as we asked to wait forever */ + if (FD_ISSET(sockets[socket_index], &read_fds_arg)) + { + int client_fd= accept(sockets[socket_index], 0, 0); + /* accept may return -1 (failure or spurious wakeup) */ + if (client_fd >= 0) // connection established + { + Vio *vio = vio_new(client_fd, socket_index==0?VIO_TYPE_SOCKET:VIO_TYPE_TCPIP, + socket_index==0?1:0); + if (vio != 0) + handle_new_mysql_connection(vio); + else + { + shutdown(client_fd, SHUT_RDWR); + close(client_fd); + } + } + } + } + } + + /* III. Release all resources and exit */ + + log_info("Listener_thread::run(): shutdown requested, exiting..."); + + for (int i=0; i < num_sockets; i++) + close(sockets[i]); + +#ifndef __WIN__ + unlink(unix_socket_address.sun_path); +#endif + + thread_registry.unregister_thread(&thread_info); + my_thread_end(); + return; + +err: + thread_registry.unregister_thread(&thread_info); + thread_registry.request_shutdown(); + my_thread_end(); + return; +} + +void set_non_blocking(int socket) +{ +#ifndef __WIN__ + int flags= fcntl(socket, F_GETFL, 0); + fcntl(socket, F_SETFL, flags | O_NONBLOCK); +#else + u_long arg = 1; + ioctlsocket(socket, FIONBIO, &arg); +#endif +} + +void set_no_inherit(int socket) +{ +#ifndef __WIN__ + int flags= fcntl(socket, F_GETFD, 0); + fcntl(socket, F_SETFD, flags | FD_CLOEXEC); +#else +#endif +} + +int Listener_thread::create_tcp_socket() +{ + /* value to be set by setsockopt */ + int arg= 1; int ip_socket= socket(AF_INET, SOCK_STREAM, 0); if (ip_socket == INVALID_SOCKET) { log_error("Listener_thead::run(): socket(AF_INET) failed, %s", strerror(errno)); - goto err; + return -1; } struct sockaddr_in ip_socket_address; @@ -115,7 +229,7 @@ void Listener_thread::run() } else im_bind_addr= htonl(INADDR_ANY); - im_port= options.port_number; + uint im_port= options.port_number; ip_socket_address.sin_family= AF_INET; ip_socket_address.sin_addr.s_addr = im_bind_addr; @@ -130,154 +244,86 @@ void Listener_thread::run() { log_error("Listener_thread::run(): bind(ip socket) failed, '%s'", strerror(errno)); - goto err; + close(ip_socket); + return -1; } if (listen(ip_socket, LISTEN_BACK_LOG_SIZE)) { log_error("Listener_thread::run(): listen(ip socket) failed, %s", strerror(errno)); - goto err; + close(ip_socket); + return -1; } - /* set the socket nonblocking */ - flags= fcntl(ip_socket, F_GETFL, 0); - fcntl(ip_socket, F_SETFL, flags | O_NONBLOCK); - /* make sure that instances won't be listening our sockets */ - flags= fcntl(ip_socket, F_GETFD, 0); - fcntl(ip_socket, F_SETFD, flags | FD_CLOEXEC); + /* set the socket nonblocking */ + set_non_blocking(ip_socket); + + /* make sure that instances won't be listening our sockets */ + set_no_inherit(ip_socket); + + FD_SET(ip_socket, &read_fds); + sockets[num_sockets++] = ip_socket; log_info("accepting connections on ip socket"); + return 0; +} - /*--------------------------------------------------------------*/ - unix_socket= socket(AF_UNIX, SOCK_STREAM, 0); +#ifndef __WIN__ +int Listener_thread::create_unix_socket( + struct sockaddr_un &unix_socket_address) +{ + int unix_socket= socket(AF_UNIX, SOCK_STREAM, 0); if (unix_socket == INVALID_SOCKET) { log_error("Listener_thead::run(): socket(AF_UNIX) failed, %s", strerror(errno)); - goto err; + return -1; } - struct sockaddr_un unix_socket_address; bzero(&unix_socket_address, sizeof(unix_socket_address)); unix_socket_address.sun_family= AF_UNIX; strmake(unix_socket_address.sun_path, options.socket_file_name, sizeof(unix_socket_address.sun_path)); - unlink(unix_socket_address.sun_path); /* in case we have stale socket file */ + unlink(unix_socket_address.sun_path); // in case we have stale socket file + /* + POSIX specifies default permissions for a pathname created by bind + to be 0777. We need everybody to have access to the socket. + */ + mode_t old_mask= umask(0); + if (bind(unix_socket, (struct sockaddr *) &unix_socket_address, + sizeof(unix_socket_address))) { - /* - POSIX specifies default permissions for a pathname created by bind - to be 0777. We need everybody to have access to the socket. - */ - mode_t old_mask= umask(0); - if (bind(unix_socket, (struct sockaddr *) &unix_socket_address, - sizeof(unix_socket_address))) - { - log_error("Listener_thread::run(): bind(unix socket) failed, " + log_error("Listener_thread::run(): bind(unix socket) failed, " "socket file name is '%s', error '%s'", unix_socket_address.sun_path, strerror(errno)); - goto err; - } - umask(old_mask); - - if (listen(unix_socket, LISTEN_BACK_LOG_SIZE)) - { - log_error("Listener_thread::run(): listen(unix socket) failed, %s", - strerror(errno)); - goto err; - } - - /* set the socket nonblocking */ - flags= fcntl(unix_socket, F_GETFL, 0); - fcntl(unix_socket, F_SETFL, flags | O_NONBLOCK); - /* make sure that instances won't be listening our sockets */ - flags= fcntl(unix_socket, F_GETFD, 0); - fcntl(unix_socket, F_SETFD, flags | FD_CLOEXEC); + close(unix_socket); + return -1; } - log_info("accepting connections on unix socket %s", - unix_socket_address.sun_path); - - /* II. Listen sockets and spawn childs */ - + + umask(old_mask); + + if (listen(unix_socket, LISTEN_BACK_LOG_SIZE)) { - int n= max(unix_socket, ip_socket) + 1; - fd_set read_fds; - - FD_ZERO(&read_fds); - FD_SET(unix_socket, &read_fds); - FD_SET(ip_socket, &read_fds); - - while (thread_registry.is_shutdown() == false) - { - fd_set read_fds_arg= read_fds; - - /* - When using valgrind 2.0 this syscall doesn't get kicked off by a - signal during shutdown. This results in failing assert - (Thread_registry::~Thread_registry). Valgrind 2.2 works fine. - */ - int rc= select(n, &read_fds_arg, 0, 0, 0); - - - if (rc == -1 && errno != EINTR) - log_error("Listener_thread::run(): select() failed, %s", - strerror(errno)); - else - { - /* Assuming that rc > 0 as we asked to wait forever */ - if (FD_ISSET(unix_socket, &read_fds_arg)) - { - int client_fd= accept(unix_socket, 0, 0); - /* accept may return -1 (failure or spurious wakeup) */ - if (client_fd >= 0) // connection established - { - if (Vio *vio= vio_new(client_fd, VIO_TYPE_SOCKET, 1)) - handle_new_mysql_connection(vio); - else - { - shutdown(client_fd, SHUT_RDWR); - close(client_fd); - } - } - } - else if (FD_ISSET(ip_socket, &read_fds_arg)) - { - int client_fd= accept(ip_socket, 0, 0); - /* accept may return -1 (failure or spurious wakeup) */ - if (client_fd >= 0) // connection established - { - if (Vio *vio= vio_new(client_fd, VIO_TYPE_TCPIP, 0)) - handle_new_mysql_connection(vio); - else - { - shutdown(client_fd, SHUT_RDWR); - close(client_fd); - } - } - } - } - } + log_error("Listener_thread::run(): listen(unix socket) failed, %s", + strerror(errno)); + close(unix_socket); + return -1; } - /* III. Release all resources and exit */ + /* set the socket nonblocking */ + set_non_blocking(unix_socket); - log_info("Listener_thread::run(): shutdown requested, exiting..."); + /* make sure that instances won't be listening our sockets */ + set_no_inherit(unix_socket); - close(unix_socket); - close(ip_socket); - unlink(unix_socket_address.sun_path); - - thread_registry.unregister_thread(&thread_info); - my_thread_end(); - return; - -err: - thread_registry.unregister_thread(&thread_info); - thread_registry.request_shutdown(); - my_thread_end(); - return; + log_info("accepting connections on unix socket %s", unix_socket_address.sun_path); + sockets[num_sockets++] = unix_socket; + FD_SET(unix_socket, &read_fds); + return 0; } +#endif /* diff --git a/server-tools/instance-manager/listener.h b/server-tools/instance-manager/listener.h index 7a8af49e2b3..67a090c3aa2 100644 --- a/server-tools/instance-manager/listener.h +++ b/server-tools/instance-manager/listener.h @@ -31,7 +31,7 @@ pthread_handler_decl(listener, arg); C_MODE_END class Thread_registry; -class Options; +struct Options; class User_map; class Instance_map; diff --git a/server-tools/instance-manager/log.cc b/server-tools/instance-manager/log.cc index 3c18d2816bf..2a363312fed 100644 --- a/server-tools/instance-manager/log.cc +++ b/server-tools/instance-manager/log.cc @@ -17,7 +17,7 @@ #include #include "log.h" - +#include "port.h" #include #include #include diff --git a/server-tools/instance-manager/manager.cc b/server-tools/instance-manager/manager.cc index a4c81739b17..5f2d9d0b493 100644 --- a/server-tools/instance-manager/manager.cc +++ b/server-tools/instance-manager/manager.cc @@ -30,7 +30,9 @@ #include #include #include +#ifndef __WIN__ #include +#endif static int create_pid_file(const char *pid_file_name) @@ -50,6 +52,61 @@ static int create_pid_file(const char *pid_file_name) return 0; } +#ifndef __WIN__ +void set_signals(sigset_t *mask) +{ + /* block signals */ + sigemptyset(mask); + sigaddset(mask, SIGINT); + sigaddset(mask, SIGTERM); + sigaddset(mask, SIGPIPE); + sigaddset(mask, SIGHUP); + signal(SIGPIPE, SIG_IGN); + + /* + We want this signal to be blocked in all theads but the signal + one. It is needed for the thr_alarm subsystem to work. + */ + sigaddset(mask,THR_SERVER_ALARM); + + /* all new threads will inherite this signal mask */ + pthread_sigmask(SIG_BLOCK, mask, NULL); + + /* + In our case the signal thread also implements functions of alarm thread. + Here we init alarm thread functionality. We suppose that we won't have + more then 10 alarms at the same time. + */ + init_thr_alarm(10); +} +#else + +bool have_signal; + +void onsignal(int signo) +{ + have_signal = true; +} + +void set_signals(sigset_t *set) +{ + signal(SIGINT, onsignal); + signal(SIGTERM, onsignal); + have_signal = false; +} + +int my_sigwait(const sigset_t *set, int *sig) +{ +// MSG msg; + while (!have_signal) + { + Sleep(100); + } + return 0; +} + +#endif + /* manager - entry point to the main instance manager process: start @@ -98,21 +155,8 @@ void manager(const Options &options) if (create_pid_file(options.pid_file_name)) return; - /* block signals */ sigset_t mask; - sigemptyset(&mask); - sigaddset(&mask, SIGINT); - sigaddset(&mask, SIGTERM); - sigaddset(&mask, SIGPIPE); - sigaddset(&mask, SIGHUP); - /* - We want this signal to be blocked in all theads but the signal - one. It is needed for the thr_alarm subsystem to work. - */ - sigaddset(&mask,THR_SERVER_ALARM); - - /* all new threads will inherite this signal mask */ - pthread_sigmask(SIG_BLOCK, &mask, NULL); + set_signals(&mask); /* create the listener */ { @@ -166,12 +210,7 @@ void manager(const Options &options) bool shutdown_complete; shutdown_complete= FALSE; - /* - In our case the signal thread also implements functions of alarm thread. - Here we init alarm thread functionality. We suppose that we won't have - more then 10 alarms at the same time. - */ - init_thr_alarm(10); + /* init list of guarded instances */ guardian_thread.lock(); @@ -185,8 +224,6 @@ void manager(const Options &options) */ pthread_cond_signal(&guardian_thread.COND_guardian); - signal(SIGPIPE, SIG_IGN); - while (!shutdown_complete) { int status= 0; @@ -197,11 +234,11 @@ void manager(const Options &options) goto err; } - switch (signo) { - case THR_SERVER_ALARM: - process_alarm(signo); - break; - default: +#ifndef __WIN__ + if (THR_SERVER_ALARM == signo) + process_alarm(signo); + else +#endif { if (!guardian_thread.is_stopped()) { @@ -215,16 +252,16 @@ void manager(const Options &options) shutdown_complete= TRUE; } } - break; } - } err: /* delete the pid file */ my_delete(options.pid_file_name, MYF(0)); +#ifndef __WIN__ /* free alarm structures */ end_thr_alarm(1); /* don't pthread_exit to kill all threads who did not shut down in time */ +#endif } diff --git a/server-tools/instance-manager/manager.h b/server-tools/instance-manager/manager.h index d73f4b35f18..12ed6b3b1ff 100644 --- a/server-tools/instance-manager/manager.h +++ b/server-tools/instance-manager/manager.h @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -class Options; +struct Options; void manager(const Options &options); diff --git a/server-tools/instance-manager/mysqlmanager.cc b/server-tools/instance-manager/mysqlmanager.cc index 5a6c398614b..1533580de31 100644 --- a/server-tools/instance-manager/mysqlmanager.cc +++ b/server-tools/instance-manager/mysqlmanager.cc @@ -23,12 +23,16 @@ #include #include #include +#ifndef __WIN__ #include #include #include +#endif #include #include - +#ifdef __WIN__ +#include "windowsservice.h" +#endif /* Few notes about Instance Manager architecture: @@ -55,10 +59,14 @@ */ static void init_environment(char *progname); +#ifndef __WIN__ static void daemonize(const char *log_file_name); static void angel(const Options &options); static struct passwd *check_user(const char *user); static int set_user(const char *user, struct passwd *user_info); +#else +int HandleServiceOptions(Options options); +#endif /* @@ -78,6 +86,7 @@ int main(int argc, char *argv[]) if (options.load(argc, argv)) goto err; +#ifndef __WIN__ if ((user_info= check_user(options.user))) { if (set_user(options.user, user_info)) @@ -94,6 +103,12 @@ int main(int argc, char *argv[]) /* forks again, and returns only in child: parent becomes angel */ angel(options); } +#else +#ifdef NDEBUG + return HandleServiceOptions(options); +#endif +#endif + manager(options); options.cleanup(); my_end(0); @@ -105,11 +120,11 @@ err: /******************* Auxilary functions implementation **********************/ +#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) /* Change to run as another user if started with --user */ static struct passwd *check_user(const char *user) { -#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) struct passwd *user_info; uid_t user_id= geteuid(); @@ -150,7 +165,6 @@ static struct passwd *check_user(const char *user) err: log_error("Fatal error: Can't change to run as user '%s' ; Please check that the user exists!\n", user); -#endif return NULL; } @@ -172,7 +186,7 @@ static int set_user(const char *user, struct passwd *user_info) } return 0; } - +#endif /* @@ -188,6 +202,7 @@ static void init_environment(char *progname) } +#ifndef __WIN__ /* Become a UNIX service SYNOPSYS @@ -342,3 +357,4 @@ spawn: } } +#endif diff --git a/server-tools/instance-manager/mysqlmanager.vcproj b/server-tools/instance-manager/mysqlmanager.vcproj new file mode 100755 index 00000000000..5263deae6a9 --- /dev/null +++ b/server-tools/instance-manager/mysqlmanager.vcproj @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server-tools/instance-manager/options.cc b/server-tools/instance-manager/options.cc index e44e4c6ff34..f563fa783d2 100644 --- a/server-tools/instance-manager/options.cc +++ b/server-tools/instance-manager/options.cc @@ -21,7 +21,7 @@ #include "options.h" #include "priv.h" - +#include "port.h" #include #include #include @@ -30,19 +30,29 @@ #define QUOTE2(x) #x #define QUOTE(x) QUOTE2(x) +const char *default_password_file_name = QUOTE(DEFAULT_PASSWORD_FILE_NAME); +const char *default_log_file_name = QUOTE(DEFAULT_LOG_FILE_NAME); +char default_config_file[FN_REFLEN] = "/etc/my.cnf"; + +#ifndef __WIN__ char Options::run_as_service; -const char *Options::log_file_name= QUOTE(DEFAULT_LOG_FILE_NAME); +const char *Options::user= 0; /* No default value */ +#else +char Options::install_as_service; +char Options::remove_service; +#endif +const char *Options::log_file_name= default_log_file_name; const char *Options::pid_file_name= QUOTE(DEFAULT_PID_FILE_NAME); const char *Options::socket_file_name= QUOTE(DEFAULT_SOCKET_FILE_NAME); -const char *Options::password_file_name= QUOTE(DEFAULT_PASSWORD_FILE_NAME); +const char *Options::password_file_name= default_password_file_name; const char *Options::default_mysqld_path= QUOTE(DEFAULT_MYSQLD_PATH); const char *Options::first_option= 0; /* No default value */ const char *Options::bind_address= 0; /* No default value */ -const char *Options::user= 0; /* No default value */ uint Options::monitoring_interval= DEFAULT_MONITORING_INTERVAL; uint Options::port_number= DEFAULT_PORT; /* just to declare */ char **Options::saved_argv; +const char *Options::config_file = NULL; /* List of options, accepted by the instance manager. @@ -55,8 +65,13 @@ enum options { OPT_SOCKET, OPT_PASSWORD_FILE, OPT_MYSQLD_PATH, +#ifndef __WIN__ OPT_RUN_AS_SERVICE, OPT_USER, +#else + OPT_INSTALL_SERVICE, + OPT_REMOVE_SERVICE, +#endif OPT_MONITORING_INTERVAL, OPT_PORT, OPT_BIND_ADDRESS @@ -107,7 +122,14 @@ static struct my_option my_long_options[] = (gptr *) &Options::monitoring_interval, 0, GET_UINT, REQUIRED_ARG, DEFAULT_MONITORING_INTERVAL, 0, 0, 0, 0, 0 }, - +#ifdef __WIN__ + { "install", OPT_INSTALL_SERVICE, "Install as system service.", + (gptr *) &Options::install_as_service, (gptr*) &Options::install_as_service, + 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 }, + { "remove", OPT_REMOVE_SERVICE, "Remove system service.", + (gptr *)&Options::remove_service, (gptr*) &Options::remove_service, + 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0}, +#else { "run-as-service", OPT_RUN_AS_SERVICE, "Daemonize and start angel process.", (gptr *) &Options::run_as_service, 0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 }, @@ -116,7 +138,7 @@ static struct my_option my_long_options[] = (gptr *) &Options::user, (gptr *) &Options::user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - +#endif { "version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, @@ -214,20 +236,44 @@ C_MODE_END int Options::load(int argc, char **argv) { int rc; + char** argv_ptr = argv; +#ifdef __WIN__ + setup_windows_defaults(*argv); +#endif + + config_file=NULL; if (argc >= 2) { + if (is_prefix(argv[1], "--defaults-file=")) + config_file=argv[1]; if (is_prefix(argv[1],"--defaults-file=") || is_prefix(argv[1],"--defaults-extra-file=")) Options::first_option= argv[1]; } + // we were not given a config file on the command line so we + // set have to construct a new argv array + if (config_file == NULL) + { +#ifdef __WIN__ + ::GetModuleFileName(NULL, default_config_file, sizeof(default_config_file)); + char *filename = strstr(default_config_file, "mysqlmanager.exe"); + strcpy(filename, "my.ini"); +#endif + config_file = default_config_file; + } + /* config-file options are prepended to command-line ones */ - load_defaults("my", default_groups, &argc, &argv); + load_defaults(config_file, default_groups, &argc, &argv); + + rc= handle_options(&argc, &argv, my_long_options, get_one_option); + + if (rc != 0) + return rc; + Options::saved_argv= argv; - if ((rc= handle_options(&argc, &argv, my_long_options, get_one_option)) != 0) - return rc; return 0; } @@ -235,4 +281,31 @@ void Options::cleanup() { /* free_defaults returns nothing */ free_defaults(Options::saved_argv); + +#ifdef __WIN__ + free((char*)default_password_file_name); +#endif } + +#ifdef __WIN__ + +char* change_extension(const char *src, const char *newext) +{ + char *dot = (char*)strrchr(src, '.'); + if (!dot) return (char*)src; + + int newlen = dot-src+strlen(newext)+1; + char *temp = (char*)malloc(newlen); + bzero(temp, newlen); + strncpy(temp, src, dot-src+1); + strcat(temp, newext); + return temp; +} + +void Options::setup_windows_defaults(const char *progname) +{ + Options::password_file_name = default_password_file_name = change_extension(progname, "passwd"); + Options::log_file_name = default_log_file_name = change_extension(progname, "log"); +} + +#endif diff --git a/server-tools/instance-manager/options.h b/server-tools/instance-manager/options.h index 3df259864be..3ef054b6339 100644 --- a/server-tools/instance-manager/options.h +++ b/server-tools/instance-manager/options.h @@ -28,23 +28,32 @@ struct Options { +#ifdef __WIN__ + static char install_as_service; + static char remove_service; +#else static char run_as_service; /* handle_options doesn't support bool */ + static const char *user; +#endif static const char *log_file_name; static const char *pid_file_name; static const char *socket_file_name; static const char *password_file_name; static const char *default_mysqld_path; - static const char *user; /* the option which should be passed to process_default_option_files */ static const char *first_option; static uint monitoring_interval; static uint port_number; static const char *bind_address; + static const char *config_file; static char **saved_argv; - static int load(int argc, char **argv); + int load(int argc, char **argv); void cleanup(); +#ifdef __WIN__ + void setup_windows_defaults(const char *progname); +#endif }; #endif // INCLUDES_MYSQL_INSTANCE_MANAGER_OPTIONS_H diff --git a/server-tools/instance-manager/parse_output.cc b/server-tools/instance-manager/parse_output.cc index e83a75c6778..4b3a8b75ca1 100644 --- a/server-tools/instance-manager/parse_output.cc +++ b/server-tools/instance-manager/parse_output.cc @@ -21,6 +21,7 @@ #include #include #include +#include "port.h" /* diff --git a/server-tools/instance-manager/port.h b/server-tools/instance-manager/port.h new file mode 100755 index 00000000000..3b1c3e2ad93 --- /dev/null +++ b/server-tools/instance-manager/port.h @@ -0,0 +1,25 @@ +#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_PORT_H +#define INCLUDES_MYSQL_INSTANCE_MANAGER_PORT_H + +#ifdef __WIN__ + +#define vsnprintf _vsnprintf + +#define SIGKILL 9 +#define SHUT_RDWR 0x2 + +//TODO: fix this +#define DEFAULT_MONITORING_INTERVAL 20 +#define DEFAULT_PORT 2273 +#define PROTOCOL_VERSION 10 + +typedef int pid_t; + +#undef popen +#define popen(A,B) _popen(A,B) + +#endif /* __WIN__ */ + +#endif /* INCLUDES_MYSQL_INSTANCE_MANAGER_PORT_H */ + + diff --git a/server-tools/instance-manager/priv.cc b/server-tools/instance-manager/priv.cc index dd192370aaf..496992aa43b 100644 --- a/server-tools/instance-manager/priv.cc +++ b/server-tools/instance-manager/priv.cc @@ -14,7 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "priv.h" +#include "port.h" /* the pid of the manager process (of the signal thread on the LinuxThreads) */ pid_t manager_pid; diff --git a/server-tools/instance-manager/priv.h b/server-tools/instance-manager/priv.h index decc3605dff..0f4c9be9a11 100644 --- a/server-tools/instance-manager/priv.h +++ b/server-tools/instance-manager/priv.h @@ -17,17 +17,23 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#ifdef __WIN__ +#include "port.h" +#else #include +#endif /* the pid of the manager process (of the signal thread on the LinuxThreads) */ extern pid_t manager_pid; +#ifndef __WIN__ /* This flag is set if mysqlmanager has detected that it is running on the system using LinuxThreads */ extern bool linuxthreads; +#endif extern const char mysqlmanager_version[]; extern const int mysqlmanager_version_length; diff --git a/server-tools/instance-manager/thread_registry.cc b/server-tools/instance-manager/thread_registry.cc index 16821df4146..0d47664a89a 100644 --- a/server-tools/instance-manager/thread_registry.cc +++ b/server-tools/instance-manager/thread_registry.cc @@ -27,6 +27,7 @@ #include +#ifndef __WIN__ /* Kick-off signal handler */ enum { THREAD_KICK_OFF_SIGNAL= SIGUSR2 }; @@ -34,7 +35,7 @@ enum { THREAD_KICK_OFF_SIGNAL= SIGUSR2 }; static void handle_signal(int __attribute__((unused)) sig_no) { } - +#endif /* TODO: think about moving signal information (now it's shutdown_in_progress) @@ -76,12 +77,13 @@ Thread_registry::~Thread_registry() void Thread_registry::register_thread(Thread_info *info) { +#ifndef __WIN__ struct sigaction sa; sa.sa_handler= handle_signal; sa.sa_flags= 0; sigemptyset(&sa.sa_mask); sigaction(THREAD_KICK_OFF_SIGNAL, &sa, 0); - +#endif info->current_cond= 0; pthread_mutex_lock(&LOCK_thread_registry); @@ -156,6 +158,7 @@ void Thread_registry::deliver_shutdown() pthread_mutex_lock(&LOCK_thread_registry); shutdown_in_progress= true; +#ifndef __WIN__ /* to stop reading from the network we need to flush alarm queue */ end_thr_alarm(0); /* @@ -163,6 +166,8 @@ void Thread_registry::deliver_shutdown() stopped alarm processing. */ process_alarm(THR_SERVER_ALARM); +#endif + for (info= head.next; info != &head; info= info->next) { pthread_kill(info->thread_id, THREAD_KICK_OFF_SIGNAL); diff --git a/server-tools/instance-manager/user_map.cc b/server-tools/instance-manager/user_map.cc index 7cb2cd67d7f..a80cb7767d1 100644 --- a/server-tools/instance-manager/user_map.cc +++ b/server-tools/instance-manager/user_map.cc @@ -36,7 +36,8 @@ struct User int User::init(const char *line) { - const char *name_begin, *name_end, *password; + const char *name_begin, *name_end; + char *password; if (line[0] == '\'' || line[0] == '"') { @@ -44,7 +45,7 @@ int User::init(const char *line) name_end= strchr(name_begin, line[0]); if (name_end == 0 || name_end[1] != ':') goto err; - password= name_end + 2; + password= (char*)(name_end + 2); } else { @@ -52,13 +53,18 @@ int User::init(const char *line) name_end= strchr(name_begin, ':'); if (name_end == 0) goto err; - password= name_end + 1; + password= (char*)(name_end + 1); } user_length= name_end - name_begin; if (user_length > USERNAME_LENGTH) goto err; /* assume that newline characater is present */ + if (password[strlen(password)-2] == '\r') + { + password[strlen(password)-2] = '\n'; + password[strlen(password)-1] = 0; + } if (strlen(password) != SCRAMBLED_PASSWORD_CHAR_LENGTH + 1) goto err; From 41984105287d0c209c2c4a017abb149ca312a831 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Jul 2005 20:08:54 -0700 Subject: [PATCH 007/144] Fix error message generated when trying to create a table in a non-existent database. (Bug #10407) mysql-test/r/create.result: Update results mysql-test/t/create.test: Update error numbers sql/mysql_priv.h: Adjust some other function signature so table and db information is passed down into create_frm(). sql/sql_table.cc: Check for database not existing after hitting an error when copying the .frm file for 'CREATE TABLE ... LIKE ...', and pass table and db name into rea_create_table(). sql/table.cc: Generate specific error message when .frm creation fails because the database does not exist. sql/unireg.cc: Pass database and table name down into create_frm(). --- mysql-test/r/create.result | 4 ++-- mysql-test/t/create.test | 4 ++-- sql/mysql_priv.h | 8 ++++++-- sql/sql_table.cc | 14 +++++++++----- sql/table.cc | 12 ++++++++++-- sql/unireg.cc | 12 +++++++++--- 6 files changed, 38 insertions(+), 16 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 4c4b388388a..00bc0320028 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -37,7 +37,7 @@ Note 1051 Unknown table 't1' create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap; ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key create table not_existing_database.test (a int); -Got one of the listed errors +ERROR 42000: Unknown database 'not_existing_database' create table `a/a` (a int); ERROR 42000: Incorrect table name 'a/a' create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int); @@ -342,7 +342,7 @@ create table t3 like t1; create table t3 like mysqltest.t3; ERROR 42S01: Table 't3' already exists create table non_existing_database.t1 like t1; -Got one of the listed errors +ERROR 42000: Unknown database 'non_existing_database' create table t3 like non_existing_table; ERROR 42S02: Unknown table 'non_existing_table' create temporary table t3 like t1; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index ca3446b46fc..d1152736d1c 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -39,7 +39,7 @@ drop table if exists t1; --error 1075 create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap; --- error 1044,1 +-- error 1049 create table not_existing_database.test (a int); --error 1103 create table `a/a` (a int); @@ -294,7 +294,7 @@ select * from t2; create table t3 like t1; --error 1050 create table t3 like mysqltest.t3; ---error 1044,1 +--error 1049 create table non_existing_database.t1 like t1; --error 1051 create table t3 like non_existing_table; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 42e45442f9c..4b570c7bbd1 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1029,10 +1029,13 @@ void unlock_table_names(THD *thd, TABLE_LIST *table_list, void unireg_init(ulong options); void unireg_end(void); bool mysql_create_frm(THD *thd, my_string file_name, + const char *table, const char* db, HA_CREATE_INFO *create_info, List &create_field, uint key_count,KEY *key_info,handler *db_type); -int rea_create_table(THD *thd, my_string file_name,HA_CREATE_INFO *create_info, +int rea_create_table(THD *thd, my_string file_name, + const char *table, const char* db, + HA_CREATE_INFO *create_info, List &create_field, uint key_count,KEY *key_info); int format_number(uint inputflag,uint max_length,my_string pos,uint length, @@ -1104,7 +1107,8 @@ ulong make_new_entry(File file,uchar *fileinfo,TYPELIB *formnames, const char *newname); ulong next_io_size(ulong pos); void append_unescaped(String *res, const char *pos, uint length); -int create_frm(char *name,uint reclength,uchar *fileinfo, +int create_frm(char *name, const char *table, const char *db, + uint reclength,uchar *fileinfo, HA_CREATE_INFO *create_info, uint keys); void update_create_info_from_table(HA_CREATE_INFO *info, TABLE *form); int rename_file_ext(const char * from,const char * to,const char * ext); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index a40da9e0525..69d13e19309 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1418,12 +1418,10 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, create_info->data_file_name= create_info->index_file_name= 0; create_info->table_options=db_options; - if (rea_create_table(thd, path, create_info, fields, key_count, + if (rea_create_table(thd, path, table_name, db, + create_info, fields, key_count, key_info_buffer)) - { - /* my_error(ER_CANT_CREATE_TABLE,MYF(0),table_name,my_errno); */ goto end; - } if (create_info->options & HA_LEX_CREATE_TMP_TABLE) { /* Open table and put in temporary table list */ @@ -2366,8 +2364,14 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, /* Create a new table by copying from source table */ - if (my_copy(src_path, dst_path, MYF(MY_WME|MY_DONT_OVERWRITE_FILE))) + if (my_copy(src_path, dst_path, MYF(MY_DONT_OVERWRITE_FILE))) + { + if (my_errno == ENOENT) + my_error(ER_BAD_DB_ERROR,MYF(0),db); + else + my_error(ER_CANT_CREATE_FILE,MYF(0),dst_path,my_errno); goto err; + } /* As mysql_truncate don't work on a new table at this stage of diff --git a/sql/table.cc b/sql/table.cc index d9000933ee0..eb8746cec53 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1238,7 +1238,8 @@ void append_unescaped(String *res, const char *pos, uint length) /* Create a .frm file */ -File create_frm(register my_string name, uint reclength, uchar *fileinfo, +File create_frm(register my_string name, const char *table, const char *db, + uint reclength, uchar *fileinfo, HA_CREATE_INFO *create_info, uint keys) { register File file; @@ -1263,7 +1264,7 @@ File create_frm(register my_string name, uint reclength, uchar *fileinfo, */ set_if_smaller(create_info->raid_chunks, 255); - if ((file= my_create(name, CREATE_MODE, create_flags, MYF(MY_WME))) >= 0) + if ((file= my_create(name, CREATE_MODE, create_flags, MYF(0))) >= 0) { bzero((char*) fileinfo,64); fileinfo[0]=(uchar) 254; fileinfo[1]= 1; fileinfo[2]= FRM_VER+3; // Header @@ -1300,6 +1301,13 @@ File create_frm(register my_string name, uint reclength, uchar *fileinfo, } } } + else + { + if (my_errno == ENOENT) + my_error(ER_BAD_DB_ERROR,MYF(0),db); + else + my_error(ER_CANT_CREATE_TABLE,MYF(0),table,my_errno); + } return (file); } /* create_frm */ diff --git a/sql/unireg.cc b/sql/unireg.cc index e6484a9c1c2..a3d461513b8 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -56,6 +56,8 @@ static bool make_empty_rec(int file, enum db_type table_type, mysql_create_frm() thd Thread handler file_name Name of file (including database and .frm) + table Name of table + db Name of database create_info create info parameters create_fields Fields to create keys number of keys to create @@ -68,6 +70,7 @@ static bool make_empty_rec(int file, enum db_type table_type, */ bool mysql_create_frm(THD *thd, my_string file_name, + const char *table, const char *db, HA_CREATE_INFO *create_info, List &create_fields, uint keys, KEY *key_info, @@ -114,7 +117,7 @@ bool mysql_create_frm(THD *thd, my_string file_name, reclength=uint2korr(forminfo+266); null_fields=uint2korr(forminfo+282); - if ((file=create_frm(file_name, reclength, fileinfo, + if ((file=create_frm(file_name, table, db, reclength, fileinfo, create_info, keys)) < 0) { my_free((gptr) screen_buff,MYF(0)); @@ -213,9 +216,11 @@ err3: Create a frm (table definition) file and the tables SYNOPSIS - mysql_create_frm() + rea_create_table() thd Thread handler file_name Name of file (including database and .frm) + table Name of table + db Name of database create_info create info parameters create_fields Fields to create keys number of keys to create @@ -228,13 +233,14 @@ err3: */ int rea_create_table(THD *thd, my_string file_name, + const char *table, const char *db, HA_CREATE_INFO *create_info, List &create_fields, uint keys, KEY *key_info) { DBUG_ENTER("rea_create_table"); - if (mysql_create_frm(thd, file_name, create_info, + if (mysql_create_frm(thd, file_name, table, db, create_info, create_fields, keys, key_info, NULL)) DBUG_RETURN(1); if (ha_create_table(file_name,create_info,0)) From 0c17b6ed37011ba2997f129f2b32f811a397eab5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Jul 2005 08:11:23 +0200 Subject: [PATCH 008/144] fix for bug#8692 mysql-test/r/sp.result: added expected result for bug #8692 mysql-test/t/sp.test: added testcase for bug #8692 sql/protocol_cursor.cc: fixed detecting of null fields: A field contains a null value only if length is NULL_LENGTH --- mysql-test/r/sp.result | 24 ++++++++++++++++++++++++ mysql-test/t/sp.test | 28 ++++++++++++++++++++++++++++ sql/protocol_cursor.cc | 3 +-- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index fd63204e32f..69900edf3d9 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3099,4 +3099,28 @@ select @@sort_buffer_size| 1000000 set @@sort_buffer_size = @x| drop procedure bug9538| +drop procedure if exists bug8692| +create table t3 (c1 varchar(5), c2 char(5), c3 enum('one','two'), c4 text, c5 blob, c6 char(5), c7 varchar(5))| +insert into t3 values ('', '', '', '', '', '', NULL)| +Warnings: +Warning 1265 Data truncated for column 'c3' at row 1 +create procedure bug8692() +begin +declare v1 VARCHAR(10); +declare v2 VARCHAR(10); +declare v3 VARCHAR(10); +declare v4 VARCHAR(10); +declare v5 VARCHAR(10); +declare v6 VARCHAR(10); +declare v7 VARCHAR(10); +declare c8692 cursor for select c1,c2,c3,c4,c5,c6,c7 from t3; +open c8692; +fetch c8692 into v1,v2,v3,v4,v5,v6,v7; +select v1, v2, v3, v4, v5, v6, v7; +end| +call bug8692()| +v1 v2 v3 v4 v5 v6 v7 + NULL +drop procedure bug8692| +drop table t3| drop table t1,t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index d9e6163cbc7..1a35df40a17 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -3876,6 +3876,34 @@ set @@sort_buffer_size = @x| drop procedure bug9538| +# +# BUG#8692: Cursor fetch of empty string +# +--disable_warnings +drop procedure if exists bug8692| +--enable_warnings +create table t3 (c1 varchar(5), c2 char(5), c3 enum('one','two'), c4 text, c5 blob, c6 char(5), c7 varchar(5))| +insert into t3 values ('', '', '', '', '', '', NULL)| + +create procedure bug8692() +begin + declare v1 VARCHAR(10); + declare v2 VARCHAR(10); + declare v3 VARCHAR(10); + declare v4 VARCHAR(10); + declare v5 VARCHAR(10); + declare v6 VARCHAR(10); + declare v7 VARCHAR(10); + declare c8692 cursor for select c1,c2,c3,c4,c5,c6,c7 from t3; + open c8692; + fetch c8692 into v1,v2,v3,v4,v5,v6,v7; + select v1, v2, v3, v4, v5, v6, v7; +end| + +call bug8692()| +drop procedure bug8692| +drop table t3| + # # BUG#NNNN: New bug synopsis # diff --git a/sql/protocol_cursor.cc b/sql/protocol_cursor.cc index ed2d0b583d0..093a2bf2b90 100644 --- a/sql/protocol_cursor.cc +++ b/sql/protocol_cursor.cc @@ -114,8 +114,7 @@ bool Protocol_cursor::write() for (; cur_field < fields_end; cur_field++, data_tmp++) { - if ((len= net_field_length((uchar **)&cp)) == 0 || - len == NULL_LENGTH) + if ((len= net_field_length((uchar **)&cp)) == NULL_LENGTH) { *data_tmp= 0; } From 6fd13aaa3ccc470f03c51686f781651c9709154e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Jul 2005 14:10:03 +0300 Subject: [PATCH 009/144] Implement MySQL framework to support consistent read views in cursors for InnoDB. The idea of the patch is that if MySQL requests a consistent read view, we open one when open a cursor, set is as the active view to a transaction when fetch from the cursor, and close together with cursor close. This patch is associated to bugs #11813, #11832, and #11833. Contains after review fixes. --- innobase/include/read0read.h | 40 ++++++++++ innobase/include/read0types.h | 1 + innobase/include/trx0trx.h | 15 +++- innobase/read/read0read.c | 141 +++++++++++++++++++++++++++++++++- innobase/row/row0sel.c | 8 +- innobase/trx/trx0trx.c | 28 +++++-- sql/ha_innodb.cc | 45 ++++++++++- sql/ha_innodb.h | 29 +++++++ 8 files changed, 294 insertions(+), 13 deletions(-) diff --git a/innobase/include/read0read.h b/innobase/include/read0read.h index db6bf888095..1a7a86470a8 100644 --- a/innobase/include/read0read.h +++ b/innobase/include/read0read.h @@ -69,6 +69,35 @@ read_view_print( /*============*/ read_view_t* view); /* in: read view */ +/************************************************************************* +Create a consistent cursor view for mysql to be used in cursors. In this +consistent read view modifications done by the creating transaction or future +transactions are not visible. */ + +cursor_view_t* +read_cursor_view_create_for_mysql( +/*==============================*/ + trx_t* cr_trx);/* in: trx where cursor view is created */ + +/************************************************************************* +Close a given consistent cursor view for and restore global read view +back to a transaction. */ + +void +read_cursor_view_close_for_mysql( +/*=============================*/ + trx_t* trx, /* in: trx */ + cursor_view_t* curview); /* in: cursor view to be closed */ +/************************************************************************* +This function sets a given consistent cursor view to a transaction +read view if given consistent cursor view is not null. Otherwice, function +restores a global read view to a transaction read view. */ + +void +read_cursor_set_for_mysql( +/*======================*/ + trx_t* trx, /* in: transaction where cursor is set */ + cursor_view_t* curview);/* in: consistent cursor view to be set */ /* Read view lists the trx ids of those transactions for which a consistent read should not see the modifications to the database. */ @@ -100,6 +129,17 @@ struct read_view_struct{ /* List of read views in trx_sys */ }; +/* Implement InnoDB framework to support consistent read views in +cursors. This struct holds both heap where consistent read view +is allocated and pointer to a read view. */ + +struct cursor_view_struct{ + mem_heap_t* heap; + /* Memory heap for the cursor view */ + read_view_t* read_view; + /* Consistent read view of the cursor*/ +}; + #ifndef UNIV_NONINL #include "read0read.ic" #endif diff --git a/innobase/include/read0types.h b/innobase/include/read0types.h index 5eb3e533f89..7d42728523e 100644 --- a/innobase/include/read0types.h +++ b/innobase/include/read0types.h @@ -10,5 +10,6 @@ Created 2/16/1997 Heikki Tuuri #define read0types_h typedef struct read_view_struct read_view_t; +typedef struct cursor_view_struct cursor_view_t; #endif diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 146730d46f8..2fc4d5a289f 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -602,8 +602,19 @@ struct trx_struct{ UT_LIST_BASE_NODE_T(lock_t) trx_locks; /* locks reserved by the transaction */ /*------------------------------*/ - mem_heap_t* read_view_heap; /* memory heap for the read view */ - read_view_t* read_view; /* consistent read view or NULL */ + mem_heap_t* global_read_view_heap; + /* memory heap for the global read + view */ + read_view_t* global_read_view; + /* consistent read view used in the + transaction is stored here if + transaction is using a consistent + read view associated to a cursor */ + read_view_t* read_view; /* consistent read view used in the + transaction or NULL, this read view + can be normal read view associated + to a transaction or read view + associated to a cursor */ /*------------------------------*/ UT_LIST_BASE_NODE_T(trx_named_savept_t) trx_savepoints; /* savepoints set with SAVEPOINT ..., diff --git a/innobase/read/read0read.c b/innobase/read/read0read.c index 0c4a037508e..76df7cdbee0 100644 --- a/innobase/read/read0read.c +++ b/innobase/read/read0read.c @@ -212,15 +212,16 @@ read_view_close_for_mysql( /*======================*/ trx_t* trx) /* in: trx which has a read view */ { - ut_a(trx->read_view); + ut_a(trx->global_read_view); mutex_enter(&kernel_mutex); - read_view_close(trx->read_view); + read_view_close(trx->global_read_view); - mem_heap_empty(trx->read_view_heap); + mem_heap_empty(trx->global_read_view_heap); trx->read_view = NULL; + trx->global_read_view = NULL; mutex_exit(&kernel_mutex); } @@ -258,3 +259,137 @@ read_view_print( (ulong) ut_dulint_get_low(read_view_get_nth_trx_id(view, i))); } } + +/************************************************************************* +Create a consistent cursor view for mysql to be used in cursors. In this +consistent read view modifications done by the creating transaction or future +transactions are not visible. */ + +cursor_view_t* +read_cursor_view_create_for_mysql( +/*==============================*/ + trx_t* cr_trx) /* in: trx where cursor view is created */ +{ + cursor_view_t* curview; + read_view_t* view; + mem_heap_t* heap; + trx_t* trx; + ulint n; + + ut_a(cr_trx); + + /* Use larger heap than in trx_create when creating a read_view + because cursors are quite long. */ + + heap = mem_heap_create(512); + + curview = (cursor_view_t*) mem_heap_alloc(heap, sizeof(cursor_view_t)); + curview->heap = heap; + + mutex_enter(&kernel_mutex); + + curview->read_view = read_view_create_low( + UT_LIST_GET_LEN(trx_sys->trx_list), + curview->heap); + + view = curview->read_view; + view->creator = cr_trx; + + /* No future transactions should be visible in the view */ + + view->low_limit_no = trx_sys->max_trx_id; + view->low_limit_id = view->low_limit_no; + + view->can_be_too_old = FALSE; + + n = 0; + trx = UT_LIST_GET_FIRST(trx_sys->trx_list); + + /* No active transaction should be visible, not even cr_trx !*/ + + while (trx) { + if (trx->conc_state == TRX_ACTIVE || + trx->conc_state == TRX_PREPARED) { + + read_view_set_nth_trx_id(view, n, trx->id); + + n++; + + /* NOTE that a transaction whose trx number is < + trx_sys->max_trx_id can still be active, if it is + in the middle of its commit! Note that when a + transaction starts, we initialize trx->no to + ut_dulint_max. */ + + if (ut_dulint_cmp(view->low_limit_no, trx->no) > 0) { + + view->low_limit_no = trx->no; + } + } + + trx = UT_LIST_GET_NEXT(trx_list, trx); + } + + view->n_trx_ids = n; + + if (n > 0) { + /* The last active transaction has the smallest id: */ + view->up_limit_id = read_view_get_nth_trx_id(view, n - 1); + } else { + view->up_limit_id = view->low_limit_id; + } + + UT_LIST_ADD_FIRST(view_list, trx_sys->view_list, view); + + mutex_exit(&kernel_mutex); + + return(curview); +} + +/************************************************************************* +Close a given consistent cursor view for and restore global read view +back to a transaction. */ + +void +read_cursor_view_close_for_mysql( +/*=============================*/ + trx_t* trx, /* in: trx */ + cursor_view_t* curview)/* in: cursor view to be closed */ +{ + ut_a(curview); + ut_a(curview->read_view); + ut_a(curview->heap); + + mutex_enter(&kernel_mutex); + + read_view_close(curview->read_view); + trx->read_view = trx->global_read_view; + + mutex_exit(&kernel_mutex); + + mem_heap_free(curview->heap); +} + +/************************************************************************* +This function sets a given consistent cursor view to a transaction +read view if given consistent cursor view is not null. Otherwice, function +restores a global read view to a transaction read view. */ + +void +read_cursor_set_for_mysql( +/*======================*/ + trx_t* trx, /* in: transaction where cursor is set */ + cursor_view_t* curview)/* in: consistent cursor view to be set */ +{ + ut_a(trx); + + mutex_enter(&kernel_mutex); + + if (UNIV_LIKELY(curview != NULL)) { + trx->read_view = curview->read_view; + } else { + trx->read_view = trx->global_read_view; + } + + mutex_exit(&kernel_mutex); +} diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 15439bed7e7..602f5855171 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -4083,6 +4083,11 @@ normal_return: } func_exit: + /* Restore a global read view back to transaction. This forces + MySQL always to set cursor view before fetch if it is used. */ + + trx->read_view = trx->global_read_view; + trx->op_info = ""; if (UNIV_LIKELY_NULL(heap)) { mem_heap_free(heap); @@ -4136,7 +4141,8 @@ row_search_check_if_query_cache_permitted( && !trx->read_view) { trx->read_view = read_view_open_now(trx, - trx->read_view_heap); + trx->global_read_view_heap); + trx->global_read_view = trx->read_view; } } diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index 10fbf3468c0..f95491443ee 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -159,7 +159,8 @@ trx_create( trx->auto_inc_lock = NULL; - trx->read_view_heap = mem_heap_create(256); + trx->global_read_view_heap = mem_heap_create(256); + trx->global_read_view = NULL; trx->read_view = NULL; /* Set X/Open XA transaction identification to NULL */ @@ -318,10 +319,12 @@ trx_free( ut_a(UT_LIST_GET_LEN(trx->trx_locks) == 0); - if (trx->read_view_heap) { - mem_heap_free(trx->read_view_heap); + if (trx->global_read_view_heap) { + mem_heap_free(trx->global_read_view_heap); } + trx->global_read_view = NULL; + ut_a(trx->read_view == NULL); mem_free(trx); @@ -831,10 +834,23 @@ trx_commit_off_kernel( lock_release_off_kernel(trx); if (trx->read_view) { + /* If transaction has a global read view this case + means that transaction has been using a consistent + read view associated to a cursor. Only the global + read view associated to a transaction is closed + and read view is then removed from the transaction. + If read view associated to a cursor is still used + it must be re-registered to another transaction. */ + + if (UNIV_LIKELY_NULL(trx->global_read_view)) { + trx->read_view = trx->global_read_view; + } + read_view_close(trx->read_view); - mem_heap_empty(trx->read_view_heap); + mem_heap_empty(trx->global_read_view_heap); trx->read_view = NULL; + trx->global_read_view = NULL; } if (must_flush_log) { @@ -964,7 +980,9 @@ trx_assign_read_view( mutex_enter(&kernel_mutex); if (!trx->read_view) { - trx->read_view = read_view_open_now(trx, trx->read_view_heap); + trx->read_view = read_view_open_now(trx, + trx->global_read_view_heap); + trx->global_read_view = trx->read_view; } mutex_exit(&kernel_mutex); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 690f1354d2b..1c3bca08037 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5879,7 +5879,7 @@ ha_innobase::start_stmt( innobase_release_stat_resources(trx); if (trx->isolation_level <= TRX_ISO_READ_COMMITTED - && trx->read_view) { + && trx->global_read_view) { /* At low transaction isolation levels we let each consistent read set its own snapshot */ @@ -6100,7 +6100,7 @@ ha_innobase::external_lock( } } else { if (trx->isolation_level <= TRX_ISO_READ_COMMITTED - && trx->read_view) { + && trx->global_read_view) { /* At low transaction isolation levels we let each consistent read set its own snapshot */ @@ -7130,4 +7130,45 @@ innobase_rollback_by_xid( } } +/*********************************************************************** +This function creates a consistent view for a cursor and start a transaction +if it has not been started. This consistent view is then used inside of MySQL +when accesing records using a cursor. */ + +void* +innobase_create_cursor_view(void) +/*=============================*/ + /* out: Pointer to cursor view or NULL */ +{ + return(read_cursor_view_create_for_mysql( + check_trx_exists(current_thd))); +} + +/*********************************************************************** +This function closes the given consistent cursor view. Note that +global read view is restored to a transaction and a transaction is +started if it has not been started. */ + +void +innobase_close_cursor_view( +/*=======================*/ + void* curview)/* in: Consistent read view to be closed */ +{ + read_cursor_view_close_for_mysql(check_trx_exists(current_thd), + (cursor_view_t*) curview); +} + +/*********************************************************************** +This function sets the given consistent cursor view to a transaction. +If a transaction does not exist, transaction is started. */ + +void +innobase_set_cursor_view( +/*=====================*/ + void* curview)/* in: Consistent cursor view to be closed */ +{ + read_cursor_set_for_mysql(check_trx_exists(current_thd), + (cursor_view_t*) curview); +} + #endif /* HAVE_INNOBASE_DB */ diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 1584a2182c9..2cbc1c8d91b 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -310,3 +310,32 @@ int innobase_xa_end(THD *thd); int innobase_repl_report_sent_binlog(THD *thd, char *log_file_name, my_off_t end_offset); + +/*********************************************************************** +This function creates a consistent view for a cursor and start a transaction +if it has not been started. This consistent view is then used inside of MySQL +when accesing records using a cursor. */ + +void* +innobase_create_cursor_view(void); +/*=============================*/ + /* out: Pointer to cursor view or NULL */ + +/*********************************************************************** +This function closes the given consistent cursor view. Note that +global read view is restored to a transaction and a transaction is +started if it has not been started. */ + +void +innobase_close_cursor_view( +/*=======================*/ + void* curview); /* in: Consistent read view to be closed */ + +/*********************************************************************** +This function sets the given consistent cursor view to a transaction. +If a transaction does not exist, transaction is started. */ + +void +innobase_set_cursor_view( +/*=====================*/ + void* curview); /* in: Consistent read view to be closed */ From 5f900fb5322f123fcf63c59ca16b749a6c49bd73 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Jul 2005 20:37:59 +0200 Subject: [PATCH 010/144] Add the definition of "floatget". Necessary to compile 5.0.10 on Windows, no bug report filed. include/config-win.h: Add the definition of "floatget" (as taken from "include/my_config.h", matching the common "floatstore"). Necessary to compile 5.0.10 on Windows, no bug report filed. --- include/config-win.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/config-win.h b/include/config-win.h index 6e0740497b0..4eaf97cd4f5 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -285,6 +285,7 @@ inline double ulonglong2double(ulonglong value) *(((long *) T)+1) = *(((long*) &V)+1); } #define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); } #define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float)) +#define floatget(V,M) memcpy((byte*)(&V), (byte*)(M), sizeof(float)) #define float8get(V,M) doubleget((V),(M)) #define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) #define float8store(V,M) doublestore((V),(M)) From 657a5346e4df9b0aa9a533d407340d5603c9614b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Jul 2005 11:46:29 -0700 Subject: [PATCH 011/144] Fix calculation for length of LPAD() and RPAD() reported to client via mysql_fetch_fields(). (Bug #11311) mysql-test/r/func_str.result: Add new results mysql-test/t/func_str.test: Add new regression test sql/item_strfunc.cc: Fix length reported for LPAD() and RPAD() -- they always truncate to the length that is given. --- mysql-test/r/func_str.result | 15 +++++++++++++++ mysql-test/t/func_str.test | 11 +++++++++++ sql/item_strfunc.cc | 2 -- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 18a04574596..4c3a03b8066 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -868,3 +868,18 @@ drop table t1; select hex(29223372036854775809), hex(-29223372036854775809); hex(29223372036854775809) hex(-29223372036854775809) FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF +create table t1 (i int); +insert into t1 values (1000000000),(1); +select lpad(i, 7, ' ') as t from t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t 253 7 7 Y 128 31 63 +t +1000000 + 1 +select rpad(i, 7, ' ') as t from t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t 253 7 7 Y 128 31 63 +t +1000000 +1 +drop table t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index ae3cdc361ab..57d4f4c548e 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -611,3 +611,14 @@ drop table t1; # Bug #9854 hex() and out of range handling # select hex(29223372036854775809), hex(-29223372036854775809); + +# +# Bug #11311: Incorrect length returned from LPAD() and RPAD() +# +create table t1 (i int); +insert into t1 values (1000000000),(1); +--enable_metadata +select lpad(i, 7, ' ') as t from t1; +select rpad(i, 7, ' ') as t from t1; +--disable_metadata +drop table t1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 3a5ddd583ef..d316c7eaf72 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2042,7 +2042,6 @@ void Item_func_rpad::fix_length_and_dec() { ulonglong length= ((ulonglong) args[1]->val_int() * collation.collation->mbmaxlen); - length= max((ulonglong) args[0]->max_length, length); if (length >= MAX_BLOB_WIDTH) { length= MAX_BLOB_WIDTH; @@ -2130,7 +2129,6 @@ void Item_func_lpad::fix_length_and_dec() { ulonglong length= ((ulonglong) args[1]->val_int() * collation.collation->mbmaxlen); - length= max((ulonglong) args[0]->max_length, length); if (length >= MAX_BLOB_WIDTH) { length= MAX_BLOB_WIDTH; From 03fb8276d5f66e9b7ce51a0aa9c0215c71c86a04 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Jul 2005 20:56:08 +0200 Subject: [PATCH 012/144] removed DBUG code from ha_federated.cc causing windows compile problems. This is for the release bk tree, same change as 1.1890, which JimW approved. sql/ha_federated.cc: removed DBUG code --- sql/ha_federated.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 1d7b8cda8e2..80fbfe13d33 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -762,7 +762,6 @@ uint ha_federated::convert_row_to_internal_format(byte *record, MYSQL_ROW row) (*field)->move_field(-old_ptr); } - DBUG_DUMP("record", record, table->s->reclength); DBUG_RETURN(0); } From 46b0edc444c0dffafbbce8ef5b65f61a0224bef1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Jul 2005 12:01:42 -0700 Subject: [PATCH 013/144] Remove use of non-portable gettimeofday() in thr_lock.c (Bug #12100) mysys/thr_lock.c: Use set_timespec() macro instead of calling gettimeofday() --- mysys/thr_lock.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index b12f8234c26..5b11aa3c6f4 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -388,7 +388,6 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, { struct st_my_thread_var *thread_var= my_thread_var; pthread_cond_t *cond= &thread_var->suspend; - struct timeval now; struct timespec wait_timeout; enum enum_thr_lock_result result= THR_LOCK_ABORTED; my_bool can_deadlock= test(data->owner->info->n_cursors); @@ -406,11 +405,7 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, data->cond= cond; if (can_deadlock) - { - gettimeofday(&now, 0); - wait_timeout.tv_sec= now.tv_sec + table_lock_wait_timeout; - wait_timeout.tv_nsec= now.tv_usec * 1000; - } + set_timespec(wait_timeout, table_lock_wait_timeout); while (!thread_var->abort || in_wait_list) { int rc= can_deadlock ? pthread_cond_timedwait(cond, &data->lock->mutex, From bc8599b48537500e87f716d322dda374ec15a4a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 23 Jul 2005 01:11:29 +0300 Subject: [PATCH 014/144] Undefined RINT for Netware. --- include/config-netware.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/config-netware.h b/include/config-netware.h index c48aff70f3b..c8eba43b86f 100644 --- a/include/config-netware.h +++ b/include/config-netware.h @@ -45,6 +45,7 @@ extern "C" { #undef HAVE_SCHED_H #undef HAVE_SYS_MMAN_H #undef HAVE_SYNCH_H +#undef HAVE_RINT #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 #define HAVE_PTHREAD_SIGMASK 1 #define HAVE_PTHREAD_YIELD_ZERO_ARG 1 From c055edc631ad5e681e3b5fea6527d0608797ddab Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Jul 2005 16:18:34 -0700 Subject: [PATCH 015/144] Fix value returned from SELECT of unsigned long system variables. (Bug #10351) mysql-test/r/variables.result: Update results mysql-test/t/variables.test: Add regression test sql/item.h: Add Item_uint(ulong) constructor sql/mysqld.cc: Fix default/max max_seeks_for_key to UINT_MAX32 sql/set_var.cc: Use correct Item_uint() constructors in sys_var::item() --- mysql-test/r/variables.result | 12 ++++++++++++ mysql-test/t/variables.test | 10 ++++++++++ sql/item.h | 1 + sql/mysqld.cc | 2 +- sql/set_var.cc | 4 ++-- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 5468508165c..8ab591e18d0 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -525,3 +525,15 @@ set @@warning_count=1; ERROR HY000: Variable 'warning_count' is a read only variable set @@global.error_count=1; ERROR HY000: Variable 'error_count' is a read only variable +set @@max_heap_table_size= 4294967296; +select @@max_heap_table_size; +@@max_heap_table_size +4294967296 +set global max_heap_table_size= 4294967296; +select @@max_heap_table_size; +@@max_heap_table_size +4294967296 +set @@max_heap_table_size= 4294967296; +select @@max_heap_table_size; +@@max_heap_table_size +4294967296 diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index c3ffdc79c16..e6efb86e325 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -406,3 +406,13 @@ drop table t1; set @@warning_count=1; --error 1238 set @@global.error_count=1; + +# +# Bug #10351: Setting max_heap_table_size to 4G fails +# +set @@max_heap_table_size= 4294967296; +select @@max_heap_table_size; +set global max_heap_table_size= 4294967296; +select @@max_heap_table_size; +set @@max_heap_table_size= 4294967296; +select @@max_heap_table_size; diff --git a/sql/item.h b/sql/item.h index 5a1cf193806..69ec9d84eef 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1142,6 +1142,7 @@ class Item_uint :public Item_int public: Item_uint(const char *str_arg, uint length); Item_uint(uint32 i) :Item_int((ulonglong) i, 10) {} + Item_uint(ulong i) :Item_int((ulonglong) i, 10) {} Item_uint(const char *str_arg, longlong i, uint length); double val_real() { DBUG_ASSERT(fixed == 1); return ulonglong2double((ulonglong)value); } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 798bd25fa7c..7afb70c32a8 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5371,7 +5371,7 @@ The minimum value for this variable is 4096.", "Limit assumed max number of seeks when looking up rows based on a key", (gptr*) &global_system_variables.max_seeks_for_key, (gptr*) &max_system_variables.max_seeks_for_key, 0, GET_ULONG, - REQUIRED_ARG, ~0L, 1, ~0L, 0, 1, 0 }, + REQUIRED_ARG, UINT_MAX32, 1, UINT_MAX32, 0, 1, 0 }, {"max_sort_length", OPT_MAX_SORT_LENGTH, "The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored).", (gptr*) &global_system_variables.max_sort_length, diff --git a/sql/set_var.cc b/sql/set_var.cc index 09581aed217..5cdd4081614 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1679,7 +1679,7 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base) pthread_mutex_lock(&LOCK_global_system_variables); value= *(uint*) value_ptr(thd, var_type, base); pthread_mutex_unlock(&LOCK_global_system_variables); - return new Item_uint((int32) value); + return new Item_uint((uint32) value); } case SHOW_LONG: { @@ -1687,7 +1687,7 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base) pthread_mutex_lock(&LOCK_global_system_variables); value= *(ulong*) value_ptr(thd, var_type, base); pthread_mutex_unlock(&LOCK_global_system_variables); - return new Item_uint((int32) value); + return new Item_uint(value); } case SHOW_LONGLONG: { From cebe1b5db71132a7bf0b3ffcb2d3bf3347be6384 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 23 Jul 2005 07:51:25 +0300 Subject: [PATCH 016/144] store SERVER_MORE_RESULTS_EXISTS in key of query cache (BUG#6897) mysql-test/r/query_cache.result: query in QC from normal execution and SP mysql-test/t/query_cache.test: environment restoring fix layout fix query in QC from normal execution and SP sql/mysql_priv.h: store SERVER_MORE_RESULTS_EXISTS sql/sql_cache.cc: store SERVER_MORE_RESULTS_EXISTS in key of query cache BitKeeper/etc/config: switching logging off --- BitKeeper/etc/config | 2 +- mysql-test/r/query_cache.result | 79 +++++++++++++++++++++++++++++++++ mysql-test/t/query_cache.test | 45 ++++++++++++++++++- sql/mysql_priv.h | 1 + sql/sql_cache.cc | 46 +++++++++++++++---- 5 files changed, 163 insertions(+), 10 deletions(-) diff --git a/BitKeeper/etc/config b/BitKeeper/etc/config index 1ac24031dca..56ae08e5ffa 100644 --- a/BitKeeper/etc/config +++ b/BitKeeper/etc/config @@ -24,7 +24,7 @@ description: MySQL - fast and reliable SQL database # repository is commercial it can be an internal email address or "none" # to disable logging. # -logging: logging@openlogging.org +logging: none # # If this field is set, all checkins will appear to be made by this user, # in effect making this a single user package. Single user packages are diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 506a76579ae..d011efd8c6d 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -852,6 +852,7 @@ Qcache_hits 6 show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 4 +SET NAMES default; DROP TABLE t1; CREATE TABLE t1 (a int(1)); CREATE DATABASE mysqltest; @@ -1007,6 +1008,8 @@ abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba flush query cache; drop table t1, t2; +set GLOBAL query_cache_size=1355776 +#; create table t1 (a int); insert into t1 values (1),(2); CREATE PROCEDURE `p1`() @@ -1036,4 +1039,80 @@ a f1() 2 2 drop procedure p1// drop table t1// +flush query cache; +reset query cache; +flush status; +create table t1 (s1 int)// +create procedure f1 () begin +select sql_cache * from t1; +select sql_cache * from t1; +end;// +call f1(); +s1 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 1 +call f1(); +s1 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 3 +call f1(); +s1 +select sql_cache * from t1; +s1 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 2 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 5 +insert into t1 values (1); +select sql_cache * from t1; +s1 +1 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 3 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 5 +call f1(); +s1 +1 +call f1(); +s1 +1 +select sql_cache * from t1; +s1 +1 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 4 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 9 +drop procedure f1; +drop table t1; set GLOBAL query_cache_size=0; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 88891bd3881..9193d7e1001 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -616,6 +616,7 @@ set character_set_results=cp1251; SELECT a,'Â','â'='Â' FROM t1; show status like "Qcache_hits"; show status like "Qcache_queries_in_cache"; +SET NAMES default; DROP TABLE t1; @@ -711,9 +712,10 @@ repair table t1; show status like 'qcache_queries_in_cache'; drop table t1; +# # Bug #9549: Make sure cached queries that span more than one cache block # are handled properly in the embedded server. - +# # We just want a small query cache, so we can fragment it easily set GLOBAL query_cache_size=64*1024; # This actually gives us a usable cache size of about 48K @@ -755,6 +757,8 @@ select a from t1; flush query cache; drop table t1, t2; +set GLOBAL query_cache_size=1355776 + # # SP cursors and selects with query cache (BUG#9715) @@ -788,4 +792,43 @@ drop procedure p1// drop table t1// delimiter ;// +# +# query in QC from normal execution and SP (BUG#6897) +# +flush query cache; +reset query cache; +flush status; +delimiter //; +create table t1 (s1 int)// +create procedure f1 () begin +select sql_cache * from t1; +select sql_cache * from t1; +end;// +delimiter ;// +call f1(); +show status like "Qcache_queries_in_cache"; +show status like "Qcache_inserts"; +show status like "Qcache_hits"; +call f1(); +show status like "Qcache_queries_in_cache"; +show status like "Qcache_inserts"; +show status like "Qcache_hits"; +call f1(); +select sql_cache * from t1; +show status like "Qcache_queries_in_cache"; +show status like "Qcache_inserts"; +show status like "Qcache_hits"; +insert into t1 values (1); +select sql_cache * from t1; +show status like "Qcache_queries_in_cache"; +show status like "Qcache_inserts"; +show status like "Qcache_hits"; +call f1(); +call f1(); +select sql_cache * from t1; +show status like "Qcache_queries_in_cache"; +show status like "Qcache_inserts"; +show status like "Qcache_hits"; +drop procedure f1; +drop table t1; set GLOBAL query_cache_size=0; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 2add9ac9269..0e2912e0a6d 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -521,6 +521,7 @@ struct Query_cache_query_flags { unsigned int client_long_flag:1; unsigned int client_protocol_41:1; + unsigned int more_results_exists:1; uint character_set_client_num; uint character_set_results_num; uint collation_connection_num; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 430e0fbcabf..d2721e93f12 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -775,10 +775,11 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) Query_cache_query_flags flags; // fill all gaps between fields with 0 to get repeatable key bzero(&flags, QUERY_CACHE_FLAGS_SIZE); - flags.client_long_flag= (thd->client_capabilities & CLIENT_LONG_FLAG ? - 1 : 0); - flags.client_protocol_41= (thd->client_capabilities & CLIENT_PROTOCOL_41 ? - 1 : 0); + flags.client_long_flag= test(thd->client_capabilities & CLIENT_LONG_FLAG); + flags.client_protocol_41= test(thd->client_capabilities & + CLIENT_PROTOCOL_41); + flags.more_results_exists= test(thd->server_status & + SERVER_MORE_RESULTS_EXISTS); flags.character_set_client_num= thd->variables.character_set_client->number; flags.character_set_results_num= @@ -792,6 +793,20 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) flags.sql_mode= thd->variables.sql_mode; flags.max_sort_length= thd->variables.max_sort_length; flags.group_concat_max_len= thd->variables.group_concat_max_len; + DBUG_PRINT("qcache", ("long %d, 4.1: %d, more results %d, \ +CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \ +sql mode: 0x%lx, sort len: %lu, conncat len: %lu", + (int)flags.client_long_flag, + (int)flags.client_protocol_41, + (int)flags.more_results_exists, + flags.character_set_client_num, + flags.character_set_results_num, + flags.collation_connection_num, + flags.limit, + (ulong)flags.time_zone, + flags.sql_mode, + flags.max_sort_length, + flags.group_concat_max_len)); STRUCT_LOCK(&structure_guard_mutex); if (query_cache_size == 0) @@ -974,10 +989,11 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) // fill all gaps between fields with 0 to get repeatable key bzero(&flags, QUERY_CACHE_FLAGS_SIZE); - flags.client_long_flag= (thd->client_capabilities & CLIENT_LONG_FLAG ? - 1 : 0); - flags.client_protocol_41= (thd->client_capabilities & CLIENT_PROTOCOL_41 ? - 1 : 0); + flags.client_long_flag= test(thd->client_capabilities & CLIENT_LONG_FLAG); + flags.client_protocol_41= test(thd->client_capabilities & + CLIENT_PROTOCOL_41); + flags.more_results_exists= test(thd->server_status & + SERVER_MORE_RESULTS_EXISTS); flags.character_set_client_num= thd->variables.character_set_client->number; flags.character_set_results_num= (thd->variables.character_set_results ? @@ -989,6 +1005,20 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) flags.sql_mode= thd->variables.sql_mode; flags.max_sort_length= thd->variables.max_sort_length; flags.group_concat_max_len= thd->variables.group_concat_max_len; + DBUG_PRINT("qcache", ("long %d, 4.1: %d, more results %d, \ +CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \ +sql mode: 0x%lx, sort len: %lu, conncat len: %lu", + (int)flags.client_long_flag, + (int)flags.client_protocol_41, + (int)flags.more_results_exists, + flags.character_set_client_num, + flags.character_set_results_num, + flags.collation_connection_num, + flags.limit, + (ulong)flags.time_zone, + flags.sql_mode, + flags.max_sort_length, + flags.group_concat_max_len)); memcpy((void *)(sql + (tot_length - QUERY_CACHE_FLAGS_SIZE)), &flags, QUERY_CACHE_FLAGS_SIZE); query_block = (Query_cache_block *) hash_search(&queries, (byte*) sql, From 8dd5bd5e5501adcaa09e21b1f3846663a5d663c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 23 Jul 2005 12:06:02 +0200 Subject: [PATCH 017/144] Add tool to extract config info from ndb_mgmd ndb/include/mgmapi/mgmapi.h: Add feature to redirect error printouts ndb/src/mgmapi/mgmapi.cpp: Add feature to redirect error printouts ndb/src/mgmsrv/ConfigInfo.hpp: Make param info public ndb/tools/Makefile.am: Add ndb_config ndb/tools/config.cpp: New BitKeeper file ``ndb/tools/config.cpp'' --- ndb/include/mgmapi/mgmapi.h | 7 + ndb/src/mgmapi/mgmapi.cpp | 62 ++++-- ndb/src/mgmsrv/ConfigInfo.hpp | 6 +- ndb/tools/Makefile.am | 13 +- ndb/tools/config.cpp | 407 ++++++++++++++++++++++++++++++++++ 5 files changed, 467 insertions(+), 28 deletions(-) create mode 100644 ndb/tools/config.cpp diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index fa0774afa06..26b9dc65947 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -49,6 +49,7 @@ * @{ */ +#include #include #include "mgmapi_config_parameters.h" @@ -351,6 +352,12 @@ extern "C" { int ndb_mgm_get_latest_error_line(const NdbMgmHandle handle); #endif + /** + * Set error stream + */ + void ndb_mgm_set_error_stream(NdbMgmHandle, FILE *); + + /** @} *********************************************************************/ /** * @name Functions: Create/Destroy Management Server Handles diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 863f54ce51a..c14847ef512 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -100,6 +100,7 @@ struct ndb_mgm_handle { #ifdef MGMAPI_LOG FILE* logfile; #endif + FILE *errstream; }; #define SET_ERROR(h, e, s) setError(h, e, __LINE__, s) @@ -152,6 +153,7 @@ ndb_mgm_create_handle() h->read_timeout = 50000; h->write_timeout = 100; h->cfg_i = 0; + h->errstream = stdout; strncpy(h->last_error_desc, "No error", NDB_MGM_MAX_ERR_DESC_SIZE); @@ -205,6 +207,13 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle) * handle = 0; } +extern "C" +void +ndb_mgm_set_error_stream(NdbMgmHandle handle, FILE * file) +{ + handle->errstream = file; +} + /***************************************************************************** * Error handling *****************************************************************************/ @@ -369,8 +378,8 @@ ndb_mgm_connect(NdbMgmHandle handle, int no_retries, break; if (verbose > 0) { char buf[1024]; - ndbout_c("Unable to connect with connect string: %s", - cfg.makeConnectString(buf,sizeof(buf))); + fprintf(handle->errstream, "Unable to connect with connect string: %s\n", + cfg.makeConnectString(buf,sizeof(buf))); verbose= -1; } if (no_retries == 0) { @@ -379,32 +388,35 @@ ndb_mgm_connect(NdbMgmHandle handle, int no_retries, "Unable to connect with connect string: %s", cfg.makeConnectString(buf,sizeof(buf))); if (verbose == -2) - ndbout << ", failed." << endl; + fprintf(handle->errstream, ", failed.\n"); return -1; } if (verbose == -1) { - ndbout << "Retrying every " << retry_delay_in_seconds << " seconds"; + fprintf(handle->errstream, "Retrying every %d seconds", + retry_delay_in_seconds); if (no_retries > 0) - ndbout << ". Attempts left:"; + fprintf(handle->errstream, ". Attempts left:"); else - ndbout << ", until connected.";; - ndbout << flush; + fprintf(handle->errstream, ", until connected."); + fflush(handle->errstream); verbose= -2; } if (no_retries > 0) { if (verbose == -2) { - ndbout << " " << no_retries; - ndbout << flush; + fprintf(handle->errstream, " %d", no_retries); + fflush(handle->errstream); } no_retries--; } NdbSleep_SecSleep(retry_delay_in_seconds); } if (verbose == -2) - ndbout << endl; - + { + fprintf(handle->errstream, "\n"); + fflush(handle->errstream); + } handle->cfg_i = i; - + handle->socket = sockfd; handle->connected = 1; @@ -456,7 +468,9 @@ ndb_mgm_match_node_type(const char * type) for(int i = 0; iget("result", &buf) || strcmp(buf, "Ok") != 0){ - ndbout_c("ERROR Message: %s\n", buf); + fprintf(handle->errstream, "ERROR Message: %s\n\n", buf); break; } buf = ""; if(!prop->get("Content-Type", &buf) || strcmp(buf, "ndbconfig/octet-stream") != 0){ - ndbout_c("Unhandled response type: %s", buf); + fprintf(handle->errstream, "Unhandled response type: %s\n", buf); break; } buf = ""; if(!prop->get("Content-Transfer-Encoding", &buf) || strcmp(buf, "base64") != 0){ - ndbout_c("Unhandled encoding: %s", buf); + fprintf(handle->errstream, "Unhandled encoding: %s\n", buf); break; } buf = ""; Uint32 len = 0; if(!prop->get("Content-Length", &len)){ - ndbout_c("Invalid response: %s\n", buf); + fprintf(handle->errstream, "Invalid response: %s\n\n", buf); break; } @@ -1697,14 +1711,14 @@ ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) { const int res = base64_decode(buf64, len-1, tmp); delete[] buf64; if(res != 0){ - ndbout_c("Failed to decode buffer"); + fprintf(handle->errstream, "Failed to decode buffer\n"); break; } ConfigValuesFactory cvf; const int res2 = cvf.unpack(tmp); if(!res2){ - ndbout_c("Failed to unpack buffer"); + fprintf(handle->errstream, "Failed to unpack buffer\n"); break; } @@ -1808,7 +1822,7 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype) } Uint32 _nodeid; if(!prop->get("nodeid", &_nodeid) != 0){ - ndbout_c("ERROR Message: \n"); + fprintf(handle->errstream, "ERROR Message: \n"); break; } nodeid= _nodeid; @@ -1884,7 +1898,7 @@ ndb_mgm_set_int_parameter(NdbMgmHandle handle, do { const char * buf; if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){ - ndbout_c("ERROR Message: %s\n", buf); + fprintf(handle->errstream, "ERROR Message: %s\n", buf); break; } res= 0; @@ -1927,7 +1941,7 @@ ndb_mgm_set_int64_parameter(NdbMgmHandle handle, do { const char * buf; if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){ - ndbout_c("ERROR Message: %s\n", buf); + fprintf(handle->errstream, "ERROR Message: %s\n", buf); break; } res= 0; @@ -1970,7 +1984,7 @@ ndb_mgm_set_string_parameter(NdbMgmHandle handle, do { const char * buf; if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){ - ndbout_c("ERROR Message: %s\n", buf); + fprintf(handle->errstream, "ERROR Message: %s\n", buf); break; } res= 0; @@ -2007,7 +2021,7 @@ ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **purged){ do { const char * buf; if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){ - ndbout_c("ERROR Message: %s\n", buf); + fprintf(handle->errstream, "ERROR Message: %s\n", buf); break; } if (purged) { diff --git a/ndb/src/mgmsrv/ConfigInfo.hpp b/ndb/src/mgmsrv/ConfigInfo.hpp index dff8b34bf4a..94f1cebde04 100644 --- a/ndb/src/mgmsrv/ConfigInfo.hpp +++ b/ndb/src/mgmsrv/ConfigInfo.hpp @@ -126,14 +126,14 @@ private: Properties m_info; Properties m_systemDefaults; - static const ParamInfo m_ParamInfo[]; - static const int m_NoOfParams; - static const AliasPair m_sectionNameAliases[]; static const char* m_sectionNames[]; static const int m_noOfSectionNames; public: + static const ParamInfo m_ParamInfo[]; + static const int m_NoOfParams; + static const SectionRule m_SectionRules[]; static const ConfigRule m_ConfigRules[]; static const int m_NoOfRules; diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index c350fb0a141..1f11122fb70 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -9,7 +9,7 @@ ndbtools_PROGRAMS = \ ndb_show_tables \ ndb_select_all \ ndb_select_count \ - ndb_restore + ndb_restore ndb_config tools_common_sources = ../test/src/NDBT_ReturnCodes.cpp \ ../test/src/NDBT_Table.cpp \ @@ -32,6 +32,16 @@ ndb_restore_SOURCES = restore/restore_main.cpp \ restore/consumer_printer.cpp \ restore/Restore.cpp +ndb_config_SOURCES = config.cpp \ + ../src/mgmsrv/Config.cpp \ + ../src/mgmsrv/ConfigInfo.cpp \ + ../src/mgmsrv/InitConfigFileParser.cpp +ndb_config_CXXFLAGS = -I$(top_srcdir)/ndb/src/mgmapi \ + -I$(top_srcdir)/ndb/src/mgmsrv \ + -I$(top_srcdir)/ndb/include/mgmcommon \ + -DMYSQLCLUSTERDIR="\"\"" + + include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapitools.mk.am @@ -45,6 +55,7 @@ ndb_show_tables_LDFLAGS = @ndb_bin_am_ldflags@ ndb_select_all_LDFLAGS = @ndb_bin_am_ldflags@ ndb_select_count_LDFLAGS = @ndb_bin_am_ldflags@ ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_config_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/ndb/tools/config.cpp b/ndb/tools/config.cpp new file mode 100644 index 00000000000..8dd69e050f7 --- /dev/null +++ b/ndb/tools/config.cpp @@ -0,0 +1,407 @@ +/* Copyright (C) 2003 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; either version 2 of the License, or + (at your option) any later version. + + 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 */ + +/** + * ndb_config --nodes --query=nodeid --type=ndbd --host=local1 + */ + +#include +#include +#include +#include + +#include +#include +#include +#include + +static int g_verbose = 0; +static int try_reconnect = 3; + +static int g_nodes = 1; +static const char * g_connectstring = 0; +static const char * g_query = 0; + +static int g_nodeid = 0; +static const char * g_type = 0; +static const char * g_host = 0; +static const char * g_field_delimiter=","; +static const char * g_row_delimiter=" "; + +int g_print_full_config, opt_ndb_shm; + +typedef ndb_mgm_configuration_iterator Iter; + +static void ndb_std_print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n", + MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); +} + +static struct my_option my_long_options[] = +{ + { "usage", '?', "Display this help and exit.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "help", '?', "Display this help and exit.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "version", 'V', "Output version information and exit.", 0, 0, 0, + GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "ndb-connectstring", 256, + "Set connect string for connecting to ndb_mgmd. " + "Syntax: \"[nodeid=;][host=][:]\". " + "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", + (gptr*) &g_connectstring, (gptr*) &g_connectstring, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "nodes", 256, "Print nodes", + (gptr*) &g_nodes, (gptr*) &g_nodes, + 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + { "query", 'q', "Query option(s)", + (gptr*) &g_query, (gptr*) &g_query, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { "host", 257, "Host", + (gptr*) &g_host, (gptr*) &g_host, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { "type", 258, "Type of node/connection", + (gptr*) &g_type, (gptr*) &g_type, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { "id", 258, "Nodeid", + (gptr*) &g_nodeid, (gptr*) &g_nodeid, + 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { "nodeid", 258, "Nodeid", + (gptr*) &g_nodeid, (gptr*) &g_nodeid, + 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { "fields", 'f', "Field separator", + (gptr*) &g_field_delimiter, (gptr*) &g_field_delimiter, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { "rows", 'r', "Row separator", + (gptr*) &g_row_delimiter, (gptr*) &g_row_delimiter, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; + +static void usage() +{ + char desc[] = + "This program will retreive config options for a ndb cluster\n"; + ndb_std_print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +ndb_std_get_one_option(int optid, + const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case 'V': + ndb_std_print_version(); + exit(0); + case '?': + usage(); + exit(0); + } + return 0; +} + +/** + * Match/Apply framework + */ +struct Match +{ + int m_key; + BaseString m_value; + virtual int eval(NdbMgmHandle, const Iter&); +}; + +struct Apply +{ + Apply() {} + Apply(int val) { m_key = val;} + int m_key; + virtual int apply(NdbMgmHandle, const Iter&); +}; + +struct NodeTypeApply : public Apply +{ + virtual int apply(NdbMgmHandle, const Iter&); +}; + +static int parse_query(Vector&, int &argc, char**& argv); +static int parse_where(Vector&, int &argc, char**& argv); +static int eval(NdbMgmHandle, const Iter&, const Vector&); +static int apply(NdbMgmHandle, const Iter&, const Vector&); +int +main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "mysql_cluster",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, + ndb_std_get_one_option))) + return -1; + + NdbMgmHandle mgm = ndb_mgm_create_handle(); + if(mgm == NULL) { + fprintf(stderr, "Cannot create handle to management server.\n"); + exit(-1); + } + + ndb_mgm_set_error_stream(mgm, stderr); + + if (ndb_mgm_set_connectstring(mgm, g_connectstring)) + { + fprintf(stderr, "* %5d: %s\n", + ndb_mgm_get_latest_error(mgm), + ndb_mgm_get_latest_error_msg(mgm)); + fprintf(stderr, + "* %s", ndb_mgm_get_latest_error_desc(mgm)); + exit(-1); + } + + if(ndb_mgm_connect(mgm, try_reconnect-1, 5, 1)) + { + fprintf(stderr, "Connect failed"); + fprintf(stderr, " code: %d, msg: %s\n", + ndb_mgm_get_latest_error(mgm), + ndb_mgm_get_latest_error_msg(mgm)); + exit(-1); + } + else if(g_verbose) + { + fprintf(stderr, "Connected to %s:%d\n", + ndb_mgm_get_connected_host(mgm), + ndb_mgm_get_connected_port(mgm)); + } + + ndb_mgm_configuration * conf = ndb_mgm_get_configuration(mgm, 0); + if(conf == 0) + { + fprintf(stderr, "Could not get configuration"); + fprintf(stderr, "code: %d, msg: %s\n", + ndb_mgm_get_latest_error(mgm), + ndb_mgm_get_latest_error_msg(mgm)); + exit(-1); + } + else if(g_verbose) + { + fprintf(stderr, "Fetched configuration\n"); + } + + Vector select_list; + Vector where_clause; + + if(strcmp(g_row_delimiter, "\\n") == 0) + g_row_delimiter = "\n"; + if(strcmp(g_field_delimiter, "\\n") == 0) + g_field_delimiter = "\n"; + + if(parse_query(select_list, argc, argv)) + { + exit(0); + } + + if(parse_where(where_clause, argc, argv)) + { + exit(0); + } + + Iter iter(* conf, CFG_SECTION_NODE); + bool prev= false; + iter.first(); + for(iter.first(); iter.valid(); iter.next()) + { + if(eval(mgm, iter, where_clause)) + { + if(prev) + printf("%s", g_row_delimiter); + prev= true; + apply(mgm, iter, select_list); + } + } + printf("\n"); + return 0; +} + +static +int +parse_query(Vector& select, int &argc, char**& argv) +{ + if(g_query) + { + BaseString q(g_query); + Vector list; + q.split(list, ","); + for(unsigned i = 0; i& where, int &argc, char**& argv) +{ + Match m; + if(g_host) + { + m.m_key = CFG_NODE_HOST; + m.m_value.assfmt("%s", g_host); + where.push_back(new Match(m)); + } + + if(g_type) + { + m.m_key = CFG_TYPE_OF_SECTION; + m.m_value.assfmt("%d", ndb_mgm_match_node_type(g_type)); + where.push_back(new Match(m)); + } + + if(g_nodeid) + { + m.m_key = CFG_NODE_ID; + m.m_value.assfmt("%d", g_nodeid); + where.push_back(new Match(m)); + } + return 0; +} + +template Vector; +template Vector; + +static +int +eval(NdbMgmHandle mgm, const Iter& iter, const Vector& where) +{ + for(unsigned i = 0; ieval(mgm, iter) == 0) + return 0; + } + + return 1; +} + +static +int +apply(NdbMgmHandle mgm, const Iter& iter, const Vector& list) +{ + for(unsigned i = 0; iapply(mgm, iter); + if(i + 1 != list.size()) + printf("%s", g_field_delimiter); + } + return 0; +} + +int +Match::eval(NdbMgmHandle h, const Iter& iter) +{ + Uint32 val32; + Uint64 val64; + const char* valc; + if (iter.get(m_key, &val32) == 0) + { + if(atoi(m_value.c_str()) != val32) + return 0; + } + else if(iter.get(m_key, &val64) == 0) + { + if(atoll(m_value.c_str()) != val64) + return 0; + } + else if(iter.get(m_key, &valc) == 0) + { + if(strcmp(m_value.c_str(), valc) != 0) + return 0; + } + else + { + return 0; + } + return 1; +} + +int +Apply::apply(NdbMgmHandle h, const Iter& iter) +{ + Uint32 val32; + Uint64 val64; + const char* valc; + if (iter.get(m_key, &val32) == 0) + { + printf("%u", val32); + } + else if(iter.get(m_key, &val64) == 0) + { + printf("%llu", val64); + } + else if(iter.get(m_key, &valc) == 0) + { + printf("%s", valc); + } + return 0; +} + +int +NodeTypeApply::apply(NdbMgmHandle h, const Iter& iter) +{ + Uint32 val32; + if (iter.get(CFG_TYPE_OF_SECTION, &val32) == 0) + { + printf("%s", ndb_mgm_get_node_type_alias_string((ndb_mgm_node_type)val32, 0)); + } + return 0; +} From 1517f4b6e8ff000bc7f33c16f94590e384403d50 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 23 Jul 2005 17:21:27 +0500 Subject: [PATCH 018/144] Fix for bug #6710 (CREATE FUNCTION fails with 'Unknown error') sql/sql_parse.cc: error message added --- sql/sql_parse.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index a3f3ef41dee..07650182c8f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3400,6 +3400,7 @@ purposes internal to the MySQL server", MYF(0)); if (!(res = mysql_create_function(thd,&lex->udf))) send_ok(thd); #else + net_printf(thd, ER_CANT_OPEN_LIBRARY, lex->udf.dl, 0, "feature disabled"); res= -1; #endif break; From a55b35c9284beace3576c1f19c9b921710d4515c Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 23 Jul 2005 20:04:15 +0500 Subject: [PATCH 019/144] Fix for bug #10893 (myisamchk fails on packed spatial) need to be fixed in 4.1 myisam/mi_create.c: now we decrease on the proper value --- myisam/mi_create.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/myisam/mi_create.c b/myisam/mi_create.c index 890ee61fd7f..41c965c7c80 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -254,9 +254,11 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, /* called by myisamchk - i.e. table structure was taken from MYI file and SPATIAL key *does have* additional sp_segs keysegs. - We'd better delete them now + keydef->seg here points right at the GEOMETRY segment, + so we only need to decrease keydef->keysegs. + (see recreate_table() in mi_check.c) */ - keydef->keysegs-=sp_segs; + keydef->keysegs-=sp_segs-1; } for (j=0, keyseg=keydef->seg ; (int) j < keydef->keysegs ; From aab6612309e0953440b0e12ad23d7da9819dc5bb Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 24 Jul 2005 17:35:39 +0200 Subject: [PATCH 020/144] ndb - add mysql-test-run test case for ndb_config mysql-test/r/ndb_config.result: New BitKeeper file ``mysql-test/r/ndb_config.result'' mysql-test/t/ndb_config.test: New BitKeeper file ``mysql-test/t/ndb_config.test'' --- mysql-test/r/ndb_config.result | 5 +++++ mysql-test/t/ndb_config.test | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 mysql-test/r/ndb_config.result create mode 100644 mysql-test/t/ndb_config.test diff --git a/mysql-test/r/ndb_config.result b/mysql-test/r/ndb_config.result new file mode 100644 index 00000000000..f720b8e98df --- /dev/null +++ b/mysql-test/r/ndb_config.result @@ -0,0 +1,5 @@ +ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3, mysqld,4, mysqld,5, mysqld,6, mysqld,7, +1,localhost,41943040,12582912 2,localhost,41943040,12582912 +1 localhost 41943040 12582912 +2 localhost 41943040 12582912 +1 2 diff --git a/mysql-test/t/ndb_config.test b/mysql-test/t/ndb_config.test new file mode 100644 index 00000000000..27ffdbdcd6e --- /dev/null +++ b/mysql-test/t/ndb_config.test @@ -0,0 +1,4 @@ +--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host 2> /dev/null +--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null +--exec $NDB_TOOLS_DIR/ndb_config --no-defaults -r \\n -f " " --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null +--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --type=ndbd --host=localhost 2> /dev/null From 414eb710e4e81cb41befc137565d273c96f10262 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 24 Jul 2005 21:20:45 +0200 Subject: [PATCH 021/144] merge error --- ndb/src/mgmapi/mgmapi.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index bac66e8713b..1cfc46ae078 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -338,8 +338,9 @@ ndb_mgm_call(NdbMgmHandle handle, const ParserRow *command_reply, /** * Print some info about why the parser returns NULL */ - fprintf(h->errstream, "Error in mgm protocol parser. cmd: >%s< status: %d cyrr: %d\n", - cmd, (Uint32)ctx.m_status, ctx.m_currentToken); + fprintf(handle->errstream, + "Error in mgm protocol parser. cmd: >%s< status: %d curr: %d\n", + cmd, (Uint32)ctx.m_status, ctx.m_currentToken); DBUG_PRINT("info",("ctx.status: %d, ctx.m_currentToken: %s", ctx.m_status, ctx.m_currentToken)); } From b08c3ca42611465041f9a401884352a84f7996b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jul 2005 07:51:17 +0200 Subject: [PATCH 022/144] fix for bug #7924. added export symbols mysql_server_init and mysql_server_end to allow client to connect to external and embedded server using the same code (required for Connector/OO.org). (Backport from 5.0 - cs. 1.35) --- libmysql/libmysql.def | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index 57c97ab08ee..dce91c1e4c1 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -147,4 +147,6 @@ EXPORTS mysql_slave_query mysql_embedded mysql_set_character_set + mysql_server_init + mysql_server_end get_defaults_files From 17132a93f2bde74f625e860daee655d99c8e81a7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jul 2005 14:36:07 +0500 Subject: [PATCH 023/144] fix (bug #11964: ALTER TABLE gives wrong error message with sql-mode TRADITIONAL (timestamp)). sql/field.cc: fix (bug #11964: ALTER TABLE gives wrong error message with sql-mode TRADITIONAL (timestamp)). set def only if timestamp fields have explicit default value. --- mysql-test/r/strict.result | 21 +++++++++++++++++++++ mysql-test/t/strict.test | 14 ++++++++++++++ sql/field.cc | 5 ++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 49f118b1d96..6239d4a4012 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -1258,3 +1258,24 @@ select * from t1; d 2000-10-01 drop table t1; +set @@sql_mode='traditional'; +create table t1(a int, b timestamp); +alter table t1 add primary key(a); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0', + `b` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1(a int, b timestamp default 20050102030405); +alter table t1 add primary key(a); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0', + `b` timestamp NOT NULL default '2005-01-02 03:04:05', + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index 71b57424e75..ffe2e4e261e 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -1118,3 +1118,17 @@ insert into t1 values ('2000-10-01'); update t1 set d = 1100; select * from t1; drop table t1; + +# +# Bug #11964: alter table with timestamp field +# + +set @@sql_mode='traditional'; +create table t1(a int, b timestamp); +alter table t1 add primary key(a); +show create table t1; +drop table t1; +create table t1(a int, b timestamp default 20050102030405); +alter table t1 add primary key(a); +show create table t1; +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index 3fdd7ab45e6..06ed84ae870 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -8462,7 +8462,10 @@ create_field::create_field(Field *old_field,Field *orig_field) def=0; if (!(flags & (NO_DEFAULT_VALUE_FLAG | BLOB_FLAG)) && !old_field->is_real_null() && - old_field->ptr && orig_field) + old_field->ptr && orig_field && + (sql_type != FIELD_TYPE_TIMESTAMP || /* set def only if */ + old_field->table->timestamp_field != old_field || /* timestamp field */ + unireg_check == Field::TIMESTAMP_UN_FIELD)) /* has default val */ { char buff[MAX_FIELD_WIDTH],*pos; String tmp(buff,sizeof(buff), charset), *res; From ea010ef58494b9e578ce85b890f4a95769227729 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jul 2005 12:41:25 +0200 Subject: [PATCH 024/144] ndb - Fix LCP during SR parameters ndb/include/mgmapi/mgmapi_config_parameters.h: Fix LCP during SR parameters ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: Fix LCP during SR parameters ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: Fix LCP during SR parameters ndb/src/mgmsrv/ConfigInfo.cpp: Fix LCP during SR parameters --- ndb/include/mgmapi/mgmapi_config_parameters.h | 7 +++++-- ndb/src/kernel/blocks/dbacc/DbaccMain.cpp | 6 ++++-- ndb/src/kernel/blocks/dbtup/DbtupGen.cpp | 6 ++++-- ndb/src/mgmsrv/ConfigInfo.cpp | 8 ++++---- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ndb/include/mgmapi/mgmapi_config_parameters.h b/ndb/include/mgmapi/mgmapi_config_parameters.h index 432854d1d36..2e3b47eb42e 100644 --- a/ndb/include/mgmapi/mgmapi_config_parameters.h +++ b/ndb/include/mgmapi/mgmapi_config_parameters.h @@ -50,8 +50,11 @@ #define CFG_DB_FILESYSTEM_PATH 125 #define CFG_DB_NO_REDOLOG_FILES 126 -#define CFG_DB_DISC_BANDWIDTH 127 -#define CFG_DB_SR_DISC_BANDWITH 128 + +#define CFG_DB_LCP_DISC_PAGES_TUP 127 +#define CFG_DB_LCP_DISC_PAGES_TUP_SR 128 +#define CFG_DB_LCP_DISC_PAGES_ACC 137 +#define CFG_DB_LCP_DISC_PAGES_ACC_SR 138 #define CFG_DB_TRANSACTION_CHECK_INTERVAL 129 #define CFG_DB_TRANSACTION_INACTIVE_TIMEOUT 130 diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index 3313e22fe3a..1f0053e209a 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -722,10 +722,12 @@ void Dbacc::execREAD_CONFIG_REQ(Signal* signal) ndbrestart1Lab(signal); clblPagesPerTick = 50; - //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTick); + ndb_mgm_get_int_parameter(p, CFG_DB_LCP_DISC_PAGES_ACC_SR, + &clblPagesPerTick); clblPagesPerTickAfterSr = 50; - //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTickAfterSr); + ndb_mgm_get_int_parameter(p, CFG_DB_LCP_DISC_PAGES_ACC, + &clblPagesPerTickAfterSr); tdata0 = 0; initialiseRecordsLab(signal, ref, senderData); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index 0d7430e662d..27f817d8abc 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -663,10 +663,12 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal) initialiseRecordsLab(signal, 0, ref, senderData); clblPagesPerTick = 50; - //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTick); + ndb_mgm_get_int_parameter(p, CFG_DB_LCP_DISC_PAGES_TUP_SR, + &clblPagesPerTick); clblPagesPerTickAfterSr = 50; - //ndb_mgm_get_int_parameter(p, CFG_DB_, &clblPagesPerTickAfterSr); + ndb_mgm_get_int_parameter(p, CFG_DB_LCP_DISC_PAGES_TUP, + &clblPagesPerTickAfterSr); }//Dbtup::execSIZEALT_REP() diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 4612d17c9ce..41a3aa8c782 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -928,7 +928,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { STR_VALUE(MAX_INT_RNIL) }, { - KEY_INTERNAL, + CFG_DB_LCP_DISC_PAGES_TUP_SR, "NoOfDiskPagesToDiskDuringRestartTUP", DB_TOKEN, "?", @@ -940,7 +940,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { STR_VALUE(MAX_INT_RNIL) }, { - KEY_INTERNAL, + CFG_DB_LCP_DISC_PAGES_TUP, "NoOfDiskPagesToDiskAfterRestartTUP", DB_TOKEN, "?", @@ -952,7 +952,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { STR_VALUE(MAX_INT_RNIL) }, { - KEY_INTERNAL, + CFG_DB_LCP_DISC_PAGES_ACC_SR, "NoOfDiskPagesToDiskDuringRestartACC", DB_TOKEN, "?", @@ -964,7 +964,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { STR_VALUE(MAX_INT_RNIL) }, { - KEY_INTERNAL, + CFG_DB_LCP_DISC_PAGES_ACC, "NoOfDiskPagesToDiskAfterRestartACC", DB_TOKEN, "?", From bc10bd8e80dfa708fc3b6ce072e7c735a69b2c8d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jul 2005 13:47:40 +0200 Subject: [PATCH 025/144] fix compile error --- ndb/tools/config.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndb/tools/config.cpp b/ndb/tools/config.cpp index 8dd69e050f7..7944f66f71c 100644 --- a/ndb/tools/config.cpp +++ b/ndb/tools/config.cpp @@ -317,8 +317,8 @@ parse_where(Vector& where, int &argc, char**& argv) return 0; } -template Vector; -template Vector; +template class Vector; +template class Vector; static int From 1f36f6f45b7984bbbd2afe94c946cc00c7fcc529 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jul 2005 14:14:24 +0200 Subject: [PATCH 026/144] - Make sure the scripts make_binary_distribution, make_sharedlib_distribution and make_win_src_distribution are created, but not installed - removed make_win_binary_distribution.sh as it's obsolete and outdated BitKeeper/deleted/.del-make_win_binary_distribution.sh~e0fbb0a75af0dcd3: Delete: scripts/make_win_binary_distribution.sh scripts/Makefile.am: - Make sure the scripts make_binary_distribution, make_sharedlib_distribution and make_win_src_distribution are created, but not installed. This is the proper fix for what I began in the previous ChangeSet - removed make_win_binary_distribution.sh from the distribution, as it's obsolete and outdated --- scripts/Makefile.am | 5 +- scripts/make_win_binary_distribution.sh | 181 ------------------------ 2 files changed, 4 insertions(+), 182 deletions(-) delete mode 100644 scripts/make_win_binary_distribution.sh diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 533545aba25..a5e6b094bf6 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -34,10 +34,13 @@ bin_SCRIPTS = @server_scripts@ \ mysql_tableinfo \ mysqld_multi +noinst_SCRIPTS = make_binary_distribution \ + make_sharedlib_distribution \ + make_win_src_distribution + EXTRA_SCRIPTS = make_binary_distribution.sh \ make_sharedlib_distribution.sh \ make_win_src_distribution.sh \ - make_win_binary_distribution.sh \ msql2mysql.sh \ mysql_config.sh \ mysql_fix_privilege_tables.sh \ diff --git a/scripts/make_win_binary_distribution.sh b/scripts/make_win_binary_distribution.sh deleted file mode 100644 index 9b2cc2d7d22..00000000000 --- a/scripts/make_win_binary_distribution.sh +++ /dev/null @@ -1,181 +0,0 @@ -#!/bin/sh - -# -# Script to create a Windows binary package -# -# This is intended to be used under Cygwin, and will generate -# an archive named in the form mysql--noinstall.zip - -version=@VERSION@ - -DEBUG=0 -SUFFIX="" -DIRNAME="" -EXTRA="" - -# -# This script must run from MySQL top directory -# - -if [ ! -f scripts/make_win_binary_distribution ]; then - echo "ERROR : You must run this script from the MySQL top-level directory" - exit 1 -fi - -# -# Debug print of the status -# - -print_debug() -{ - for statement - do - if [ "$DEBUG" = "1" ] ; then - echo $statement - fi - done -} - -# -# Usage of the script -# - -show_usage() -{ - echo "MySQL utility script to create a Windows binary package" - echo "" - echo "This is intended to be used under Cygwin, and will generate" - echo "an archive named in the form mysql--noinstall.zip" - echo "Takes the following arguments:" - echo "" - echo " --dirname Directory to use for copying files" - echo " --extra Directory to get extra files from" - echo " --suffix Name to append to 'mysql' for this binary" - echo " --help Show this help message" - exit 0 -} - -# -# Parse the input arguments -# - -parse_arguments() { - for arg do - case "$arg" in - --debug) DEBUG=1;; - --extra=*) EXTRA=`echo "$arg" | sed -e "s;--extra=;;"` ;; - --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; - --dirname=*) DIRNAME=`echo "$arg" | sed -e "s;--dirname=;;"` ;; - --help) show_usage ;; - *) - echo "Unknown argument '$arg'" - exit 1 - ;; - esac - done -} - -parse_arguments "$@" - -if [ -z "$DIRNAME" ]; then - $DIRNAME="dist" -fi - -print_debug "Making directories" -mkdir $DIRNAME -$DIRNAME="$DIRNAME/mysql-$version" -mkdir $DIRNAME - -for dir in bin lib lib/opt lib/debug Embedded Embedded/DLL Embedded/DLL/debug Embedded/DLL/release Embedded/static Embedded/static/release examples examples/libmysqltest -do - mkdir $DIRNAME/$dir -done - -if [ $EXTRA ]; then - print_debug "Copying extra files" - cp -fr $EXTRA/* $DIRNAME -fi - -# Dirs to be copied as-is -for dir in data Docs include scripts share -do - print_debug "Copying $dir to $DIRNAME/" - cp -fr $dir $DIRNAME -done - -print_debug "Copying tests to $DIRNAME/examples/" -cp -fr tests $DIRNAME/examples - -print_debug "Copying sql-bench to $DIRNAME/bench" -mkdir $DIRNAME/bench -cp -fr sql-bench/* $DIRNAME/bench - -print_debug "Copying support-files to $DIRNAME" -cp support-files/* $DIRNAME - -# Files for bin -for i in client_release/* client_debug/mysqld.exe lib_release/libmySQL.dll -do - print_debug "Copying $i to $DIRNAME/bin" - cp $i $DIRNAME/bin -done - -# Files for include -for i in libmysql/libmysql.def libmysqld/libmysqld.def -do - print_debug "Copying $i to $DIRNAME/include" - cp $i $DIRNAME/include -done - -# Windows users are used to having dbug.h ? -cp include/my_dbug.h $DIRNAME/include/dbug.h - -# Libraries found in lib_release and lib_debug -for i in libmySQL.dll libmysql.lib zlib.lib mysqlclient.lib mysys.lib regex.lib strings.lib -do - print_debug "Copying lib_release/$i to $DIRNAME/lib/opt" - cp lib_release/$i $DIRNAME/lib/opt - print_debug "Copying lib_debug/$i to $DIRNAME/lib/debug" - cp lib_debug/$i $DIRNAME/lib/debug -done - -print_debug "Copying lib_release/mysys-max.lib to $DIRNAME/lib/opt" -cp lib_release/mysys-max.lib $DIRNAME/lib/opt - -# Embedded server -for i in libmysqld.dll libmysqld.lib libmysqld.exp -do - print_debug "Copying lib_release/$i to $DIRNAME/Embedded/DLL/release" - cp lib_release/$i $DIRNAME/Embedded/DLL/release - print_debug "Copying lib_debug/$i to $DIRNAME/Embedded/DLL/debug" - cp lib_debug/$i $DIRNAME/Embedded/DLL/debug -done - -# Static embedded -print_debug "Copying lib_release/mysqlserver.lib to $DIRNAME/Embedded/static/release" -cp lib_release/mysqlserver.lib $DIRNAME/Embedded/static/release - -# libmysqltest -for i in mytest.c mytest.dsp mytest.dsw mytest.exe -do - print_debug "Copying libmysqltest/release/$i to $DIRNAME/examples/libmysqltest" - cp libmysqltest/release/$i $DIRNAME/examples/libmysqltest -done - -print_debug "Copying README.txt" -cp README.txt $DIRNAME - -if [ -f MySQLEULA.txt ]; then - print_debug "Commercial version: copying MySQLEULA.txt" - cp MySQLEULA.txt $DIRNAME - rm $DIRNAME/Docs/COPYING -else - print_debug "GPL version: copying COPYING" - cp Docs/COPYING $DIRNAME -fi - -print_debug "Invoking zip to package the binary" -zip -r mysql$SUFFIX-$version-win-noinstall.zip $DIRNAME - -print_debug "Deleting intermediate directory" -rm -rf $DIRNAME From a6b225ba8d20b20cab6f32176693980504965ab0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jul 2005 21:34:20 +0500 Subject: [PATCH 027/144] charset.c: Bug#12109 possible locking bug in init_available_charset Recheck charset_initialized inside locked code, to garantee two threads are not entering consequently. mysys/charset.c: Bug#12109 possible locking bug in init_available_charset Recheck charset_initialized inside locked code, to garantee two threads are not entering consequently. --- mysys/charset.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/mysys/charset.c b/mysys/charset.c index 4b7ad3e59f4..cabdbad3413 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -383,26 +383,28 @@ static my_bool init_available_charsets(myf myflags) while we may changing the cs_info_table */ pthread_mutex_lock(&THR_LOCK_charset); - - bzero(&all_charsets,sizeof(all_charsets)); - init_compiled_charsets(myflags); - - /* Copy compiled charsets */ - for (cs=all_charsets; - cs < all_charsets+array_elements(all_charsets)-1 ; - cs++) + if (!charset_initialized) { - if (*cs) + bzero(&all_charsets,sizeof(all_charsets)); + init_compiled_charsets(myflags); + + /* Copy compiled charsets */ + for (cs=all_charsets; + cs < all_charsets+array_elements(all_charsets)-1 ; + cs++) { - if (cs[0]->ctype) - if (init_state_maps(*cs)) - *cs= NULL; + if (*cs) + { + if (cs[0]->ctype) + if (init_state_maps(*cs)) + *cs= NULL; + } } + + strmov(get_charsets_dir(fname), MY_CHARSET_INDEX); + error= my_read_charset_file(fname,myflags); + charset_initialized=1; } - - strmov(get_charsets_dir(fname), MY_CHARSET_INDEX); - error= my_read_charset_file(fname,myflags); - charset_initialized=1; pthread_mutex_unlock(&THR_LOCK_charset); } return error; From f8a6e9d369c2dcf738393ec0d7c54c9a7605156d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jul 2005 11:25:28 -0700 Subject: [PATCH 028/144] Don't force column header to @@session.var_name if @@local.var_name was used. (Bug #10724) mysql-test/r/key_cache.result: Updated results mysql-test/r/ps_1general.result: Updated results mysql-test/r/user_var.result: Add new results mysql-test/r/variables.result: Update results mysql-test/t/user_var.test: Add new regression test sql/item_func.cc: Don't set name explicitly in get_system_var(), let it get set by the select_item: rule in sql_parse.yy or other callers of get_system_var(). sql/sql_parse.cc: Set the name on the Item returned by get_system_var(). --- mysql-test/r/key_cache.result | 6 +++--- mysql-test/r/ps_1general.result | 2 +- mysql-test/r/user_var.result | 24 ++++++++++++++++++++++++ mysql-test/r/variables.result | 12 ++++++------ mysql-test/t/user_var.test | 21 +++++++++++++++++++++ sql/item_func.cc | 22 ++-------------------- sql/sql_parse.cc | 12 ++++++++++-- 7 files changed, 67 insertions(+), 32 deletions(-) diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index 79b5a6e84b2..41aaa21eea3 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -23,13 +23,13 @@ SELECT @@global.default.key_buffer_size; @@global.default.key_buffer_size 16777216 SELECT @@global.default.`key_buffer_size`; -@@global.default.key_buffer_size +@@global.default.`key_buffer_size` 16777216 SELECT @@global.`default`.`key_buffer_size`; -@@global.default.key_buffer_size +@@global.`default`.`key_buffer_size` 16777216 SELECT @@`default`.key_buffer_size; -@@default.key_buffer_size +@@`default`.key_buffer_size 16777216 SELECT @@small.key_buffer_size; @@small.key_buffer_size diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 97af043d4f2..c4ccdf9eb34 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -332,7 +332,7 @@ execute stmt1 ; ERROR 42S02: Unknown table 't5' prepare stmt1 from ' SELECT @@version ' ; execute stmt1 ; -@@VERSION +@@version prepare stmt_do from ' do @var:= (1 in (select a from t1)) ' ; prepare stmt_set from ' set @var= (1 in (select a from t1)) ' ; diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index e42849abdf1..58b785d1432 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -179,3 +179,27 @@ set session @honk=99; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@honk=99' at line 1 set one_shot @honk=99; ERROR HY000: The SET ONE_SHOT syntax is reserved for purposes internal to the MySQL server +select @@local.max_allowed_packet; +@@local.max_allowed_packet +# +select @@session.max_allowed_packet; +@@session.max_allowed_packet +# +select @@global.max_allowed_packet; +@@global.max_allowed_packet +# +select @@max_allowed_packet; +@@max_allowed_packet +# +select @@Max_Allowed_Packet; +@@Max_Allowed_Packet +# +select @@version; +@@version +# +select @@global.version; +@@global.version +# +select @@session.VERSION; +@@session.VERSION +# diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index e370202cc9f..14260cd04f9 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -70,7 +70,7 @@ Variable_name Value max_join_size HA_POS_ERROR set @@max_join_size=1000, @@global.max_join_size=2000; select @@local.max_join_size, @@global.max_join_size; -@@session.max_join_size @@global.max_join_size +@@local.max_join_size @@global.max_join_size 1000 2000 select @@identity, length(@@version)>0; @@identity length(@@version)>0 @@ -407,23 +407,23 @@ Variable_name Value myisam_max_sort_file_size MAX_FILE_SIZE set global myisam_max_sort_file_size=default; select @@global.max_user_connections,@@local.max_join_size; -@@global.max_user_connections @@session.max_join_size +@@global.max_user_connections @@local.max_join_size 100 200 set @svc=@@global.max_user_connections, @svj=@@local.max_join_size; select @@global.max_user_connections,@@local.max_join_size; -@@global.max_user_connections @@session.max_join_size +@@global.max_user_connections @@local.max_join_size 100 200 set @@global.max_user_connections=111,@@local.max_join_size=222; select @@global.max_user_connections,@@local.max_join_size; -@@global.max_user_connections @@session.max_join_size +@@global.max_user_connections @@local.max_join_size 111 222 set @@global.max_user_connections=@@local.max_join_size,@@local.max_join_size=@@global.max_user_connections; select @@global.max_user_connections,@@local.max_join_size; -@@global.max_user_connections @@session.max_join_size +@@global.max_user_connections @@local.max_join_size 222 111 set @@global.max_user_connections=@svc, @@local.max_join_size=@svj; select @@global.max_user_connections,@@local.max_join_size; -@@global.max_user_connections @@session.max_join_size +@@global.max_user_connections @@local.max_join_size 100 200 set @a=1, @b=2; set @a=@b, @b=@a; diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index a288b7ef708..028c110d158 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -119,3 +119,24 @@ select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4); set session @honk=99; --error 1105 set one_shot @honk=99; + +# +# Bug #10724 @@local not preserved in column name of select +# +# The value doesn't actually matter, we just care about the column name +--replace_column 1 # +select @@local.max_allowed_packet; +--replace_column 1 # +select @@session.max_allowed_packet; +--replace_column 1 # +select @@global.max_allowed_packet; +--replace_column 1 # +select @@max_allowed_packet; +--replace_column 1 # +select @@Max_Allowed_Packet; +--replace_column 1 # +select @@version; +--replace_column 1 # +select @@global.version; +--replace_column 1 # +select @@session.VERSION; diff --git a/sql/item_func.cc b/sql/item_func.cc index 44917eb48e4..3cff3f5380a 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3417,7 +3417,7 @@ Item *get_system_var(THD *thd, enum_var_type var_type, LEX_STRING name, if (component.str == 0 && !my_strcasecmp(system_charset_info, name.str, "VERSION")) - return new Item_string("@@VERSION", server_version, + return new Item_string(NULL, server_version, (uint) strlen(server_version), system_charset_info, DERIVATION_SYSCONST); @@ -3444,28 +3444,10 @@ Item *get_system_var(THD *thd, enum_var_type var_type, LEX_STRING name, } thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); - buff[0]='@'; - buff[1]='@'; - pos=buff+2; - if (var_type == OPT_SESSION) - pos=strmov(pos,"session."); - else if (var_type == OPT_GLOBAL) - pos=strmov(pos,"global."); - set_if_smaller(component_name->length, MAX_SYS_VAR_LENGTH); - set_if_smaller(base_name->length, MAX_SYS_VAR_LENGTH); - - if (component_name->str) - { - memcpy(pos, component_name->str, component_name->length); - pos+= component_name->length; - *pos++= '.'; - } - memcpy(pos, base_name->str, base_name->length); - pos+= base_name->length; return new Item_func_get_system_var(var, var_type, component_name, - buff, pos - buff); + NULL, 0); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index a3f3ef41dee..dd3c1fa7ba0 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4197,6 +4197,8 @@ void create_select_for_variable(const char *var_name) THD *thd; LEX *lex; LEX_STRING tmp, null_lex_string; + Item *var; + char buff[MAX_SYS_VAR_LENGTH*2+4+8], *end; DBUG_ENTER("create_select_for_variable"); thd= current_thd; @@ -4206,8 +4208,14 @@ void create_select_for_variable(const char *var_name) tmp.str= (char*) var_name; tmp.length=strlen(var_name); bzero((char*) &null_lex_string.str, sizeof(null_lex_string)); - add_item_to_list(thd, get_system_var(thd, OPT_SESSION, tmp, - null_lex_string)); + /* + We set the name of Item to @@session.var_name because that then is used + as the column name in the output. + */ + var= get_system_var(thd, OPT_SESSION, tmp, null_lex_string); + end= strxmov(buff, "@@session.", var_name, NullS); + var->set_name(buff, end-buff, system_charset_info); + add_item_to_list(thd, var); DBUG_VOID_RETURN; } From 1c3f8cc214db5d487ea275dbbc9ec24712050fd3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jul 2005 12:57:23 -0700 Subject: [PATCH 029/144] sql_select.cc: Fixed bug #11412. Reversed the patch of cs 1.1934 for the function create_tmp_table. Modified the function to support tem_ref objects created for view fields. item_buff.cc: Fixed bug #11412. Modified implementation of new_Cached_item to support cacheing of view fields. item.h: Fixed bug #11412. Changed implementation of Item_ref::get_tmp_table_field and added Item_ref::get_tmp_table_item to support Item_ref objects created for view fields. view.test, view.result: Added a test case for bug #11412. mysql-test/r/view.result: Added a test case for bug #11412. mysql-test/t/view.test: Added a test case for bug #11412. sql/item.h: Fixed bug #11412. Changed implementation of Item_ref::get_tmp_table_field and added Item_ref::get_tmp_table_item to support Item_ref objects created for view fields. sql/item_buff.cc: Fixed bug #11412. Modified implementation of new_Cached_item to support cacheing of view fields. sql/sql_select.cc: Fixed bug #11412. Reversed the patch of cs 1.1934 for the function create_tmp_table. Modified the function to support tem_ref objects created for view fields. --- mysql-test/r/view.result | 23 ++++++++++++++++++++ mysql-test/t/view.test | 26 +++++++++++++++++++++- sql/item.h | 7 ++++-- sql/item_buff.cc | 6 ++--- sql/sql_select.cc | 47 ++++++++++++++++++++-------------------- 5 files changed, 79 insertions(+), 30 deletions(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index c8078a0604e..730e180cbd9 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2024,3 +2024,26 @@ f1 sb 2005-01-01 12:00:00 2005-01-01 10:58:59 drop view v1; drop table t1; +CREATE TABLE t1 ( +aid int PRIMARY KEY, +fn varchar(20) NOT NULL, +ln varchar(20) NOT NULL +); +CREATE TABLE t2 ( +aid int NOT NULL, +pid int NOT NULL +); +INSERT INTO t1 VALUES(1,'a','b'), (2,'c','d'); +INSERT INTO t2 values (1,1), (2,1), (2,2); +CREATE VIEW v1 AS SELECT t1.*,t2.pid FROM t1,t2 WHERE t1.aid = t2.aid; +SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM t1,t2 +WHERE t1.aid = t2.aid GROUP BY pid; +pid GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) +1 a b,c d +2 c d +SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM v1 GROUP BY pid; +pid GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) +1 a b,c d +2 c d +DROP VIEW v1; +DROP TABLE t1,t2; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 16a94820596..5454b3409da 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -1862,4 +1862,28 @@ insert into t1 values('2005.01.01 12:0:0'); create view v1 as select f1, subtime(f1, '1:1:1') as sb from t1; select * from v1; drop view v1; -drop table t1; +drop table t1; + +# +# Test for bug #11412: query over a multitable view with GROUP_CONCAT +# +CREATE TABLE t1 ( + aid int PRIMARY KEY, + fn varchar(20) NOT NULL, + ln varchar(20) NOT NULL +); +CREATE TABLE t2 ( + aid int NOT NULL, + pid int NOT NULL +); +INSERT INTO t1 VALUES(1,'a','b'), (2,'c','d'); +INSERT INTO t2 values (1,1), (2,1), (2,2); + +CREATE VIEW v1 AS SELECT t1.*,t2.pid FROM t1,t2 WHERE t1.aid = t2.aid; + +SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM t1,t2 + WHERE t1.aid = t2.aid GROUP BY pid; +SELECT pid,GROUP_CONCAT(CONCAT(fn,' ',ln) ORDER BY 1) FROM v1 GROUP BY pid; + +DROP VIEW v1; +DROP TABLE t1,t2; diff --git a/sql/item.h b/sql/item.h index 5a1cf193806..259b3654461 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1464,7 +1464,10 @@ public: void save_org_in_field(Field *field) { (*ref)->save_org_in_field(field); } enum Item_result result_type () const { return (*ref)->result_type(); } enum_field_types field_type() const { return (*ref)->field_type(); } - Field *get_tmp_table_field() { return result_field; } + Field *get_tmp_table_field() + { return result_field ? result_field : (*ref)->get_tmp_table_field(); } + Item *get_tmp_table_item(THD *thd) + { return (*ref)->get_tmp_table_item(thd); } table_map used_tables() const { return depended_from ? OUTER_REF_TABLE_BIT : (*ref)->used_tables(); @@ -1702,7 +1705,7 @@ class Cached_item_field :public Cached_item public: Cached_item_field(Item_field *item) { - field=item->field; + field= item->field; buff= (char*) sql_calloc(length=field->pack_length()); } bool cmp(void); diff --git a/sql/item_buff.cc b/sql/item_buff.cc index a67e420170a..9db2f465080 100644 --- a/sql/item_buff.cc +++ b/sql/item_buff.cc @@ -25,9 +25,9 @@ Cached_item *new_Cached_item(THD *thd, Item *item) { - if (item->type() == Item::FIELD_ITEM && - !(((Item_field *) item)->field->flags & BLOB_FLAG)) - return new Cached_item_field((Item_field *) item); + if (item->real_item()->type() == Item::FIELD_ITEM && + !(((Item_field *) (item->real_item()))->field->flags & BLOB_FLAG)) + return new Cached_item_field((Item_field *) (item->real_item())); switch (item->result_type()) { case STRING_RESULT: return new Cached_item_str(thd, (Item_field *) item); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 05fb2d4d83e..117e16a2db3 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8026,6 +8026,12 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, bool table_cant_handle_bit_fields, uint convert_blob_length) { + Item *org_item= item; + if (item->real_item()->type() == Item::FIELD_ITEM) + { + item= item->real_item(); + type= item->type(); + } switch (type) { case Item::SUM_FUNC_ITEM: { @@ -8038,30 +8044,22 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, case Item::FIELD_ITEM: case Item::DEFAULT_VALUE_ITEM: { - Item_field *field= (Item_field*) item; - if (table_cant_handle_bit_fields && field->field->type() == FIELD_TYPE_BIT) - return create_tmp_field_from_item(thd, item, table, copy_func, - modify_item, convert_blob_length); - return create_tmp_field_from_field(thd, (*from_field= field->field), - item->name, table, - modify_item ? (Item_field*) item : NULL, - convert_blob_length); - } - case Item::REF_ITEM: - { - Item *tmp_item; - if ((tmp_item= item->real_item())->type() == Item::FIELD_ITEM) + if (org_item->type() != Item::REF_ITEM || + !((Item_ref *)org_item)->depended_from) { - Item_field *field= (Item_field*) tmp_item; - Field *new_field= create_tmp_field_from_field(thd, - (*from_field= field->field), - item->name, table, - NULL, - convert_blob_length); - if (modify_item) - item->set_result_field(new_field); - return new_field; + Item_field *field= (Item_field*) item; + if (table_cant_handle_bit_fields && + field->field->type() == FIELD_TYPE_BIT) + return create_tmp_field_from_item(thd, item, table, copy_func, + modify_item, convert_blob_length); + return create_tmp_field_from_field(thd, (*from_field= field->field), + item->name, table, + modify_item ? (Item_field*) item : + NULL, + convert_blob_length); } + else + item= org_item; } case Item::FUNC_ITEM: case Item::COND_ITEM: @@ -8074,6 +8072,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, case Item::REAL_ITEM: case Item::DECIMAL_ITEM: case Item::STRING_ITEM: + case Item::REF_ITEM: case Item::NULL_ITEM: case Item::VARBIN_ITEM: return create_tmp_field_from_item(thd, item, table, copy_func, modify_item, @@ -10904,12 +10903,12 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, usable_keys.set_all(); for (ORDER *tmp_order=order; tmp_order ; tmp_order=tmp_order->next) { - if ((*tmp_order->item)->type() != Item::FIELD_ITEM) + if ((*tmp_order->item)->real_item()->type() != Item::FIELD_ITEM) { usable_keys.clear_all(); DBUG_RETURN(0); } - usable_keys.intersect(((Item_field*) (*tmp_order->item))-> + usable_keys.intersect(((Item_field*) (*tmp_order->item)->real_item())-> field->part_of_sortkey); if (usable_keys.is_clear_all()) DBUG_RETURN(0); // No usable keys From 88c2b4b6c95bb9834be39e1a092dc376fb8165ca Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 07:41:32 +0200 Subject: [PATCH 030/144] fix for bug#5650 ('replace' does not follow symlinks) fix now checks if the original (from) file is a symlink and uses the link name. This prevents creation of a new file (and loss of symlink) when renaming the tempfile. --- extra/replace.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/extra/replace.c b/extra/replace.c index 0b7d9600232..9acf1620d49 100644 --- a/extra/replace.c +++ b/extra/replace.c @@ -1053,12 +1053,18 @@ static int convert_file(REPLACE *rep, my_string name) int error; FILE *in,*out; char dir_buff[FN_REFLEN], tempname[FN_REFLEN]; + char link_name[FN_REFLEN], *org_name = name; File temp_file; DBUG_ENTER("convert_file"); - if (!(in=my_fopen(name,O_RDONLY,MYF(MY_WME)))) + /* check if name is a symlink */ +#ifdef HAVE_READLINK + org_name= (!my_disable_symlinks && + !my_readlink(link_name, name, MYF(0))) ? link_name : name; +#endif + if (!(in= my_fopen(org_name,O_RDONLY,MYF(MY_WME)))) DBUG_RETURN(1); - dirname_part(dir_buff,name); + dirname_part(dir_buff,org_name); if ((temp_file= create_temp_file(tempname, dir_buff, "PR", O_WRONLY, MYF(MY_WME))) < 0) { @@ -1075,7 +1081,7 @@ static int convert_file(REPLACE *rep, my_string name) my_fclose(in,MYF(0)); my_fclose(out,MYF(0)); if (updated && ! error) - my_redel(name,tempname,MYF(MY_WME | MY_LINK_WARNING)); + my_redel(org_name,tempname,MYF(MY_WME | MY_LINK_WARNING)); else my_delete(tempname,MYF(MY_WME)); if (!silent && ! error) From 702f17ee89d4f36c034381bcc18d374ee6370d86 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 07:59:10 +0200 Subject: [PATCH 031/144] ndb_config test requires ndb mysql-test/t/ndb_config.test: test requires ndb --- mysql-test/t/ndb_config.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/t/ndb_config.test b/mysql-test/t/ndb_config.test index 27ffdbdcd6e..ea78a32b1ba 100644 --- a/mysql-test/t/ndb_config.test +++ b/mysql-test/t/ndb_config.test @@ -1,3 +1,6 @@ +-- source include/have_ndb.inc +-- source include/not_embedded.inc + --exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host 2> /dev/null --exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null --exec $NDB_TOOLS_DIR/ndb_config --no-defaults -r \\n -f " " --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null From 359b78f10bd175b24330d79cada615d112cd907e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 09:06:37 +0200 Subject: [PATCH 032/144] ndb - changed config mysql-test/r/ndb_config.result: changed config --- mysql-test/r/ndb_config.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/ndb_config.result b/mysql-test/r/ndb_config.result index f720b8e98df..c2557f85c0b 100644 --- a/mysql-test/r/ndb_config.result +++ b/mysql-test/r/ndb_config.result @@ -1,4 +1,4 @@ -ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3, mysqld,4, mysqld,5, mysqld,6, mysqld,7, +ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7, 1,localhost,41943040,12582912 2,localhost,41943040,12582912 1 localhost 41943040 12582912 2 localhost 41943040 12582912 From 19117503544af34ad492286351ded5f60cbf5854 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 12:08:00 +0500 Subject: [PATCH 033/144] Fix for bug #9110 (Max_join_size error) libmysqld/lib_sql.cc: This should be done during the thread activation --- libmysqld/lib_sql.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 15fe3a03390..82e1c19d758 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -506,6 +506,8 @@ void *create_embedded_thd(int client_flag, char *db) /* TODO - add init_connect command execution */ + if (thd->variables.max_join_size == HA_POS_ERROR) + thd->options |= OPTION_BIG_SELECTS; thd->proc_info=0; // Remove 'login' thd->command=COM_SLEEP; thd->version=refresh_version; From 607852cf47e39927d9b96ff419b336ee6823d48a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 12:18:35 +0500 Subject: [PATCH 034/144] a fix (bug #11546: Bad error message from inserting out of range values, SQL_MODE='tradition'). sql/field.cc: a fix (bug #11546: Bad error message from inserting out of range values, SQL_MODE='tradition'). raise an error in case of strict mode for bit fields. --- mysql-test/r/strict.result | 7 +++++++ mysql-test/t/strict.test | 11 +++++++++++ sql/field.cc | 10 ++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 49f118b1d96..a742770ae9b 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -1258,3 +1258,10 @@ select * from t1; d 2000-10-01 drop table t1; +set @@sql_mode='traditional'; +create table t1(a bit(2)); +insert into t1 values(b'101'); +ERROR 22001: Data too long for column 'a' at row 1 +select * from t1; +a +drop table t1; diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index 71b57424e75..9e8d92533d9 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -1118,3 +1118,14 @@ insert into t1 values ('2000-10-01'); update t1 set d = 1100; select * from t1; drop table t1; + +# +# BIT fields +# + +set @@sql_mode='traditional'; +create table t1(a bit(2)); +--error 1406 +insert into t1 values(b'101'); +select * from t1; +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index 3fdd7ab45e6..2fb60ec1fd9 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7846,7 +7846,10 @@ int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs) { set_rec_bits(0xff, bit_ptr, bit_ofs, bit_len); memset(ptr, 0xff, field_length); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + if (table->in_use->really_abort_on_warning()) + set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1); + else + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } /* delta is >= -1 here */ @@ -8063,7 +8066,10 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs) memset(ptr, 0xff, field_length); if (bits) *ptr&= ((1 << bits) - 1); /* set first byte */ - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); + if (table->in_use->really_abort_on_warning()) + set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1); + else + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } bzero(ptr, delta); From 8624bcfdbefb99e39a0f50e6e4937781c9417c38 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 12:52:02 +0500 Subject: [PATCH 035/144] func_gconcat.result, func_gconcat.test: Adding test item_sum.cc: Adding a call for collation/charset aggregation, to collect attributes from the arguments. The actual bug fix. item_func.h, item_func.cc, item.h, item.cc: - Removing collation aggrgation functions from Item_func class in item.cc, and adding it as non-class functions in item.cc to be able to reuse this code for group_concat. - Adding replacement for these functions into Item_func class as wrappers for moved functions, to minizize patch size, sql/item.cc: - Removing collation aggrgation functions from Item_func class in item.cc, and adding it as non-class functions in item.cc to be able to reuse this code for group_concat. - Adding replacement for these functions into Item_func class as wrappers for moved functions, to minizize patch size, sql/item.h: - Removing collation aggrgation functions from Item_func class in item.cc, and adding it as non-class functions in item.cc to be able to reuse this code for group_concat. - Adding replacement for these functions into Item_func class as wrappers for moved functions, to minizize patch size, sql/item_func.cc: - Removing collation aggrgation functions from Item_func class in item.cc, and adding it as non-class functions in item.cc to be able to reuse this code for group_concat. - Adding replacement for these functions into Item_func class as wrappers for moved functions, to minizize patch size, sql/item_func.h: - Removing collation aggrgation functions from Item_func class in item.cc, and adding it as non-class functions in item.cc to be able to reuse this code for group_concat. - Adding replacement for these functions into Item_func class as wrappers for moved functions, to minizize patch size, sql/item_sum.cc: Adding a call for collation/charset aggregation, to collect attributes from the arguments. The actual bug fix. mysql-test/t/func_gconcat.test: Adding test mysql-test/r/func_gconcat.result: Adding test --- mysql-test/r/func_gconcat.result | 24 +++++ mysql-test/t/func_gconcat.test | 18 ++++ sql/item.cc | 164 +++++++++++++++++++++++++++++++ sql/item.h | 9 ++ sql/item_func.cc | 162 ------------------------------ sql/item_func.h | 16 ++- sql/item_sum.cc | 4 + 7 files changed, 232 insertions(+), 165 deletions(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 7a256edc91a..661793821a0 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -445,6 +445,30 @@ group_concat(distinct b order by b) Warnings: Warning 1260 2 line(s) were cut by GROUP_CONCAT() drop table t1; +create table t1 (a varchar(255) character set cp1250 collate cp1250_general_ci, +b varchar(255) character set koi8r); +insert into t1 values ('xxx','yyy'); +select collation(a) from t1; +collation(a) +cp1250_general_ci +select collation(group_concat(a)) from t1; +collation(group_concat(a)) +cp1250_general_ci +create table t2 select group_concat(a) as a from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` longtext character set cp1250 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select collation(group_concat(a,_koi8r'test')) from t1; +collation(group_concat(a,_koi8r'test')) +cp1250_general_ci +select collation(group_concat(a,_koi8r 0xC1C2)) from t1; +ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation 'group_concat' +select collation(group_concat(a,b)) from t1; +ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,IMPLICIT) for operation 'group_concat' +drop table t1; +drop table t2; CREATE TABLE t1 (id int); SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL; gc diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 5f02db7707c..edb4d42e3c2 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -263,6 +263,24 @@ select group_concat(distinct b order by b) from t1 group by a; drop table t1; +# +# Bug#10201 +# +create table t1 (a varchar(255) character set cp1250 collate cp1250_general_ci, + b varchar(255) character set koi8r); +insert into t1 values ('xxx','yyy'); +select collation(a) from t1; +select collation(group_concat(a)) from t1; +create table t2 select group_concat(a) as a from t1; +show create table t2; +select collation(group_concat(a,_koi8r'test')) from t1; +--error 1267 +select collation(group_concat(a,_koi8r 0xC1C2)) from t1; +--error 1267 +select collation(group_concat(a,b)) from t1; +drop table t1; +drop table t2; + # # bug #7769: group_concat returning null is checked in having # diff --git a/sql/item.cc b/sql/item.cc index 71940c824e7..84dbc382a52 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -523,6 +523,170 @@ bool DTCollation::aggregate(DTCollation &dt, uint flags) return 0; } +/******************************/ +static +void my_coll_agg_error(DTCollation &c1, DTCollation &c2, const char *fname) +{ + my_error(ER_CANT_AGGREGATE_2COLLATIONS,MYF(0), + c1.collation->name,c1.derivation_name(), + c2.collation->name,c2.derivation_name(), + fname); +} + + +static +void my_coll_agg_error(DTCollation &c1, DTCollation &c2, DTCollation &c3, + const char *fname) +{ + my_error(ER_CANT_AGGREGATE_3COLLATIONS,MYF(0), + c1.collation->name,c1.derivation_name(), + c2.collation->name,c2.derivation_name(), + c3.collation->name,c3.derivation_name(), + fname); +} + + +static +void my_coll_agg_error(Item** args, uint count, const char *fname) +{ + if (count == 2) + my_coll_agg_error(args[0]->collation, args[1]->collation, fname); + else if (count == 3) + my_coll_agg_error(args[0]->collation, args[1]->collation, + args[2]->collation, fname); + else + my_error(ER_CANT_AGGREGATE_NCOLLATIONS,MYF(0),fname); +} + + +bool agg_item_collations(DTCollation &c, const char *fname, + Item **av, uint count, uint flags) +{ + uint i; + c.set(av[0]->collation); + for (i= 1; i < count; i++) + { + if (c.aggregate(av[i]->collation, flags)) + { + my_coll_agg_error(av, count, fname); + return TRUE; + } + } + if ((flags & MY_COLL_DISALLOW_NONE) && + c.derivation == DERIVATION_NONE) + { + my_coll_agg_error(av, count, fname); + return TRUE; + } + return FALSE; +} + + +bool agg_item_collations_for_comparison(DTCollation &c, const char *fname, + Item **av, uint count, uint flags) +{ + return (agg_item_collations(c, fname, av, count, + flags | MY_COLL_DISALLOW_NONE)); +} + + +/* + Collect arguments' character sets together. + We allow to apply automatic character set conversion in some cases. + The conditions when conversion is possible are: + - arguments A and B have different charsets + - A wins according to coercibility rules + (i.e. a column is stronger than a string constant, + an explicit COLLATE clause is stronger than a column) + - character set of A is either superset for character set of B, + or B is a string constant which can be converted into the + character set of A without data loss. + + If all of the above is true, then it's possible to convert + B into the character set of A, and then compare according + to the collation of A. + + For functions with more than two arguments: + + collect(A,B,C) ::= collect(collect(A,B),C) +*/ + +bool agg_item_charsets(DTCollation &coll, const char *fname, + Item **args, uint nargs, uint flags) +{ + Item **arg, **last, *safe_args[2]; + if (agg_item_collations(coll, fname, args, nargs, flags)) + return TRUE; + + /* + For better error reporting: save the first and the second argument. + We need this only if the the number of args is 3 or 2: + - for a longer argument list, "Illegal mix of collations" + doesn't display each argument's characteristics. + - if nargs is 1, then this error cannot happen. + */ + if (nargs >=2 && nargs <= 3) + { + safe_args[0]= args[0]; + safe_args[1]= args[1]; + } + + THD *thd= current_thd; + Item_arena *arena, backup; + bool res= FALSE; + /* + In case we're in statement prepare, create conversion item + in its memory: it will be reused on each execute. + */ + arena= thd->change_arena_if_needed(&backup); + + for (arg= args, last= args + nargs; arg < last; arg++) + { + Item* conv; + uint32 dummy_offset; + if (!String::needs_conversion(0, coll.collation, + (*arg)->collation.collation, + &dummy_offset)) + continue; + + if (!(conv= (*arg)->safe_charset_converter(coll.collation))) + { + if (nargs >=2 && nargs <= 3) + { + /* restore the original arguments for better error message */ + args[0]= safe_args[0]; + args[1]= safe_args[1]; + } + my_coll_agg_error(args, nargs, fname); + res= TRUE; + break; // we cannot return here, we need to restore "arena". + } + conv->fix_fields(thd, 0, &conv); + /* + If in statement prepare, then we create a converter for two + constant items, do it once and then reuse it. + If we're in execution of a prepared statement, arena is NULL, + and the conv was created in runtime memory. This can be + the case only if the argument is a parameter marker ('?'), + because for all true constants the charset converter has already + been created in prepare. In this case register the change for + rollback. + */ + if (arena) + *arg= conv; + else + thd->change_item_tree(arg, conv); + } + if (arena) + thd->restore_backup_item_arena(arena, &backup); + return res; +} + + + + +/**********************************************/ + Item_field::Item_field(Field *f) :Item_ident(NullS, f->table_name, f->field_name) { diff --git a/sql/item.h b/sql/item.h index 895463ceeca..825b37fe64c 100644 --- a/sql/item.h +++ b/sql/item.h @@ -330,6 +330,15 @@ public: }; +bool agg_item_collations(DTCollation &c, const char *name, + Item **items, uint nitems, uint flags= 0); +bool agg_item_collations_for_comparison(DTCollation &c, const char *name, + Item **items, uint nitems, + uint flags= 0); +bool agg_item_charsets(DTCollation &c, const char *name, + Item **items, uint nitems, uint flags= 0); + + class Item_num: public Item { public: diff --git a/sql/item_func.cc b/sql/item_func.cc index 44917eb48e4..2514a4beacf 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -39,73 +39,6 @@ bool check_reserved_words(LEX_STRING *name) } -static void my_coll_agg_error(DTCollation &c1, DTCollation &c2, - const char *fname) -{ - my_error(ER_CANT_AGGREGATE_2COLLATIONS,MYF(0), - c1.collation->name,c1.derivation_name(), - c2.collation->name,c2.derivation_name(), - fname); -} - -static void my_coll_agg_error(DTCollation &c1, - DTCollation &c2, - DTCollation &c3, - const char *fname) -{ - my_error(ER_CANT_AGGREGATE_3COLLATIONS,MYF(0), - c1.collation->name,c1.derivation_name(), - c2.collation->name,c2.derivation_name(), - c3.collation->name,c3.derivation_name(), - fname); -} - - -static void my_coll_agg_error(Item** args, uint count, const char *fname) -{ - if (count == 2) - my_coll_agg_error(args[0]->collation, args[1]->collation, fname); - else if (count == 3) - my_coll_agg_error(args[0]->collation, - args[1]->collation, - args[2]->collation, - fname); - else - my_error(ER_CANT_AGGREGATE_NCOLLATIONS,MYF(0),fname); -} - - -bool Item_func::agg_arg_collations(DTCollation &c, Item **av, uint count, - uint flags) -{ - uint i; - c.set(av[0]->collation); - for (i= 1; i < count; i++) - { - if (c.aggregate(av[i]->collation, flags)) - { - my_coll_agg_error(av, count, func_name()); - return TRUE; - } - } - if ((flags & MY_COLL_DISALLOW_NONE) && - c.derivation == DERIVATION_NONE) - { - my_coll_agg_error(av, count, func_name()); - return TRUE; - } - return FALSE; -} - - -bool Item_func::agg_arg_collations_for_comparison(DTCollation &c, - Item **av, uint count, - uint flags) -{ - return (agg_arg_collations(c, av, count, flags | MY_COLL_DISALLOW_NONE)); -} - - /* return TRUE if item is a constant */ bool @@ -115,101 +48,6 @@ eval_const_cond(COND *cond) } - -/* - Collect arguments' character sets together. - We allow to apply automatic character set conversion in some cases. - The conditions when conversion is possible are: - - arguments A and B have different charsets - - A wins according to coercibility rules - (i.e. a column is stronger than a string constant, - an explicit COLLATE clause is stronger than a column) - - character set of A is either superset for character set of B, - or B is a string constant which can be converted into the - character set of A without data loss. - - If all of the above is true, then it's possible to convert - B into the character set of A, and then compare according - to the collation of A. - - For functions with more than two arguments: - - collect(A,B,C) ::= collect(collect(A,B),C) -*/ - -bool Item_func::agg_arg_charsets(DTCollation &coll, - Item **args, uint nargs, uint flags) -{ - Item **arg, **last, *safe_args[2]; - if (agg_arg_collations(coll, args, nargs, flags)) - return TRUE; - - /* - For better error reporting: save the first and the second argument. - We need this only if the the number of args is 3 or 2: - - for a longer argument list, "Illegal mix of collations" - doesn't display each argument's characteristics. - - if nargs is 1, then this error cannot happen. - */ - if (nargs >=2 && nargs <= 3) - { - safe_args[0]= args[0]; - safe_args[1]= args[1]; - } - - THD *thd= current_thd; - Item_arena *arena, backup; - bool res= FALSE; - /* - In case we're in statement prepare, create conversion item - in its memory: it will be reused on each execute. - */ - arena= thd->change_arena_if_needed(&backup); - - for (arg= args, last= args + nargs; arg < last; arg++) - { - Item* conv; - uint32 dummy_offset; - if (!String::needs_conversion(0, coll.collation, - (*arg)->collation.collation, - &dummy_offset)) - continue; - - if (!(conv= (*arg)->safe_charset_converter(coll.collation))) - { - if (nargs >=2 && nargs <= 3) - { - /* restore the original arguments for better error message */ - args[0]= safe_args[0]; - args[1]= safe_args[1]; - } - my_coll_agg_error(args, nargs, func_name()); - res= TRUE; - break; // we cannot return here, we need to restore "arena". - } - conv->fix_fields(thd, 0, &conv); - /* - If in statement prepare, then we create a converter for two - constant items, do it once and then reuse it. - If we're in execution of a prepared statement, arena is NULL, - and the conv was created in runtime memory. This can be - the case only if the argument is a parameter marker ('?'), - because for all true constants the charset converter has already - been created in prepare. In this case register the change for - rollback. - */ - if (arena) - *arg= conv; - else - thd->change_item_tree(arg, conv); - } - if (arena) - thd->restore_backup_item_arena(arena, &backup); - return res; -} - - - void Item_func::set_arguments(List &list) { allowed_arg_cols= 1; diff --git a/sql/item_func.h b/sql/item_func.h index 5e36f9863bb..5d6cc445317 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -145,12 +145,22 @@ public: Item *get_tmp_table_item(THD *thd); bool agg_arg_collations(DTCollation &c, Item **items, uint nitems, - uint flags= 0); + uint flags= 0) + { + return agg_item_collations(c, func_name(), items, nitems, flags); + } bool agg_arg_collations_for_comparison(DTCollation &c, Item **items, uint nitems, - uint flags= 0); + uint flags= 0) + { + return agg_item_collations_for_comparison(c, func_name(), + items, nitems, flags); + } bool agg_arg_charsets(DTCollation &c, Item **items, uint nitems, - uint flags= 0); + uint flags= 0) + { + return agg_item_charsets(c, func_name(), items, nitems, flags); + } bool walk(Item_processor processor, byte *arg); }; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 0e252259f53..6ca3f024f61 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1925,6 +1925,10 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) maybe_null|= args[i]->maybe_null; } + if (agg_item_charsets(collation, func_name(), + args, arg_count, MY_COLL_ALLOW_CONV)) + return 1; + result_field= 0; null_value= 1; max_length= group_concat_max_len; From 4d7aaed11df6fba27408b80d63e2a1cfb89d6cb4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 14:52:33 +0500 Subject: [PATCH 036/144] Bug#10201 group_concat returns string with binary collation item.cc: After merge fixes. func_gconcat.result: After merge fixes mysql-test/r/func_gconcat.result: After merge fixes sql/item.cc: After merge fixes. --- mysql-test/r/func_gconcat.result | 2 +- sql/item.cc | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 221b311b1ce..09b6de796c4 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -458,7 +458,7 @@ create table t2 select group_concat(a) as a from t1; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` longtext character set cp1250 + `a` varchar(400) character set cp1250 default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select collation(group_concat(a,_koi8r'test')) from t1; collation(group_concat(a,_koi8r'test')) diff --git a/sql/item.cc b/sql/item.cc index eeb4b43b783..22c56fa5f2b 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1191,7 +1191,7 @@ bool agg_item_charsets(DTCollation &coll, const char *fname, } THD *thd= current_thd; - Item_arena *arena, backup; + Query_arena *arena, backup; bool res= FALSE; /* In case we're in statement prepare, create conversion item @@ -1220,7 +1220,8 @@ bool agg_item_charsets(DTCollation &coll, const char *fname, res= TRUE; break; // we cannot return here, we need to restore "arena". } - conv->fix_fields(thd, 0, &conv); + if ((*arg)->type() == Item::FIELD_ITEM) + ((Item_field *)(*arg))->no_const_subst= 1; /* If in statement prepare, then we create a converter for two constant items, do it once and then reuse it. @@ -1235,6 +1236,11 @@ bool agg_item_charsets(DTCollation &coll, const char *fname, *arg= conv; else thd->change_item_tree(arg, conv); + /* + We do not check conv->fixed, because Item_func_conv_charset which can + be return by safe_charset_converter can't be fixed at creation + */ + conv->fix_fields(thd, arg); } if (arena) thd->restore_backup_item_arena(arena, &backup); From aee8de3527f8f14262c2c3151659f9aef77d1cf6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 14:03:34 +0300 Subject: [PATCH 037/144] InnoDB: Do not flush after each write, not even when creating the data files. Previously, writes were flushed until the doublewrite buffer was created. That would be too slow on systems where os_file_flush() [or fsync(2)] is slow. (Bug #12125) innobase/include/os0file.h: Disable os_do_not_call_flush_at_each_write unless #ifdef UNIV_DO_FLUSH innobase/os/os0file.c: Disable os_do_not_call_flush_at_each_write unless #ifdef UNIV_DO_FLUSH innobase/trx/trx0sys.c: Disable os_do_not_call_flush_at_each_write unless #ifdef UNIV_DO_FLUSH --- innobase/include/os0file.h | 2 ++ innobase/os/os0file.c | 14 ++++++++++++++ innobase/trx/trx0sys.c | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/innobase/include/os0file.h b/innobase/include/os0file.h index 63cd41a6d28..280a949c1c5 100644 --- a/innobase/include/os0file.h +++ b/innobase/include/os0file.h @@ -17,7 +17,9 @@ Created 10/21/1995 Heikki Tuuri #include #endif +#ifdef UNIV_DO_FLUSH extern ibool os_do_not_call_flush_at_each_write; +#endif /* UNIV_DO_FLUSH */ extern ibool os_has_said_disk_full; extern ibool os_aio_print_debug; diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 4313b7f7019..49f88c0d62a 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -33,9 +33,13 @@ ulint os_innodb_umask = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; ulint os_innodb_umask = 0; #endif +#ifdef UNIV_DO_FLUSH /* If the following is set to TRUE, we do not call os_file_flush in every os_file_write. We can set this TRUE when the doublewrite buffer is used. */ ibool os_do_not_call_flush_at_each_write = FALSE; +#else +/* We do not call os_file_flush in every os_file_write. */ +#endif /* UNIV_DO_FLUSH */ /* We use these mutexes to protect lseek + file i/o operation, if the OS does not provide an atomic pread or pwrite, or similar */ @@ -1974,6 +1978,7 @@ os_file_pwrite( os_file_n_pending_pwrites--; os_mutex_exit(os_file_count_mutex); +# ifdef UNIV_DO_FLUSH if (srv_unix_file_flush_method != SRV_UNIX_LITTLESYNC && srv_unix_file_flush_method != SRV_UNIX_NOSYNC && !os_do_not_call_flush_at_each_write) { @@ -1984,6 +1989,7 @@ os_file_pwrite( ut_a(TRUE == os_file_flush(file)); } +# endif /* UNIV_DO_FLUSH */ return(ret); #else @@ -2006,6 +2012,7 @@ os_file_pwrite( ret = write(file, buf, (ssize_t)n); +# ifdef UNIV_DO_FLUSH if (srv_unix_file_flush_method != SRV_UNIX_LITTLESYNC && srv_unix_file_flush_method != SRV_UNIX_NOSYNC && !os_do_not_call_flush_at_each_write) { @@ -2016,6 +2023,7 @@ os_file_pwrite( ut_a(TRUE == os_file_flush(file)); } +# endif /* UNIV_DO_FLUSH */ os_mutex_exit(os_file_seek_mutexes[i]); @@ -2282,9 +2290,11 @@ retry: /* Always do fsync to reduce the probability that when the OS crashes, a database page is only partially physically written to disk. */ +# ifdef UNIV_DO_FLUSH if (!os_do_not_call_flush_at_each_write) { ut_a(TRUE == os_file_flush(file)); } +# endif /* UNIV_DO_FLUSH */ os_mutex_exit(os_file_seek_mutexes[i]); @@ -3498,10 +3508,12 @@ os_aio_windows_handle( if (ret && len == slot->len) { ret_val = TRUE; +# ifdef UNIV_DO_FLUSH if (slot->type == OS_FILE_WRITE && !os_do_not_call_flush_at_each_write) { ut_a(TRUE == os_file_flush(slot->file)); } +# endif /* UNIV_DO_FLUSH */ } else { os_file_handle_error(slot->name, "Windows aio"); @@ -3582,10 +3594,12 @@ os_aio_posix_handle( *message1 = slot->message1; *message2 = slot->message2; +# ifdef UNIV_DO_FLUSH if (slot->type == OS_FILE_WRITE && !os_do_not_call_flush_at_each_write) { ut_a(TRUE == os_file_flush(slot->file)); } +# endif /* UNIV_DO_FLUSH */ os_mutex_exit(array->mutex); diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c index 51e193d563b..c7292fb7650 100644 --- a/innobase/trx/trx0sys.c +++ b/innobase/trx/trx0sys.c @@ -97,8 +97,9 @@ trx_doublewrite_init( /* Since we now start to use the doublewrite buffer, no need to call fsync() after every write to a data file */ - +#ifdef UNIV_DO_FLUSH os_do_not_call_flush_at_each_write = TRUE; +#endif /* UNIV_DO_FLUSH */ mutex_create(&(trx_doublewrite->mutex)); mutex_set_level(&(trx_doublewrite->mutex), SYNC_DOUBLEWRITE); From f12ded495c40a361e6b37c0d9a4852822821500a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 16:38:10 +0500 Subject: [PATCH 038/144] ctype-big5.c: ctype-cp932.c: ctype-gbk.c: ctype-mb.c: ctype-simple.c: ctype-sjis.c: ctype-ucs2.c: ctype-ujis.c: ctype-utf8.c: Adding explicit cast to return type in pointer substructions to avoid warnings from some compilers. strings/ctype-big5.c: Adding explicit cast to return type in pointer substructions to avoid warnings from some compilers. Adding explicit cast to return type in pointer substructions to avoid warnings from some compilers. Adding explicit cast to return type in pointer substructions to avoid warnings from some compilers. strings/ctype-cp932.c: Adding explicit cast to return type in pointer substructions to avoid warnings from some compilers. strings/ctype-gbk.c: Adding explicit cast to return type in pointer substructions to avoid warnings from some compilers. strings/ctype-mb.c: Adding explicit cast to return type in pointer substructions to avoid warnings from some compilers. strings/ctype-simple.c: Adding explicit cast to return type in pointer substructions to avoid warnings from some compilers. strings/ctype-sjis.c: Adding explicit cast to return type in pointer substructions to avoid warnings from some compilers. strings/ctype-ucs2.c: Adding explicit cast to return type in pointer substructions to avoid warnings from some compilers. strings/ctype-ujis.c: Adding explicit cast to return type in pointer substructions to avoid warnings from some compilers. strings/ctype-utf8.c: Adding explicit cast to return type in pointer substructions to avoid warnings from some compilers. --- strings/ctype-big5.c | 2 +- strings/ctype-cp932.c | 4 ++-- strings/ctype-gbk.c | 2 +- strings/ctype-mb.c | 4 ++-- strings/ctype-simple.c | 8 ++++---- strings/ctype-sjis.c | 4 ++-- strings/ctype-ucs2.c | 8 ++++---- strings/ctype-ujis.c | 10 +++++----- strings/ctype-utf8.c | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index ff4ce6fdb51..b467c8c5ba3 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -6309,7 +6309,7 @@ uint my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)), break; } } - return b - b0; + return (uint) (b - b0); } diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index c77ce858dff..be3526519cb 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -213,7 +213,7 @@ static int my_strnncoll_cp932_internal(CHARSET_INFO *cs, uint a_char= cp932code(*a, *(a+1)); uint b_char= cp932code(*b, *(b+1)); if (a_char != b_char) - return a_char - b_char; + return (int) a_char - (int) b_char; a += 2; b += 2; } else @@ -5449,7 +5449,7 @@ uint my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)), break; } } - return b - b0; + return (uint) (b - b0); } diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index 6fb072d266d..7196d004ad5 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -9956,7 +9956,7 @@ uint my_well_formed_len_gbk(CHARSET_INFO *cs __attribute__((unused)), break; } } - return b - b0; + return (uint) (b - b0); } diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index cbbd035c631..4b22f158284 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -260,7 +260,7 @@ uint my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)), pos+= (mblen= my_ismbchar(cs, pos, end)) ? mblen : 1; length--; } - return length ? end+2-start : pos-start; + return length ? (uint) (end + 2 - start) : (uint) (pos - start); } @@ -282,7 +282,7 @@ uint my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e, b+= mblen; pos--; } - return b - b_start; + return (uint) (b - b_start); } diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 9e3a328ec26..af673b78254 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -1051,7 +1051,7 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq) if (*str == '.') { for(str++ ; str != end && *str == '0' ; str++); - return str-str0; + return (ulong) (str - str0); } return 0; @@ -1061,7 +1061,7 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq) if (!my_isspace(cs,*str)) break; } - return str-str0; + return (ulong) (str - str0); default: return 0; } @@ -1078,14 +1078,14 @@ void my_fill_8bit(CHARSET_INFO *cs __attribute__((unused)), uint my_numchars_8bit(CHARSET_INFO *cs __attribute__((unused)), const char *b, const char *e) { - return e-b; + return (uint) (e - b); } uint my_numcells_8bit(CHARSET_INFO *cs __attribute__((unused)), const char *b, const char *e) { - return e-b; + return (uint) (e - b); } diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 7f34ee3fa2d..900acefd4ea 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -213,7 +213,7 @@ static int my_strnncoll_sjis_internal(CHARSET_INFO *cs, uint a_char= sjiscode(*a, *(a+1)); uint b_char= sjiscode(*b, *(b+1)); if (a_char != b_char) - return a_char - b_char; + return (int) a_char - (int) b_char; a += 2; b += 2; } else @@ -4605,7 +4605,7 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)), break; } } - return b - b0; + return (uint) (b - b0); } diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index c3caaeadfb3..025fdd5a7f6 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -215,7 +215,7 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs, s+=s_res; t+=t_res; } - return t_is_prefix ? t-te : ((se-s) - (te-t)); + return t_is_prefix ? (int) (t - te) : (int) ((se - s) - (te - t)); } /* @@ -326,7 +326,7 @@ static int my_strncasecmp_ucs2(CHARSET_INFO *cs, s+=s_res; t+=t_res; } - return ( (se-s) - (te-t) ); + return (int) ( (se-s) - (te-t) ); } @@ -1349,7 +1349,7 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs, s+=s_res; t+=t_res; } - return t_is_prefix ? t-te : ((se-s) - (te-t)); + return t_is_prefix ? (int) (t - te) : (int) ((se-s) - (te-t)); } static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs, @@ -1494,7 +1494,7 @@ ulong my_scan_ucs2(CHARSET_INFO *cs __attribute__((unused)), if (str[0] != '\0' || str[1] != ' ') break; } - return str - str0; + return (ulong) (str - str0); default: return 0; } diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 612dda2b3eb..f20e2756810 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -8270,7 +8270,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)), if (b >= (uchar *) end) /* need more bytes */ { *error= 1; - return chbeg - beg; /* unexpected EOL */ + return (uint) (chbeg - beg); /* unexpected EOL */ } if (ch == 0x8E) /* [x8E][xA0-xDF] */ @@ -8278,7 +8278,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)), if (*b >= 0xA0 && *b <= 0xDF) continue; *error= 1; - return chbeg - beg; /* invalid sequence */ + return (uint) (chbeg - beg); /* invalid sequence */ } if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */ @@ -8287,7 +8287,7 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)), if (b >= (uchar*) end) { *error= 1; - return chbeg - beg; /* unexpected EOL */ + return (uint) (chbeg - beg);/* unexpected EOL */ } } @@ -8295,9 +8295,9 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)), *b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */ continue; *error= 1; - return chbeg - beg; /* invalid sequence */ + return (uint) (chbeg - beg); /* invalid sequence */ } - return b - (uchar *) beg; + return (uint) (b - (uchar *) beg); } diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 205701e87c7..0bf57967630 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -2008,7 +2008,7 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs, s+=s_res; t+=t_res; } - return t_is_prefix ? t-te : ((se-s) - (te-t)); + return t_is_prefix ? (int) (t-te) : (int) ((se-s) - (te-t)); } From 90e41facf78150df4f8d387f6d44647957c7a8a0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 17:55:58 +0300 Subject: [PATCH 039/144] Review fixes: Fixed portability problem with bool in C programs Moved close_thread_tables out from LOCK_thread_count mutex (safety fix) my_sleep() -> pthread_cond_timedwait() include/thr_lock.h: bool -> my_bool (bool is not portable in C programs) mysys/thr_lock.c: bool -> my_bool (bool is not portable in C programs) sql/lock.cc: Added comment Don't use | on bool variable sql/mysql_priv.h: Added comment sql/slave.cc: Moved close_thread_tables out from LOCK_thread_count mutex (safety fix) sql/sql_base.cc: Added comments my_sleep() -> pthread_cond_timedwait() to get less code and potentitally faster loop BitKeeper/etc/ignore: added ac_available_languages_fragment --- .bzrignore | 1 + include/thr_lock.h | 2 +- mysys/thr_lock.c | 4 ++-- sql/lock.cc | 20 +++++++++++++++----- sql/mysql_priv.h | 3 +++ sql/slave.cc | 2 +- sql/sql_base.cc | 26 +++++++++++++++----------- 7 files changed, 38 insertions(+), 20 deletions(-) diff --git a/.bzrignore b/.bzrignore index 1d14c09a602..9f57a7ad7de 100644 --- a/.bzrignore +++ b/.bzrignore @@ -546,3 +546,4 @@ vio/viotest-ssl scripts/make_win_binary_distribution EXCEPTIONS-CLIENT support-files/my-innodb-heavy-4G.cnf +ac_available_languages_fragment diff --git a/include/thr_lock.h b/include/thr_lock.h index 8caaa112605..1062a49472b 100644 --- a/include/thr_lock.h +++ b/include/thr_lock.h @@ -107,7 +107,7 @@ void thr_unlock(THR_LOCK_DATA *data); int thr_multi_lock(THR_LOCK_DATA **data,uint count); void thr_multi_unlock(THR_LOCK_DATA **data,uint count); void thr_abort_locks(THR_LOCK *lock); -bool thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread); +my_bool thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread); void thr_print_locks(void); /* For debugging */ my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data); my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data); diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 63dbe67c68e..a789162a56a 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -966,10 +966,10 @@ void thr_abort_locks(THR_LOCK *lock) This is used to abort all locks for a specific thread */ -bool thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread) +my_bool thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread) { THR_LOCK_DATA *data; - bool found= FALSE; + my_bool found= FALSE; DBUG_ENTER("thr_abort_locks_for_thread"); pthread_mutex_lock(&lock->mutex); diff --git a/sql/lock.cc b/sql/lock.cc index eb49254215d..47ccc44952d 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -331,7 +331,18 @@ void mysql_lock_abort(THD *thd, TABLE *table) } -/* Abort one thread / table combination */ +/* + Abort one thread / table combination + + SYNOPSIS + mysql_lock_abort_for_thread() + thd Thread handler + table Table that should be removed from lock queue + + RETURN + 0 Table was not locked by another thread + 1 Table was locked by at least one other thread +*/ bool mysql_lock_abort_for_thread(THD *thd, TABLE *table) { @@ -344,10 +355,9 @@ bool mysql_lock_abort_for_thread(THD *thd, TABLE *table) { for (uint i=0; i < locked->lock_count; i++) { - bool found; - found= thr_abort_locks_for_thread(locked->locks[i]->lock, - table->in_use->real_id); - result|= found; + if (thr_abort_locks_for_thread(locked->locks[i]->lock, + table->in_use->real_id)) + result= TRUE; } my_free((gptr) locked,MYF(0)); } diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index bc7ec53ccd9..9b9edd905ad 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -606,12 +606,15 @@ bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db, const char *table_name); void remove_db_from_cache(const my_string db); void flush_tables(); + +/* bits for last argument to remove_table_from_cache() */ #define RTFC_NO_FLAG 0x0000 #define RTFC_OWNED_BY_THD_FLAG 0x0001 #define RTFC_WAIT_OTHER_THREAD_FLAG 0x0002 #define RTFC_CHECK_KILLED_FLAG 0x0004 bool remove_table_from_cache(THD *thd, const char *db, const char *table, uint flags); + bool close_cached_tables(THD *thd, bool wait_for_refresh, TABLE_LIST *tables); void copy_field_from_tmp_record(Field *field,int offset); int fill_record(List &fields,List &values, bool ignore_errors); diff --git a/sql/slave.cc b/sql/slave.cc index 6132d334dbb..5e3d073b38a 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2719,9 +2719,9 @@ err: mi->abort_slave = 0; // TODO: check if this is needed DBUG_ASSERT(thd->net.buff != 0); net_end(&thd->net); // destructor will not free it, because net.vio is 0 + close_thread_tables(thd, 0); pthread_mutex_lock(&LOCK_thread_count); THD_CHECK_SENTRY(thd); - close_thread_tables(thd); delete thd; pthread_mutex_unlock(&LOCK_thread_count); pthread_cond_broadcast(&mi->stop_cond); // tell the world we are done diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 32d14854e08..7d3bb81793a 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2403,8 +2403,14 @@ void flush_tables() /* -** Mark all entries with the table as deleted to force an reopen of the table -** Returns true if the table is in use by another thread + Mark all entries with the table as deleted to force an reopen of the table + + PREREQUISITES + Lock on LOCK_open() + + RETURN + 0 If the table is NOT in use by another thread + 1 If the table is NOT in use by another thread */ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name, @@ -2416,6 +2422,7 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name, bool result=0, signalled= 0; DBUG_ENTER("remove_table_from_cache"); + key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1; for (;;) { @@ -2473,15 +2480,12 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name, { if (!(flags & RTFC_CHECK_KILLED_FLAG) || !thd->killed) { + dropping_tables++; if (likely(signalled)) - { - dropping_tables++; (void) pthread_cond_wait(&COND_refresh, &LOCK_open); - dropping_tables--; - continue; - } else { + struct timespec abstime; /* It can happen that another thread has opened the table but has not yet locked any table at all. Since @@ -2492,11 +2496,11 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name, and then we retry another loop in the remove_table_from_cache routine. */ - pthread_mutex_unlock(&LOCK_open); - my_sleep(10); - pthread_mutex_lock(&LOCK_open); - continue; + set_timespec(abstime, 10); + pthread_cond_timedwait(&COND_refresh, &LOCK_open, &abstime); } + dropping_tables--; + continue; } } break; From 4903707c341c4a94e775682a71287361eaf24b92 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 08:20:42 -0700 Subject: [PATCH 040/144] item.h: Post review change in Item_ref::get_tmp_table_field (bug #11412). sql/item.h: Post review change in Item_ref::get_tmp_table_field (bug #11412). --- sql/item.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql/item.h b/sql/item.h index 259b3654461..c9f87c4df90 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1467,7 +1467,10 @@ public: Field *get_tmp_table_field() { return result_field ? result_field : (*ref)->get_tmp_table_field(); } Item *get_tmp_table_item(THD *thd) - { return (*ref)->get_tmp_table_item(thd); } + { + return (result_field ? new Item_field(result_field) : + (*ref)->get_tmp_table_item(thd)); + } table_map used_tables() const { return depended_from ? OUTER_REF_TABLE_BIT : (*ref)->used_tables(); From 70e7d4d096ca25339ba58fcd0bf40f0a4a7c46a5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 20:59:43 +0500 Subject: [PATCH 041/144] Fix for bug #11329 (lowercase_table.test fails) sql/mysqld.cc: code moved to the init_server_variables() so it will work in embedded server as well --- sql/mysqld.cc | 88 +++++++++++++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 896114f98c6..6bbd6f79aa2 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2569,6 +2569,50 @@ static int init_common_variables(const char *conf_file_name, int argc, if (my_dbopt_init()) return 1; + /* + Ensure that lower_case_table_names is set on system where we have case + insensitive names. If this is not done the users MyISAM tables will + get corrupted if accesses with names of different case. + */ + DBUG_PRINT("info", ("lower_case_table_names: %d", lower_case_table_names)); + if (!lower_case_table_names && + (lower_case_file_system= + (test_if_case_insensitive(mysql_real_data_home) == 1))) + { + if (lower_case_table_names_used) + { + if (global_system_variables.log_warnings) + sql_print_warning("\ +You have forced lower_case_table_names to 0 through a command-line \ +option, even though your file system '%s' is case insensitive. This means \ +that you can corrupt a MyISAM table by accessing it with different cases. \ +You should consider changing lower_case_table_names to 1 or 2", + mysql_real_data_home); + } + else + { + if (global_system_variables.log_warnings) + sql_print_warning("Setting lower_case_table_names=2 because file system for %s is case insensitive", mysql_real_data_home); + lower_case_table_names= 2; + } + } + else if (lower_case_table_names == 2 && + !(lower_case_file_system= + (test_if_case_insensitive(mysql_real_data_home) == 1))) + { + if (global_system_variables.log_warnings) + sql_print_warning("lower_case_table_names was set to 2, even though your " + "the file system '%s' is case sensitive. Now setting " + "lower_case_table_names to 0 to avoid future problems.", + mysql_real_data_home); + lower_case_table_names= 0; + } + + /* Reset table_alias_charset, now that lower_case_table_names is set. */ + table_alias_charset= (lower_case_table_names ? + files_charset_info : + &my_charset_bin); + return 0; } @@ -2969,50 +3013,6 @@ int main(int argc, char **argv) (void) thr_setconcurrency(concurrency); // 10 by default - /* - Ensure that lower_case_table_names is set on system where we have case - insensitive names. If this is not done the users MyISAM tables will - get corrupted if accesses with names of different case. - */ - DBUG_PRINT("info", ("lower_case_table_names: %d", lower_case_table_names)); - if (!lower_case_table_names && - (lower_case_file_system= - (test_if_case_insensitive(mysql_real_data_home) == 1))) - { - if (lower_case_table_names_used) - { - if (global_system_variables.log_warnings) - sql_print_warning("\ -You have forced lower_case_table_names to 0 through a command-line \ -option, even though your file system '%s' is case insensitive. This means \ -that you can corrupt a MyISAM table by accessing it with different cases. \ -You should consider changing lower_case_table_names to 1 or 2", - mysql_real_data_home); - } - else - { - if (global_system_variables.log_warnings) - sql_print_warning("Setting lower_case_table_names=2 because file system for %s is case insensitive", mysql_real_data_home); - lower_case_table_names= 2; - } - } - else if (lower_case_table_names == 2 && - !(lower_case_file_system= - (test_if_case_insensitive(mysql_real_data_home) == 1))) - { - if (global_system_variables.log_warnings) - sql_print_warning("lower_case_table_names was set to 2, even though your " - "the file system '%s' is case sensitive. Now setting " - "lower_case_table_names to 0 to avoid future problems.", - mysql_real_data_home); - lower_case_table_names= 0; - } - - /* Reset table_alias_charset, now that lower_case_table_names is set. */ - table_alias_charset= (lower_case_table_names ? - files_charset_info : - &my_charset_bin); - select_thread=pthread_self(); select_thread_in_use=1; init_ssl(); From eb25e83ee4a2b960a387778a19440b6db4a01fd7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jul 2005 18:08:49 -0700 Subject: [PATCH 042/144] Increase allowed size of stored procedure bodies to 4GB, and produce a sensible error when that limit is exceeded. (Bug #11602) client/mysqltest.c: Increase query buffer size, and explain why mysql-test/r/system_mysql_db.result: Update results scripts/mysql_create_system_tables.sh: Increase size of proc.body scripts/mysql_fix_privilege_tables.sql: Increase size of proc.body sql/share/errmsg.txt: Add error for SP routines that are too long sql/sp.cc: Raise an error when the SP body is too long. sql/sp.h: Add error for SP body being too long. sql/sql_parse.cc: Handle SP_BODY_TOO_LONG error. mysql-test/r/sp-big.result: New BitKeeper file ``mysql-test/r/sp-big.result'' mysql-test/t/sp-big.test: New BitKeeper file ``mysql-test/t/sp-big.test'' --- client/mysqltest.c | 3 ++- mysql-test/r/sp-big.result | 15 ++++++++++++ mysql-test/r/system_mysql_db.result | 2 +- mysql-test/t/sp-big.test | 33 ++++++++++++++++++++++++++ scripts/mysql_create_system_tables.sh | 2 +- scripts/mysql_fix_privilege_tables.sql | 3 ++- sql/share/errmsg.txt | 2 ++ sql/sp.cc | 5 ++++ sql/sp.h | 1 + sql/sql_parse.cc | 6 +++++ 10 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 mysql-test/r/sp-big.result create mode 100644 mysql-test/t/sp-big.test diff --git a/client/mysqltest.c b/client/mysqltest.c index 67fa931a3f3..596efc7f12f 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -66,7 +66,8 @@ #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif -#define MAX_QUERY 131072 +/* MAX_QUERY is 256K -- there is a test in sp-big that is >128K */ +#define MAX_QUERY (256*1024) #define MAX_VAR_NAME 256 #define MAX_COLUMNS 256 #define PAD_SIZE 128 diff --git a/mysql-test/r/sp-big.result b/mysql-test/r/sp-big.result new file mode 100644 index 00000000000..004ff586aab --- /dev/null +++ b/mysql-test/r/sp-big.result @@ -0,0 +1,15 @@ +drop procedure if exists test.longprocedure; +drop table if exists t1; +create table t1 (a int); +insert into t1 values (1),(2),(3); +length +107520 +select length(routine_definition) from information_schema.routines where routine_schema = 'test' and routine_name = 'longprocedure'; +length(routine_definition) +107530 +call test.longprocedure(@value); +select @value; +@value +3 +drop procedure test.longprocedure; +drop table t1; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index 277115733d4..d2872878cb9 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -172,7 +172,7 @@ proc CREATE TABLE `proc` ( `security_type` enum('INVOKER','DEFINER') NOT NULL default 'DEFINER', `param_list` blob NOT NULL, `returns` char(64) NOT NULL default '', - `body` blob NOT NULL, + `body` longblob NOT NULL, `definer` char(77) character set utf8 collate utf8_bin NOT NULL default '', `created` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `modified` timestamp NOT NULL default '0000-00-00 00:00:00', diff --git a/mysql-test/t/sp-big.test b/mysql-test/t/sp-big.test new file mode 100644 index 00000000000..769d77dbef9 --- /dev/null +++ b/mysql-test/t/sp-big.test @@ -0,0 +1,33 @@ +# +# Bug #11602: SP with very large body not handled well +# + +--disable_warnings +drop procedure if exists test.longprocedure; +drop table if exists t1; +--enable_warnings + +create table t1 (a int); +insert into t1 values (1),(2),(3); + +let $body=`select repeat('select count(*) into out1 from t1;\n', 3072)`; + +delimiter //; +--disable_query_log +eval select length('$body') as length// +eval create procedure test.longprocedure (out out1 int) deterministic +begin + $body +end// +--enable_query_log + +delimiter ;// + +# this is larger than the length above, because it includes the 'begin' and +# 'end' bits and some whitespace +select length(routine_definition) from information_schema.routines where routine_schema = 'test' and routine_name = 'longprocedure'; + +call test.longprocedure(@value); select @value; + +drop procedure test.longprocedure; +drop table t1; diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index a3036b5c10b..383f8b80dc8 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -683,7 +683,7 @@ then c_p="$c_p security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL," c_p="$c_p param_list blob DEFAULT '' NOT NULL," c_p="$c_p returns char(64) DEFAULT '' NOT NULL," - c_p="$c_p body blob DEFAULT '' NOT NULL," + c_p="$c_p body longblob DEFAULT '' NOT NULL," c_p="$c_p definer char(77) collate utf8_bin DEFAULT '' NOT NULL," c_p="$c_p created timestamp," c_p="$c_p modified timestamp," diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index b93e0a47b1b..f67bab44514 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -426,7 +426,7 @@ CREATE TABLE IF NOT EXISTS proc ( security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob DEFAULT '' NOT NULL, returns char(64) DEFAULT '' NOT NULL, - body blob DEFAULT '' NOT NULL, + body longblob DEFAULT '' NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, @@ -477,6 +477,7 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL, 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, + MODIFY body longblob DEFAULT '' NOT NULL, MODIFY sql_mode set('REAL_AS_FLOAT', 'PIPES_AS_CONCAT', diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index f999f17aedf..7f5453be771 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5370,3 +5370,5 @@ ER_SCALE_BIGGER_THAN_PRECISION 42000 S1009 eng "Scale may not be larger than the precision (column '%-.64s')." ER_WRONG_LOCK_OF_SYSTEM_TABLE eng "You can't combine write-locking of system '%-.64s.%-.64s' table with other tables" +ER_TOO_LONG_BODY 42000 S1009 + eng "Routine body for '%-.100s' is too long" diff --git a/sql/sp.cc b/sql/sp.cc index 55087f47f5e..48878927c87 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -503,6 +503,11 @@ db_create_routine(THD *thd, int type, sp_head *sp) ret= SP_BAD_IDENTIFIER; goto done; } + if (sp->m_body.length > table->field[MYSQL_PROC_FIELD_BODY]->field_length) + { + ret= SP_BODY_TOO_LONG; + goto done; + } table->field[MYSQL_PROC_FIELD_DB]-> store(sp->m_db.str, sp->m_db.length, system_charset_info); table->field[MYSQL_PROC_FIELD_NAME]-> diff --git a/sql/sp.h b/sql/sp.h index b8af8d3a321..86351f61de9 100644 --- a/sql/sp.h +++ b/sql/sp.h @@ -29,6 +29,7 @@ #define SP_INTERNAL_ERROR -7 #define SP_NO_DB_ERROR -8 #define SP_BAD_IDENTIFIER -9 +#define SP_BODY_TOO_LONG -10 /* Drop all routines in database 'db' */ int diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2e5cab4bb1c..e3bc3daab24 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4112,6 +4112,12 @@ end_with_restore_list: delete lex->sphead; lex->sphead= 0; goto error; + case SP_BODY_TOO_LONG: + my_error(ER_TOO_LONG_BODY, MYF(0), name); + lex->unit.cleanup(); + delete lex->sphead; + lex->sphead= 0; + goto error; default: my_error(ER_SP_STORE_FAILED, MYF(0), SP_TYPE_STRING(lex), name); lex->unit.cleanup(); From 62aad3332271b63e538ba82be09934a92929f699 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 14:37:16 +0500 Subject: [PATCH 043/144] Merging sql/sql_parse.cc: error function changed --- sql/sql_parse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 07c6c62da28..1c220ccb9f3 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3645,7 +3645,7 @@ end_with_restore_list: if (!(res = mysql_create_function(thd, &lex->udf))) send_ok(thd); #else - net_printf(thd, ER_CANT_OPEN_LIBRARY, lex->udf.dl, 0, "feature disabled"); + net_printf_error(thd, ER_CANT_OPEN_LIBRARY, lex->udf.dl, 0, "feature disabled"); res= TRUE; #endif break; From 34b340c4dd6e20c1ab41696f71b3d00797d68ff2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 13:05:30 +0300 Subject: [PATCH 044/144] Review of new code: Change argument order to be database, tablename for some functions sql/lock.cc: Remove not needed block sql/mysql_priv.h: Change argument order to be database, tablename (like in most other functions) sql/sql_table.cc: Change argument order to be database, tablename (like in most other functions) Make 'flags' inline sql/table.cc: Change argument order to be database, tablename (like in most other functions) sql/unireg.cc: Change argument order to be database, tablename (like in most other functions) --- sql/lock.cc | 7 ++----- sql/mysql_priv.h | 6 +++--- sql/sql_table.cc | 19 ++++++++++--------- sql/table.cc | 2 +- sql/unireg.cc | 12 ++++++------ 5 files changed, 22 insertions(+), 24 deletions(-) diff --git a/sql/lock.cc b/sql/lock.cc index f8697cd9bc6..c198ff1e7d4 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -584,12 +584,9 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list) DBUG_RETURN(-1); } + if (remove_table_from_cache(thd, db, table_list->real_name, RTFC_NO_FLAG)) { - if (remove_table_from_cache(thd, db, - table_list->real_name, RTFC_NO_FLAG)) - { - DBUG_RETURN(1); // Table is in use - } + DBUG_RETURN(1); // Table is in use } DBUG_RETURN(0); } diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 4b570c7bbd1..53a2273eb6e 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1029,12 +1029,12 @@ void unlock_table_names(THD *thd, TABLE_LIST *table_list, void unireg_init(ulong options); void unireg_end(void); bool mysql_create_frm(THD *thd, my_string file_name, - const char *table, const char* db, + const char *db, const char *table, HA_CREATE_INFO *create_info, List &create_field, uint key_count,KEY *key_info,handler *db_type); int rea_create_table(THD *thd, my_string file_name, - const char *table, const char* db, + const char *db, const char *table, HA_CREATE_INFO *create_info, List &create_field, uint key_count,KEY *key_info); @@ -1107,7 +1107,7 @@ ulong make_new_entry(File file,uchar *fileinfo,TYPELIB *formnames, const char *newname); ulong next_io_size(ulong pos); void append_unescaped(String *res, const char *pos, uint length); -int create_frm(char *name, const char *table, const char *db, +int create_frm(char *name, const char *db, const char *table, uint reclength,uchar *fileinfo, HA_CREATE_INFO *create_info, uint keys); void update_create_info_from_table(HA_CREATE_INFO *info, TABLE *form); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 69d13e19309..87b864c73fa 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -220,7 +220,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, for (table=tables ; table ; table=table->next) { char *db=table->db; - uint flags; mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL); if (!close_temporary_table(thd, db, table->real_name)) { @@ -232,8 +231,9 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, if (!drop_temporary) { abort_locked_tables(thd,db,table->real_name); - flags= RTFC_WAIT_OTHER_THREAD_FLAG | RTFC_CHECK_KILLED_FLAG; - remove_table_from_cache(thd,db,table->real_name,flags); + remove_table_from_cache(thd,db,table->real_name, + RTFC_WAIT_OTHER_THREAD_FLAG | + RTFC_CHECK_KILLED_FLAG); drop_locked_tables(thd,db,table->real_name); if (thd->killed) DBUG_RETURN(-1); @@ -1418,7 +1418,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, create_info->data_file_name= create_info->index_file_name= 0; create_info->table_options=db_options; - if (rea_create_table(thd, path, table_name, db, + if (rea_create_table(thd, path, db, table_name, create_info, fields, key_count, key_info_buffer)) goto end; @@ -1979,14 +1979,14 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, /* Close all instances of the table to allow repair to rename files */ if (lock_type == TL_WRITE && table->table->version) { - uint flags; pthread_mutex_lock(&LOCK_open); const char *old_message=thd->enter_cond(&COND_refresh, &LOCK_open, "Waiting to get writelock"); mysql_lock_abort(thd,table->table); - flags= RTFC_WAIT_OTHER_THREAD_FLAG | RTFC_CHECK_KILLED_FLAG; remove_table_from_cache(thd, table->table->table_cache_key, - table->table->real_name, flags); + table->table->real_name, + RTFC_WAIT_OTHER_THREAD_FLAG | + RTFC_CHECK_KILLED_FLAG); thd->exit_cond(old_message); if (thd->killed) goto err; @@ -3410,9 +3410,10 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, if (table) { VOID(table->file->extra(HA_EXTRA_FORCE_REOPEN)); // Use new file + /* Mark in-use copies old */ remove_table_from_cache(thd,db,table_name,RTFC_NO_FLAG); - // Mark in-use copies old - mysql_lock_abort(thd,table); // end threads waiting on lock + /* end threads waiting on lock */ + mysql_lock_abort(thd,table); } VOID(quick_rm_table(old_db_type,db,old_name)); if (close_data_tables(thd,db,table_name) || diff --git a/sql/table.cc b/sql/table.cc index eb8746cec53..04d1a95cd9b 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1238,7 +1238,7 @@ void append_unescaped(String *res, const char *pos, uint length) /* Create a .frm file */ -File create_frm(register my_string name, const char *table, const char *db, +File create_frm(register my_string name, const char *db, const char *table, uint reclength, uchar *fileinfo, HA_CREATE_INFO *create_info, uint keys) { diff --git a/sql/unireg.cc b/sql/unireg.cc index a3d461513b8..e3bf763f700 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -56,8 +56,8 @@ static bool make_empty_rec(int file, enum db_type table_type, mysql_create_frm() thd Thread handler file_name Name of file (including database and .frm) - table Name of table db Name of database + table Name of table create_info create info parameters create_fields Fields to create keys number of keys to create @@ -70,7 +70,7 @@ static bool make_empty_rec(int file, enum db_type table_type, */ bool mysql_create_frm(THD *thd, my_string file_name, - const char *table, const char *db, + const char *db, const char *table, HA_CREATE_INFO *create_info, List &create_fields, uint keys, KEY *key_info, @@ -117,7 +117,7 @@ bool mysql_create_frm(THD *thd, my_string file_name, reclength=uint2korr(forminfo+266); null_fields=uint2korr(forminfo+282); - if ((file=create_frm(file_name, table, db, reclength, fileinfo, + if ((file=create_frm(file_name, db, table, reclength, fileinfo, create_info, keys)) < 0) { my_free((gptr) screen_buff,MYF(0)); @@ -219,8 +219,8 @@ err3: rea_create_table() thd Thread handler file_name Name of file (including database and .frm) - table Name of table db Name of database + table Name of table create_info create info parameters create_fields Fields to create keys number of keys to create @@ -233,14 +233,14 @@ err3: */ int rea_create_table(THD *thd, my_string file_name, - const char *table, const char *db, + const char *db, const char *table, HA_CREATE_INFO *create_info, List &create_fields, uint keys, KEY *key_info) { DBUG_ENTER("rea_create_table"); - if (mysql_create_frm(thd, file_name, table, db, create_info, + if (mysql_create_frm(thd, file_name, db, table, create_info, create_fields, keys, key_info, NULL)) DBUG_RETURN(1); if (ha_create_table(file_name,create_info,0)) From 53f40f95f8fa48bec147d50f2cfe620a6ba49073 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 13:45:06 +0300 Subject: [PATCH 045/144] Moved test for 'show full processlist' to not_embedded_server.test becasue it could fail on a slow computer where previous connections has not yet disconnected mysql-test/r/ps_grant.result: Deallocate prepare statements Moved test for 'show full processlist' to not_embedded_server.test becasue it's shouldn't be here and it could fail on a slow computer where previous connections has not yet disconnected mysql-test/t/ps_grant.test: Deallocate prepare statements Moved test for 'show full processlist' to not_embedded_server.test becasue it's shouldn't be here and it could fail on a slow computer where previous connections has not yet disconnected sql/sql_lex.cc: Fixed typo mysql-test/r/not_embedded_server.result: New BitKeeper file ``mysql-test/r/not_embedded_server.result'' mysql-test/t/not_embedded_server.test: New BitKeeper file ``mysql-test/t/not_embedded_server.test'' BitKeeper/etc/ignore: added ndb/tools/ndb_config --- .bzrignore | 1 + mysql-test/r/not_embedded_server.result | 5 +++++ mysql-test/r/ps_grant.result | 5 +---- mysql-test/t/not_embedded_server.test | 16 ++++++++++++++++ mysql-test/t/ps_grant.test | 9 +-------- sql/sql_lex.cc | 2 +- 6 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 mysql-test/r/not_embedded_server.result create mode 100644 mysql-test/t/not_embedded_server.test diff --git a/.bzrignore b/.bzrignore index 093c9b2f2bc..7a10ce9db69 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1053,3 +1053,4 @@ vio/test-ssl vio/test-sslclient vio/test-sslserver vio/viotest-ssl +ndb/tools/ndb_config diff --git a/mysql-test/r/not_embedded_server.result b/mysql-test/r/not_embedded_server.result new file mode 100644 index 00000000000..082ebe72ba4 --- /dev/null +++ b/mysql-test/r/not_embedded_server.result @@ -0,0 +1,5 @@ +prepare stmt1 from ' show full processlist '; +execute stmt1; +Id User Host db Command Time State Info +number root localhost test Execute time NULL show full processlist +deallocate prepare stmt1; diff --git a/mysql-test/r/ps_grant.result b/mysql-test/r/ps_grant.result index 249fb2fe40f..f883bef8591 100644 --- a/mysql-test/r/ps_grant.result +++ b/mysql-test/r/ps_grant.result @@ -54,6 +54,7 @@ my_col 4 execute s_t9 ; ERROR 42S02: Table 'mysqltest.t9' doesn't exist +deallocate prepare s_t9; revoke all privileges on mysqltest.t1 from second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; @@ -75,7 +76,3 @@ commit ; show grants for second_user@localhost ; ERROR 42000: There is no such grant defined for user 'second_user' on host 'localhost' drop database mysqltest; -prepare stmt4 from ' show full processlist '; -execute stmt4; -Id User Host db Command Time State Info -number root localhost test Execute time NULL show full processlist diff --git a/mysql-test/t/not_embedded_server.test b/mysql-test/t/not_embedded_server.test new file mode 100644 index 00000000000..b3607107320 --- /dev/null +++ b/mysql-test/t/not_embedded_server.test @@ -0,0 +1,16 @@ +# +# Here we collect tests that doesn't work with the embedded server +# + +-- source include/not_embedded.inc + +# +# Show full process list with prepare +# To not show other connections, this must be the first test and we must +# have a server restart before this one +# + +prepare stmt1 from ' show full processlist '; +--replace_column 1 number 6 time 3 localhost +execute stmt1; +deallocate prepare stmt1; diff --git a/mysql-test/t/ps_grant.test b/mysql-test/t/ps_grant.test index d6448dd152a..082ae9d7610 100644 --- a/mysql-test/t/ps_grant.test +++ b/mysql-test/t/ps_grant.test @@ -1,7 +1,6 @@ # Can't test grants with embedded server -- source include/not_embedded.inc - let $type= 'MYISAM' ; ################ GRANT/REVOKE/DROP affecting a parallel session ################ @@ -80,6 +79,7 @@ execute s_t1 ; ######## Question 2: The table t9 does not exist. ######## --error 1146 execute s_t9 ; +deallocate prepare s_t9; #### revoke the access rights to t1 @@ -111,10 +111,3 @@ commit ; show grants for second_user@localhost ; drop database mysqltest; - -# Tested here simply so it is not tested with embedded server -prepare stmt4 from ' show full processlist '; ---replace_column 1 number 6 time 3 localhost -execute stmt4; - - diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 42e3b678c09..8636b6542fc 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -561,7 +561,7 @@ int yylex(void *arg, void *yythd) grammatically correct. */ else if (c == '?' && ((THD*) yythd)->command == COM_PREPARE && - !ident_map[cs, yyPeek()]) + !ident_map[yyPeek()]) return(PARAM_MARKER); return((int) c); From b8d992f0a74392b722ffeb39704af4d329e5fa28 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 12:45:32 +0200 Subject: [PATCH 046/144] fix for bug#9968 (slow query log contains useless entries) Query has to be written to the log before calling thd->set_statement(&stmt_backup), otherwise query will be empty. Setting thd->enabe_slow_log to FALSE prevents that dispatch_command logs the (empty) query again. --- sql/sql_prepare.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index cec432a86be..ed1a1d67e88 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2079,6 +2079,10 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) reset_stmt_params(stmt); } + log_slow_statement(thd); + /* Prevent from second logging in the end of dispatch_command */ + thd->enable_slow_log= FALSE; + thd->set_statement(&stmt_backup); thd->lock_id= &thd->main_lock_id; thd->current_arena= thd; From 852247019998f78fcac13dfc32d468526dd3a148 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 15:57:00 +0500 Subject: [PATCH 047/144] after-merge fix --- mysql-test/r/strict.result | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index ce3cf8bb204..6299e8dcc88 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -1279,6 +1279,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +set @@sql_mode='traditional'; create table t1(a bit(2)); insert into t1 values(b'101'); ERROR 22001: Data too long for column 'a' at row 1 From 26ae9152626e21314f1166c23274bb90bfa96b91 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 13:01:48 +0200 Subject: [PATCH 048/144] Fix shortcircuit of 127.0.0.1 -> localhost lookup on little-endian machines. (Bug #11822) (Originally: 1.1891 05/07/25 12:07:47 jimw@mysql.com ) configure.in: Modify version number. sql/hostname.cc: Fix comparison against INADDR_LOOPBACK to deal with endianness. (Originally applied to "sql/hostname.cpp": 1.31 05/07/25 12:07:44 jimw@mysql.com ) --- configure.in | 2 +- sql/hostname.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 12293ecf5ec..3ed1cfe6054 100644 --- a/configure.in +++ b/configure.in @@ -6,7 +6,7 @@ AC_PREREQ(2.57)dnl Minimum Autoconf version required. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # Don't forget to also update the NDB lines below. -AM_INIT_AUTOMAKE(mysql, 5.0.10-beta) +AM_INIT_AUTOMAKE(mysql, 5.0.10a-beta) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 diff --git a/sql/hostname.cc b/sql/hostname.cc index 12b69a97859..3b1eeb63d37 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -143,8 +143,8 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) *errors=0; /* We always treat the loopback address as "localhost". */ - if (in->s_addr == INADDR_LOOPBACK) - return (char *)my_localhost; + if (in->s_addr == htonl(INADDR_LOOPBACK)) // is expanded inline by gcc + DBUG_RETURN((char *)my_localhost); /* Check first if we have name in cache */ if (!(specialflag & SPECIAL_NO_HOST_CACHE)) From 7ee715d76f2dacdbca5aae0e74a0dd8800eee59e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 14:04:10 +0300 Subject: [PATCH 049/144] Fixed comment --- sql/unireg.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/unireg.cc b/sql/unireg.cc index 7f170b3ef87..c0d57dc144a 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -211,7 +211,7 @@ err3: Create a frm (table definition) file and the tables SYNOPSIS - mysql_create_frm() + rea_create_table() thd Thread handler file_name Name of file (including database and .frm) create_info create info parameters From 983a836f74a3b439a8e90b6e3aaee5a454842396 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 16:17:05 +0500 Subject: [PATCH 050/144] Fix for bug#12127 triggers do not show in info_schema before they are used if set to the database(2nd version) use db name of table which trigger belongs to instead of thd->db name during trigger body parsing --- mysql-test/r/information_schema.result | 9 +++++++++ mysql-test/t/information_schema.test | 11 +++++++++++ sql/sql_trigger.cc | 9 +++++++++ 3 files changed, 29 insertions(+) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 89b3df0a83b..5c95d7b39d8 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -940,3 +940,12 @@ f5 19 NULL f6 1 NULL f7 64 NULL drop table t1; +create table t1 (f1 integer); +create trigger tr1 after insert on t1 for each row set @test_var=42; +use information_schema; +select trigger_schema, trigger_name from triggers where +trigger_name='tr1'; +trigger_schema trigger_name +test tr1 +use test; +drop table t1; diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index f13a29f07ad..a8fc75f8aa4 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -622,3 +622,14 @@ select column_name, NUMERIC_PRECISION, NUMERIC_SCALE from information_schema.columns where table_name='t1'; drop table t1; + +# +# Bug #12127 triggers do not show in info_schema before they are used if set to the database +# +create table t1 (f1 integer); +create trigger tr1 after insert on t1 for each row set @test_var=42; +use information_schema; +select trigger_schema, trigger_name from triggers where +trigger_name='tr1'; +use test; +drop table t1; diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index a7aee95197e..a69ae8064c7 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -520,6 +520,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, char path_buff[FN_REFLEN]; LEX_STRING path; File_parser *parser; + LEX_STRING save_db; DBUG_ENTER("Table_triggers_list::check_n_load"); @@ -581,6 +582,10 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, thd->lex= &lex; + save_db.str= thd->db; + save_db.length= thd->db_length; + thd->db_length= strlen(db); + thd->db= (char *) db; while ((trg_create_str= it++)) { lex_start(thd, (uchar*)trg_create_str->str, trg_create_str->length); @@ -623,6 +628,8 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, lex_end(&lex); } + thd->db= save_db.str; + thd->db_length= save_db.length; thd->lex= old_lex; DBUG_RETURN(0); @@ -631,6 +638,8 @@ err_with_lex_cleanup: // QQ: anything else ? lex_end(&lex); thd->lex= old_lex; + thd->db= save_db.str; + thd->db_length= save_db.length; DBUG_RETURN(1); } From 73ec339dbdb0134d687bedc2123e9b2ed2dc9573 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 17:34:20 +0500 Subject: [PATCH 051/144] Fix for bug #12177 (error file isn't closed) libmysqld/lib_sql.cc: now errorlog is closed during mysql_server_end --- libmysqld/lib_sql.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 0ec7d161f24..4b05dd70e35 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -320,7 +320,8 @@ extern "C" static my_bool org_my_init_done; my_bool server_inited; -char ** copy_arguments_ptr= 0; +char ** copy_arguments_ptr= 0; +static FILE *errorlog_file=0; int STDCALL mysql_server_init(int argc, char **argv, char **groups) { @@ -421,7 +422,7 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups) opt_error_log= 1; // Too long file name else { - freopen(log_error_file, "a+", stderr); + errorlog_file= freopen(log_error_file, "a+", stderr); } } @@ -626,6 +627,8 @@ void STDCALL mysql_server_end() my_free((char*) copy_arguments_ptr, MYF(MY_ALLOW_ZERO_PTR)); copy_arguments_ptr=0; clean_up(0); + if (errorlog_file) + fclose(errorlog_file); /* If library called my_init(), free memory allocated by it */ if (!org_my_init_done) my_end(0); From 62f8a31b215072b09bc25395fa1781afe5542386 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 14:55:08 +0200 Subject: [PATCH 052/144] - applied a security fix to inftrees.h from the bundled zlib to resolve a second potential zlib security vulnerability (CAN-2005-1849). Fix was taken from the official zlib-1.2.3 distribution (no other zlib-1.2.3 changes were applied) zlib/inftrees.h: - applied another security fix to resolve CAN-2005-1849, taken from the 1.2.3 zlib sources --- zlib/inftrees.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zlib/inftrees.h b/zlib/inftrees.h index 82d365a7e90..b1104c87e76 100644 --- a/zlib/inftrees.h +++ b/zlib/inftrees.h @@ -1,5 +1,5 @@ /* inftrees.h -- header to use inftrees.c - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -36,12 +36,12 @@ typedef struct { */ /* Maximum size of dynamic tree. The maximum found in a long but non- - exhaustive search was 1004 code structures (850 for length/literals - and 154 for distances, the latter actually the result of an + exhaustive search was 1444 code structures (852 for length/literals + and 592 for distances, the latter actually the result of an exhaustive search). The true maximum is not known, but the value below is more than safe. */ -#define ENOUGH 1440 -#define MAXD 154 +#define ENOUGH 2048 +#define MAXD 592 /* Type of code to build for inftable() */ typedef enum { From 153353fd29d94e2c466fea54643323c2c25d049b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 19:39:59 +0500 Subject: [PATCH 053/144] addition to the fix for bug #12177(error log file isn't closed) libmysqld/lib_sql.cc: we should set errorlog_file=0 to make consequent mysql_server_init work properly --- libmysqld/lib_sql.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 4b05dd70e35..b71b442b4ca 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -628,7 +628,10 @@ void STDCALL mysql_server_end() copy_arguments_ptr=0; clean_up(0); if (errorlog_file) + { fclose(errorlog_file); + errorlog_file=0; + } /* If library called my_init(), free memory allocated by it */ if (!org_my_init_done) my_end(0); From 7b88672dce715ccc023be3cbb68905d5c0fd4d53 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 16:42:13 +0200 Subject: [PATCH 054/144] - build the RPM binaries against the bundled zlib, when static linking is requested support-files/mysql.spec.sh: - build against the bundled zlib, when linking statically --- support-files/mysql.spec.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 7dc04c39225..e4cd3027b8a 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -348,6 +348,7 @@ BuildMySQL "--disable-shared \ %if %{STATIC_BUILD} --with-mysqld-ldflags='-all-static' \ --with-client-ldflags='-all-static' \ + --with-zlib-dir=bundled \ $USE_OTHER_LIBC_DIR \ %endif --with-comment=\"MySQL Community Edition - Standard (GPL)\" \ From b863330d43334f70bfd2720a0e7b09d584d09994 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 21:54:02 +0500 Subject: [PATCH 055/144] Fix for bug #11083 (myisam test fails witout-geometry) mysql-test/r/myisam.result: test result fixed mysql-test/t/myisam.test: we can get two kings of errors here --- mysql-test/r/myisam.result | 2 +- mysql-test/t/myisam.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 4def82e5752..38273c01a98 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -499,7 +499,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct drop table t1,t2; CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM; -ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX' +Got one of the listed errors create table t1 (a int, b varchar(200), c text not null) checksum=1; create table t2 (a int, b varchar(200), c text not null) checksum=0; insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 7d7985fd8ac..928ed194ebd 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -476,7 +476,7 @@ drop table t1,t2; # # Test RTREE index # ---error 1235 +--error 1235, 1289 CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM; # INSERT INTO t1 VALUES (1,1),(1,1); # DELETE FROM rt WHERE a<1; From e0b13405f6a3ac6ceee3518d50f964cb9542feb4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 22:58:55 +0300 Subject: [PATCH 056/144] We have also to test 'conds' even if there was no tables. (This is because conds may not be a constant) This bug caused a failure in the test suite for select.test becasue for prepared statements in one case a 'constant sub query' was not regarded as a constant Sanja will as a separate task check if we can fix that the sub query can be recognized as a constant Bug #12217 sql/sql_select.cc: We have also to test 'conds' even if there was no tables. (This is because conds may not be a constant) This bug caused a failure in the test suite for select.test becasue for prepared statements in one case a 'constant sub query' was not regarded as a constant Sanja will as a separate task check if we can fix that the sub query can be recognized as a constant --- sql/sql_select.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 29560e8701b..d3e8b3ab9e7 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1072,7 +1072,14 @@ JOIN::exec() else { result->send_fields(fields_list,1); - if (cond_value != Item::COND_FALSE && (!having || having->val_int())) + /* + We have to test for 'conds' here as the WHERE may not be constant + even if we don't have any tables for prepared statements or if + conds uses something like 'rand()'. + */ + if (cond_value != Item::COND_FALSE && + (!conds || conds->val_int()) && + (!having || having->val_int())) { if (do_send_rows && (procedure ? (procedure->send_row(fields_list) || procedure->end_of_records()) From 9bbcede4fa03cac77ab97fb1c9ac1048b354eaf8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jul 2005 18:13:48 -0400 Subject: [PATCH 057/144] Missing initialisation of table->s->db in lock_table_name Bug #12112 --- sql/lock.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/lock.cc b/sql/lock.cc index 376a582ae32..889761369b6 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -601,6 +601,7 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list) DBUG_RETURN(-1); table->s= &table->share_not_to_be_used; memcpy((table->s->table_cache_key= (char*) (table+1)), key, key_length); + table->s->db= table->s->table_cache_key; table->s->key_length=key_length; table->in_use=thd; table->locked_by_name=1; From 167fb5f17025966046b2459531b27462b5c77c9a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 03:22:47 +0300 Subject: [PATCH 058/144] Added end marker for tests to make future merges easier mysql-test/t/alias.test: Added end marker for test to make future merges easier mysql-test/t/alter_table.test: Added end marker for test to make future merges easier mysql-test/t/analyse.test: Added end marker for test to make future merges easier mysql-test/t/analyze.test: Added end marker for test to make future merges easier Fixed length of comment lines mysql-test/t/ansi.test: Added end marker for test to make future merges easier mysql-test/t/archive.test: Added end marker for test to make future merges easier mysql-test/t/auto_increment.test: Added end marker for test to make future merges easier mysql-test/t/backup.test: Added end marker for test to make future merges easier mysql-test/t/bdb-alter-table-1.test: Added end marker for test to make future merges easier mysql-test/t/bdb-alter-table-2.test: Added end marker for test to make future merges easier mysql-test/t/bdb-crash.test: Added end marker for test to make future merges easier mysql-test/t/bdb-deadlock.test: Added end marker for test to make future merges easier mysql-test/t/bdb-deadlock.tminus: Added end marker for test to make future merges easier mysql-test/t/bdb.test: Added end marker for test to make future merges easier mysql-test/t/bdb_cache.test: Added end marker for test to make future merges easier mysql-test/t/bench_count_distinct.test: Added end marker for test to make future merges easier mysql-test/t/bigint.test: Added end marker for test to make future merges easier mysql-test/t/binary.test: Added end marker for test to make future merges easier mysql-test/t/blackhole.test: Added end marker for test to make future merges easier mysql-test/t/bool.test: Added end marker for test to make future merges easier mysql-test/t/bulk_replace.test: Added end marker for test to make future merges easier mysql-test/t/case.test: Added end marker for test to make future merges easier mysql-test/t/cast.test: Added end marker for test to make future merges easier mysql-test/t/check.test: Added end marker for test to make future merges easier mysql-test/t/comments.test: Added end marker for test to make future merges easier mysql-test/t/compare.test: Added end marker for test to make future merges easier mysql-test/t/connect.test: Added end marker for test to make future merges easier mysql-test/t/consistent_snapshot.test: Added end marker for test to make future merges easier mysql-test/t/constraints.test: Added end marker for test to make future merges easier mysql-test/t/count_distinct.test: Added end marker for test to make future merges easier mysql-test/t/count_distinct2.test: Added end marker for test to make future merges easier mysql-test/t/count_distinct3.test: Added end marker for test to make future merges easier mysql-test/t/create.test: Added end marker for test to make future merges easier mysql-test/t/create_select_tmp.test: Added end marker for test to make future merges easier mysql-test/t/csv.test: Added end marker for test to make future merges easier mysql-test/t/ctype_big5.test: Added end marker for test to make future merges easier mysql-test/t/ctype_collate.test: Added end marker for test to make future merges easier mysql-test/t/ctype_cp1250_ch.test: Added end marker for test to make future merges easier mysql-test/t/ctype_cp1251.test: Added end marker for test to make future merges easier mysql-test/t/ctype_cp932.test: Added end marker for test to make future merges easier mysql-test/t/ctype_create.test: Added end marker for test to make future merges easier mysql-test/t/ctype_gbk.test: Added end marker for test to make future merges easier mysql-test/t/ctype_latin1.test: Added end marker for test to make future merges easier mysql-test/t/ctype_latin1_de.test: Added end marker for test to make future merges easier mysql-test/t/ctype_latin2.test: Added end marker for test to make future merges easier mysql-test/t/ctype_many.test: Added end marker for test to make future merges easier mysql-test/t/ctype_mb.test: Added end marker for test to make future merges easier mysql-test/t/ctype_recoding.test: Added end marker for test to make future merges easier mysql-test/t/ctype_sjis.test: Added end marker for test to make future merges easier mysql-test/t/ctype_tis620.test: Added end marker for test to make future merges easier mysql-test/t/ctype_uca.test: Added end marker for test to make future merges easier mysql-test/t/ctype_ucs.test: Added end marker for test to make future merges easier mysql-test/t/ctype_ucs_binlog.test: Added end marker for test to make future merges easier mysql-test/t/ctype_ujis.test: Added end marker for test to make future merges easier mysql-test/t/ctype_utf8.test: Added end marker for test to make future merges easier mysql-test/t/date_formats.test: Added end marker for test to make future merges easier mysql-test/t/delayed.test: Added end marker for test to make future merges easier mysql-test/t/delete.test: Added end marker for test to make future merges easier mysql-test/t/derived.test: Added end marker for test to make future merges easier mysql-test/t/dirty_close.test: Added end marker for test to make future merges easier mysql-test/t/distinct.test: Added end marker for test to make future merges easier mysql-test/t/drop.test: Added end marker for test to make future merges easier mysql-test/t/drop_temp_table.test: Added end marker for test to make future merges easier mysql-test/t/empty_table.test: Added end marker for test to make future merges easier mysql-test/t/endspace.test: Added end marker for test to make future merges easier mysql-test/t/errors.test: Added end marker for test to make future merges easier mysql-test/t/exampledb.test: Added end marker for test to make future merges easier mysql-test/t/explain.test: Added end marker for test to make future merges easier mysql-test/t/flush.test: Added end marker for test to make future merges easier mysql-test/t/flush_block_commit.test: Added end marker for test to make future merges easier mysql-test/t/flush_table.test: Added end marker for test to make future merges easier mysql-test/t/foreign_key.test: Added end marker for test to make future merges easier mysql-test/t/fulltext.test: Added end marker for test to make future merges easier mysql-test/t/fulltext2.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_cache.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_distinct.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_left_join.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_multi.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_order_by.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_update.test: Added end marker for test to make future merges easier mysql-test/t/fulltext_var.test: Added end marker for test to make future merges easier mysql-test/t/func_compress.test: Added end marker for test to make future merges easier mysql-test/t/func_concat.test: Added end marker for test to make future merges easier mysql-test/t/func_crypt.test: Added end marker for test to make future merges easier mysql-test/t/func_date_add.test: Added end marker for test to make future merges easier mysql-test/t/func_default.test: Added end marker for test to make future merges easier mysql-test/t/func_des_encrypt.test: Added end marker for test to make future merges easier mysql-test/t/func_encrypt.test: Added end marker for test to make future merges easier mysql-test/t/func_encrypt_nossl.test: Added end marker for test to make future merges easier mysql-test/t/func_equal.test: Added end marker for test to make future merges easier mysql-test/t/func_gconcat.test: Added end marker for test to make future merges easier mysql-test/t/func_group.test: Added end marker for test to make future merges easier mysql-test/t/func_if.test: Added end marker for test to make future merges easier mysql-test/t/func_in.test: Added end marker for test to make future merges easier mysql-test/t/func_isnull.test: Added end marker for test to make future merges easier mysql-test/t/func_like.test: Added end marker for test to make future merges easier mysql-test/t/func_math.test: Added end marker for test to make future merges easier mysql-test/t/func_misc.test: Added end marker for test to make future merges easier mysql-test/t/func_op.test: Added end marker for test to make future merges easier mysql-test/t/func_regexp.test: Added end marker for test to make future merges easier mysql-test/t/func_sapdb.test: Added end marker for test to make future merges easier mysql-test/t/func_set.test: Added end marker for test to make future merges easier mysql-test/t/func_str.test: Added end marker for test to make future merges easier mysql-test/t/func_system.test: Added end marker for test to make future merges easier mysql-test/t/func_test.test: Added end marker for test to make future merges easier mysql-test/t/func_time.test: Added end marker for test to make future merges easier mysql-test/t/func_timestamp.test: Added end marker for test to make future merges easier mysql-test/t/gcc296.test: Added end marker for test to make future merges easier mysql-test/t/gis-rtree.test: Added end marker for test to make future merges easier mysql-test/t/gis.test: Added end marker for test to make future merges easier mysql-test/t/grant.test: Added end marker for test to make future merges easier mysql-test/t/grant2.test: Added end marker for test to make future merges easier mysql-test/t/grant_cache.test: Added end marker for test to make future merges easier mysql-test/t/group_by.test: Added end marker for test to make future merges easier mysql-test/t/handler.test: Added end marker for test to make future merges easier mysql-test/t/having.test: Added end marker for test to make future merges easier mysql-test/t/heap.test: Added end marker for test to make future merges easier mysql-test/t/heap_auto_increment.test: Added end marker for test to make future merges easier mysql-test/t/heap_btree.test: Added end marker for test to make future merges easier mysql-test/t/heap_hash.test: Added end marker for test to make future merges easier mysql-test/t/help.test: Added end marker for test to make future merges easier mysql-test/t/init_connect.test: Added end marker for test to make future merges easier mysql-test/t/init_file.test: Added end marker for test to make future merges easier mysql-test/t/innodb-deadlock.test: Added end marker for test to make future merges easier mysql-test/t/innodb-lock.test: Added end marker for test to make future merges easier mysql-test/t/innodb-replace.test: Added end marker for test to make future merges easier mysql-test/t/innodb.test: Added end marker for test to make future merges easier mysql-test/t/innodb_cache.test: Added end marker for test to make future merges easier mysql-test/t/innodb_handler.test: Added end marker for test to make future merges easier mysql-test/t/insert.test: Added end marker for test to make future merges easier mysql-test/t/insert_select-binlog.test: Added end marker for test to make future merges easier mysql-test/t/insert_select.test: Added end marker for test to make future merges easier mysql-test/t/insert_update.test: Added end marker for test to make future merges easier mysql-test/t/isam.test: Added end marker for test to make future merges easier mysql-test/t/join.test: Added end marker for test to make future merges easier mysql-test/t/join_crash.test: Added end marker for test to make future merges easier mysql-test/t/join_outer.test: Added end marker for test to make future merges easier mysql-test/t/key.test: Added end marker for test to make future merges easier mysql-test/t/key_cache.test: Added end marker for test to make future merges easier mysql-test/t/key_diff.test: Added end marker for test to make future merges easier mysql-test/t/key_primary.test: Added end marker for test to make future merges easier mysql-test/t/keywords.test: Added end marker for test to make future merges easier mysql-test/t/kill.test: Added end marker for test to make future merges easier mysql-test/t/limit.test: Added end marker for test to make future merges easier mysql-test/t/loaddata.test: Added end marker for test to make future merges easier mysql-test/t/lock.test: Added end marker for test to make future merges easier mysql-test/t/lock_multi.test: Added end marker for test to make future merges easier mysql-test/t/lock_tables_lost_commit.test: Added end marker for test to make future merges easier mysql-test/t/lowercase_table.test: Added end marker for test to make future merges easier mysql-test/t/lowercase_table2.test: Added end marker for test to make future merges easier mysql-test/t/lowercase_table3.test: Added end marker for test to make future merges easier mysql-test/t/lowercase_table_grant.test: Added end marker for test to make future merges easier mysql-test/t/lowercase_table_qcache.test: Added end marker for test to make future merges easier mysql-test/t/merge.test: Added end marker for test to make future merges easier mysql-test/t/metadata.test: Added end marker for test to make future merges easier mysql-test/t/mix_innodb_myisam_binlog.test: Added end marker for test to make future merges easier mysql-test/t/multi_statement.test: Added end marker for test to make future merges easier mysql-test/t/multi_update.test: Added end marker for test to make future merges easier mysql-test/t/myisam-blob.test: Added end marker for test to make future merges easier mysql-test/t/myisam.test: Added end marker for test to make future merges easier mysql-test/t/mysql_client_test.test: Added end marker for test to make future merges easier mysql-test/t/mysql_protocols.test: Added end marker for test to make future merges easier mysql-test/t/mysqlbinlog.test: Added end marker for test to make future merges easier mysql-test/t/mysqlbinlog2.test: Added end marker for test to make future merges easier mysql-test/t/mysqldump.test: Added end marker for test to make future merges easier mysql-test/t/mysqltest.test: Added end marker for test to make future merges easier mysql-test/t/ndb_alter_table.test: Added end marker for test to make future merges easier mysql-test/t/ndb_autodiscover.test: Added end marker for test to make future merges easier mysql-test/t/ndb_autodiscover2.test: Added end marker for test to make future merges easier mysql-test/t/ndb_basic.test: Added end marker for test to make future merges easier mysql-test/t/ndb_blob.test: Added end marker for test to make future merges easier mysql-test/t/ndb_cache.test: Added end marker for test to make future merges easier mysql-test/t/ndb_charset.test: Added end marker for test to make future merges easier mysql-test/t/ndb_config.test: Added end marker for test to make future merges easier mysql-test/t/ndb_database.test: Added end marker for test to make future merges easier mysql-test/t/ndb_grant.later: Added end marker for test to make future merges easier mysql-test/t/ndb_index.test: Added end marker for test to make future merges easier mysql-test/t/ndb_index_ordered.test: Added end marker for test to make future merges easier mysql-test/t/ndb_index_unique.test: Added end marker for test to make future merges easier mysql-test/t/ndb_insert.test: Added end marker for test to make future merges easier mysql-test/t/ndb_limit.test: Added end marker for test to make future merges easier mysql-test/t/ndb_lock.test: Added end marker for test to make future merges easier mysql-test/t/ndb_minmax.test: Added end marker for test to make future merges easier mysql-test/t/ndb_multi.test: Added end marker for test to make future merges easier mysql-test/t/ndb_replace.test: Added end marker for test to make future merges easier mysql-test/t/ndb_restore.test: Added end marker for test to make future merges easier mysql-test/t/ndb_subquery.test: Added end marker for test to make future merges easier mysql-test/t/ndb_transaction.test: Added end marker for test to make future merges easier mysql-test/t/ndb_truncate.test: Added end marker for test to make future merges easier mysql-test/t/ndb_types.test: Added end marker for test to make future merges easier mysql-test/t/ndb_update.test: Added end marker for test to make future merges easier mysql-test/t/negation_elimination.test: Added end marker for test to make future merges easier mysql-test/t/not_embedded_server.test: Added end marker for test to make future merges easier mysql-test/t/null.test: Added end marker for test to make future merges easier mysql-test/t/null_key.test: Added end marker for test to make future merges easier mysql-test/t/odbc.test: Added end marker for test to make future merges easier mysql-test/t/olap.test: Added end marker for test to make future merges easier mysql-test/t/openssl_1.test: Added end marker for test to make future merges easier mysql-test/t/order_by.test: Added end marker for test to make future merges easier mysql-test/t/order_fill_sortbuf.test: Added end marker for test to make future merges easier mysql-test/t/outfile.test: Added end marker for test to make future merges easier mysql-test/t/overflow.test: Added end marker for test to make future merges easier mysql-test/t/packet.test: Added end marker for test to make future merges easier mysql-test/t/preload.test: Added end marker for test to make future merges easier mysql-test/t/ps.test: Added end marker for test to make future merges easier mysql-test/t/ps_10nestset.test: Added end marker for test to make future merges easier mysql-test/t/ps_11bugs.test: Added end marker for test to make future merges easier mysql-test/t/ps_1general.test: Added end marker for test to make future merges easier mysql-test/t/ps_2myisam.test: Added end marker for test to make future merges easier mysql-test/t/ps_3innodb.test: Added end marker for test to make future merges easier mysql-test/t/ps_4heap.test: Added end marker for test to make future merges easier mysql-test/t/ps_5merge.test: Added end marker for test to make future merges easier mysql-test/t/ps_6bdb.test: Added end marker for test to make future merges easier mysql-test/t/ps_7ndb.test: Added end marker for test to make future merges easier mysql-test/t/ps_grant.test: Added end marker for test to make future merges easier mysql-test/t/query_cache.test: Added end marker for test to make future merges easier mysql-test/t/query_cache_merge.test: Added end marker for test to make future merges easier mysql-test/t/raid.test: Added end marker for test to make future merges easier mysql-test/t/range.test: Added end marker for test to make future merges easier mysql-test/t/rename.test: Added end marker for test to make future merges easier mysql-test/t/repair.test: Added end marker for test to make future merges easier mysql-test/t/replace.test: Added end marker for test to make future merges easier mysql-test/t/rollback.test: Added end marker for test to make future merges easier mysql-test/t/row.test: Added end marker for test to make future merges easier mysql-test/t/rpl000001.test: Added end marker for test to make future merges easier mysql-test/t/rpl000002.test: Added end marker for test to make future merges easier mysql-test/t/rpl000004.test: Added end marker for test to make future merges easier mysql-test/t/rpl000005.test: Added end marker for test to make future merges easier mysql-test/t/rpl000006.test: Added end marker for test to make future merges easier mysql-test/t/rpl000008.test: Added end marker for test to make future merges easier mysql-test/t/rpl000009.test: Added end marker for test to make future merges easier mysql-test/t/rpl000010.test: Added end marker for test to make future merges easier mysql-test/t/rpl000011.test: Added end marker for test to make future merges easier mysql-test/t/rpl000012.test: Added end marker for test to make future merges easier mysql-test/t/rpl000013.test: Added end marker for test to make future merges easier mysql-test/t/rpl000015.test: Added end marker for test to make future merges easier mysql-test/t/rpl000017.test: Added end marker for test to make future merges easier mysql-test/t/rpl000018.test: Added end marker for test to make future merges easier mysql-test/t/rpl_EE_error.test: Added end marker for test to make future merges easier mysql-test/t/rpl_alter.test: Added end marker for test to make future merges easier mysql-test/t/rpl_chain_temp_table.test: Added end marker for test to make future merges easier mysql-test/t/rpl_change_master.test: Added end marker for test to make future merges easier mysql-test/t/rpl_charset.test: Added end marker for test to make future merges easier mysql-test/t/rpl_commit_after_flush.test: Added end marker for test to make future merges easier mysql-test/t/rpl_create_database.test: Added end marker for test to make future merges easier mysql-test/t/rpl_ddl.test: Added end marker for test to make future merges easier mysql-test/t/rpl_deadlock.test: Added end marker for test to make future merges easier mysql-test/t/rpl_delete_all.test: Added end marker for test to make future merges easier mysql-test/t/rpl_do_grant.test: Added end marker for test to make future merges easier mysql-test/t/rpl_drop.test: Added end marker for test to make future merges easier mysql-test/t/rpl_drop_temp.test: Added end marker for test to make future merges easier mysql-test/t/rpl_empty_master_crash.test: Added end marker for test to make future merges easier mysql-test/t/rpl_error_ignored_table.test: Added end marker for test to make future merges easier mysql-test/t/rpl_failed_optimize.test: Added end marker for test to make future merges easier mysql-test/t/rpl_failsafe.test: Added end marker for test to make future merges easier mysql-test/t/rpl_flush_log_loop.test: Added end marker for test to make future merges easier mysql-test/t/rpl_flush_tables.test: Added end marker for test to make future merges easier mysql-test/t/rpl_free_items.test: Added end marker for test to make future merges easier mysql-test/t/rpl_get_lock.test: Added end marker for test to make future merges easier mysql-test/t/rpl_heap.test: Added end marker for test to make future merges easier mysql-test/t/rpl_ignore_grant.test: Added end marker for test to make future merges easier mysql-test/t/rpl_init_slave.test: Added end marker for test to make future merges easier mysql-test/t/rpl_innodb.test: Added end marker for test to make future merges easier mysql-test/t/rpl_insert_id.test: Added end marker for test to make future merges easier mysql-test/t/rpl_insert_ignore.test: Added end marker for test to make future merges easier mysql-test/t/rpl_loaddata.test: Added end marker for test to make future merges easier mysql-test/t/rpl_loaddata_rule_m.test: Added end marker for test to make future merges easier mysql-test/t/rpl_loaddata_rule_s.test: Added end marker for test to make future merges easier mysql-test/t/rpl_loaddatalocal.test: Added end marker for test to make future merges easier mysql-test/t/rpl_log.test: Added end marker for test to make future merges easier mysql-test/t/rpl_log_pos.test: Added end marker for test to make future merges easier mysql-test/t/rpl_many_optimize.test: Added end marker for test to make future merges easier mysql-test/t/rpl_master_pos_wait.test: Added end marker for test to make future merges easier mysql-test/t/rpl_max_relay_size.test: Added end marker for test to make future merges easier mysql-test/t/rpl_misc_functions.test: Added end marker for test to make future merges easier mysql-test/t/rpl_multi_delete.test: Added end marker for test to make future merges easier mysql-test/t/rpl_multi_delete2.test: Added end marker for test to make future merges easier mysql-test/t/rpl_multi_query.test: Added end marker for test to make future merges easier mysql-test/t/rpl_multi_update.test: Added end marker for test to make future merges easier mysql-test/t/rpl_multi_update2.test: Added end marker for test to make future merges easier mysql-test/t/rpl_multi_update3.test: Added end marker for test to make future merges easier mysql-test/t/rpl_mystery22.test: Added end marker for test to make future merges easier mysql-test/t/rpl_openssl.test: Added end marker for test to make future merges easier mysql-test/t/rpl_optimize.test: Added end marker for test to make future merges easier mysql-test/t/rpl_ps.test: Added end marker for test to make future merges easier mysql-test/t/rpl_redirect.test: Added end marker for test to make future merges easier mysql-test/t/rpl_relayrotate.test: Added end marker for test to make future merges easier mysql-test/t/rpl_relayspace.test: Added end marker for test to make future merges easier mysql-test/t/rpl_replicate_do.test: Added end marker for test to make future merges easier mysql-test/t/rpl_reset_slave.test: Added end marker for test to make future merges easier mysql-test/t/rpl_rewrite_db.test: Added end marker for test to make future merges easier mysql-test/t/rpl_rotate_logs.test: Added end marker for test to make future merges easier mysql-test/t/rpl_server_id1.test: Added end marker for test to make future merges easier mysql-test/t/rpl_server_id2.test: Added end marker for test to make future merges easier mysql-test/t/rpl_set_charset.test: Added end marker for test to make future merges easier mysql-test/t/rpl_skip_error.test: Added end marker for test to make future merges easier mysql-test/t/rpl_sporadic_master.test: Added end marker for test to make future merges easier mysql-test/t/rpl_start_stop_slave.test: Added end marker for test to make future merges easier mysql-test/t/rpl_temporary.test: Added end marker for test to make future merges easier mysql-test/t/rpl_timezone.test: Added end marker for test to make future merges easier mysql-test/t/rpl_trunc_binlog.test: Added end marker for test to make future merges easier mysql-test/t/rpl_until.test: Added end marker for test to make future merges easier mysql-test/t/rpl_user_variables.test: Added end marker for test to make future merges easier mysql-test/t/rpl_variables.test: Added end marker for test to make future merges easier mysql-test/t/select.test: Added end marker for test to make future merges easier mysql-test/t/select_found.test: Added end marker for test to make future merges easier mysql-test/t/select_safe.test: Added end marker for test to make future merges easier mysql-test/t/show_check.test: Added end marker for test to make future merges easier mysql-test/t/skip_name_resolve.test: Added end marker for test to make future merges easier mysql-test/t/sql_mode.test: Added end marker for test to make future merges easier mysql-test/t/status.test: Added end marker for test to make future merges easier mysql-test/t/subselect.test: Added end marker for test to make future merges easier mysql-test/t/subselect2.test: Added end marker for test to make future merges easier mysql-test/t/subselect_gis.test: Added end marker for test to make future merges easier mysql-test/t/subselect_innodb.test: Added end marker for test to make future merges easier mysql-test/t/symlink.test: Added end marker for test to make future merges easier mysql-test/t/synchronization.test: Added end marker for test to make future merges easier mysql-test/t/system_mysql_db.test: Added end marker for test to make future merges easier mysql-test/t/system_mysql_db_fix.test: Added end marker for test to make future merges easier mysql-test/t/system_mysql_db_refs.test: Added end marker for test to make future merges easier mysql-test/t/tablelock.test: Added end marker for test to make future merges easier mysql-test/t/temp_table.test: Added end marker for test to make future merges easier mysql-test/t/timezone.test: Added end marker for test to make future merges easier mysql-test/t/timezone2.test: Added end marker for test to make future merges easier mysql-test/t/timezone3.test: Added end marker for test to make future merges easier mysql-test/t/timezone_grant.test: Added end marker for test to make future merges easier mysql-test/t/truncate.test: Added end marker for test to make future merges easier mysql-test/t/type_blob.test: Added end marker for test to make future merges easier mysql-test/t/type_date.test: Added end marker for test to make future merges easier mysql-test/t/type_datetime.test: Added end marker for test to make future merges easier mysql-test/t/type_decimal.test: Added end marker for test to make future merges easier mysql-test/t/type_enum.test: Added end marker for test to make future merges easier mysql-test/t/type_float.test: Added end marker for test to make future merges easier mysql-test/t/type_nchar.test: Added end marker for test to make future merges easier mysql-test/t/type_ranges.test: Added end marker for test to make future merges easier mysql-test/t/type_set.test: Added end marker for test to make future merges easier mysql-test/t/type_time.test: Added end marker for test to make future merges easier mysql-test/t/type_timestamp.test: Added end marker for test to make future merges easier mysql-test/t/type_uint.test: Added end marker for test to make future merges easier mysql-test/t/type_year.test: Added end marker for test to make future merges easier mysql-test/t/union.test: Added end marker for test to make future merges easier mysql-test/t/update.test: Added end marker for test to make future merges easier mysql-test/t/user_var-binlog.test: Added end marker for test to make future merges easier mysql-test/t/user_var.test: Added end marker for test to make future merges easier mysql-test/t/varbinary.test: Added end marker for test to make future merges easier mysql-test/t/variables.test: Added end marker for test to make future merges easier mysql-test/t/warnings.test: Added end marker for test to make future merges easier --- mysql-test/t/alias.test | 2 ++ mysql-test/t/alter_table.test | 2 ++ mysql-test/t/analyse.test | 2 ++ mysql-test/t/analyze.test | 21 ++++++++++++--------- mysql-test/t/ansi.test | 2 ++ mysql-test/t/archive.test | 2 ++ mysql-test/t/auto_increment.test | 2 ++ mysql-test/t/backup.test | 2 ++ mysql-test/t/bdb-alter-table-1.test | 2 ++ mysql-test/t/bdb-alter-table-2.test | 2 ++ mysql-test/t/bdb-crash.test | 2 ++ mysql-test/t/bdb-deadlock.test | 2 ++ mysql-test/t/bdb-deadlock.tminus | 2 ++ mysql-test/t/bdb.test | 2 ++ mysql-test/t/bdb_cache.test | 2 ++ mysql-test/t/bench_count_distinct.test | 2 ++ mysql-test/t/bigint.test | 1 + mysql-test/t/binary.test | 2 ++ mysql-test/t/blackhole.test | 2 ++ mysql-test/t/bool.test | 2 ++ mysql-test/t/bulk_replace.test | 1 + mysql-test/t/case.test | 2 ++ mysql-test/t/cast.test | 2 ++ mysql-test/t/check.test | 1 + mysql-test/t/comments.test | 2 ++ mysql-test/t/compare.test | 2 ++ mysql-test/t/connect.test | 2 ++ mysql-test/t/consistent_snapshot.test | 2 ++ mysql-test/t/constraints.test | 2 ++ mysql-test/t/count_distinct.test | 1 + mysql-test/t/count_distinct2.test | 1 + mysql-test/t/count_distinct3.test | 2 ++ mysql-test/t/create.test | 2 ++ mysql-test/t/create_select_tmp.test | 2 ++ mysql-test/t/csv.test | 2 ++ mysql-test/t/ctype_big5.test | 2 ++ mysql-test/t/ctype_collate.test | 2 ++ mysql-test/t/ctype_cp1250_ch.test | 2 ++ mysql-test/t/ctype_cp1251.test | 2 ++ mysql-test/t/ctype_cp932.test | 2 ++ mysql-test/t/ctype_create.test | 2 ++ mysql-test/t/ctype_gbk.test | 2 ++ mysql-test/t/ctype_latin1.test | 2 ++ mysql-test/t/ctype_latin1_de.test | 2 ++ mysql-test/t/ctype_latin2.test | 2 ++ mysql-test/t/ctype_many.test | 2 ++ mysql-test/t/ctype_mb.test | 2 ++ mysql-test/t/ctype_recoding.test | 2 ++ mysql-test/t/ctype_sjis.test | 2 ++ mysql-test/t/ctype_tis620.test | 2 ++ mysql-test/t/ctype_uca.test | 2 ++ mysql-test/t/ctype_ucs.test | 2 ++ mysql-test/t/ctype_ucs_binlog.test | 2 +- mysql-test/t/ctype_ujis.test | 2 ++ mysql-test/t/ctype_utf8.test | 2 ++ mysql-test/t/date_formats.test | 2 ++ mysql-test/t/delayed.test | 2 ++ mysql-test/t/delete.test | 2 ++ mysql-test/t/derived.test | 2 ++ mysql-test/t/dirty_close.test | 2 ++ mysql-test/t/distinct.test | 2 ++ mysql-test/t/drop.test | 2 ++ mysql-test/t/drop_temp_table.test | 2 ++ mysql-test/t/empty_table.test | 2 ++ mysql-test/t/endspace.test | 2 ++ mysql-test/t/errors.test | 2 ++ mysql-test/t/exampledb.test | 2 ++ mysql-test/t/explain.test | 2 ++ mysql-test/t/flush.test | 2 ++ mysql-test/t/flush_block_commit.test | 2 ++ mysql-test/t/flush_table.test | 2 ++ mysql-test/t/foreign_key.test | 2 ++ mysql-test/t/fulltext.test | 2 ++ mysql-test/t/fulltext2.test | 1 + mysql-test/t/fulltext_cache.test | 2 ++ mysql-test/t/fulltext_distinct.test | 2 ++ mysql-test/t/fulltext_left_join.test | 1 + mysql-test/t/fulltext_multi.test | 2 ++ mysql-test/t/fulltext_order_by.test | 1 + mysql-test/t/fulltext_update.test | 2 ++ mysql-test/t/fulltext_var.test | 1 + mysql-test/t/func_compress.test | 1 + mysql-test/t/func_concat.test | 1 + mysql-test/t/func_crypt.test | 2 ++ mysql-test/t/func_date_add.test | 2 ++ mysql-test/t/func_default.test | 4 +++- mysql-test/t/func_des_encrypt.test | 2 ++ mysql-test/t/func_encrypt.test | 2 ++ mysql-test/t/func_encrypt_nossl.test | 1 + mysql-test/t/func_equal.test | 2 ++ mysql-test/t/func_gconcat.test | 2 ++ mysql-test/t/func_group.test | 2 ++ mysql-test/t/func_if.test | 2 ++ mysql-test/t/func_in.test | 2 ++ mysql-test/t/func_isnull.test | 2 ++ mysql-test/t/func_like.test | 1 + mysql-test/t/func_math.test | 2 ++ mysql-test/t/func_misc.test | 1 + mysql-test/t/func_op.test | 2 ++ mysql-test/t/func_regexp.test | 2 ++ mysql-test/t/func_sapdb.test | 2 ++ mysql-test/t/func_set.test | 1 + mysql-test/t/func_str.test | 2 ++ mysql-test/t/func_system.test | 2 ++ mysql-test/t/func_test.test | 2 ++ mysql-test/t/func_time.test | 2 ++ mysql-test/t/func_timestamp.test | 2 ++ mysql-test/t/gcc296.test | 2 ++ mysql-test/t/gis-rtree.test | 2 ++ mysql-test/t/gis.test | 2 ++ mysql-test/t/grant.test | 2 ++ mysql-test/t/grant2.test | 2 ++ mysql-test/t/grant_cache.test | 2 ++ mysql-test/t/group_by.test | 3 +-- mysql-test/t/handler.test | 2 ++ mysql-test/t/having.test | 2 ++ mysql-test/t/heap.test | 2 ++ mysql-test/t/heap_auto_increment.test | 2 ++ mysql-test/t/heap_btree.test | 2 ++ mysql-test/t/heap_hash.test | 2 ++ mysql-test/t/help.test | 2 ++ mysql-test/t/init_connect.test | 2 ++ mysql-test/t/init_file.test | 2 ++ mysql-test/t/innodb-deadlock.test | 2 ++ mysql-test/t/innodb-lock.test | 2 ++ mysql-test/t/innodb-replace.test | 1 + mysql-test/t/innodb.test | 2 ++ mysql-test/t/innodb_cache.test | 1 + mysql-test/t/innodb_handler.test | 1 + mysql-test/t/insert.test | 2 ++ mysql-test/t/insert_select-binlog.test | 1 + mysql-test/t/insert_select.test | 2 ++ mysql-test/t/insert_update.test | 2 ++ mysql-test/t/isam.test | 2 ++ mysql-test/t/join.test | 2 ++ mysql-test/t/join_crash.test | 2 ++ mysql-test/t/join_outer.test | 2 ++ mysql-test/t/key.test | 2 ++ mysql-test/t/key_cache.test | 2 ++ mysql-test/t/key_diff.test | 2 ++ mysql-test/t/key_primary.test | 2 ++ mysql-test/t/keywords.test | 2 ++ mysql-test/t/kill.test | 2 ++ mysql-test/t/limit.test | 2 ++ mysql-test/t/loaddata.test | 1 + mysql-test/t/lock.test | 2 ++ mysql-test/t/lock_multi.test | 2 ++ mysql-test/t/lock_tables_lost_commit.test | 2 ++ mysql-test/t/lowercase_table.test | 1 + mysql-test/t/lowercase_table2.test | 2 ++ mysql-test/t/lowercase_table3.test | 2 ++ mysql-test/t/lowercase_table_grant.test | 2 ++ mysql-test/t/lowercase_table_qcache.test | 2 ++ mysql-test/t/merge.test | 1 + mysql-test/t/metadata.test | 2 ++ mysql-test/t/mix_innodb_myisam_binlog.test | 2 ++ mysql-test/t/multi_statement.test | 2 ++ mysql-test/t/multi_update.test | 1 + mysql-test/t/myisam-blob.test | 2 ++ mysql-test/t/myisam.test | 1 + mysql-test/t/mysql_client_test.test | 2 ++ mysql-test/t/mysql_protocols.test | 1 + mysql-test/t/mysqlbinlog.test | 2 ++ mysql-test/t/mysqlbinlog2.test | 2 ++ mysql-test/t/mysqldump.test | 1 + mysql-test/t/mysqltest.test | 2 ++ mysql-test/t/ndb_alter_table.test | 2 ++ mysql-test/t/ndb_autodiscover.test | 2 ++ mysql-test/t/ndb_autodiscover2.test | 1 + mysql-test/t/ndb_basic.test | 2 ++ mysql-test/t/ndb_blob.test | 2 ++ mysql-test/t/ndb_cache.test | 2 ++ mysql-test/t/ndb_charset.test | 2 ++ mysql-test/t/ndb_config.test | 2 ++ mysql-test/t/ndb_database.test | 2 ++ mysql-test/t/ndb_grant.later | 2 ++ mysql-test/t/ndb_index.test | 3 ++- mysql-test/t/ndb_index_ordered.test | 2 ++ mysql-test/t/ndb_index_unique.test | 2 ++ mysql-test/t/ndb_insert.test | 2 ++ mysql-test/t/ndb_limit.test | 2 ++ mysql-test/t/ndb_lock.test | 1 + mysql-test/t/ndb_minmax.test | 4 +--- mysql-test/t/ndb_multi.test | 2 +- mysql-test/t/ndb_replace.test | 2 ++ mysql-test/t/ndb_restore.test | 2 ++ mysql-test/t/ndb_subquery.test | 2 ++ mysql-test/t/ndb_transaction.test | 2 +- mysql-test/t/ndb_truncate.test | 2 ++ mysql-test/t/ndb_types.test | 2 ++ mysql-test/t/ndb_update.test | 2 ++ mysql-test/t/negation_elimination.test | 2 ++ mysql-test/t/not_embedded_server.test | 2 ++ mysql-test/t/null.test | 2 ++ mysql-test/t/null_key.test | 2 ++ mysql-test/t/odbc.test | 2 ++ mysql-test/t/olap.test | 2 ++ mysql-test/t/openssl_1.test | 2 ++ mysql-test/t/order_by.test | 2 ++ mysql-test/t/order_fill_sortbuf.test | 2 ++ mysql-test/t/outfile.test | 2 ++ mysql-test/t/overflow.test | 2 ++ mysql-test/t/packet.test | 2 ++ mysql-test/t/preload.test | 2 ++ mysql-test/t/ps.test | 2 ++ mysql-test/t/ps_10nestset.test | 2 ++ mysql-test/t/ps_11bugs.test | 1 + mysql-test/t/ps_1general.test | 2 ++ mysql-test/t/ps_2myisam.test | 2 ++ mysql-test/t/ps_3innodb.test | 2 ++ mysql-test/t/ps_4heap.test | 2 ++ mysql-test/t/ps_5merge.test | 2 ++ mysql-test/t/ps_6bdb.test | 2 ++ mysql-test/t/ps_7ndb.test | 2 ++ mysql-test/t/ps_grant.test | 2 ++ mysql-test/t/query_cache.test | 2 ++ mysql-test/t/query_cache_merge.test | 2 ++ mysql-test/t/raid.test | 2 ++ mysql-test/t/range.test | 1 + mysql-test/t/rename.test | 2 ++ mysql-test/t/repair.test | 2 ++ mysql-test/t/replace.test | 2 ++ mysql-test/t/rollback.test | 2 ++ mysql-test/t/row.test | 2 ++ mysql-test/t/rpl000001.test | 2 ++ mysql-test/t/rpl000002.test | 2 ++ mysql-test/t/rpl000004.test | 2 ++ mysql-test/t/rpl000005.test | 2 ++ mysql-test/t/rpl000006.test | 2 ++ mysql-test/t/rpl000008.test | 2 ++ mysql-test/t/rpl000009.test | 2 ++ mysql-test/t/rpl000010.test | 1 + mysql-test/t/rpl000011.test | 2 ++ mysql-test/t/rpl000012.test | 2 ++ mysql-test/t/rpl000013.test | 2 ++ mysql-test/t/rpl000015.test | 2 ++ mysql-test/t/rpl000017.test | 2 ++ mysql-test/t/rpl000018.test | 2 ++ mysql-test/t/rpl_EE_error.test | 2 ++ mysql-test/t/rpl_alter.test | 2 ++ mysql-test/t/rpl_chain_temp_table.test | 2 ++ mysql-test/t/rpl_change_master.test | 2 ++ mysql-test/t/rpl_charset.test | 2 ++ mysql-test/t/rpl_commit_after_flush.test | 2 ++ mysql-test/t/rpl_create_database.test | 2 ++ mysql-test/t/rpl_ddl.test | 2 ++ mysql-test/t/rpl_deadlock.test | 2 ++ mysql-test/t/rpl_delete_all.test | 2 ++ mysql-test/t/rpl_do_grant.test | 2 ++ mysql-test/t/rpl_drop.test | 2 ++ mysql-test/t/rpl_drop_temp.test | 2 ++ mysql-test/t/rpl_empty_master_crash.test | 2 ++ mysql-test/t/rpl_error_ignored_table.test | 2 ++ mysql-test/t/rpl_failed_optimize.test | 2 ++ mysql-test/t/rpl_failsafe.test | 2 ++ mysql-test/t/rpl_flush_log_loop.test | 2 ++ mysql-test/t/rpl_flush_tables.test | 2 ++ mysql-test/t/rpl_free_items.test | 2 ++ mysql-test/t/rpl_get_lock.test | 2 ++ mysql-test/t/rpl_heap.test | 2 ++ mysql-test/t/rpl_ignore_grant.test | 2 ++ mysql-test/t/rpl_init_slave.test | 2 ++ mysql-test/t/rpl_innodb.test | 2 ++ mysql-test/t/rpl_insert_id.test | 4 +--- mysql-test/t/rpl_insert_ignore.test | 2 ++ mysql-test/t/rpl_loaddata.test | 2 ++ mysql-test/t/rpl_loaddata_rule_m.test | 2 ++ mysql-test/t/rpl_loaddata_rule_s.test | 2 ++ mysql-test/t/rpl_loaddatalocal.test | 2 ++ mysql-test/t/rpl_log.test | 2 ++ mysql-test/t/rpl_log_pos.test | 2 ++ mysql-test/t/rpl_many_optimize.test | 2 ++ mysql-test/t/rpl_master_pos_wait.test | 2 ++ mysql-test/t/rpl_max_relay_size.test | 2 ++ mysql-test/t/rpl_misc_functions.test | 2 ++ mysql-test/t/rpl_multi_delete.test | 2 ++ mysql-test/t/rpl_multi_delete2.test | 2 ++ mysql-test/t/rpl_multi_query.test | 2 ++ mysql-test/t/rpl_multi_update.test | 2 ++ mysql-test/t/rpl_multi_update2.test | 2 ++ mysql-test/t/rpl_multi_update3.test | 2 ++ mysql-test/t/rpl_mystery22.test | 1 + mysql-test/t/rpl_openssl.test | 2 ++ mysql-test/t/rpl_optimize.test | 2 ++ mysql-test/t/rpl_ps.test | 1 + mysql-test/t/rpl_redirect.test | 2 ++ mysql-test/t/rpl_relayrotate.test | 2 ++ mysql-test/t/rpl_relayspace.test | 2 ++ mysql-test/t/rpl_replicate_do.test | 1 + mysql-test/t/rpl_reset_slave.test | 2 ++ mysql-test/t/rpl_rewrite_db.test | 1 + mysql-test/t/rpl_rotate_logs.test | 2 ++ mysql-test/t/rpl_server_id1.test | 2 ++ mysql-test/t/rpl_server_id2.test | 2 ++ mysql-test/t/rpl_set_charset.test | 2 ++ mysql-test/t/rpl_skip_error.test | 2 ++ mysql-test/t/rpl_sporadic_master.test | 2 ++ mysql-test/t/rpl_start_stop_slave.test | 2 ++ mysql-test/t/rpl_temporary.test | 2 ++ mysql-test/t/rpl_timezone.test | 2 ++ mysql-test/t/rpl_trunc_binlog.test | 2 ++ mysql-test/t/rpl_until.test | 2 ++ mysql-test/t/rpl_user_variables.test | 2 ++ mysql-test/t/rpl_variables.test | 2 ++ mysql-test/t/select.test | 2 ++ mysql-test/t/select_found.test | 2 ++ mysql-test/t/select_safe.test | 2 ++ mysql-test/t/show_check.test | 2 ++ mysql-test/t/skip_name_resolve.test | 2 ++ mysql-test/t/sql_mode.test | 2 ++ mysql-test/t/status.test | 2 ++ mysql-test/t/subselect.test | 2 ++ mysql-test/t/subselect2.test | 3 ++- mysql-test/t/subselect_gis.test | 2 ++ mysql-test/t/subselect_innodb.test | 2 ++ mysql-test/t/symlink.test | 2 ++ mysql-test/t/synchronization.test | 2 ++ mysql-test/t/system_mysql_db.test | 2 ++ mysql-test/t/system_mysql_db_fix.test | 2 ++ mysql-test/t/system_mysql_db_refs.test | 2 ++ mysql-test/t/tablelock.test | 2 ++ mysql-test/t/temp_table.test | 2 ++ mysql-test/t/timezone.test | 2 ++ mysql-test/t/timezone2.test | 2 ++ mysql-test/t/timezone3.test | 2 ++ mysql-test/t/timezone_grant.test | 1 + mysql-test/t/truncate.test | 2 ++ mysql-test/t/type_blob.test | 2 +- mysql-test/t/type_date.test | 2 ++ mysql-test/t/type_datetime.test | 2 ++ mysql-test/t/type_decimal.test | 2 ++ mysql-test/t/type_enum.test | 2 ++ mysql-test/t/type_float.test | 2 ++ mysql-test/t/type_nchar.test | 1 + mysql-test/t/type_ranges.test | 2 ++ mysql-test/t/type_set.test | 2 ++ mysql-test/t/type_time.test | 2 ++ mysql-test/t/type_timestamp.test | 1 + mysql-test/t/type_uint.test | 2 ++ mysql-test/t/type_year.test | 2 ++ mysql-test/t/union.test | 2 ++ mysql-test/t/update.test | 2 ++ mysql-test/t/user_var-binlog.test | 2 ++ mysql-test/t/user_var.test | 2 ++ mysql-test/t/varbinary.test | 2 ++ mysql-test/t/variables.test | 2 ++ mysql-test/t/warnings.test | 2 ++ 347 files changed, 660 insertions(+), 24 deletions(-) diff --git a/mysql-test/t/alias.test b/mysql-test/t/alias.test index 986af339456..941bc8091fc 100644 --- a/mysql-test/t/alias.test +++ b/mysql-test/t/alias.test @@ -85,3 +85,5 @@ UPDATE t1 SET t1.xstatus_vor = Greatest(t1.xstatus_vor,1) WHERE t1.aufnr = ASC LIMIT 1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index c3ba2c8a7a4..a237b21f403 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -360,3 +360,5 @@ create table t1 ( a timestamp ); --error 1089 alter table t1 add unique ( a(1) ); drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test index 52e367769a2..e7fbf09c19a 100644 --- a/mysql-test/t/analyse.test +++ b/mysql-test/t/analyse.test @@ -47,3 +47,5 @@ create table t1 (v varchar(128)); insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); select * from t1 procedure analyse(); drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/analyze.test b/mysql-test/t/analyze.test index faf30279c68..3c3b3933bc3 100644 --- a/mysql-test/t/analyze.test +++ b/mysql-test/t/analyze.test @@ -1,16 +1,18 @@ # # Bug #10901 Analyze Table on new table destroys table # This is minimal test case to get error -# The problem was that analyze table wrote the shared state to the file and this -# didn't include the inserts while locked. A check was needed to ensure that -# state information was not updated when executing analyze table for a locked table. -# The analyze table had to be within locks and check table had to be after unlocking -# since then it brings the wrong state from disk rather than from the currently -# correct internal state. The insert is needed since it changes the file state, -# number of records. -# The fix is to synchronise the state of the shared state and the current state before -# calling mi_state_info_write +# The problem was that analyze table wrote the shared state to the +# file and this didn't include the inserts while locked. A check was +# needed to ensure that state information was not updated when +# executing analyze table for a locked table. The analyze table had +# to be within locks and check table had to be after unlocking since +# then it brings the wrong state from disk rather than from the +# currently correct internal state. The insert is needed since it +# changes the file state, number of records. The fix is to +# synchronise the state of the shared state and the current state +# before calling mi_state_info_write # + create table t1 (a bigint); lock tables t1 write; insert into t1 values(0); @@ -37,3 +39,4 @@ check table t1; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/ansi.test b/mysql-test/t/ansi.test index 9d235df5b46..444bf982b8a 100644 --- a/mysql-test/t/ansi.test +++ b/mysql-test/t/ansi.test @@ -25,3 +25,5 @@ SELECT id FROM t1 GROUP BY id2; drop table t1; SET @@SQL_MODE=""; + +# End of 4.1 tests diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index b9e392870dc..ca8a870dac0 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1311,3 +1311,5 @@ select * from t4 where fld3='bonfire'; select count(*) from t4; drop table t1, t2, t4; + +# End of 4.1 tests diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index ef344df5fb6..b6a0aeb9a19 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -218,3 +218,5 @@ CHECK TABLE t1; INSERT INTO t1 (b) VALUES ('bbbb'); CHECK TABLE t1; DROP TABLE IF EXISTS t1; + +# End of 4.1 tests diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index ed24161bef5..b6b3ef1c060 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -51,3 +51,5 @@ unlock tables; connection con1; reap; drop table t5; + +# End of 4.1 tests diff --git a/mysql-test/t/bdb-alter-table-1.test b/mysql-test/t/bdb-alter-table-1.test index 18b6c70758f..9cb469a8df6 100644 --- a/mysql-test/t/bdb-alter-table-1.test +++ b/mysql-test/t/bdb-alter-table-1.test @@ -14,3 +14,5 @@ select * from t1; alter table t1 drop column test; # Now we do a reboot and continue with the next test + +# End of 4.1 tests diff --git a/mysql-test/t/bdb-alter-table-2.test b/mysql-test/t/bdb-alter-table-2.test index a474efe42e1..15b8938a11d 100644 --- a/mysql-test/t/bdb-alter-table-2.test +++ b/mysql-test/t/bdb-alter-table-2.test @@ -6,3 +6,5 @@ -- source include/have_bdb.inc select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/bdb-crash.test b/mysql-test/t/bdb-crash.test index 3cd78821000..75f4d04d5df 100644 --- a/mysql-test/t/bdb-crash.test +++ b/mysql-test/t/bdb-crash.test @@ -47,3 +47,5 @@ set autocommit=0; insert into t1 values(1); analyze table t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/bdb-deadlock.test b/mysql-test/t/bdb-deadlock.test index 5e6ca666cc2..88243cfc860 100644 --- a/mysql-test/t/bdb-deadlock.test +++ b/mysql-test/t/bdb-deadlock.test @@ -55,3 +55,5 @@ select * from t2; commit; drop table t1,t2; + +# End of 4.1 tests diff --git a/mysql-test/t/bdb-deadlock.tminus b/mysql-test/t/bdb-deadlock.tminus index d86403fcffc..3918a8ffe9d 100644 --- a/mysql-test/t/bdb-deadlock.tminus +++ b/mysql-test/t/bdb-deadlock.tminus @@ -55,3 +55,5 @@ select * from t2; commit; drop table t1,t2; + +# End of 4.1 tests diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 069ec758ba2..6ceb0ea0789 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -929,3 +929,5 @@ SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb"); SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera"); SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd"); DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/bdb_cache.test b/mysql-test/t/bdb_cache.test index 401456711ac..85328920d71 100644 --- a/mysql-test/t/bdb_cache.test +++ b/mysql-test/t/bdb_cache.test @@ -49,3 +49,5 @@ show status like "Qcache_hits"; commit; show status like "Qcache_queries_in_cache"; drop table if exists t1, t2, t3; + +# End of 4.1 tests diff --git a/mysql-test/t/bench_count_distinct.test b/mysql-test/t/bench_count_distinct.test index 3ffb95a69c2..131208f1fa1 100644 --- a/mysql-test/t/bench_count_distinct.test +++ b/mysql-test/t/bench_count_distinct.test @@ -18,3 +18,5 @@ enable_query_log; select count(distinct n) from t1; explain extended select count(distinct n) from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test index a26b78254e7..741c7ec360b 100644 --- a/mysql-test/t/bigint.test +++ b/mysql-test/t/bigint.test @@ -104,3 +104,4 @@ t2.value64=t1.value64; drop table t1, t2; +# End of 4.1 tests diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test index 54ad8e92237..02773b32302 100644 --- a/mysql-test/t/binary.test +++ b/mysql-test/t/binary.test @@ -87,3 +87,5 @@ drop table t1; create table t1 (a binary); show create table t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/blackhole.test b/mysql-test/t/blackhole.test index d1fcfc971a9..257770d311c 100644 --- a/mysql-test/t/blackhole.test +++ b/mysql-test/t/blackhole.test @@ -125,3 +125,5 @@ let $VERSION=`select version()`; show binlog events; drop table t1,t2,t3; + +# End of 4.1 tests diff --git a/mysql-test/t/bool.test b/mysql-test/t/bool.test index b263ecfded2..67b9eeaeb94 100644 --- a/mysql-test/t/bool.test +++ b/mysql-test/t/bool.test @@ -48,3 +48,5 @@ select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnul select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/bulk_replace.test b/mysql-test/t/bulk_replace.test index 755d34083f8..4e567c43104 100644 --- a/mysql-test/t/bulk_replace.test +++ b/mysql-test/t/bulk_replace.test @@ -11,3 +11,4 @@ select * from t1; check table t1; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test index ac60d7298ce..fbbbce15576 100644 --- a/mysql-test/t/case.test +++ b/mysql-test/t/case.test @@ -118,3 +118,5 @@ SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END; SELECT 'case+union+test' UNION SELECT CASE '1' WHEN '2' THEN 'BUG' ELSE 'nobug' END; + +# End of 4.1 tests diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index aeab81585f0..394971f9648 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -142,3 +142,5 @@ select cast(concat('184467440','73709551615') as signed); select cast(repeat('1',20) as unsigned); select cast(repeat('1',20) as signed); + +# End of 4.1 tests diff --git a/mysql-test/t/check.test b/mysql-test/t/check.test index bc61aea2d66..4ce2cb04a3b 100644 --- a/mysql-test/t/check.test +++ b/mysql-test/t/check.test @@ -22,3 +22,4 @@ connection con1; reap; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/comments.test b/mysql-test/t/comments.test index 087df60f3f5..52273ec9523 100644 --- a/mysql-test/t/comments.test +++ b/mysql-test/t/comments.test @@ -17,3 +17,5 @@ select 1 --2 select 1 # The rest of the row will be ignored ; /* line with only comment */; + +# End of 4.1 tests diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test index bc20786227b..a42ba5ac88a 100644 --- a/mysql-test/t/compare.test +++ b/mysql-test/t/compare.test @@ -35,3 +35,5 @@ DROP TABLE t1; SELECT CHAR(31) = '', '' = CHAR(31); # Extra test SELECT CHAR(30) = '', '' = CHAR(30); + +# End of 4.1 tests diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index 034cd11d0c1..1a6dca5b69e 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -76,3 +76,5 @@ show tables; delete from mysql.user where user=_binary"test"; flush privileges; + +# End of 4.1 tests diff --git a/mysql-test/t/consistent_snapshot.test b/mysql-test/t/consistent_snapshot.test index 7afdae36325..8da8e9ce660 100644 --- a/mysql-test/t/consistent_snapshot.test +++ b/mysql-test/t/consistent_snapshot.test @@ -39,3 +39,5 @@ select * from t1; # if consistent snapshot was not set, as expected, we commit; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/constraints.test b/mysql-test/t/constraints.test index dbc34a0dff1..ed268ab5846 100644 --- a/mysql-test/t/constraints.test +++ b/mysql-test/t/constraints.test @@ -27,3 +27,5 @@ alter table t1 add constraint unique key_1(a); alter table t1 add constraint constraint_2 unique key_2(a); show create table t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/count_distinct.test b/mysql-test/t/count_distinct.test index 1f0404876cb..8e3ca7025b4 100644 --- a/mysql-test/t/count_distinct.test +++ b/mysql-test/t/count_distinct.test @@ -55,3 +55,4 @@ create table t1 (f int); select count(distinct f) from t1; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/count_distinct2.test b/mysql-test/t/count_distinct2.test index 9100f622dec..dd43fe6f7ba 100644 --- a/mysql-test/t/count_distinct2.test +++ b/mysql-test/t/count_distinct2.test @@ -79,3 +79,4 @@ select count(distinct s) from t1; show status like 'Created_tmp_disk_tables'; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/count_distinct3.test b/mysql-test/t/count_distinct3.test index 9d2bb0d139a..52a4f271dac 100644 --- a/mysql-test/t/count_distinct3.test +++ b/mysql-test/t/count_distinct3.test @@ -56,3 +56,5 @@ SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp; DROP TABLE t1; set @@read_buffer_size=default; + +# End of 4.1 tests diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index d1152736d1c..3b4b86a3df3 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -503,3 +503,5 @@ create table test.t1 like x; --disable_warnings drop table if exists test.t1; --enable_warnings + +# End of 4.1 tests diff --git a/mysql-test/t/create_select_tmp.test b/mysql-test/t/create_select_tmp.test index d81a3799d98..2e4c0f22997 100644 --- a/mysql-test/t/create_select_tmp.test +++ b/mysql-test/t/create_select_tmp.test @@ -27,3 +27,5 @@ select * from t2; CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1; --error 1146; select * from t2; + +# End of 4.1 tests diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index 591fab3961a..2ac46d75f9a 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1313,3 +1313,5 @@ INSERT INTO t1 VALUES (9410,9412); select period from t1; drop table if exists t1,t2,t3,t4; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test index da31a8f3245..e4fb1d2a32b 100644 --- a/mysql-test/t/ctype_big5.test +++ b/mysql-test/t/ctype_big5.test @@ -27,3 +27,5 @@ CREATE TABLE t1 (a text) character set big5; INSERT INTO t1 VALUES ('ùØ'); SELECT * FROM t1; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_collate.test b/mysql-test/t/ctype_collate.test index b65067a36cf..e59693680bf 100644 --- a/mysql-test/t/ctype_collate.test +++ b/mysql-test/t/ctype_collate.test @@ -206,3 +206,5 @@ EXPLAIN SELECT * FROM t1 WHERE s1 LIKE 'a' COLLATE latin1_german1_ci; EXPLAIN SELECT * FROM t1 WHERE s2 LIKE 'a' COLLATE latin1_german1_ci; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test index 814da628fb7..ea4b35a44a3 100644 --- a/mysql-test/t/ctype_cp1250_ch.test +++ b/mysql-test/t/ctype_cp1250_ch.test @@ -22,3 +22,5 @@ INSERT INTO t1 VALUES ('2005-01-1'); SELECT * FROM t1 WHERE popisek = '2005-01-1'; SELECT * FROM t1 WHERE popisek LIKE '2005-01-1'; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test index 76873e6fa0e..1aafe7b7266 100644 --- a/mysql-test/t/ctype_cp1251.test +++ b/mysql-test/t/ctype_cp1251.test @@ -46,3 +46,5 @@ insert into t1 (a) values ('air'), select * from t1 where a like 'we_%'; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_cp932.test b/mysql-test/t/ctype_cp932.test index 70f666f734e..7060d917ab0 100644 --- a/mysql-test/t/ctype_cp932.test +++ b/mysql-test/t/ctype_cp932.test @@ -408,3 +408,5 @@ SET collation_connection='cp932_japanese_ci'; SET collation_connection='cp932_bin'; -- source include/ctype_filesort.inc -- source include/ctype_innodb_like.inc + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_create.test b/mysql-test/t/ctype_create.test index e97017ab416..e88004bbb8c 100644 --- a/mysql-test/t/ctype_create.test +++ b/mysql-test/t/ctype_create.test @@ -98,3 +98,5 @@ show create database mysqltest2; drop database mysqltest2; --error 1046 ALTER DATABASE DEFAULT CHARACTER SET latin2; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_gbk.test b/mysql-test/t/ctype_gbk.test index 82a2e61879e..2210891454e 100644 --- a/mysql-test/t/ctype_gbk.test +++ b/mysql-test/t/ctype_gbk.test @@ -28,3 +28,5 @@ CREATE TABLE t1 (a text) character set gbk; INSERT INTO t1 VALUES (0xA3A0),(0xA1A1); SELECT hex(a) FROM t1 ORDER BY a; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index 6006ee4c527..1b83373da29 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -75,3 +75,5 @@ SET collation_connection='latin1_bin'; --error 1064 CREATE TABLE „a (a int); SELECT '„a' as str; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test index 512ae88a445..58153913648 100644 --- a/mysql-test/t/ctype_latin1_de.test +++ b/mysql-test/t/ctype_latin1_de.test @@ -132,3 +132,5 @@ INSERT INTO t1 VALUES (' ALTER TABLE t1 ADD KEY ifword(col1); SELECT * FROM t1 WHERE col1='ß' ORDER BY col1, BINARY col1; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_latin2.test b/mysql-test/t/ctype_latin2.test index cc232adeaec..676b472e7b8 100644 --- a/mysql-test/t/ctype_latin2.test +++ b/mysql-test/t/ctype_latin2.test @@ -48,3 +48,5 @@ a, lower(a) l, upper(a) u from t1 order by ha; # SELECT group_concat(a collate latin2_croatian_ci order by binary a) from t1 group by a collate latin2_croatian_ci; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test index 26057e7c997..26dc6282e1e 100644 --- a/mysql-test/t/ctype_many.test +++ b/mysql-test/t/ctype_many.test @@ -209,3 +209,5 @@ SET CHARACTER SET 'binary'; SELECT * FROM t1; SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_mb.test b/mysql-test/t/ctype_mb.test index b0ccab8e345..6e369e3fa0b 100644 --- a/mysql-test/t/ctype_mb.test +++ b/mysql-test/t/ctype_mb.test @@ -24,3 +24,5 @@ ALTER TABLE t1 CHANGE a a CHAR(4) CHARACTER SET utf8; SHOW CREATE TABLE t1; SHOW KEYS FROM t1; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index 0e5e954c720..9949ef88da4 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -179,3 +179,5 @@ select rpad(c1,3,' # TODO #select case c1 when 'ß' then 'ß' when 'ö' then 'ö' else 'c' end from t1; #select export_set(5,c1,'ö'), export_set(5,'ö',c1) from t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test index 9b53d448374..252f0a0b6c8 100644 --- a/mysql-test/t/ctype_sjis.test +++ b/mysql-test/t/ctype_sjis.test @@ -77,3 +77,5 @@ SET collation_connection='sjis_bin'; --character_set sjis SET NAMES sjis; SELECT HEX('²“‘@\Œ\') FROM DUAL; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_tis620.test b/mysql-test/t/ctype_tis620.test index 87047db9b54..d649828eda3 100644 --- a/mysql-test/t/ctype_tis620.test +++ b/mysql-test/t/ctype_tis620.test @@ -157,3 +157,5 @@ SET collation_connection='tis620_thai_ci'; -- source include/ctype_filesort.inc SET collation_connection='tis620_bin'; -- source include/ctype_filesort.inc + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index dfca82fa70a..9d81aa74e90 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -455,3 +455,5 @@ drop table t1; SET collation_connection='utf8_unicode_ci'; -- source include/ctype_filesort.inc + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 8dd8d02d018..4a5c80bed6e 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -416,3 +416,5 @@ insert into t1 values (0x803d); insert into t1 values (0x005b); select hex(a) from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_ucs_binlog.test b/mysql-test/t/ctype_ucs_binlog.test index b50fe3b4180..7faefde7d1a 100644 --- a/mysql-test/t/ctype_ucs_binlog.test +++ b/mysql-test/t/ctype_ucs_binlog.test @@ -17,4 +17,4 @@ show binlog events from 79; --exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 drop table t2; - +# End of 4.1 tests diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test index 8657d5eaa86..88386500c9f 100644 --- a/mysql-test/t/ctype_ujis.test +++ b/mysql-test/t/ctype_ujis.test @@ -1149,3 +1149,5 @@ SET collation_connection='ujis_japanese_ci'; SET collation_connection='ujis_bin'; -- source include/ctype_filesort.inc -- source include/ctype_innodb_like.inc + +# End of 4.1 tests diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index de31ca79bde..a09618df7c0 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -842,3 +842,5 @@ insert into t1 values (_utf8 0xe880bd); insert into t1 values (_utf8 0x5b); select hex(a) from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index 800e5880b09..62e9d81021e 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -259,3 +259,5 @@ select str_to_date("2003-01-02 10:11:12.0012ABCD", "%Y-%m-%d %H:%i:%S.%f") as f1 select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1, str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2; --enable_ps_protocol + +# End of 4.1 tests diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index 40bd7a912f3..a32eec536ea 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -34,3 +34,5 @@ insert delayed into t1 values (3,"this will give an","error"); --sleep 2 select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index a6335d77a0c..98e4c4e35fa 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -152,3 +152,5 @@ INSERT INTO t1 VALUES (0),(1),(2); DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1; SELECT * FROM t1; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index bd27e0654e0..91fa3238e69 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -236,3 +236,5 @@ insert into t3 values(3),(3); select * from t1 union distinct select * from t2 union all select * from t3; select * from (select * from t1 union distinct select * from t2 union all select * from t3) X; drop table t1, t2, t3; + +# End of 4.1 tests diff --git a/mysql-test/t/dirty_close.test b/mysql-test/t/dirty_close.test index f965df8cfea..f1c2c88ae83 100644 --- a/mysql-test/t/dirty_close.test +++ b/mysql-test/t/dirty_close.test @@ -12,3 +12,5 @@ create table t1 (n int); insert into t1 values (1),(2),(3); select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index 3c1f18b7524..f05dd4b75a0 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -332,3 +332,5 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES ('1',1,0); SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test index 5e123ca0de8..2cd7866caf5 100644 --- a/mysql-test/t/drop.test +++ b/mysql-test/t/drop.test @@ -79,3 +79,5 @@ unlock tables; create table t1(n int); show tables; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/drop_temp_table.test b/mysql-test/t/drop_temp_table.test index dbe7959acb2..38c13e3e5e4 100644 --- a/mysql-test/t/drop_temp_table.test +++ b/mysql-test/t/drop_temp_table.test @@ -23,3 +23,5 @@ let $VERSION=`select version()`; --replace_column 2 # 5 # show binlog events; drop database `drop-temp+table-test`; + +# End of 4.1 tests diff --git a/mysql-test/t/empty_table.test b/mysql-test/t/empty_table.test index db0a8e6a247..e8e532832f4 100644 --- a/mysql-test/t/empty_table.test +++ b/mysql-test/t/empty_table.test @@ -11,3 +11,5 @@ select count(*) from t1; select * from t1; select * from t1 limit 0; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/endspace.test b/mysql-test/t/endspace.test index 462bc3083e1..28b288e34a3 100644 --- a/mysql-test/t/endspace.test +++ b/mysql-test/t/endspace.test @@ -94,3 +94,5 @@ select text1, length(text1) from t1 where text1='teststring' or text1 like 'test select text1, length(text1) from t1 where text1='teststring' or text1 >= 'teststring\t'; select concat('|', text1, '|') from t1 order by text1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test index b558c90b0c6..93668ffdd3d 100644 --- a/mysql-test/t/errors.test +++ b/mysql-test/t/errors.test @@ -29,3 +29,5 @@ select 1 from t1 order by t1.b; --error 1054 select count(*),b from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/exampledb.test b/mysql-test/t/exampledb.test index c60a9d7f930..946d25325dc 100644 --- a/mysql-test/t/exampledb.test +++ b/mysql-test/t/exampledb.test @@ -14,3 +14,5 @@ CREATE TABLE t1 ( ) ENGINE=example; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test index 050939e5ad2..2a3a23c5f96 100644 --- a/mysql-test/t/explain.test +++ b/mysql-test/t/explain.test @@ -41,3 +41,5 @@ insert into explain select ËÏÌ0 from ÔÁ where ËÏÌ0=1; drop table ÔÁÂ; set names latin1; + +# End of 4.1 tests diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test index 9ee6b5d76b8..5a9ab8db740 100644 --- a/mysql-test/t/flush.test +++ b/mysql-test/t/flush.test @@ -69,3 +69,5 @@ connection con2; insert into t1 values (345); select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/flush_block_commit.test b/mysql-test/t/flush_block_commit.test index 49d68d05fb6..1e7ecd2548c 100644 --- a/mysql-test/t/flush_block_commit.test +++ b/mysql-test/t/flush_block_commit.test @@ -76,3 +76,5 @@ select * from t1; show create database test; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/flush_table.test b/mysql-test/t/flush_table.test index afb30d21da7..0330582bc34 100644 --- a/mysql-test/t/flush_table.test +++ b/mysql-test/t/flush_table.test @@ -72,3 +72,5 @@ handler t1 read next limit 1; handler t1 read next limit 1; handler t1 close; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/foreign_key.test b/mysql-test/t/foreign_key.test index 8c35fd65f74..0a3708e6dc8 100644 --- a/mysql-test/t/foreign_key.test +++ b/mysql-test/t/foreign_key.test @@ -21,3 +21,5 @@ create table t1 ( create index a on t1 (a); create unique index b on t1 (a,b); drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index d5493daf63e..6212ea6e8bb 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -338,3 +338,5 @@ SET NAMES latin1; INSERT INTO t1 VALUES('Mit freundlichem Grüß aus Osnabrück'); SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabrück"' IN BOOLEAN MODE); DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/fulltext2.test b/mysql-test/t/fulltext2.test index 1d3a5307412..bcd39b9ea04 100644 --- a/mysql-test/t/fulltext2.test +++ b/mysql-test/t/fulltext2.test @@ -182,3 +182,4 @@ select count(*) from t1 where match a against ('aaazzz' in boolean mode); drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/fulltext_cache.test b/mysql-test/t/fulltext_cache.test index b01f0d18b76..ea05f699506 100644 --- a/mysql-test/t/fulltext_cache.test +++ b/mysql-test/t/fulltext_cache.test @@ -42,3 +42,5 @@ SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; drop table t1, t2; + +# End of 4.1 tests diff --git a/mysql-test/t/fulltext_distinct.test b/mysql-test/t/fulltext_distinct.test index 1f4cb8cd7bc..bf773c36844 100644 --- a/mysql-test/t/fulltext_distinct.test +++ b/mysql-test/t/fulltext_distinct.test @@ -42,3 +42,5 @@ WHERE MATCH (t1.value) AGAINST ('baz333' IN BOOLEAN MODE) AND t1.id = t2.id_t1; DROP TABLE t1, t2; + +# End of 4.1 tests diff --git a/mysql-test/t/fulltext_left_join.test b/mysql-test/t/fulltext_left_join.test index 96751ef8678..3bb1f0b7309 100644 --- a/mysql-test/t/fulltext_left_join.test +++ b/mysql-test/t/fulltext_left_join.test @@ -45,3 +45,4 @@ select * from t1 left join t2 on (venue_id = entity_id and match(name) against(' select * from t1 left join t2 on (venue_id = entity_id and match(name) against('aberdeen')) where dt = '2003-05-23 19:30:00'; drop table t1,t2; +# End of 4.1 tests diff --git a/mysql-test/t/fulltext_multi.test b/mysql-test/t/fulltext_multi.test index 3a622a551bc..fe64fe88599 100644 --- a/mysql-test/t/fulltext_multi.test +++ b/mysql-test/t/fulltext_multi.test @@ -21,3 +21,5 @@ SELECT a, round(MATCH b AGAINST ('lala lkjh'),5) FROM t1; SELECT a, round(MATCH c AGAINST ('lala lkjh'),5) FROM t1; SELECT a, round(MATCH b,c AGAINST ('lala lkjh'),5) FROM t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/fulltext_order_by.test b/mysql-test/t/fulltext_order_by.test index 6894f63fa77..1a70ac3880b 100644 --- a/mysql-test/t/fulltext_order_by.test +++ b/mysql-test/t/fulltext_order_by.test @@ -135,3 +135,4 @@ order by drop table t1,t2,t3; +# End of 4.1 tests diff --git a/mysql-test/t/fulltext_update.test b/mysql-test/t/fulltext_update.test index a1d133ba3fe..14eb0de58a5 100644 --- a/mysql-test/t/fulltext_update.test +++ b/mysql-test/t/fulltext_update.test @@ -25,3 +25,5 @@ update test set url='test', shortdesc='ggg', longdesc='mmm', description='ddd', name='nam' where gnr=2; check table test; drop table test; + +# End of 4.1 tests diff --git a/mysql-test/t/fulltext_var.test b/mysql-test/t/fulltext_var.test index 8cc8acf60a6..6b0b8aa463b 100644 --- a/mysql-test/t/fulltext_var.test +++ b/mysql-test/t/fulltext_var.test @@ -25,3 +25,4 @@ set global ft_boolean_syntax='@ -><()~*:""@|'; set global ft_boolean_syntax='+ -><()~*:""@!|'; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index f46589e9e0e..6b85062b9fa 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -45,3 +45,4 @@ set @@max_allowed_packet=1048576*100; --replace_result "''" XXX "'1'" XXX eval select compress(repeat('aaaaaaaaaa', IF('$LOW_MEMORY', 10, 10000000))) is null; +# End of 4.1 tests diff --git a/mysql-test/t/func_concat.test b/mysql-test/t/func_concat.test index b94901e9966..69ce10c83c9 100644 --- a/mysql-test/t/func_concat.test +++ b/mysql-test/t/func_concat.test @@ -50,3 +50,4 @@ select 'a' union select concat('a', -0); --replace_result 'a-0.0' good 'a0.0' good select 'a' union select concat('a', -0.0); +# End of 4.1 tests diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test index f352a98e3cd..5e0283feb28 100644 --- a/mysql-test/t/func_crypt.test +++ b/mysql-test/t/func_crypt.test @@ -48,3 +48,5 @@ select old_password('idkfa'); select old_password(' i d k f a '); explain extended select password('idkfa '), old_password('idkfa'); + +# End of 4.1 tests diff --git a/mysql-test/t/func_date_add.test b/mysql-test/t/func_date_add.test index 93c77daf86e..5213395c35d 100644 --- a/mysql-test/t/func_date_add.test +++ b/mysql-test/t/func_date_add.test @@ -40,3 +40,5 @@ having mts < DATE_SUB(NOW(),INTERVAL 3 MONTH); select visitor_id,max(ts) as mts from t1 group by visitor_id having DATE_ADD(mts,INTERVAL 3 MONTH) < NOW(); drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/func_default.test b/mysql-test/t/func_default.test index 6ae9f088f92..836511cc07a 100644 --- a/mysql-test/t/func_default.test +++ b/mysql-test/t/func_default.test @@ -16,4 +16,6 @@ explain select * from t1 where str <> default(str); #show create table from t1; #insert into t2 select select default(str), default(strnull), default(intg), default(rel) from t1; -drop table t1; \ No newline at end of file +drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/func_des_encrypt.test b/mysql-test/t/func_des_encrypt.test index 201a0051c58..5d102bd02eb 100644 --- a/mysql-test/t/func_des_encrypt.test +++ b/mysql-test/t/func_des_encrypt.test @@ -7,3 +7,5 @@ # Bug #11643: des_encrypt() causes server to die # select des_encrypt('hello'); + +# End of 4.1 tests diff --git a/mysql-test/t/func_encrypt.test b/mysql-test/t/func_encrypt.test index 52aca7f9dcb..a7364fa43da 100644 --- a/mysql-test/t/func_encrypt.test +++ b/mysql-test/t/func_encrypt.test @@ -86,3 +86,5 @@ select hex(des_decrypt(des_encrypt("hello",4),'password2')); select hex(des_decrypt(des_encrypt("hello","hidden"))); explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden")); + +# End of 4.1 tests diff --git a/mysql-test/t/func_encrypt_nossl.test b/mysql-test/t/func_encrypt_nossl.test index 95c104ce046..11866db1da7 100644 --- a/mysql-test/t/func_encrypt_nossl.test +++ b/mysql-test/t/func_encrypt_nossl.test @@ -35,3 +35,4 @@ select hex("hello"); select hex(des_decrypt(des_encrypt("hello",4),'password2')); select hex(des_decrypt(des_encrypt("hello","hidden"))); +# End of 4.1 tests diff --git a/mysql-test/t/func_equal.test b/mysql-test/t/func_equal.test index cbf589ffcc2..18d34e3ba16 100644 --- a/mysql-test/t/func_equal.test +++ b/mysql-test/t/func_equal.test @@ -31,3 +31,5 @@ select * from t1 where id <=>id; select * from t1 where value <=> value; select * from t1 where id <=> value or value<=>id; drop table t1,t2; + +# End of 4.1 tests diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index edb4d42e3c2..e93ffcb17b3 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -309,3 +309,5 @@ select a, group_concat(distinct b) from t1 group by a with rollup; select a, group_concat(b order by b) from t1 group by a with rollup; select a, group_concat(distinct b order by b) from t1 group by a with rollup; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 78e7d3c5ed6..4dc8d66c4f1 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -526,3 +526,5 @@ INSERT INTO t1 VALUES (1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1); SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test index 4333defa412..5756793c673 100644 --- a/mysql-test/t/func_if.test +++ b/mysql-test/t/func_if.test @@ -72,3 +72,5 @@ SELECT a, NULLIF(a,'') FROM t1; SELECT a, NULLIF(a,'') FROM t1 WHERE NULLIF(a,'') IS NULL; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index 6e0883b821f..aec2de7a467 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -101,3 +101,5 @@ create table t1 (a char(20) character set binary); insert into t1 values ('aa'), ('bb'); select * from t1 where a in (NULL, 'aa'); drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/func_isnull.test b/mysql-test/t/func_isnull.test index 506efada0eb..6218efb882f 100644 --- a/mysql-test/t/func_isnull.test +++ b/mysql-test/t/func_isnull.test @@ -11,3 +11,5 @@ insert into t1 values (0,"2002-05-01"),(0,"2002-05-01"),(0,"2002-05-01"); flush tables; select * from t1 where isnull(to_days(mydate)); drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test index 4ca2f28fa6e..684d7032038 100644 --- a/mysql-test/t/func_like.test +++ b/mysql-test/t/func_like.test @@ -96,3 +96,4 @@ DROP TABLE t1; # select _cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin; +# End of 4.1 tests diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 4c24dae8c5d..1f282b1fb76 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -71,3 +71,5 @@ create table t1 select round(1, 6); show create table t1; select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index 89aba7ee583..72af9024070 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -38,3 +38,4 @@ select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) ); drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/func_op.test b/mysql-test/t/func_op.test index 33a2884b424..24266150e4c 100644 --- a/mysql-test/t/func_op.test +++ b/mysql-test/t/func_op.test @@ -16,3 +16,5 @@ select 1 | -1, 1 ^ -1, 1 & -1; select 0 | -1, 0 ^ -1, 0 & -1; select -1 >> 0, -1 << 0; select -1 >> 1, -1 << 1; + +# End of 4.1 tests diff --git a/mysql-test/t/func_regexp.test b/mysql-test/t/func_regexp.test index 1a771d466fa..23070c71fe9 100644 --- a/mysql-test/t/func_regexp.test +++ b/mysql-test/t/func_regexp.test @@ -73,3 +73,5 @@ set @a="^R.*"; execute stmt1 using @a; deallocate prepare stmt1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index da3affaa36d..8fd793f067b 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -121,3 +121,5 @@ select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a; --disable_ps_protocol select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f"); --enable_ps_protocol + +# End of 4.1 tests diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test index 98ef1e07bfe..c003826ff5a 100644 --- a/mysql-test/t/func_set.test +++ b/mysql-test/t/func_set.test @@ -52,3 +52,4 @@ select find_in_set(binary 'a', 'A,B,C'); # select find_in_set('1','3,1,'); +# End of 4.1 tests diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 57d4f4c548e..ddfc83e620a 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -622,3 +622,5 @@ select lpad(i, 7, ' ') as t from t1; select rpad(i, 7, ' ') as t from t1; --disable_metadata drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/func_system.test b/mysql-test/t/func_system.test index bbfef25bcfe..d7e215f5d48 100644 --- a/mysql-test/t/func_system.test +++ b/mysql-test/t/func_system.test @@ -41,3 +41,5 @@ select * from t1 where a=user(); insert into t1 values ('a'); select left(concat(a,version()),1) from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test index eb506a58870..2ad64b6c5a6 100644 --- a/mysql-test/t/func_test.test +++ b/mysql-test/t/func_test.test @@ -107,3 +107,5 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; # select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; + +# End of 4.1 tests diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 9e2703da110..68a33afd85c 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -314,3 +314,5 @@ DROP TABLE t1; select last_day('2005-00-00'); select last_day('2005-00-01'); select last_day('2005-01-00'); + +# End of 4.1 tests diff --git a/mysql-test/t/func_timestamp.test b/mysql-test/t/func_timestamp.test index 8583c16073d..e1bb7e878ee 100644 --- a/mysql-test/t/func_timestamp.test +++ b/mysql-test/t/func_timestamp.test @@ -13,3 +13,5 @@ SELECT CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit) AS Date, UNIX_TIMESTAMP(CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit)) AS Unix FROM t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/gcc296.test b/mysql-test/t/gcc296.test index ebca4dbc897..bfcd56ff396 100644 --- a/mysql-test/t/gcc296.test +++ b/mysql-test/t/gcc296.test @@ -18,3 +18,5 @@ INSERT INTO t1 VALUES ('0104000000','xxx','XXX'); select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index 716dd38a119..3c38ec8d599 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -172,3 +172,5 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)); --error 1105 INSERT INTO t2 SELECT GeomFromText(st) FROM t1; drop table t1, t2; + +# End of 4.1 tests diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 86c34eacbc5..b204bc11e2f 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -359,3 +359,5 @@ select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from t1 where object_id=85984; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 6c38aac1ebd..50255d515e0 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -401,3 +401,5 @@ insert into tables_priv values ('','test_db','mysqltest_1','test_table','test_gr flush privileges; delete from tables_priv where host = '' and user = 'mysqltest_1'; flush privileges; + +# End of 4.1 tests diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index 362efc1230d..f347869d9ec 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -124,3 +124,5 @@ connection default; REVOKE ALL ON mysqltest_1.t1 FROM mysqltest_1@'127.0.0.0/255.0.0.0'; drop table mysqltest_1.t1; drop database mysqltest_1; + +# End of 4.1 tests diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test index 0fb0b3c2fc0..703ad5d8004 100644 --- a/mysql-test/t/grant_cache.test +++ b/mysql-test/t/grant_cache.test @@ -149,3 +149,5 @@ drop table test.t1,mysqltest.t1,mysqltest.t2; drop database mysqltest; set GLOBAL query_cache_size=default; + +# End of 4.1 tests diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 23d51b0f297..c07d309005e 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -587,8 +587,7 @@ DROP TABLE t1, t2; CREATE TABLE t1 (n int); INSERT INTO t1 VALUES (1); - SELECT n+1 AS n FROM t1 GROUP BY n; - DROP TABLE t1; +# End of 4.1 tests diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test index 3de8e8ae784..eb970e7a710 100644 --- a/mysql-test/t/handler.test +++ b/mysql-test/t/handler.test @@ -346,3 +346,5 @@ drop table t2; drop table t3; drop table t4; drop table t5; + +# End of 4.1 tests diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index 12a44fd75dc..920a3b752ab 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -122,3 +122,5 @@ from t1 a left join t3 b on a.id=b.order_id group by a.id, a.description having (a.description is not null) and (c=0); drop table t1,t2,t3; + +# End of 4.1 tests diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index c0977819487..270b8a1df6f 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -233,3 +233,5 @@ insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd --error 1062 insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/heap_auto_increment.test b/mysql-test/t/heap_auto_increment.test index 9d0fefa4d52..016bc946209 100644 --- a/mysql-test/t/heap_auto_increment.test +++ b/mysql-test/t/heap_auto_increment.test @@ -31,3 +31,5 @@ insert into t1 values (NULL, "hey"); select * from t1; select _rowid,t1._rowid,skey,sval from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test index d156d059634..aea9e9486e5 100644 --- a/mysql-test/t/heap_btree.test +++ b/mysql-test/t/heap_btree.test @@ -163,3 +163,5 @@ INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11); DELETE from t1 where a < 100; SELECT * from t1; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/heap_hash.test b/mysql-test/t/heap_hash.test index 59af50da932..2cdec652688 100644 --- a/mysql-test/t/heap_hash.test +++ b/mysql-test/t/heap_hash.test @@ -259,3 +259,5 @@ insert into t1 values (1),(2),(3),(4),(5); select a from t1 where a in (1,3); explain select a from t1 where a in (1,3); drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/help.test b/mysql-test/t/help.test index 3f3e99e1556..ff431fb4ebd 100644 --- a/mysql-test/t/help.test +++ b/mysql-test/t/help.test @@ -113,3 +113,5 @@ delete from mysql.help_relation where help_keyword_id=@keyword1_id and help_topi delete from mysql.help_relation where help_keyword_id=@keyword2_id and help_topic_id=@topic1_id; delete from mysql.help_relation where help_keyword_id=@keyword3_id and help_topic_id=@topic3_id; delete from mysql.help_relation where help_keyword_id=@keyword3_id and help_topic_id=@topic4_id; + +# End of 4.1 tests diff --git a/mysql-test/t/init_connect.test b/mysql-test/t/init_connect.test index 29962abc04d..f90d1b8670d 100644 --- a/mysql-test/t/init_connect.test +++ b/mysql-test/t/init_connect.test @@ -32,3 +32,5 @@ connection con5; select @a; connection con0; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/init_file.test b/mysql-test/t/init_file.test index 604d0a01794..de6aca455bd 100644 --- a/mysql-test/t/init_file.test +++ b/mysql-test/t/init_file.test @@ -5,3 +5,5 @@ # See mysql-test/std_data/init_file.dat and # mysql-test/t/init_file-master.opt for the actual test # + +# End of 4.1 tests diff --git a/mysql-test/t/innodb-deadlock.test b/mysql-test/t/innodb-deadlock.test index 7a7f657f35d..9d15a23da3c 100644 --- a/mysql-test/t/innodb-deadlock.test +++ b/mysql-test/t/innodb-deadlock.test @@ -113,3 +113,5 @@ select * from t1; commit; drop table t1, t2; + +# End of 4.1 tests diff --git a/mysql-test/t/innodb-lock.test b/mysql-test/t/innodb-lock.test index 887a664e262..dd7f4319892 100644 --- a/mysql-test/t/innodb-lock.test +++ b/mysql-test/t/innodb-lock.test @@ -100,3 +100,5 @@ reap; commit; select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/innodb-replace.test b/mysql-test/t/innodb-replace.test index 516f058a68e..51b70f34b65 100644 --- a/mysql-test/t/innodb-replace.test +++ b/mysql-test/t/innodb-replace.test @@ -19,3 +19,4 @@ replace delayed into t1 (c1, c2) values ( "text1","12"),( "text2","13"),( "text select * from t1; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 5216c889e59..be502c2db44 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1201,3 +1201,5 @@ INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2); SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz; DROP TABLE t2; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/innodb_cache.test b/mysql-test/t/innodb_cache.test index 101dde37f89..a811d660bd7 100644 --- a/mysql-test/t/innodb_cache.test +++ b/mysql-test/t/innodb_cache.test @@ -80,3 +80,4 @@ commit; select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; drop table t3,t2,t1; +# End of 4.1 tests diff --git a/mysql-test/t/innodb_handler.test b/mysql-test/t/innodb_handler.test index 65728519e7b..18cec97af0d 100644 --- a/mysql-test/t/innodb_handler.test +++ b/mysql-test/t/innodb_handler.test @@ -93,3 +93,4 @@ HANDLER t1 READ `primary` = (1, 1000); HANDLER t1 READ `primary` PREV; DROP TABLE t1; +# End of 4.1 tests diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index f5acab05108..0c8252ad479 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -154,3 +154,5 @@ insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@val drop table t1; --enable_ps_protocol + +# End of 4.1 tests diff --git a/mysql-test/t/insert_select-binlog.test b/mysql-test/t/insert_select-binlog.test index 9bb1ec274ef..d4041f86ab5 100644 --- a/mysql-test/t/insert_select-binlog.test +++ b/mysql-test/t/insert_select-binlog.test @@ -32,3 +32,4 @@ let $VERSION=`select version()`; show binlog events; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 67799873b73..14853b38db2 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -203,3 +203,5 @@ insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b; --error 1109 insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b; drop table t1,t2,t3; + +# End of 4.1 tests diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index 3d6297d8d7a..d0e75f0fa2a 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -100,3 +100,5 @@ insert into t1 select a from t1 on duplicate key update a=a+1 ; --error 1052 insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/isam.test b/mysql-test/t/isam.test index f77d29fd20f..7fa841c11a3 100644 --- a/mysql-test/t/isam.test +++ b/mysql-test/t/isam.test @@ -245,3 +245,5 @@ update t1 set b=repeat('a',256); update t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0; check table t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index 1d18e020543..2715f30b6cf 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -325,3 +325,5 @@ select * from t1,t2 right join t3 on (t2.i=t3.i) order by t1.i,t2.i,t3.i; select t1.i,t2.i,t3.i from t2 natural right join t3,t1 order by t1.i,t2.i,t3.i; select t1.i,t2.i,t3.i from t2 right join t3 on (t2.i=t3.i),t1 order by t1.i,t2.i,t3.i; drop table t1,t2,t3; + +# End of 4.1 tests diff --git a/mysql-test/t/join_crash.test b/mysql-test/t/join_crash.test index 2d2222ad67a..68fd9226e41 100644 --- a/mysql-test/t/join_crash.test +++ b/mysql-test/t/join_crash.test @@ -124,3 +124,5 @@ from client_name asc, project_name asc; DROP TABLE t1,t2,t3,t4; + +# End of 4.1 tests diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index d5fa1592965..fa2dd93c9ba 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -624,3 +624,5 @@ select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by t1.a; select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a; drop table t1, t2; set group_concat_max_len=default; + +# End of 4.1 tests diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index a0a291fdf3c..23a4de8456c 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -320,3 +320,5 @@ alter table t1 add key (c1,c2,c1); --error 1060 alter table t1 add key (c1,c1,c2); drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 5ff26b315e2..5d0f904a716 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -167,3 +167,5 @@ set GLOBAL key_cache_block_size=2048; check table t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/key_diff.test b/mysql-test/t/key_diff.test index b4e4339ae33..b490c613c61 100644 --- a/mysql-test/t/key_diff.test +++ b/mysql-test/t/key_diff.test @@ -20,3 +20,5 @@ explain select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B; select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a; select * from t1 where a='a'; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/key_primary.test b/mysql-test/t/key_primary.test index 816365c517c..1ca2059b871 100644 --- a/mysql-test/t/key_primary.test +++ b/mysql-test/t/key_primary.test @@ -16,3 +16,5 @@ select * from t1 where t1 like "a_\%"; describe select * from t1 where t1="ABC"; describe select * from t1 where t1="ABCD"; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/keywords.test b/mysql-test/t/keywords.test index e7ec63afe54..96c3dc3f17c 100644 --- a/mysql-test/t/keywords.test +++ b/mysql-test/t/keywords.test @@ -15,3 +15,5 @@ create table events(binlog int); insert into events values(1); select events.binlog from events; drop table events; + +# End of 4.1 tests diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index 1fec41d8ee4..fdedaa8cd7f 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -38,3 +38,5 @@ select @id != connection_id(); connection con2; select 4; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/limit.test b/mysql-test/t/limit.test index 28b287a5d4a..ef9f63067a4 100644 --- a/mysql-test/t/limit.test +++ b/mysql-test/t/limit.test @@ -59,3 +59,5 @@ insert into t1 values (1); select 1 as a from t1 union all select 1 from dual limit 1; (select 1 as a from t1) union all (select 1 from dual) limit 1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index aa0ea0a2f55..689bdbbf92d 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -31,3 +31,4 @@ load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated select * from t1; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test index 261c01b405c..4809dcc5abe 100644 --- a/mysql-test/t/lock.test +++ b/mysql-test/t/lock.test @@ -73,3 +73,5 @@ delete from t2 using t1,t2 where t1.a=t2.a; --error 1099 delete t2 from t1,t2 where t1.a=t2.a; drop table t1,t2; + +# End of 4.1 tests diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test index cbda47ac864..2e40aeaccb7 100644 --- a/mysql-test/t/lock_multi.test +++ b/mysql-test/t/lock_multi.test @@ -94,3 +94,5 @@ connection reader; reap; connection locker; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/lock_tables_lost_commit.test b/mysql-test/t/lock_tables_lost_commit.test index 8c1ad97c0cc..d31b4b7dfb5 100644 --- a/mysql-test/t/lock_tables_lost_commit.test +++ b/mysql-test/t/lock_tables_lost_commit.test @@ -20,3 +20,5 @@ connection con2; # binlog-ignore-db select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/lowercase_table.test b/mysql-test/t/lowercase_table.test index ca81c7c66bc..4d33c8c1c48 100644 --- a/mysql-test/t/lowercase_table.test +++ b/mysql-test/t/lowercase_table.test @@ -93,3 +93,4 @@ use com1; --error 1049 use prn; +# End of 4.1 tests diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test index f5cf292482e..c02ae8f5073 100644 --- a/mysql-test/t/lowercase_table2.test +++ b/mysql-test/t/lowercase_table2.test @@ -137,3 +137,5 @@ create table t2aA (col1 int); create table t1Aa (col1 int); select t1Aa.col1 from t1aA,t2Aa where t1Aa.col1 = t2aA.col1; drop table t2aA, t1Aa; + +# End of 4.1 tests diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test index a394cde7237..9208f3a76ec 100644 --- a/mysql-test/t/lowercase_table3.test +++ b/mysql-test/t/lowercase_table3.test @@ -35,3 +35,5 @@ CREATE TABLE t1 (a int) ENGINE=INNODB; --error 1016 SELECT * from T1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/lowercase_table_grant.test b/mysql-test/t/lowercase_table_grant.test index 3d6adb477a3..7449231fca5 100644 --- a/mysql-test/t/lowercase_table_grant.test +++ b/mysql-test/t/lowercase_table_grant.test @@ -26,3 +26,5 @@ flush privileges; drop user mysqltest_1@localhost; drop database MYSQLtest; + +# End of 4.1 tests diff --git a/mysql-test/t/lowercase_table_qcache.test b/mysql-test/t/lowercase_table_qcache.test index 5077a41402a..e63ad3b2c16 100644 --- a/mysql-test/t/lowercase_table_qcache.test +++ b/mysql-test/t/lowercase_table_qcache.test @@ -27,3 +27,5 @@ enable_result_log; show status like "Qcache_queries_in_cache"; set GLOBAL query_cache_size=0; + +# End of 4.1 tests diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 999dd2bed9b..fa13107ca04 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -318,3 +318,4 @@ INSERT INTO t2 (b) VALUES (1) ON DUPLICATE KEY UPDATE b=3; SELECT b FROM t2; DROP TABLE t1, t2; +# End of 4.1 tests diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test index ebd58ef4ebb..b4edd15f5ef 100644 --- a/mysql-test/t/metadata.test +++ b/mysql-test/t/metadata.test @@ -48,3 +48,5 @@ select * from (select 1 union select 1) aaa; drop table t1; --disable_metadata + +# End of 4.1 tests diff --git a/mysql-test/t/mix_innodb_myisam_binlog.test b/mysql-test/t/mix_innodb_myisam_binlog.test index 544fa5559fa..6eb9eae2d99 100644 --- a/mysql-test/t/mix_innodb_myisam_binlog.test +++ b/mysql-test/t/mix_innodb_myisam_binlog.test @@ -208,3 +208,5 @@ select (@after-@before) >= 2; # cleanup drop table t1,t2; + +# End of 4.1 tests diff --git a/mysql-test/t/multi_statement.test b/mysql-test/t/multi_statement.test index 2abec332878..eb8d867f3f0 100644 --- a/mysql-test/t/multi_statement.test +++ b/mysql-test/t/multi_statement.test @@ -29,3 +29,5 @@ show status like 'Slow_queries'|||| drop table t1|||| delimiter ;|||| + +# End of 4.1 tests diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 4a7367a333c..27bdf4df3d7 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -448,3 +448,4 @@ insert into t2 values(1,null); delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; drop table t1, t2; +# End of 4.1 tests diff --git a/mysql-test/t/myisam-blob.test b/mysql-test/t/myisam-blob.test index 7af8c661c02..ac1b45b8c6c 100644 --- a/mysql-test/t/myisam-blob.test +++ b/mysql-test/t/myisam-blob.test @@ -39,3 +39,5 @@ INSERT INTO t1 (data) VALUES (NULL); UPDATE t1 set data=repeat('a',18*1024*1024); select length(data) from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 7d7985fd8ac..481f92a8002 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -575,3 +575,4 @@ show keys from t1; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 3639fc2e262..ccf5e0bf66a 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -8,3 +8,5 @@ --disable_result_log --exec echo $MYSQL_CLIENT_TEST --exec $MYSQL_CLIENT_TEST + +# End of 4.1 tests diff --git a/mysql-test/t/mysql_protocols.test b/mysql-test/t/mysql_protocols.test index 6e2d4f20429..0253c2b5d17 100644 --- a/mysql-test/t/mysql_protocols.test +++ b/mysql-test/t/mysql_protocols.test @@ -10,3 +10,4 @@ --exec echo "select ' ok' as 'MEMORY'" | $MYSQL --protocol=MEMORY 2>&1 || true --exec echo "select ' ok' as 'NullS'" | $MYSQL --protocol=NullS 2>&1 || true +# End of 4.1 tests diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 435fa8289da..0f9faa5c337 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -100,3 +100,5 @@ select "--- --position --" as ""; # clean up drop table t1, t2; + +# End of 4.1 tests diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index 0eddc4ec2e4..67131dd9d0d 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -157,3 +157,5 @@ select "--- to-last-log --" as ""; select "--- end of test --" as ""; --enable_query_log drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 7f3d3adebbc..f2d56eed151 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -635,3 +635,4 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir --exec $MYSQL_DUMP --skip-comments --xml --no-create-info test drop table t1, t2; +# End of 4.1 tests diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 0802c18ed6c..6864e125958 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -286,3 +286,5 @@ select 3 from t1 ; #select 3 from t1 ; # #select 3 from t1 ; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index d6a1ef5e25f..65384a339e2 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -175,3 +175,5 @@ drop table t1; #truncate table t2; #select count(*) from t2; #drop table t2; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index 1eed78b43df..e45133afbca 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -503,3 +503,5 @@ create table t10 ( insert into t10 values (1, 'kalle'); --exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test `$NDB_TOOLS_DIR/ndb_show_tables --no-defaults | grep BLOB` >> $NDB_TOOLS_OUTPUT 2>&1 || true + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_autodiscover2.test b/mysql-test/t/ndb_autodiscover2.test index 76baa31a2a9..f12d3d31fdd 100644 --- a/mysql-test/t/ndb_autodiscover2.test +++ b/mysql-test/t/ndb_autodiscover2.test @@ -18,3 +18,4 @@ drop table t9; select * from t10; drop table t10; +# End of 4.1 tests diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index 24baf8d9fb4..144e466d937 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -605,3 +605,5 @@ insert into t1 (datavalue) select datavalue from t1 where counter < 100; select * from t1 order by counter; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index b265809b75f..a12ebee2f0d 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -404,3 +404,5 @@ Proper fix: Set inline bytes to multiple of mbmaxlen and validate it (after the 8 byte length).'); select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_cache.test b/mysql-test/t/ndb_cache.test index 5ba42f9b23c..481ec156307 100644 --- a/mysql-test/t/ndb_cache.test +++ b/mysql-test/t/ndb_cache.test @@ -30,3 +30,5 @@ show status like "Qcache_hits"; drop table t1, t2; SET GLOBAL query_cache_size=0; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_charset.test b/mysql-test/t/ndb_charset.test index 242f9192948..89f1ed17cfb 100644 --- a/mysql-test/t/ndb_charset.test +++ b/mysql-test/t/ndb_charset.test @@ -168,3 +168,5 @@ replace into t1 values ('jonas % '); replace into t1 values ('jonas % '); select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_config.test b/mysql-test/t/ndb_config.test index ea78a32b1ba..66287bf6d29 100644 --- a/mysql-test/t/ndb_config.test +++ b/mysql-test/t/ndb_config.test @@ -5,3 +5,5 @@ --exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null --exec $NDB_TOOLS_DIR/ndb_config --no-defaults -r \\n -f " " --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null --exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --type=ndbd --host=localhost 2> /dev/null + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_database.test b/mysql-test/t/ndb_database.test index 1264c3fa73b..2e924ba2dcc 100644 --- a/mysql-test/t/ndb_database.test +++ b/mysql-test/t/ndb_database.test @@ -48,3 +48,5 @@ show tables; drop table if exists t1; drop database if exists mysqltest; --enable_warnings + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_grant.later b/mysql-test/t/ndb_grant.later index d3899d9972f..5258501d79e 100644 --- a/mysql-test/t/ndb_grant.later +++ b/mysql-test/t/ndb_grant.later @@ -372,3 +372,5 @@ alter table time_zone_transition_type engine=myisam; alter table user engine=myisam; use test; flush privileges; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_index.test b/mysql-test/t/ndb_index.test index 93085dea587..272f30e3e6f 100644 --- a/mysql-test/t/ndb_index.test +++ b/mysql-test/t/ndb_index.test @@ -126,5 +126,6 @@ select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessno select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='kllopmn'; select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='foo'; - drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 4bc2021d45e..eb2b4e86343 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -317,3 +317,5 @@ connection con1; select a from t1 where b = 2; show tables; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test index 67cf6cb4537..458f6a165f8 100644 --- a/mysql-test/t/ndb_index_unique.test +++ b/mysql-test/t/ndb_index_unique.test @@ -308,3 +308,5 @@ INSERT INTO t1 (month, year, code) VALUES (5,2004,'12'); select * from t1 where code = '12' and month = 4 and year = 2004 ; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test index 68f3817e134..92bc51bcf4f 100644 --- a/mysql-test/t/ndb_insert.test +++ b/mysql-test/t/ndb_insert.test @@ -616,3 +616,5 @@ INSERT IGNORE INTO t1 VALUES (1); INSERT IGNORE INTO t1 VALUES (1); SELECT * FROM t1; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_limit.test b/mysql-test/t/ndb_limit.test index 0df3b2f7566..01613606d66 100644 --- a/mysql-test/t/ndb_limit.test +++ b/mysql-test/t/ndb_limit.test @@ -81,3 +81,5 @@ SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y') as date_formatted FROM t2 GROUP BY day ORDER BY day DESC LIMIT 2; drop table t2; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_lock.test b/mysql-test/t/ndb_lock.test index b93abbd564b..6945f91ee39 100644 --- a/mysql-test/t/ndb_lock.test +++ b/mysql-test/t/ndb_lock.test @@ -69,3 +69,4 @@ insert into t1 values (1,1,1); drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/ndb_minmax.test b/mysql-test/t/ndb_minmax.test index 97ea84f98ef..a3ac677cd2a 100644 --- a/mysql-test/t/ndb_minmax.test +++ b/mysql-test/t/ndb_minmax.test @@ -62,6 +62,4 @@ select MAX(c) from t2; select * from t2 order by a; drop table t2; - - - +# End of 4.1 tests diff --git a/mysql-test/t/ndb_multi.test b/mysql-test/t/ndb_multi.test index 85950c72cf9..760150c6f6a 100644 --- a/mysql-test/t/ndb_multi.test +++ b/mysql-test/t/ndb_multi.test @@ -68,4 +68,4 @@ drop table t1, t2, t3, t4; connection server2; drop table t1, t3, t4; - +# End of 4.1 tests diff --git a/mysql-test/t/ndb_replace.test b/mysql-test/t/ndb_replace.test index 1c06a9a6633..b97a0322a6a 100644 --- a/mysql-test/t/ndb_replace.test +++ b/mysql-test/t/ndb_replace.test @@ -26,3 +26,5 @@ insert into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); select * from t1 order by gesuchnr; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_restore.test b/mysql-test/t/ndb_restore.test index 454171d9938..586c39ed96b 100644 --- a/mysql-test/t/ndb_restore.test +++ b/mysql-test/t/ndb_restore.test @@ -214,3 +214,5 @@ drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; # --exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults -d sys -D , SYSTAB_0 | grep 520093696 + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_subquery.test b/mysql-test/t/ndb_subquery.test index 9d3a256a263..135dc4fb862 100644 --- a/mysql-test/t/ndb_subquery.test +++ b/mysql-test/t/ndb_subquery.test @@ -37,3 +37,5 @@ drop table t1; drop table t2; # bug#5367 ########## + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_transaction.test b/mysql-test/t/ndb_transaction.test index ae02059786d..d3ebadb1a78 100644 --- a/mysql-test/t/ndb_transaction.test +++ b/mysql-test/t/ndb_transaction.test @@ -295,4 +295,4 @@ select count(*) from t2; drop table test.t1, t2; drop database mysqltest; - +# End of 4.1 tests diff --git a/mysql-test/t/ndb_truncate.test b/mysql-test/t/ndb_truncate.test index 7c0f79bcc59..73af70d0d0f 100644 --- a/mysql-test/t/ndb_truncate.test +++ b/mysql-test/t/ndb_truncate.test @@ -32,3 +32,5 @@ truncate table t2; select count(*) from t2; drop table t2; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_types.test b/mysql-test/t/ndb_types.test index 4276fa147eb..1ca89447892 100644 --- a/mysql-test/t/ndb_types.test +++ b/mysql-test/t/ndb_types.test @@ -78,3 +78,5 @@ from t1; select time_stamp>@now from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test index 5453e41f937..45e3add4639 100644 --- a/mysql-test/t/ndb_update.test +++ b/mysql-test/t/ndb_update.test @@ -32,3 +32,5 @@ select * from t1 order by pk1; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings + +# End of 4.1 tests diff --git a/mysql-test/t/negation_elimination.test b/mysql-test/t/negation_elimination.test index c50a9678edb..0e0d8891e1f 100644 --- a/mysql-test/t/negation_elimination.test +++ b/mysql-test/t/negation_elimination.test @@ -70,3 +70,5 @@ select a, not(not(a)) from t1; explain extended select a, not(not(a)), not(a <= 2 and not(a)), not(a not like "1"), not (a not in (1,2)), not(a != 2) from t1 where not(not(a)) having not(not(a)); drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/not_embedded_server.test b/mysql-test/t/not_embedded_server.test index b3607107320..83ec03d6706 100644 --- a/mysql-test/t/not_embedded_server.test +++ b/mysql-test/t/not_embedded_server.test @@ -14,3 +14,5 @@ prepare stmt1 from ' show full processlist '; --replace_column 1 number 6 time 3 localhost execute stmt1; deallocate prepare stmt1; + +# End of 4.1 tests diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test index 9ddef252d67..731f0a4cb34 100644 --- a/mysql-test/t/null.test +++ b/mysql-test/t/null.test @@ -186,3 +186,5 @@ select # Restore charset to the default value. set names latin1; + +# End of 4.1 tests diff --git a/mysql-test/t/null_key.test b/mysql-test/t/null_key.test index 9b346a181bf..37a1dc439a7 100644 --- a/mysql-test/t/null_key.test +++ b/mysql-test/t/null_key.test @@ -191,3 +191,5 @@ select * from t1 where id2 is null or id2 > 0; delete from t1 where id <=> NULL; select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/odbc.test b/mysql-test/t/odbc.test index 9aac5948359..d4b6fc35e74 100644 --- a/mysql-test/t/odbc.test +++ b/mysql-test/t/odbc.test @@ -20,3 +20,5 @@ select * from t1 where a is null and b=2; select * from t1 where a is null; explain select * from t1 where b is null; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index 9e6adffffcf..c9a16b897c6 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -249,3 +249,5 @@ INSERT INTO t1 VALUES (1, 2); SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 912c9fb9bec..3698ab54ec1 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -43,3 +43,5 @@ delete from mysql.user where user='ssl_user%'; delete from mysql.db where user='ssl_user%'; flush privileges; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index c6a77c71b2f..4b7ec84dc54 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -544,3 +544,5 @@ INSERT INTO t1 VALUES (2), (1), (1), (2), (1); SELECT a FROM t1 ORDER BY a; (SELECT a FROM t1) ORDER BY a; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/order_fill_sortbuf.test b/mysql-test/t/order_fill_sortbuf.test index 37620ebe331..f13cf8cf350 100644 --- a/mysql-test/t/order_fill_sortbuf.test +++ b/mysql-test/t/order_fill_sortbuf.test @@ -22,3 +22,5 @@ enable_query_log; create table t2 select id2 from t1 order by id3; select count(*) from t2; drop table t1,t2; + +# End of 4.1 tests diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test index 4b12f9e4e50..a74bebe1460 100644 --- a/mysql-test/t/outfile.test +++ b/mysql-test/t/outfile.test @@ -63,3 +63,5 @@ EXPLAIN FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' FROM t1; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/overflow.test b/mysql-test/t/overflow.test index 17e443d51f8..c930707413b 100644 --- a/mysql-test/t/overflow.test +++ b/mysql-test/t/overflow.test @@ -2,3 +2,5 @@ connect (con1,localhost,boo,,); connection con1; -- error 1064,1102,1280 drop database AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA; + +# End of 4.1 tests diff --git a/mysql-test/t/packet.test b/mysql-test/t/packet.test index c7f10d75d74..04122b42b44 100644 --- a/mysql-test/t/packet.test +++ b/mysql-test/t/packet.test @@ -31,3 +31,5 @@ set global net_buffer_length=default; set net_buffer_length=default; SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; select length(repeat('a',2000)); + +# End of 4.1 tests diff --git a/mysql-test/t/preload.test b/mysql-test/t/preload.test index 7a049d06a86..1b7f3c5b9eb 100644 --- a/mysql-test/t/preload.test +++ b/mysql-test/t/preload.test @@ -98,3 +98,5 @@ load index into cache t3 key (b), t2 key (c) ; show status like "key_read%"; drop table t1, t2; + +# End of 4.1 tests diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index a4911115c9f..5a2e469fbc4 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -719,3 +719,5 @@ execute stmt; set @@tx_isolation=default; execute stmt; deallocate prepare stmt; + +# End of 4.1 tests diff --git a/mysql-test/t/ps_10nestset.test b/mysql-test/t/ps_10nestset.test index 53e84f7a47d..46a88653da3 100644 --- a/mysql-test/t/ps_10nestset.test +++ b/mysql-test/t/ps_10nestset.test @@ -69,3 +69,5 @@ execute st_round using @arg_round, @arg_round; select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/ps_11bugs.test b/mysql-test/t/ps_11bugs.test index 5945b140645..e214afeaaf3 100644 --- a/mysql-test/t/ps_11bugs.test +++ b/mysql-test/t/ps_11bugs.test @@ -129,3 +129,4 @@ drop table t1, t2; # end of bug#1676 +# End of 4.1 tests diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index bf177a108dd..5752e6b0b66 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -938,3 +938,5 @@ drop table t5 ; # Thank you for reading these rules of thumb. # # Matthias + +# End of 4.1 tests diff --git a/mysql-test/t/ps_2myisam.test b/mysql-test/t/ps_2myisam.test index 534703efc14..0a335bd02a3 100644 --- a/mysql-test/t/ps_2myisam.test +++ b/mysql-test/t/ps_2myisam.test @@ -40,3 +40,5 @@ drop table t2 ; -- source include/ps_conv.inc drop table t1, t9; + +# End of 4.1 tests diff --git a/mysql-test/t/ps_3innodb.test b/mysql-test/t/ps_3innodb.test index f83b61914a2..e25a8b1f469 100644 --- a/mysql-test/t/ps_3innodb.test +++ b/mysql-test/t/ps_3innodb.test @@ -22,3 +22,5 @@ let $type= 'InnoDB' ; -- source include/ps_conv.inc drop table t1, t9; + +# End of 4.1 tests diff --git a/mysql-test/t/ps_4heap.test b/mysql-test/t/ps_4heap.test index a7b2e332af4..9538224bb95 100644 --- a/mysql-test/t/ps_4heap.test +++ b/mysql-test/t/ps_4heap.test @@ -47,3 +47,5 @@ eval create table t9 -- source include/ps_conv.inc drop table t1, t9; + +# End of 4.1 tests diff --git a/mysql-test/t/ps_5merge.test b/mysql-test/t/ps_5merge.test index 9a79842709c..3f4468d569f 100644 --- a/mysql-test/t/ps_5merge.test +++ b/mysql-test/t/ps_5merge.test @@ -82,3 +82,5 @@ INSERT_METHOD=LAST; drop table t1, t1_1, t1_2, t9_1, t9_2, t9; + +# End of 4.1 tests diff --git a/mysql-test/t/ps_6bdb.test b/mysql-test/t/ps_6bdb.test index 5db3349279e..49dd7aa924b 100644 --- a/mysql-test/t/ps_6bdb.test +++ b/mysql-test/t/ps_6bdb.test @@ -21,3 +21,5 @@ let $type= 'BDB' ; -- source include/ps_conv.inc drop table t1, t9; + +# End of 4.1 tests diff --git a/mysql-test/t/ps_7ndb.test b/mysql-test/t/ps_7ndb.test index b558f2f3c21..e3f65ec2c4e 100644 --- a/mysql-test/t/ps_7ndb.test +++ b/mysql-test/t/ps_7ndb.test @@ -21,3 +21,5 @@ let $type= 'NDB' ; -- source include/ps_conv.inc drop table t1, t9; + +# End of 4.1 tests diff --git a/mysql-test/t/ps_grant.test b/mysql-test/t/ps_grant.test index 082ae9d7610..4cb056db358 100644 --- a/mysql-test/t/ps_grant.test +++ b/mysql-test/t/ps_grant.test @@ -111,3 +111,5 @@ commit ; show grants for second_user@localhost ; drop database mysqltest; + +# End of 4.1 tests diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index d5042d34b74..b44c517acb9 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -775,3 +775,5 @@ show status like "Qcache_hits"; drop table t1; set GLOBAL query_cache_size=0; + +# End of 4.1 tests diff --git a/mysql-test/t/query_cache_merge.test b/mysql-test/t/query_cache_merge.test index fef3f18df60..36b8662f088 100644 --- a/mysql-test/t/query_cache_merge.test +++ b/mysql-test/t/query_cache_merge.test @@ -36,3 +36,5 @@ show status like "Qcache_queries_in_cache"; drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t257,t00; SET @@global.query_cache_size=0; + +# End of 4.1 tests diff --git a/mysql-test/t/raid.test b/mysql-test/t/raid.test index 14a55db0c34..3ca5adaaaea 100644 --- a/mysql-test/t/raid.test +++ b/mysql-test/t/raid.test @@ -220,3 +220,5 @@ ALTER TABLE t1 RENAME t2; ALTER TABLE t2 CHANGE COLUMN c c VARCHAR(251) NOT NULL; select count(*) from t2; DROP TABLE t2; + +# End of 4.1 tests diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 92b7b848a8a..944cf6ced18 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -484,3 +484,4 @@ SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 1' OR ARG1 != ' 2'); SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 2' OR ARG1 != ' 1'); drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/rename.test b/mysql-test/t/rename.test index 6fa208f37ec..5caecef176e 100644 --- a/mysql-test/t/rename.test +++ b/mysql-test/t/rename.test @@ -65,3 +65,5 @@ sleep 1; show tables; drop table t2, t4; + +# End of 4.1 tests diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test index ef7043febbc..5e39e0b6a50 100644 --- a/mysql-test/t/repair.test +++ b/mysql-test/t/repair.test @@ -33,3 +33,5 @@ system echo 1 > $MYSQL_TEST_DIR/var/master-data/test/t1.MYI ; repair table t1; repair table t1 use_frm; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/replace.test b/mysql-test/t/replace.test index 8429d80a4ef..81f7b0089b8 100644 --- a/mysql-test/t/replace.test +++ b/mysql-test/t/replace.test @@ -37,3 +37,5 @@ replace into t1 values (126,"first updated"); replace into t1 values (63,default); select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/rollback.test b/mysql-test/t/rollback.test index 3cb1ea3024b..3b8ad901907 100644 --- a/mysql-test/t/rollback.test +++ b/mysql-test/t/rollback.test @@ -21,3 +21,5 @@ select * from t1; select @@warning_count; show warnings; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test index 62e8eb7991c..d8d9a244134 100644 --- a/mysql-test/t/row.test +++ b/mysql-test/t/row.test @@ -82,3 +82,5 @@ select a, MAX(b), (1, MAX(b)) = (1, 4) from t1 group by a; drop table t1; SELECT ROW(2,10) <=> ROW(3,4); SELECT ROW(NULL,10) <=> ROW(3,NULL); + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test index 835af92186f..646f81ceb8d 100644 --- a/mysql-test/t/rpl000001.test +++ b/mysql-test/t/rpl000001.test @@ -123,3 +123,5 @@ drop table t1; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000002.test b/mysql-test/t/rpl000002.test index 4fbb6a595a4..bafd8a30159 100644 --- a/mysql-test/t/rpl000002.test +++ b/mysql-test/t/rpl000002.test @@ -37,3 +37,5 @@ show create table t5; connection master; drop table t2,t3,t5; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000004.test b/mysql-test/t/rpl000004.test index 8fc2977faab..f2a02bd4dd6 100644 --- a/mysql-test/t/rpl000004.test +++ b/mysql-test/t/rpl000004.test @@ -21,3 +21,5 @@ connection slave; sync_with_master; create table t1(n int); drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000005.test b/mysql-test/t/rpl000005.test index b94695c72e1..e81ad739402 100644 --- a/mysql-test/t/rpl000005.test +++ b/mysql-test/t/rpl000005.test @@ -20,3 +20,5 @@ drop table t1; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000006.test b/mysql-test/t/rpl000006.test index 898ef309f50..334ed575835 100644 --- a/mysql-test/t/rpl000006.test +++ b/mysql-test/t/rpl000006.test @@ -43,3 +43,5 @@ drop table t1; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000008.test b/mysql-test/t/rpl000008.test index ea782b99d28..fe030f90411 100644 --- a/mysql-test/t/rpl000008.test +++ b/mysql-test/t/rpl000008.test @@ -34,3 +34,5 @@ save_master_pos; connection slave; sync_with_master; drop table mysqltest_foo,mysqltest_bar,t1; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test index 59451bc888d..a51a64979fa 100644 --- a/mysql-test/t/rpl000009.test +++ b/mysql-test/t/rpl000009.test @@ -170,3 +170,5 @@ sync_with_master; # These has to be droped on slave as they are not replicated drop database mysqltest2; drop database mysqltest3; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000010.test b/mysql-test/t/rpl000010.test index 0725214694a..261b9148774 100644 --- a/mysql-test/t/rpl000010.test +++ b/mysql-test/t/rpl000010.test @@ -16,3 +16,4 @@ save_master_pos; connection slave; sync_with_master; +# End of 4.1 tests diff --git a/mysql-test/t/rpl000011.test b/mysql-test/t/rpl000011.test index 3b00afe10e4..32f6227f7c5 100644 --- a/mysql-test/t/rpl000011.test +++ b/mysql-test/t/rpl000011.test @@ -13,3 +13,5 @@ select * from t1; connection master; drop table t1; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000012.test b/mysql-test/t/rpl000012.test index 7f440eaaa13..2c1c65e4202 100644 --- a/mysql-test/t/rpl000012.test +++ b/mysql-test/t/rpl000012.test @@ -41,3 +41,5 @@ drop table if exists t1,t2; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000013.test b/mysql-test/t/rpl000013.test index 94d5feb3925..eca4803c6bc 100644 --- a/mysql-test/t/rpl000013.test +++ b/mysql-test/t/rpl000013.test @@ -39,3 +39,5 @@ drop table if exists t1,t2; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test index b7fff94f7f3..a9520676e1e 100644 --- a/mysql-test/t/rpl000015.test +++ b/mysql-test/t/rpl000015.test @@ -37,3 +37,5 @@ select * from t1; connection master; drop table t1; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000017.test b/mysql-test/t/rpl000017.test index cf808a2cbc0..7b4e6bf4d3a 100644 --- a/mysql-test/t/rpl000017.test +++ b/mysql-test/t/rpl000017.test @@ -17,3 +17,5 @@ select * from t1; connection master; drop table t1; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl000018.test b/mysql-test/t/rpl000018.test index 884ec9727d2..aee052ffd28 100644 --- a/mysql-test/t/rpl000018.test +++ b/mysql-test/t/rpl000018.test @@ -25,3 +25,5 @@ select * from t1; connection master; drop table t1; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_EE_error.test b/mysql-test/t/rpl_EE_error.test index 1a1572b48b0..da916047b4c 100644 --- a/mysql-test/t/rpl_EE_error.test +++ b/mysql-test/t/rpl_EE_error.test @@ -28,3 +28,5 @@ drop table t1; save_master_pos; connection slave; wait_for_slave_to_stop; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_alter.test b/mysql-test/t/rpl_alter.test index a913f01cd81..576376a0264 100644 --- a/mysql-test/t/rpl_alter.test +++ b/mysql-test/t/rpl_alter.test @@ -20,3 +20,5 @@ drop database mysqltest; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_chain_temp_table.test b/mysql-test/t/rpl_chain_temp_table.test index 007b018e9d8..96e228a17a1 100644 --- a/mysql-test/t/rpl_chain_temp_table.test +++ b/mysql-test/t/rpl_chain_temp_table.test @@ -97,3 +97,5 @@ sync_with_master; # memory they use is freed (it should) by mysqld before it terminates). # If they wouldn't be cleaned up, you would see some "still reachable" blocks in # Valgrind. + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_change_master.test b/mysql-test/t/rpl_change_master.test index e6452b5b619..42c19b67566 100644 --- a/mysql-test/t/rpl_change_master.test +++ b/mysql-test/t/rpl_change_master.test @@ -28,3 +28,5 @@ drop table t1; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_charset.test b/mysql-test/t/rpl_charset.test index 3f7eabfa434..cf079048fc3 100644 --- a/mysql-test/t/rpl_charset.test +++ b/mysql-test/t/rpl_charset.test @@ -182,3 +182,5 @@ set @p=_latin1 'test'; update t1 set pk='test' where pk=@p; drop table t1; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_commit_after_flush.test b/mysql-test/t/rpl_commit_after_flush.test index 62c89b3aae6..6129e5485a6 100644 --- a/mysql-test/t/rpl_commit_after_flush.test +++ b/mysql-test/t/rpl_commit_after_flush.test @@ -15,3 +15,5 @@ drop table t1; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_create_database.test b/mysql-test/t/rpl_create_database.test index 7ed0d5dbdbb..96781b25f20 100644 --- a/mysql-test/t/rpl_create_database.test +++ b/mysql-test/t/rpl_create_database.test @@ -68,3 +68,5 @@ DROP DATABASE IF EXISTS mysqltest_prometheus; DROP DATABASE IF EXISTS mysqltest_sisyfos; DROP DATABASE IF EXISTS mysqltest_bob; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/t/rpl_ddl.test index 301a55b5493..ce9518e80ec 100644 --- a/mysql-test/t/rpl_ddl.test +++ b/mysql-test/t/rpl_ddl.test @@ -344,3 +344,5 @@ DROP DATABASE IF EXISTS mysqltest1; DROP DATABASE IF EXISTS mysqltest2; DROP DATABASE IF EXISTS mysqltest3; --enable_warnings + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_deadlock.test b/mysql-test/t/rpl_deadlock.test index da932df5347..7310aa665aa 100644 --- a/mysql-test/t/rpl_deadlock.test +++ b/mysql-test/t/rpl_deadlock.test @@ -109,3 +109,5 @@ show slave status; connection master; drop table t1,t2,t3,t4; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_delete_all.test b/mysql-test/t/rpl_delete_all.test index ad2ce29c610..db33ee3bb86 100644 --- a/mysql-test/t/rpl_delete_all.test +++ b/mysql-test/t/rpl_delete_all.test @@ -39,3 +39,5 @@ select * from t1; connection master; drop table t1; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_do_grant.test b/mysql-test/t/rpl_do_grant.test index 27a22874497..54287a67657 100644 --- a/mysql-test/t/rpl_do_grant.test +++ b/mysql-test/t/rpl_do_grant.test @@ -44,3 +44,5 @@ sync_with_master; # no need to delete manually, as the DELETEs must have done some real job on # master (updated binlog) flush privileges; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_drop.test b/mysql-test/t/rpl_drop.test index ab5b608cab6..2544599208e 100644 --- a/mysql-test/t/rpl_drop.test +++ b/mysql-test/t/rpl_drop.test @@ -10,3 +10,5 @@ drop table t1, t2; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_drop_temp.test b/mysql-test/t/rpl_drop_temp.test index 73d691d9d90..e1c06ef4473 100644 --- a/mysql-test/t/rpl_drop_temp.test +++ b/mysql-test/t/rpl_drop_temp.test @@ -11,3 +11,5 @@ disconnect master; connection slave; --real_sleep 3; # time for DROP to be written show status like 'Slave_open_temp_tables'; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_empty_master_crash.test b/mysql-test/t/rpl_empty_master_crash.test index bee9ef72dc4..eae967a4bb1 100644 --- a/mysql-test/t/rpl_empty_master_crash.test +++ b/mysql-test/t/rpl_empty_master_crash.test @@ -11,3 +11,5 @@ load table t1 from master; connection slave; --error 1188 load table t1 from master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_error_ignored_table.test b/mysql-test/t/rpl_error_ignored_table.test index 0062a67ff1a..09de2d965f0 100644 --- a/mysql-test/t/rpl_error_ignored_table.test +++ b/mysql-test/t/rpl_error_ignored_table.test @@ -54,3 +54,5 @@ connection slave; # SQL slave thread should not have stopped (because table of the killed # query is in the ignore list). sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_failed_optimize.test b/mysql-test/t/rpl_failed_optimize.test index d245d1bacbb..57afaa89e83 100644 --- a/mysql-test/t/rpl_failed_optimize.test +++ b/mysql-test/t/rpl_failed_optimize.test @@ -16,3 +16,5 @@ OPTIMIZE TABLE t1; OPTIMIZE TABLE non_existing; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_failsafe.test b/mysql-test/t/rpl_failsafe.test index ae61b061153..4336d897fc0 100644 --- a/mysql-test/t/rpl_failsafe.test +++ b/mysql-test/t/rpl_failsafe.test @@ -20,3 +20,5 @@ start slave; sync_with_master; show variables like 'rpl_recovery_rank'; show status like 'Rpl_status'; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_flush_log_loop.test b/mysql-test/t/rpl_flush_log_loop.test index 74920722868..b0c6de76878 100644 --- a/mysql-test/t/rpl_flush_log_loop.test +++ b/mysql-test/t/rpl_flush_log_loop.test @@ -20,3 +20,5 @@ sleep 5; --replace_result $SLAVE_MYPORT SLAVE_PORT --replace_column 1 # 33 # show slave status; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_flush_tables.test b/mysql-test/t/rpl_flush_tables.test index b98235fbed8..846e2cd56ee 100644 --- a/mysql-test/t/rpl_flush_tables.test +++ b/mysql-test/t/rpl_flush_tables.test @@ -33,3 +33,5 @@ sync_with_master; select * from t3; # Note that all this confusion may cause warnings 'table xx is open on rename' # in the .err files; these are not fatal and are not reported by mysql-test-run. + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_free_items.test b/mysql-test/t/rpl_free_items.test index 3228ffd9cde..043e84160b8 100644 --- a/mysql-test/t/rpl_free_items.test +++ b/mysql-test/t/rpl_free_items.test @@ -18,3 +18,5 @@ connection master; drop table t1; drop table t2; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_get_lock.test b/mysql-test/t/rpl_get_lock.test index 5e58753e59a..a0e3c829c11 100644 --- a/mysql-test/t/rpl_get_lock.test +++ b/mysql-test/t/rpl_get_lock.test @@ -32,3 +32,5 @@ drop table t1; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_heap.test b/mysql-test/t/rpl_heap.test index 0bc71eaf30c..66dac1d7926 100644 --- a/mysql-test/t/rpl_heap.test +++ b/mysql-test/t/rpl_heap.test @@ -47,3 +47,5 @@ drop table t1; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_ignore_grant.test b/mysql-test/t/rpl_ignore_grant.test index 9b012d08df3..2e6e2ce9a31 100644 --- a/mysql-test/t/rpl_ignore_grant.test +++ b/mysql-test/t/rpl_ignore_grant.test @@ -55,3 +55,5 @@ sync_with_master; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_init_slave.test b/mysql-test/t/rpl_init_slave.test index 3ea04117ced..cefb04a7b75 100644 --- a/mysql-test/t/rpl_init_slave.test +++ b/mysql-test/t/rpl_init_slave.test @@ -24,3 +24,5 @@ save_master_pos; connection slave; sync_with_master; stop slave; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_innodb.test b/mysql-test/t/rpl_innodb.test index b171dced26e..551657fd7e3 100644 --- a/mysql-test/t/rpl_innodb.test +++ b/mysql-test/t/rpl_innodb.test @@ -44,3 +44,5 @@ connection master; DROP TABLE t4; --enable_query_log sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/t/rpl_insert_id.test index a4506e32963..704de1a423b 100644 --- a/mysql-test/t/rpl_insert_id.test +++ b/mysql-test/t/rpl_insert_id.test @@ -74,6 +74,4 @@ SET FOREIGN_KEY_CHECKS=0; INSERT INTO t1 VALUES (1),(1); sync_slave_with_master; - - - +# End of 4.1 tests diff --git a/mysql-test/t/rpl_insert_ignore.test b/mysql-test/t/rpl_insert_ignore.test index 58eaa287817..a6cc69b1df8 100644 --- a/mysql-test/t/rpl_insert_ignore.test +++ b/mysql-test/t/rpl_insert_ignore.test @@ -69,3 +69,5 @@ SELECT * FROM t1 ORDER BY a; connection master; drop table t1, t2; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_loaddata.test b/mysql-test/t/rpl_loaddata.test index 10213644836..2af9929e5b6 100644 --- a/mysql-test/t/rpl_loaddata.test +++ b/mysql-test/t/rpl_loaddata.test @@ -131,3 +131,5 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by # long as expected (can't do SHOW BINLOG EVENTS because of varying file_id). show master status; drop table t2; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_loaddata_rule_m.test b/mysql-test/t/rpl_loaddata_rule_m.test index 678dae13889..1ece82122ea 100644 --- a/mysql-test/t/rpl_loaddata_rule_m.test +++ b/mysql-test/t/rpl_loaddata_rule_m.test @@ -21,3 +21,5 @@ use mysqltest; load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; show binlog events from 79; # should be nothing drop database mysqltest; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_loaddata_rule_s.test b/mysql-test/t/rpl_loaddata_rule_s.test index 1ea4f6825f5..b4a9b5b2ee0 100644 --- a/mysql-test/t/rpl_loaddata_rule_s.test +++ b/mysql-test/t/rpl_loaddata_rule_s.test @@ -18,3 +18,5 @@ connection slave; sync_with_master; select count(*) from t1; # check that LOAD was replicated show binlog events from 79; # should be nothing + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_loaddatalocal.test b/mysql-test/t/rpl_loaddatalocal.test index 70f4ab96b6a..2ca142c3b64 100644 --- a/mysql-test/t/rpl_loaddatalocal.test +++ b/mysql-test/t/rpl_loaddatalocal.test @@ -34,3 +34,5 @@ drop table t1; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_log.test b/mysql-test/t/rpl_log.test index 8fdccdd068d..7a67ab2311a 100644 --- a/mysql-test/t/rpl_log.test +++ b/mysql-test/t/rpl_log.test @@ -107,3 +107,5 @@ show slave status; --error 1220 show binlog events in 'slave-bin.000005' from 4; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_log_pos.test b/mysql-test/t/rpl_log_pos.test index a40736577c8..25a485c7947 100644 --- a/mysql-test/t/rpl_log_pos.test +++ b/mysql-test/t/rpl_log_pos.test @@ -45,3 +45,5 @@ select * from t1; connection master; drop table t1; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_many_optimize.test b/mysql-test/t/rpl_many_optimize.test index 525e23abe15..91fab0b27a8 100644 --- a/mysql-test/t/rpl_many_optimize.test +++ b/mysql-test/t/rpl_many_optimize.test @@ -18,3 +18,5 @@ enable_query_log; drop table t1; # Bug was that slave segfaulted after ~ a hundred of OPTIMIZE (or ANALYZE) sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_master_pos_wait.test b/mysql-test/t/rpl_master_pos_wait.test index 4d4d51b04ab..893c8746efc 100644 --- a/mysql-test/t/rpl_master_pos_wait.test +++ b/mysql-test/t/rpl_master_pos_wait.test @@ -14,3 +14,5 @@ connection slave1; stop slave sql_thread; connection slave; reap; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_max_relay_size.test b/mysql-test/t/rpl_max_relay_size.test index cbcc115a942..c01041d7eee 100644 --- a/mysql-test/t/rpl_max_relay_size.test +++ b/mysql-test/t/rpl_max_relay_size.test @@ -91,3 +91,5 @@ connection master; # test that the absence of relay logs does not make a master crash flush logs; show master status; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_misc_functions.test b/mysql-test/t/rpl_misc_functions.test index 12eadbb25ed..f20d0aa83e4 100644 --- a/mysql-test/t/rpl_misc_functions.test +++ b/mysql-test/t/rpl_misc_functions.test @@ -28,3 +28,5 @@ load data local infile './var/master-data/test/rpl_misc_functions.outfile' into # compare them with the replica; the SELECT below should return no row select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p); stop slave; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_multi_delete.test b/mysql-test/t/rpl_multi_delete.test index 299cb720b62..2fd7b820b1a 100644 --- a/mysql-test/t/rpl_multi_delete.test +++ b/mysql-test/t/rpl_multi_delete.test @@ -21,3 +21,5 @@ drop table t1,t2; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_multi_delete2.test b/mysql-test/t/rpl_multi_delete2.test index c5128833843..62d95a3a90f 100644 --- a/mysql-test/t/rpl_multi_delete2.test +++ b/mysql-test/t/rpl_multi_delete2.test @@ -21,3 +21,5 @@ select * from t2; connection master; drop table t1,t2; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_multi_query.test b/mysql-test/t/rpl_multi_query.test index 482a2679e7a..7c764bd4ea2 100644 --- a/mysql-test/t/rpl_multi_query.test +++ b/mysql-test/t/rpl_multi_query.test @@ -27,3 +27,5 @@ connection master; show binlog events from 79; drop database mysqltest; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_multi_update.test b/mysql-test/t/rpl_multi_update.test index 88994aa66bd..dd75edb3055 100644 --- a/mysql-test/t/rpl_multi_update.test +++ b/mysql-test/t/rpl_multi_update.test @@ -22,3 +22,5 @@ UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/t/rpl_multi_update2.test index bba7700a88e..f92c5504f43 100644 --- a/mysql-test/t/rpl_multi_update2.test +++ b/mysql-test/t/rpl_multi_update2.test @@ -31,3 +31,5 @@ connection slave; sync_with_master; SELECT * FROM t1 ORDER BY a; SELECT * FROM t2 ORDER BY a; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_multi_update3.test b/mysql-test/t/rpl_multi_update3.test index 80b0603eb60..64e46882c16 100644 --- a/mysql-test/t/rpl_multi_update3.test +++ b/mysql-test/t/rpl_multi_update3.test @@ -157,3 +157,5 @@ SELECT * FROM t1; connection master; DROP TABLE t1, t2, t3; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_mystery22.test b/mysql-test/t/rpl_mystery22.test index d49f1a210f4..f190968a03c 100644 --- a/mysql-test/t/rpl_mystery22.test +++ b/mysql-test/t/rpl_mystery22.test @@ -37,3 +37,4 @@ connection master; drop table t1; sync_slave_with_master; +# End of 4.1 tests diff --git a/mysql-test/t/rpl_openssl.test b/mysql-test/t/rpl_openssl.test index 8a36904f4d4..a9138d1d46a 100644 --- a/mysql-test/t/rpl_openssl.test +++ b/mysql-test/t/rpl_openssl.test @@ -60,3 +60,5 @@ sync_with_master; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 33 # show slave status; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_optimize.test b/mysql-test/t/rpl_optimize.test index 9f02b715885..6858f52abab 100644 --- a/mysql-test/t/rpl_optimize.test +++ b/mysql-test/t/rpl_optimize.test @@ -41,3 +41,5 @@ sync_with_master; # If the machine is so fast that slave syncs before OPTIMIZE # starts, this test wil demonstrate nothing but will pass. + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_ps.test b/mysql-test/t/rpl_ps.test index 79f48381a4f..adf39b1e4ab 100644 --- a/mysql-test/t/rpl_ps.test +++ b/mysql-test/t/rpl_ps.test @@ -41,3 +41,4 @@ connection slave; sync_with_master; stop slave; +# End of 4.1 tests diff --git a/mysql-test/t/rpl_redirect.test b/mysql-test/t/rpl_redirect.test index c533c0052f0..18f68b1fd03 100644 --- a/mysql-test/t/rpl_redirect.test +++ b/mysql-test/t/rpl_redirect.test @@ -41,3 +41,5 @@ select * from t1; drop table t1; connection master; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_relayrotate.test b/mysql-test/t/rpl_relayrotate.test index 1bc6b574663..1dab8bf4ed5 100644 --- a/mysql-test/t/rpl_relayrotate.test +++ b/mysql-test/t/rpl_relayrotate.test @@ -73,3 +73,5 @@ drop table t1; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_relayspace.test b/mysql-test/t/rpl_relayspace.test index bb82781b511..70315c14f34 100644 --- a/mysql-test/t/rpl_relayspace.test +++ b/mysql-test/t/rpl_relayspace.test @@ -30,3 +30,5 @@ start slave; # also the slave will probably not cooperate to shutdown # (as 2 threads are locked) select master_pos_wait('master-bin.001',200,6)=-1; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_replicate_do.test b/mysql-test/t/rpl_replicate_do.test index 7066f6e53d8..98374240dd5 100644 --- a/mysql-test/t/rpl_replicate_do.test +++ b/mysql-test/t/rpl_replicate_do.test @@ -36,3 +36,4 @@ sync_with_master; --replace_column 1 # 33 # show slave status; +# End of 4.1 tests diff --git a/mysql-test/t/rpl_reset_slave.test b/mysql-test/t/rpl_reset_slave.test index d58e9c711d1..102c72d9882 100644 --- a/mysql-test/t/rpl_reset_slave.test +++ b/mysql-test/t/rpl_reset_slave.test @@ -46,3 +46,5 @@ reset slave; start slave; sync_with_master; show status like 'slave_open_temp_tables'; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_rewrite_db.test b/mysql-test/t/rpl_rewrite_db.test index b77d57294fa..1e8e5a992d8 100644 --- a/mysql-test/t/rpl_rewrite_db.test +++ b/mysql-test/t/rpl_rewrite_db.test @@ -78,3 +78,4 @@ drop database rewrite; connection master; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index da4d5f0bce1..15d539000bf 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -151,3 +151,5 @@ unlock tables; connection master; drop table if exists t1,t2,t3,t4; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_server_id1.test b/mysql-test/t/rpl_server_id1.test index 4d504325294..3583f05284c 100644 --- a/mysql-test/t/rpl_server_id1.test +++ b/mysql-test/t/rpl_server_id1.test @@ -22,3 +22,5 @@ insert into t1 values (1); sleep 2; # enough time for the event to be replicated (it should not) show status like "slave_running"; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_server_id2.test b/mysql-test/t/rpl_server_id2.test index 7bbac358ada..0f2eb560d18 100644 --- a/mysql-test/t/rpl_server_id2.test +++ b/mysql-test/t/rpl_server_id2.test @@ -22,3 +22,5 @@ select * from t1; # check that indeed 2 were inserted # (not critical). stop slave; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_set_charset.test b/mysql-test/t/rpl_set_charset.test index 269074b1c42..c70eb2681f5 100644 --- a/mysql-test/t/rpl_set_charset.test +++ b/mysql-test/t/rpl_set_charset.test @@ -31,3 +31,5 @@ drop database mysqltest1; save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_skip_error.test b/mysql-test/t/rpl_skip_error.test index 86c89c70314..e0e569a65b7 100644 --- a/mysql-test/t/rpl_skip_error.test +++ b/mysql-test/t/rpl_skip_error.test @@ -12,3 +12,5 @@ save_master_pos; connection slave; sync_with_master; select * from t1; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_sporadic_master.test b/mysql-test/t/rpl_sporadic_master.test index b24901c62a9..26b633a1c4f 100644 --- a/mysql-test/t/rpl_sporadic_master.test +++ b/mysql-test/t/rpl_sporadic_master.test @@ -22,3 +22,5 @@ select * from t1; connection master; drop table t1,t2; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_start_stop_slave.test b/mysql-test/t/rpl_start_stop_slave.test index 903ff204194..19988cf902a 100644 --- a/mysql-test/t/rpl_start_stop_slave.test +++ b/mysql-test/t/rpl_start_stop_slave.test @@ -32,3 +32,5 @@ save_master_pos; connection slave; sync_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_temporary.test b/mysql-test/t/rpl_temporary.test index f84c9b09aef..8dead9138c1 100644 --- a/mysql-test/t/rpl_temporary.test +++ b/mysql-test/t/rpl_temporary.test @@ -129,3 +129,5 @@ create temporary table t3 (f int); sync_with_master; # The server will now close done + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_timezone.test b/mysql-test/t/rpl_timezone.test index 8dff90a84cf..d371e8b62e5 100644 --- a/mysql-test/t/rpl_timezone.test +++ b/mysql-test/t/rpl_timezone.test @@ -82,3 +82,5 @@ set global time_zone='MET'; # Clean up drop table t1, t2; sync_slave_with_master; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_trunc_binlog.test b/mysql-test/t/rpl_trunc_binlog.test index 2ade41ee96d..9cdf1d8ddbd 100644 --- a/mysql-test/t/rpl_trunc_binlog.test +++ b/mysql-test/t/rpl_trunc_binlog.test @@ -23,3 +23,5 @@ sleep 3; --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 23 # 33 # show slave status; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_until.test b/mysql-test/t/rpl_until.test index 45b343ace14..2d9693e8246 100644 --- a/mysql-test/t/rpl_until.test +++ b/mysql-test/t/rpl_until.test @@ -80,3 +80,5 @@ start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; start slave sql_thread; start slave until master_log_file='master-bin.000001', master_log_pos=561; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_user_variables.test b/mysql-test/t/rpl_user_variables.test index 73b3ace473e..5cf502e05bd 100644 --- a/mysql-test/t/rpl_user_variables.test +++ b/mysql-test/t/rpl_user_variables.test @@ -53,3 +53,5 @@ save_master_pos; connection slave; sync_with_master; stop slave; + +# End of 4.1 tests diff --git a/mysql-test/t/rpl_variables.test b/mysql-test/t/rpl_variables.test index b332c006118..8c5279c0420 100644 --- a/mysql-test/t/rpl_variables.test +++ b/mysql-test/t/rpl_variables.test @@ -2,3 +2,5 @@ source include/master-slave.inc; set global slave_net_timeout=100; set global sql_slave_skip_counter=100; + +# End of 4.1 tests diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 3ae5839cd3c..b51ea89c7dd 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2163,3 +2163,5 @@ select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; select found_rows(); DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test index 91879015b51..e4bc54a5538 100644 --- a/mysql-test/t/select_found.test +++ b/mysql-test/t/select_found.test @@ -191,3 +191,5 @@ INSERT INTO t1 VALUES (1,2), (1,3), (1,4), (1,5); SELECT SQL_CALC_FOUND_ROWS DISTINCT 'a' FROM t1 GROUP BY b LIMIT 2; SELECT FOUND_ROWS(); DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/select_safe.test b/mysql-test/t/select_safe.test index 5b2dfb00bb7..236370bef03 100644 --- a/mysql-test/t/select_safe.test +++ b/mysql-test/t/select_safe.test @@ -87,3 +87,5 @@ select * from (select 1 union select 2 union select 3) x; drop table t1; SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT; + +# End of 4.1 tests diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 76691ad79b1..e6a404e3b57 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -377,3 +377,5 @@ create table t1 ( ); SHOW CREATE TABLE t1; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/skip_name_resolve.test b/mysql-test/t/skip_name_resolve.test index b669579acbf..02339ca14c5 100644 --- a/mysql-test/t/skip_name_resolve.test +++ b/mysql-test/t/skip_name_resolve.test @@ -6,3 +6,5 @@ GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255'; SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255'; REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255'; DROP USER mysqltest_1@'127.0.0.1/255.255.255.255'; + +# End of 4.1 tests diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test index 985c0853bd2..4a5a136f54a 100644 --- a/mysql-test/t/sql_mode.test +++ b/mysql-test/t/sql_mode.test @@ -85,3 +85,5 @@ drop table t1 ; # --error 1231 set @@SQL_MODE=NULL; + +# End of 4.1 tests diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index 31d9c8154d5..7fea51c9327 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -35,3 +35,5 @@ connection con1; reap; show status like 'Table_lock%'; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 12593438805..e58d6c490a5 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1754,3 +1754,5 @@ insert into t1 values ('1'); select * from (select max(fld) from t1) as foo; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/subselect2.test b/mysql-test/t/subselect2.test index 2d42320334a..839e94206d0 100644 --- a/mysql-test/t/subselect2.test +++ b/mysql-test/t/subselect2.test @@ -146,4 +146,5 @@ SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JOIN t4 ON EXPLAIN SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JOIN t4 ON t2.DOCTYPEID = t4.DOCTYPEID LEFT OUTER JOIN t1 ON t2.DOCID = t1.DOCID WHERE t2.FOLDERID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID='2f6161e879db43c1a5b82c21ddc49089' AND t3.FOLDERNAME = 'Level1') AND t3.FOLDERNAME = 'Level2') AND t3.FOLDERNAME = 'Level3') AND t3.FOLDERNAME = 'CopiedFolder') AND t3.FOLDERNAME = 'Movie Reviews') AND t2.DOCNAME = 'Last Discussion'; -drop table t1, t2, t3, t4; \ No newline at end of file +drop table t1, t2, t3, t4; +# End of 4.1 tests diff --git a/mysql-test/t/subselect_gis.test b/mysql-test/t/subselect_gis.test index 338051029c4..1ab139b7822 100644 --- a/mysql-test/t/subselect_gis.test +++ b/mysql-test/t/subselect_gis.test @@ -13,3 +13,5 @@ select City from t1 where (select intersects(GeomFromText(AsText(Location)),GeomFromText('Polygon((2 50, 2.5 50, 2.5 47, 2 47, 2 50))'))=0); drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 5d796988178..3b1d2f393c2 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -159,3 +159,5 @@ EXECUTE my_stmt; EXECUTE my_stmt; deallocate prepare my_stmt; drop table t1,t2; + +# End of 4.1 tests diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index ddde5171200..85ad04aa556 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -130,3 +130,5 @@ eval create table t1 (i int) index directory = "$MYSQL_TEST_DIR/var/master-data/ enable_query_log; show create table t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/synchronization.test b/mysql-test/t/synchronization.test index 7bdeaa8a740..ec7c7dd6545 100644 --- a/mysql-test/t/synchronization.test +++ b/mysql-test/t/synchronization.test @@ -31,3 +31,5 @@ while ($1) dec $1; } DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/system_mysql_db.test b/mysql-test/t/system_mysql_db.test index a6d683489c3..0892af77fb2 100644 --- a/mysql-test/t/system_mysql_db.test +++ b/mysql-test/t/system_mysql_db.test @@ -11,3 +11,5 @@ use test; -- enable_query_log # keep results same with system_mysql_db_fix show tables; + +# End of 4.1 tests diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test index d0aae7b411c..583ca293baa 100644 --- a/mysql-test/t/system_mysql_db_fix.test +++ b/mysql-test/t/system_mysql_db_fix.test @@ -83,3 +83,5 @@ DROP TABLE db, host, user, func, tables_priv, columns_priv, help_category, help_ # check that we droped all system tables show tables; + +# End of 4.1 tests diff --git a/mysql-test/t/system_mysql_db_refs.test b/mysql-test/t/system_mysql_db_refs.test index 9e2c5a20b54..c5146e1b043 100644 --- a/mysql-test/t/system_mysql_db_refs.test +++ b/mysql-test/t/system_mysql_db_refs.test @@ -99,3 +99,5 @@ drop table test_func; drop table test_host; drop table test_user; drop table test_db; + +# End of 4.1 tests diff --git a/mysql-test/t/tablelock.test b/mysql-test/t/tablelock.test index fbc5d685096..95533903b45 100644 --- a/mysql-test/t/tablelock.test +++ b/mysql-test/t/tablelock.test @@ -47,3 +47,5 @@ CREATE TABLE t2 (a int); lock tables t1 write,t1 as b write, t2 write, t2 as c read; drop table t2,t1; unlock tables; + +# End of 4.1 tests diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index 3e60917783a..309855d0b2d 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -98,3 +98,5 @@ insert into t1 values (3,1),(3,2); insert into t2 values (NULL, 'foo'), (NULL, 'bar'); select d, c from t1 left join t2 on b = c where a = 3 order by d; drop table t1, t2; + +# End of 4.1 tests diff --git a/mysql-test/t/timezone.test b/mysql-test/t/timezone.test index ffc2e3a3ebf..34bbb365c70 100644 --- a/mysql-test/t/timezone.test +++ b/mysql-test/t/timezone.test @@ -58,3 +58,5 @@ select unix_timestamp('1970-01-01 01:00:00'), unix_timestamp('1970-01-01 01:00:01'), unix_timestamp('2038-01-01 00:59:59'), unix_timestamp('2038-01-01 01:00:00'); + +# End of 4.1 tests diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test index f952c0f65b2..523249a3a2c 100644 --- a/mysql-test/t/timezone2.test +++ b/mysql-test/t/timezone2.test @@ -215,3 +215,5 @@ select convert_tz('2005-01-14 17:00:00', 'UTC', custTimeZone) from (select 'UTC' create table t1 select convert_tz(NULL, NULL, NULL); select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/timezone3.test b/mysql-test/t/timezone3.test index 8910783cd85..0aedbafcec4 100644 --- a/mysql-test/t/timezone3.test +++ b/mysql-test/t/timezone3.test @@ -57,3 +57,5 @@ create table t1 (ts timestamp); insert into t1 values (19730101235900), (20040101235900); select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/timezone_grant.test b/mysql-test/t/timezone_grant.test index 8627866a0bf..d02901b162b 100644 --- a/mysql-test/t/timezone_grant.test +++ b/mysql-test/t/timezone_grant.test @@ -81,3 +81,4 @@ delete from mysql.tables_priv where user like 'mysqltest\_%'; flush privileges; drop table t1, t2; +# End of 4.1 tests diff --git a/mysql-test/t/truncate.test b/mysql-test/t/truncate.test index b7ec506ecf1..f806bd8ec17 100644 --- a/mysql-test/t/truncate.test +++ b/mysql-test/t/truncate.test @@ -50,3 +50,5 @@ delete from t1; insert into t1 (a) values (NULL),(NULL); SELECT * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index b081c27cb30..2ac55da7442 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -384,4 +384,4 @@ INSERT t1 (i, c) VALUES (1,''),(2,''),(3,'asdfh'),(4,''); select max(i) from t1 where c = ''; drop table t1; - +# End of 4.1 tests diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index 304ed19b971..78bdd9b8a80 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -114,3 +114,5 @@ CREATE TABLE t1 (y YEAR); INSERT INTO t1 VALUES ('abc'); SELECT * FROM t1; DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index a7eb78cb292..f60bc5adb16 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -101,3 +101,5 @@ insert into t1 values ("12-00-00"), ("00-00-00 01:00:00"); insert into t1 values ("00-00-00"), ("00-00-00 00:00:00"); select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 414a06deaa9..a6fd99e8c9a 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -265,3 +265,5 @@ insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000 --enable_warnings select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test index 6b2183df069..0d479f312cd 100644 --- a/mysql-test/t/type_enum.test +++ b/mysql-test/t/type_enum.test @@ -126,3 +126,5 @@ create table t1 (a set('x','y') default 'x'); --error 1067 alter table t1 alter a set default 'z'; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 41812ef2652..2d4a90911a1 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -148,3 +148,5 @@ select * from t1 where reckey=1.08E2; select * from t1 where reckey=109; select * from t1 where reckey=1.09E2; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/type_nchar.test b/mysql-test/t/type_nchar.test index e85609e3f0c..f2258830450 100644 --- a/mysql-test/t/type_nchar.test +++ b/mysql-test/t/type_nchar.test @@ -33,3 +33,4 @@ create table t1 (c nchar varying(10)); show create table t1; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/type_ranges.test b/mysql-test/t/type_ranges.test index fb089cfd3df..945d3577046 100644 --- a/mysql-test/t/type_ranges.test +++ b/mysql-test/t/type_ranges.test @@ -165,3 +165,5 @@ drop table t3; create table t3 select t1.id as id_A, t2.id as id_B from t1 left join t2 using ( id ); select * from t3; drop table t1,t2,t3; + +# End of 4.1 tests diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test index b6410a9ea3d..56df3328246 100644 --- a/mysql-test/t/type_set.test +++ b/mysql-test/t/type_set.test @@ -37,3 +37,5 @@ INSERT INTO t1 VALUES ('ae,oe,ue,ss'); SELECT c FROM t1 ORDER BY c; SELECT c FROM t1 ORDER BY concat(c); DROP TABLE t1; + +# End of 4.1 tests diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test index 2f342f8bf67..7ae3f65f7cc 100644 --- a/mysql-test/t/type_time.test +++ b/mysql-test/t/type_time.test @@ -20,3 +20,5 @@ insert into t1 values ('09:00:00'),('13:00:00'),('19:38:34'), ('13:00:00'),('09: select t, time_to_sec(t),sec_to_time(time_to_sec(t)) from t1; select sec_to_time(time_to_sec(t)) from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 3c7f07dfbce..81c547c32f6 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -319,3 +319,4 @@ insert into t1 (a, c) values (4, '2004-04-04 00:00:00'), select * from t1; drop table t1; +# End of 4.1 tests diff --git a/mysql-test/t/type_uint.test b/mysql-test/t/type_uint.test index b1f59242e8e..a9212183cb6 100644 --- a/mysql-test/t/type_uint.test +++ b/mysql-test/t/type_uint.test @@ -13,3 +13,5 @@ insert into t1 values (-1); insert into t1 values ('5000000000'); select * from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test index c67b8447494..9744da24c02 100644 --- a/mysql-test/t/type_year.test +++ b/mysql-test/t/type_year.test @@ -20,3 +20,5 @@ create table t1 (y year); insert into t1 values (now()); select if(y = now(), 1, 0) from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 3666e3c3127..6acccaeafd5 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -763,3 +763,5 @@ insert into t1 (col1) values (2),(3),(4),(5),(6); select 99 union all select id from t1 order by 1; select id from t1 union all select 99 order by 1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 41f7d37e6d0..e4e751862f1 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -214,3 +214,5 @@ insert into t2 values(1,1),(2,2); UPDATE t1 SET t1.f2=(SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1); select * from t1; drop table t1,t2; + +# End of 4.1 tests diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test index 8b11ea735ad..6373a1cc426 100644 --- a/mysql-test/t/user_var-binlog.test +++ b/mysql-test/t/user_var-binlog.test @@ -17,3 +17,5 @@ show binlog events from 79; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index a288b7ef708..6409d4ffea5 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -119,3 +119,5 @@ select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4); set session @honk=99; --error 1105 set one_shot @honk=99; + +# End of 4.1 tests diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test index 9425bd7bd99..5fbd116d7b8 100644 --- a/mysql-test/t/varbinary.test +++ b/mysql-test/t/varbinary.test @@ -35,3 +35,5 @@ select 0xfg; create table t1 select 1 as x, 2 as xx; select x,xx from t1; drop table t1; + +# End of 4.1 tests diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index b8a12323cf9..7743b70d0cd 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -379,3 +379,5 @@ SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; SET GLOBAL table_cache=-1; SHOW VARIABLES LIKE 'table_cache'; SET GLOBAL table_cache=DEFAULT; + +# End of 4.1 tests diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index 6a6d533ad61..4bc8a338a35 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -155,3 +155,5 @@ select * from t1 limit 0; select * from t1 limit 1, 0; select * from t1 limit 0, 0; drop table t1; + +# End of 4.1 tests From a6350b1d05cacde74f606fdcbdf51f7acca9e965 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 12:30:52 +0300 Subject: [PATCH 059/144] row_sel_store_mysql_rec(): Convert NULL true VARCHAR columns correctly. innobase/row/row0sel.c: Initialize NULL true VARCHAR columns with NUL bytes, as that is what the columns will contain in handler::write_row(). (Bug #12186) mysql-test/r/innodb.result: Update table checksums to reflect the new handling of true VARCHAR columns that are NULL. --- innobase/row/row0sel.c | 12 ++++++++++-- mysql-test/r/innodb.result | 8 ++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 602f5855171..9234c4aeb26 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2524,11 +2524,19 @@ row_sel_store_mysql_rec( (byte) (templ->mysql_null_bit_mask); switch (templ->type) { case DATA_VARCHAR: - case DATA_CHAR: case DATA_BINARY: + case DATA_VARMYSQL: + if (templ->mysql_type + == DATA_MYSQL_TRUE_VARCHAR) { + /* This is a >= 5.0.3 type + true VARCHAR. Zero the field. */ + pad_char = 0x00; + break; + } + /* Fall through */ + case DATA_CHAR: case DATA_FIXBINARY: case DATA_MYSQL: - case DATA_VARMYSQL: /* MySQL pads all non-BLOB and non-TEXT string types with space ' ' */ if (UNIV_UNLIKELY(templ->mbminlen == 2)) { diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 2c73cbeeea4..2bdec5125dd 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1452,16 +1452,16 @@ Error 1146 Table 'test.t4' doesn't exist checksum table t1, t2, t3, t4; Table Checksum test.t1 2948697075 -test.t2 1157260244 -test.t3 1157260244 +test.t2 3835700799 +test.t3 3835700799 test.t4 NULL Warnings: Error 1146 Table 'test.t4' doesn't exist checksum table t1, t2, t3, t4 extended; Table Checksum test.t1 3092701434 -test.t2 1157260244 -test.t3 1157260244 +test.t2 3835700799 +test.t3 3835700799 test.t4 NULL Warnings: Error 1146 Table 'test.t4' doesn't exist From 2562ba5591bb8aae0aee6d8a42fea2141d1cb123 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 13:15:36 +0300 Subject: [PATCH 060/144] row0sel.c: row_sel_store_mysql_rec(): Make comment about space padding more accurate. innobase/row/row0sel.c: row_sel_store_mysql_rec(): Make comment about space padding more accurate. --- innobase/row/row0sel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 9234c4aeb26..0b563eb147e 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2537,8 +2537,8 @@ row_sel_store_mysql_rec( case DATA_CHAR: case DATA_FIXBINARY: case DATA_MYSQL: - /* MySQL pads all non-BLOB and non-TEXT - string types with space ' ' */ + /* MySQL pads all string types (except + BLOB, TEXT and true VARCHAR) with space. */ if (UNIV_UNLIKELY(templ->mbminlen == 2)) { /* Treat UCS2 as a special case. */ data = mysql_rec From 7e7bd6a43561dd8d3343935e1744ee9452eef084 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 17:18:24 +0500 Subject: [PATCH 061/144] Additional fix for #12177 (stderr isn't closed) libmysqld/lib_sql.cc: my_end() needs stderr to be active --- libmysqld/lib_sql.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index b71b442b4ca..d607e1dcf43 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -627,14 +627,14 @@ void STDCALL mysql_server_end() my_free((char*) copy_arguments_ptr, MYF(MY_ALLOW_ZERO_PTR)); copy_arguments_ptr=0; clean_up(0); + /* If library called my_init(), free memory allocated by it */ + if (!org_my_init_done) + my_end(0); if (errorlog_file) { fclose(errorlog_file); errorlog_file=0; } - /* If library called my_init(), free memory allocated by it */ - if (!org_my_init_done) - my_end(0); } my_bool STDCALL mysql_thread_init() From 79f75d8fad96e7b1da588eb850a25f9e9697ac2e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 16:10:14 +0300 Subject: [PATCH 062/144] Cleanups during review of new code Ensure mysql_close() is called if mysql_set_character_set() fails libmysql/libmysql.c: Indentation cleanup mysql-test/r/select.result: Fix bad merge & align code with 4.1 mysql-test/r/type_newdecimal.result: Added test of extreme case mysql-test/t/select.test: Fix bad merge & align code with 4.1 mysql-test/t/type_newdecimal.test: Added test of extreme case mysys/charset.c: Removed not used variable mysys/default.c: Simplify code sql-common/client.c: Ensure mysql_close() is called if mysql_set_character_set() fails sql/log.cc: strmov(strmov()) -> strxmov() sql/sp.cc: Indentation fixes sql/sql_acl.cc: Indentation fixes sql/sql_base.cc: Added commments Moved variable to inner block sql/sql_show.cc: Simple optimization (removed loop variable) sql/sql_trigger.cc: strmov(strmov()) -> strxmov() strings/decimal.c: Indentation fixes --- libmysql/libmysql.c | 7 +- mysql-test/r/select.result | 231 +++++++++++----------------- mysql-test/r/type_newdecimal.result | 7 + mysql-test/t/select.test | 206 +++++++++++-------------- mysql-test/t/type_newdecimal.test | 4 + mysys/charset.c | 3 +- mysys/default.c | 52 +++---- sql-common/client.c | 12 +- sql/log.cc | 2 +- sql/sp.cc | 5 +- sql/sql_acl.cc | 4 +- sql/sql_base.cc | 16 +- sql/sql_show.cc | 18 +-- sql/sql_trigger.cc | 3 +- strings/decimal.c | 7 +- 15 files changed, 261 insertions(+), 316 deletions(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 024d19ff24b..3931d7947aa 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1599,13 +1599,8 @@ mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, ulong length) { if (mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES) - { return escape_quotes_for_mysql(mysql->charset, to, 0, from, length); - } - else - { - return escape_string_for_mysql(mysql->charset, to, 0, from, length); - } + return escape_string_for_mysql(mysql->charset, to, 0, from, length); } diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 14c45270b04..a0f6bb7084f 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2492,6 +2492,99 @@ select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid id name gid uid ident level 1 fs NULL NULL 0 READ drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +explain select * from t2 where a > -1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +0 +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +DROP TABLE t1; CREATE TABLE t1 ( city char(30) ); INSERT INTO t1 VALUES ('London'); INSERT INTO t1 VALUES ('Paris'); @@ -2579,25 +2672,6 @@ K2C4 K4N4 F2I4 WART 0100 1 WART 0200 1 WART 0300 3 -select found_rows(); -found_rows() -3 -select count(*) from t1; -count(*) -15 -select found_rows(); -found_rows() -1 -select count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -0 -select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; -count(*) -select found_rows(); -found_rows() -1 DROP TABLE t1; CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); @@ -2612,51 +2686,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 1 SIMPLE t2 ref a a 23 test.t1.a 2 DROP TABLE t1, t2; -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); -SELECT * FROM t1 WHERE city='London'; -city -London -SELECT * FROM t1 WHERE city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city='London' AND city='london'; -city -London -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -city -London -DROP TABLE t1; -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -a-b -0 -1 -18446744073709551615 -select a-b , (a-b < 0) from t1 order by 1; -a-b (a-b < 0) -0 0 -1 0 -18446744073709551615 0 -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -d (a-b >= 0) b -1 1 0 -0 1 1 -18446744073709551615 1 2 -select cast((a - b) as unsigned) from t1 order by 1; -cast((a - b) as unsigned) -0 -1 -18446744073709551615 -drop table t1; create table t1 (a int, b int); create table t2 like t1; select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; @@ -2730,77 +2759,3 @@ DROP TABLE t1,t2; select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 16 16 2 2 -CREATE TABLE t1 ( -acct_id int(11) NOT NULL default '0', -profile_id smallint(6) default NULL, -UNIQUE KEY t1$acct_id (acct_id), -KEY t1$profile_id (profile_id) -); -INSERT INTO t1 VALUES (132,17),(133,18); -CREATE TABLE t2 ( -profile_id smallint(6) default NULL, -queue_id int(11) default NULL, -seq int(11) default NULL, -KEY t2$queue_id (queue_id) -); -INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); -CREATE TABLE t3 ( -id int(11) NOT NULL default '0', -qtype int(11) default NULL, -seq int(11) default NULL, -warn_lvl int(11) default NULL, -crit_lvl int(11) default NULL, -rr1 tinyint(4) NOT NULL default '0', -rr2 int(11) default NULL, -default_queue tinyint(4) NOT NULL default '0', -KEY t3$qtype (qtype), -KEY t3$id (id) -); -INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), -(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); -SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q -WHERE -(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND -(pq.queue_id = q.id) AND (q.rr1 <> 1); -COUNT(*) -4 -drop table t1,t2,t3; -create table t1 (f1 int); -insert into t1 values (1),(NULL); -create table t2 (f2 int, f3 int, f4 int); -create index idx1 on t2 (f4); -insert into t2 values (1,2,3),(2,4,6); -select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) -from t2 C where A.f4 = C.f4) or A.f3 IS NULL; -f2 -1 -NULL -drop table t1,t2; -create table t2 (a tinyint unsigned); -create index t2i on t2(a); -insert into t2 values (0), (254), (255); -explain select * from t2 where a > -1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index t2i t2i 2 NULL 3 Using where; Using index -select * from t2 where a > -1; -a -0 -254 -255 -drop table t2; -CREATE TABLE t1 (a int, b int, c int); -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -SELECT * FROM t1; -a b c -50 3 3 -INSERT INTO t1 -SELECT 50, 3, 3 FROM DUAL -WHERE NOT EXISTS -(SELECT * FROM t1 WHERE a = 50 AND b = 3); -SELECT * FROM t1; -a b c -50 3 3 -DROP TABLE t1; diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index c1039189a43..1dd1142aea8 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -946,6 +946,13 @@ t1 CREATE TABLE `t1` ( `sl` decimal(5,5) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +create table t1 (sl decimal(65, 30)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `sl` decimal(65,30) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; create table t1 ( f1 decimal unsigned not null default 17.49, f2 decimal unsigned not null default 17.68, diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index ef26712af06..8004d308dfa 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2080,6 +2080,94 @@ select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid drop table t1,t2,t3; +# Test for BUG#11700 +CREATE TABLE t1 ( + acct_id int(11) NOT NULL default '0', + profile_id smallint(6) default NULL, + UNIQUE KEY t1$acct_id (acct_id), + KEY t1$profile_id (profile_id) +); +INSERT INTO t1 VALUES (132,17),(133,18); + +CREATE TABLE t2 ( + profile_id smallint(6) default NULL, + queue_id int(11) default NULL, + seq int(11) default NULL, + KEY t2$queue_id (queue_id) +); +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); + +CREATE TABLE t3 ( + id int(11) NOT NULL default '0', + qtype int(11) default NULL, + seq int(11) default NULL, + warn_lvl int(11) default NULL, + crit_lvl int(11) default NULL, + rr1 tinyint(4) NOT NULL default '0', + rr2 int(11) default NULL, + default_queue tinyint(4) NOT NULL default '0', + KEY t3$qtype (qtype), + KEY t3$id (id) +); + +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), + (36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); + +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE + (pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND + (pq.queue_id = q.id) AND (q.rr1 <> 1); + +drop table t1,t2,t3; + +# +# Bug #11482 Wrongly applied optimization was erroneously rejecting valid +# rows +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +drop table t1,t2; + +# +# Bug #11521 Negative integer keys incorrectly substituted for 0 during +# range analysis. + +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +explain select * from t2 where a > -1; +select * from t2 where a > -1; +drop table t2; + +# +# Bug #11745: SELECT ... FROM DUAL with WHERE condition +# + +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 + SELECT 50, 3, 3 FROM DUAL + WHERE NOT EXISTS + (SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +INSERT INTO t1 + SELECT 50, 3, 3 FROM DUAL + WHERE NOT EXISTS + (SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +SELECT * FROM t1; +select count(*) from t1; +select found_rows(); +select count(*) from t1 limit 2,3; +select found_rows(); +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +select found_rows(); + +DROP TABLE t1; + # # Test case for bug 7098: substitution of a constant for a string field # @@ -2154,15 +2242,6 @@ SELECT K2C4, K4N4, F2I4 FROM t1 (F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); SELECT K2C4, K4N4, F2I4 FROM t1 WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); - -select found_rows(); -select count(*) from t1; -select found_rows(); -select count(*) from t1 limit 2,3; -select found_rows(); -select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; -select found_rows(); - DROP TABLE t1; # @@ -2180,36 +2259,6 @@ EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; DROP TABLE t1, t2; - -# -# Test case for bug 7098: substitution of a constant for a string field -# - -CREATE TABLE t1 ( city char(30) ); -INSERT INTO t1 VALUES ('London'); -INSERT INTO t1 VALUES ('Paris'); - -SELECT * FROM t1 WHERE city='London'; -SELECT * FROM t1 WHERE city='london'; -EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; -SELECT * FROM t1 WHERE city='London' AND city='london'; -EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; -SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; - -DROP TABLE t1; - -# -# Bug#7425 inconsistent sort order on unsigned columns result of substraction -# - -create table t1 (a int(11) unsigned, b int(11) unsigned); -insert into t1 values (1,0), (1,1), (1,2); -select a-b from t1 order by 1; -select a-b , (a-b < 0) from t1 order by 1; -select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; -select cast((a - b) as unsigned) from t1 order by 1; -drop table t1; - # # Bug#8670 # @@ -2297,82 +2346,3 @@ DROP TABLE t1,t2; # select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; -# Test for BUG#11700 -CREATE TABLE t1 ( - acct_id int(11) NOT NULL default '0', - profile_id smallint(6) default NULL, - UNIQUE KEY t1$acct_id (acct_id), - KEY t1$profile_id (profile_id) -); -INSERT INTO t1 VALUES (132,17),(133,18); - -CREATE TABLE t2 ( - profile_id smallint(6) default NULL, - queue_id int(11) default NULL, - seq int(11) default NULL, - KEY t2$queue_id (queue_id) -); -INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); - -CREATE TABLE t3 ( - id int(11) NOT NULL default '0', - qtype int(11) default NULL, - seq int(11) default NULL, - warn_lvl int(11) default NULL, - crit_lvl int(11) default NULL, - rr1 tinyint(4) NOT NULL default '0', - rr2 int(11) default NULL, - default_queue tinyint(4) NOT NULL default '0', - KEY t3$qtype (qtype), - KEY t3$id (id) -); - -INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), - (36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); - -SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q -WHERE - (pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND - (pq.queue_id = q.id) AND (q.rr1 <> 1); - -drop table t1,t2,t3; - -# -# Bug #11482 Wrongly applied optimization was erroneously rejecting valid -# rows -create table t1 (f1 int); -insert into t1 values (1),(NULL); -create table t2 (f2 int, f3 int, f4 int); -create index idx1 on t2 (f4); -insert into t2 values (1,2,3),(2,4,6); -select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) -from t2 C where A.f4 = C.f4) or A.f3 IS NULL; -drop table t1,t2; -# -# Bug #11521 Negative integer keys incorrectly substituted for 0 during -# range analysis. - -create table t2 (a tinyint unsigned); -create index t2i on t2(a); -insert into t2 values (0), (254), (255); -explain select * from t2 where a > -1; -select * from t2 where a > -1; -drop table t2; - -# -# Bug #11745: SELECT ... FROM DUAL with WHERE condition -# - -CREATE TABLE t1 (a int, b int, c int); -INSERT INTO t1 - SELECT 50, 3, 3 FROM DUAL - WHERE NOT EXISTS - (SELECT * FROM t1 WHERE a = 50 AND b = 3); -SELECT * FROM t1; -INSERT INTO t1 - SELECT 50, 3, 3 FROM DUAL - WHERE NOT EXISTS - (SELECT * FROM t1 WHERE a = 50 AND b = 3); -SELECT * FROM t1; - -DROP TABLE t1; diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index f295311fe4e..e2f247edcd3 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -986,6 +986,10 @@ create table t1 (sl decimal(0,30)); create table t1 (sl decimal(5, 5)); show create table t1; drop table t1; +# Test limits +create table t1 (sl decimal(65, 30)); +show create table t1; +drop table t1; # # Bug 11557 (DEFAULT values rounded improperly diff --git a/mysys/charset.c b/mysys/charset.c index fbdfa12c7a1..701170b747b 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -588,6 +588,7 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name, ~0 The escaped string did not fit in the to buffer >=0 The length of the escaped string */ + ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, ulong to_length, const char *from, ulong length) @@ -702,6 +703,7 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info, ~0 The escaped string did not fit in the to buffer >=0 The length of the escaped string */ + ulong escape_quotes_for_mysql(CHARSET_INFO *charset_info, char *to, ulong to_length, const char *from, ulong length) @@ -714,7 +716,6 @@ ulong escape_quotes_for_mysql(CHARSET_INFO *charset_info, #endif for (end= from + length; from < end; from++) { - char escape= 0; #ifdef USE_MB int tmp_length; if (use_mb_flag && (tmp_length= my_ismbchar(charset_info, from, end))) diff --git a/mysys/default.c b/mysys/default.c index 6b78d031291..d649df48332 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -917,6 +917,7 @@ typedef UINT (WINAPI *GET_SYSTEM_WINDOWS_DIRECTORY)(LPSTR, UINT); static uint my_get_system_windows_directory(char *buffer, uint size) { + uint count; GET_SYSTEM_WINDOWS_DIRECTORY func_ptr= (GET_SYSTEM_WINDOWS_DIRECTORY) GetProcAddress(GetModuleHandle("kernel32.dll"), @@ -924,22 +925,19 @@ static uint my_get_system_windows_directory(char *buffer, uint size) if (func_ptr) return func_ptr(buffer, size); - else - { - /* - Windows NT 4.0 Terminal Server Edition: - To retrieve the shared Windows directory, call GetSystemDirectory and - trim the "System32" element from the end of the returned path. - */ - UINT count= GetSystemDirectory(buffer, size); - if (count > 8 && stricmp(buffer+(count-8), "\\System32") == 0) - { - count-= 8; - buffer[count] = '\0'; - } - return count; + /* + Windows NT 4.0 Terminal Server Edition: + To retrieve the shared Windows directory, call GetSystemDirectory and + trim the "System32" element from the end of the returned path. + */ + count= GetSystemDirectory(buffer, size); + if (count > 8 && stricmp(buffer+(count-8), "\\System32") == 0) + { + count-= 8; + buffer[count] = '\0'; } + return count; } #endif @@ -952,7 +950,7 @@ static uint my_get_system_windows_directory(char *buffer, uint size) 2. GetWindowsDirectory() 3. GetSystemWindowsDirectory() 4. getenv(DEFAULT_HOME_ENV) - 5. Direcotry above where the executable is located + 5. Directory above where the executable is located 6. "" On Novell NetWare, this is: @@ -1011,26 +1009,28 @@ static void init_default_directories() Look for the second-to-last \ in the filename, but hang on to a pointer after the last \ in case we're in the root of a drive. - */ + */ for ( ; end > config_dir; end--) { if (*end == FN_LIBCHAR) { if (last) + { + if (end != config_dir) + { + /* Keep the last '\' as this works both with D:\ and a directory */ + end[1]= 0; + } + else + { + /' No parent directory (strange). Use current dir + '\' '*/ + last[1]= 0; + } break; + } last= end; } } - - if (last) - { - if (end != config_dir && end[-1] == FN_DEVCHAR) /* Ended up with D:\ */ - end[1]= 0; /* Keep one \ */ - else if (end != config_dir) - end[0]= 0; - else - last[1]= 0; - } *ptr++= (char *)&config_dir; } #endif diff --git a/sql-common/client.c b/sql-common/client.c index 4ecc8d26fc7..4ec919553c6 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -2206,14 +2206,22 @@ my_bool mysql_reconnect(MYSQL *mysql) tmp_mysql.rpl_pivot = mysql->rpl_pivot; if (!mysql_real_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd, mysql->db, mysql->port, mysql->unix_socket, - mysql->client_flag | CLIENT_REMEMBER_OPTIONS) || - mysql_set_character_set(&tmp_mysql, mysql->charset->csname)) + mysql->client_flag | CLIENT_REMEMBER_OPTIONS)) { mysql->net.last_errno= tmp_mysql.net.last_errno; strmov(mysql->net.last_error, tmp_mysql.net.last_error); strmov(mysql->net.sqlstate, tmp_mysql.net.sqlstate); DBUG_RETURN(1); } + if (mysql_set_character_set(&tmp_mysql, mysql->charset->csname)) + { + mysql_close(&tmp_mysql); + mysql->net.last_errno= tmp_mysql.net.last_errno; + strmov(mysql->net.last_error, tmp_mysql.net.last_error); + strmov(mysql->net.sqlstate, tmp_mysql.net.sqlstate); + DBUG_RETURN(1); + } + tmp_mysql.reconnect= 1; tmp_mysql.free_me= mysql->free_me; diff --git a/sql/log.cc b/sql/log.cc index 7b67a11ab53..540e482f578 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2209,7 +2209,7 @@ bool flush_error_log() On Windows is necessary a temporary file for to rename the current error file. */ - strmov(strmov(err_temp, err_renamed),"-tmp"); + strxmov(err_temp, err_renamed,"-tmp",NullS); (void) my_delete(err_temp, MYF(0)); if (freopen(err_temp,"a+",stdout)) { diff --git a/sql/sp.cc b/sql/sp.cc index a277c6bd253..dec0eee0095 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1443,7 +1443,9 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex, Sroutine_hash_entry **last_cached_routine_ptr= (Sroutine_hash_entry **)lex->sroutines_list.next; for (int i= 0; i < (int)TRG_EVENT_MAX; i++) + { for (int j= 0; j < (int)TRG_ACTION_MAX; j++) + { if (triggers->bodies[i][j]) { (void)triggers->bodies[i][j]->add_used_tables_to_table_list(thd, @@ -1451,7 +1453,8 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex, sp_update_stmt_used_routines(thd, lex, &triggers->bodies[i][j]->m_sroutines); } - + } + } (void)sp_cache_routines_and_add_tables_aux(thd, lex, *last_cached_routine_ptr); } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 04666469e9c..1b3d8cc914a 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3547,9 +3547,9 @@ bool check_grant_db(THD *thd,const char *db) { char helping [NAME_LEN+USERNAME_LENGTH+2]; uint len; - bool error=1; + bool error= 1; - len = (uint) (strmov(strmov(helping,thd->priv_user)+1,db)-helping)+ 1; + len= (uint) (strmov(strmov(helping,thd->priv_user)+1,db)-helping)+ 1; rw_rdlock(&LOCK_grant); for (uint idx=0 ; idx < column_priv_hash.records ; idx++) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 65bb0ec047b..930a176f6fa 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1043,26 +1043,26 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, if (thd->locked_tables || thd->prelocked_mode) { // Using table locks TABLE *best_table= 0; - int best_distance= INT_MIN, distance; + int best_distance= INT_MIN; for (table=thd->open_tables; table ; table=table->next) { if (table->s->key_length == key_length && !memcmp(table->s->table_cache_key, key, key_length) && !my_strcasecmp(system_charset_info, table->alias, alias) && - table->query_id != thd->query_id && /* skip tables already used by this query */ + table->query_id != thd->query_id && /* skip tables already used */ !(thd->prelocked_mode && table->query_id)) { - distance= ((int) table->reginfo.lock_type - - (int) table_list->lock_type); + int distance= ((int) table->reginfo.lock_type - + (int) table_list->lock_type); /* Find a table that either has the exact lock type requested, or has the best suitable lock. In case there is no locked table that has an equal or higher lock than requested, - we still maitain the best_table to produce an error message - about wrong lock mode on the table. The best_table is changed + we us the closest matching lock to be able to produce an error + message about wrong lock mode on the table. The best_table is changed if bd < 0 <= d or bd < d < 0 or 0 <= d < bd. - distance < 0 - we have not enough high lock mode + distance < 0 - No suitable lock found distance > 0 - we have lock mode higher then we require distance == 0 - we have lock mode exactly which we need */ @@ -1071,7 +1071,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, { best_distance= distance; best_table= table; - if (best_distance == 0) + if (best_distance == 0) // Found perfect lock break; } } diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 6989eacf334..b9ab93cd66f 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3543,9 +3543,8 @@ int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list) if (table_list->schema_table_reformed) // show command { SELECT_LEX *sel= lex->current_select; - uint i= 0; Item *item; - Field_translator *transl; + Field_translator *transl, *org_transl; if (table_list->field_translation) { @@ -3566,16 +3565,17 @@ int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list) { DBUG_RETURN(1); } - while ((item= it++)) + for (org_transl= transl; (item= it++); transl++) { - char *name= item->name; - transl[i].item= item; - if (!item->fixed && item->fix_fields(thd, &transl[i].item)) + transl->item= item; + transl->name= item->name; + if (!item->fixed && item->fix_fields(thd, &transl->item)) + { DBUG_RETURN(1); - transl[i++].name= name; + } } - table_list->field_translation= transl; - table_list->field_translation_end= transl + sel->item_list.elements; + table_list->field_translation= org_transl; + table_list->field_translation_end= transl; } DBUG_RETURN(0); diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index a7aee95197e..ee16b219421 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -564,8 +564,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, alloc_root(&table->mem_root, triggers->sroutines_key.length))) DBUG_RETURN(1); triggers->sroutines_key.str[0]= TYPE_ENUM_TRIGGER; - strmov(strmov(strmov(triggers->sroutines_key.str+1, db), "."), - table_name); + strxmov(triggers->sroutines_key.str+1, db, ".", table_name, NullS); /* TODO: This could be avoided if there is no triggers diff --git a/strings/decimal.c b/strings/decimal.c index 1d75502f0da..ca92ace92e1 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -745,14 +745,17 @@ int decimal_shift(decimal_t *dec, int shift) new_point= ROUND_UP(new_point) - 1; if (new_point > end) + { do { dec->buf[new_point]=0; - }while (--new_point > end); + } while (--new_point > end); + } else + { for (; new_point < beg; new_point++) dec->buf[new_point]= 0; - + } dec->intg= digits_int; dec->frac= digits_frac; return err; From e0010838fd1b64e0d99ae78d6bc81a3d8509118c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 19:25:48 +0500 Subject: [PATCH 063/144] Fix for bug #10226 (mysql_get_client_version not implemented) libmysqld/libmysqld.c: mysql_get_client_version implementation added --- libmysqld/libmysqld.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index 9c79536b2e0..aa8932f798b 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -1795,6 +1795,10 @@ mysql_get_client_info(void) return MYSQL_SERVER_VERSION; } +ulong STDCALL mysql_get_client_version(void) +{ + return MYSQL_VERSION_ID; +} int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, const char *arg) From 000f2403aaf918b9e78d592dcb1df69635f59689 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 18:25:58 +0200 Subject: [PATCH 064/144] Combining zlib security fixes for version 4.1.13a: Fix for CAN-2005-1849 from zlib-1.2.3 (originally: 2005/07/27 14:55:08+02:00 lenz@mysql.com ) Ensure static linking takes the bundled libraries (originally: 2005/07/27 16:42:13+02:00 lenz@mysql.com ) Version number change. configure.in: Update the version number. support-files/mysql.spec.sh: - build against the bundled zlib, when linking statically (originally: 2005/07/27 16:42:08+02:00 lenz@mysql.com +1 -0 ) zlib/inftrees.h: - applied another security fix to resolve CAN-2005-1849, taken from the 1.2.3 zlib sources (CAN-2005-1849) (originally: 2005/07/27 14:54:58+02:00 lenz@mysql.com +5 -5 ) --- configure.in | 2 +- support-files/mysql.spec.sh | 1 + zlib/inftrees.h | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 0889e9a3257..e86baf9d0df 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 4.1.13) +AM_INIT_AUTOMAKE(mysql, 4.1.13a) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 7dc04c39225..e4cd3027b8a 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -348,6 +348,7 @@ BuildMySQL "--disable-shared \ %if %{STATIC_BUILD} --with-mysqld-ldflags='-all-static' \ --with-client-ldflags='-all-static' \ + --with-zlib-dir=bundled \ $USE_OTHER_LIBC_DIR \ %endif --with-comment=\"MySQL Community Edition - Standard (GPL)\" \ diff --git a/zlib/inftrees.h b/zlib/inftrees.h index 82d365a7e90..b1104c87e76 100644 --- a/zlib/inftrees.h +++ b/zlib/inftrees.h @@ -1,5 +1,5 @@ /* inftrees.h -- header to use inftrees.c - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -36,12 +36,12 @@ typedef struct { */ /* Maximum size of dynamic tree. The maximum found in a long but non- - exhaustive search was 1004 code structures (850 for length/literals - and 154 for distances, the latter actually the result of an + exhaustive search was 1444 code structures (852 for length/literals + and 592 for distances, the latter actually the result of an exhaustive search). The true maximum is not known, but the value below is more than safe. */ -#define ENOUGH 1440 -#define MAXD 154 +#define ENOUGH 2048 +#define MAXD 592 /* Type of code to build for inftable() */ typedef enum { From f11418f76f54614ad3dcc82da4172195667663f0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 21:39:24 +0300 Subject: [PATCH 065/144] After merge fixes mysql-test/r/func_group.result: Update results after merge (things moved around when aligning 4.1 and 5.0 tests) mysql-test/r/mysqldump.result: Update results after merge (things moved around when aligning 4.1 and 5.0 tests) mysql-test/r/ps_grant.result: Update results after merge (test moved to another file) mysql-test/t/mysqldump.test: Align with other lines sql/lock.cc: Removed compiler warning Fixed typo during merge --- mysql-test/r/func_group.result | 52 +++---- mysql-test/r/mysqldump.result | 252 ++++++++++++++++----------------- mysql-test/r/ps_grant.result | 5 - mysql-test/t/mysqldump.test | 1 + sql/lock.cc | 9 +- 5 files changed, 158 insertions(+), 161 deletions(-) diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 0db2ceb0e6b..1542794798a 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -795,6 +795,32 @@ show columns from t2; Field Type Null Key Default Extra f2 datetime NO 0000-00-00 00:00:00 drop table t2, t1; +CREATE TABLE t1( +id int PRIMARY KEY, +a int, +b int, +INDEX i_b_id(a,b,id), +INDEX i_id(a,id) +); +INSERT INTO t1 VALUES +(1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1); +SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6; +MAX(id) +NULL +DROP TABLE t1; +CREATE TABLE t1( +id int PRIMARY KEY, +a int, +b int, +INDEX i_id(a,id), +INDEX i_b_id(a,b,id) +); +INSERT INTO t1 VALUES +(1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1); +SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6; +MAX(id) +NULL +DROP TABLE t1; create table t2 (ff double); insert into t2 values (2.2); select cast(sum(distinct ff) as decimal(5,2)) from t2; @@ -860,32 +886,6 @@ select col1,sum(col1),max(col1),min(col1) from t1 group by col1; col1 sum(col1) max(col1) min(col1) 5.000000000010 10.000000000020 5.000000000010 5.000000000010 DROP TABLE t1; -CREATE TABLE t1( -id int PRIMARY KEY, -a int, -b int, -INDEX i_b_id(a,b,id), -INDEX i_id(a,id) -); -INSERT INTO t1 VALUES -(1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1); -SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6; -MAX(id) -NULL -DROP TABLE t1; -CREATE TABLE t1( -id int PRIMARY KEY, -a int, -b int, -INDEX i_id(a,id), -INDEX i_b_id(a,b,id) -); -INSERT INTO t1 VALUES -(1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1); -SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6; -MAX(id) -NULL -DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(400)); INSERT INTO t1 (a) VALUES ("A"), ("a"), ("a "), ("a "), ("B"), ("b"), ("b "), ("b "); diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index bf783402921..77b67dc5ba7 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1,6 +1,5 @@ DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa; drop database if exists mysqldump_test_db; -drop database if exists db1; drop view if exists v1, v2, v3; CREATE TABLE t1(a int); INSERT INTO t1 VALUES (1), (2); @@ -357,46 +356,6 @@ CREATE TABLE `t1` ( 2 3 drop table t1; -create table t1(a int); -create view v1 as select * from t1; - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -DROP TABLE IF EXISTS `t1`; -CREATE TABLE `t1` ( - `a` int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; -LOCK TABLES `t1` WRITE; -UNLOCK TABLES; -/*!40000 ALTER TABLE `t1` ENABLE KEYS */; -DROP TABLE IF EXISTS `v1`; -DROP VIEW IF EXISTS `v1`; -CREATE TABLE `v1` ( - `a` int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -DROP TABLE IF EXISTS `v1`; -DROP VIEW IF EXISTS `v1`; -CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from `test`.`t1`; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - -drop view v1; -drop table t1; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -604,38 +563,6 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -DROP TABLE t1; -CREATE TABLE t1 (a char(10)); -INSERT INTO t1 VALUES ('\''); - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -DROP TABLE IF EXISTS `t1`; -CREATE TABLE `t1` ( - `a` char(10) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; -LOCK TABLES `t1` WRITE; -INSERT INTO `t1` VALUES ('\''); -UNLOCK TABLES; -/*!40000 ALTER TABLE `t1` ENABLE KEYS */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - DROP TABLE t1; CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (1),(2),(3); @@ -1428,59 +1355,6 @@ UNLOCK TABLES; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; -create database db1; -use db1; -CREATE TABLE t2 ( -a varchar(30) default NULL, -KEY a (a(5)) -); -INSERT INTO t2 VALUES ('alfred'); -INSERT INTO t2 VALUES ('angie'); -INSERT INTO t2 VALUES ('bingo'); -INSERT INTO t2 VALUES ('waffle'); -INSERT INTO t2 VALUES ('lemon'); -create view v2 as select * from t2 where a like 'a%' with check option; - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -DROP TABLE IF EXISTS `t2`; -CREATE TABLE `t2` ( - `a` varchar(30) default NULL, - KEY `a` (`a`(5)) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - - -/*!40000 ALTER TABLE `t2` DISABLE KEYS */; -LOCK TABLES `t2` WRITE; -INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon'); -UNLOCK TABLES; -/*!40000 ALTER TABLE `t2` ENABLE KEYS */; -DROP TABLE IF EXISTS `v2`; -DROP VIEW IF EXISTS `v2`; -CREATE TABLE `v2` ( - `a` varchar(30) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -DROP TABLE IF EXISTS `v2`; -DROP VIEW IF EXISTS `v2`; -CREATE ALGORITHM=UNDEFINED VIEW `db1`.`v2` AS select `db1`.`t2`.`a` AS `a` from `db1`.`t2` where (`db1`.`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - -drop table t2; -drop view v2; -drop database db1; CREATE DATABASE mysqldump_test_db; USE mysqldump_test_db; CREATE TABLE t1 ( a INT ); @@ -1647,6 +1521,132 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir drop table t1, t2; +create table t1(a int); +create view v1 as select * from t1; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +DROP TABLE IF EXISTS `v1`; +DROP VIEW IF EXISTS `v1`; +CREATE TABLE `v1` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS `v1`; +DROP VIEW IF EXISTS `v1`; +CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from `test`.`t1`; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +drop view v1; +drop table t1; +create database mysqldump_test_db; +use mysqldump_test_db; +CREATE TABLE t2 ( +a varchar(30) default NULL, +KEY a (a(5)) +); +INSERT INTO t2 VALUES ('alfred'); +INSERT INTO t2 VALUES ('angie'); +INSERT INTO t2 VALUES ('bingo'); +INSERT INTO t2 VALUES ('waffle'); +INSERT INTO t2 VALUES ('lemon'); +create view v2 as select * from t2 where a like 'a%' with check option; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t2`; +CREATE TABLE `t2` ( + `a` varchar(30) default NULL, + KEY `a` (`a`(5)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t2` DISABLE KEYS */; +LOCK TABLES `t2` WRITE; +INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t2` ENABLE KEYS */; +DROP TABLE IF EXISTS `v2`; +DROP VIEW IF EXISTS `v2`; +CREATE TABLE `v2` ( + `a` varchar(30) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS `v2`; +DROP VIEW IF EXISTS `v2`; +CREATE ALGORITHM=UNDEFINED VIEW `mysqldump_test_db`.`v2` AS select `mysqldump_test_db`.`t2`.`a` AS `a` from `mysqldump_test_db`.`t2` where (`mysqldump_test_db`.`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +drop table t2; +drop view v2; +drop database mysqldump_test_db; +use test; +CREATE TABLE t1 (a char(10)); +INSERT INTO t1 VALUES ('\''); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('\''); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +DROP TABLE t1; create table t1(a int, b int, c varchar(30)); insert into t1 values(1, 2, "one"), (2, 4, "two"), (3, 6, "three"); create view v3 as diff --git a/mysql-test/r/ps_grant.result b/mysql-test/r/ps_grant.result index fa963f944b5..fdc1f97bb4c 100644 --- a/mysql-test/r/ps_grant.result +++ b/mysql-test/r/ps_grant.result @@ -88,8 +88,3 @@ revoke all privileges on test.t1 from drop_user@localhost ; prepare stmt3 from ' drop user drop_user@localhost '; ERROR HY000: This command is not supported in the prepared statement protocol yet drop user drop_user@localhost; -prepare stmt4 from ' show full processlist '; -execute stmt4; -Id User Host db Command Time State Info -number root localhost test Execute time NULL show full processlist -deallocate prepare stmt4; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 16d1148ef1d..5cb86788aa2 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -578,6 +578,7 @@ select '------ Testing with illegal table names ------' as test_sequence ; --enable_query_log --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1 + --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\t1" 2>&1 diff --git a/sql/lock.cc b/sql/lock.cc index 377b2b6ba26..d51d9083058 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -99,14 +99,15 @@ static void print_lock_error(int error, const char *); NULL on error. */ +static int thr_lock_errno_to_mysql[]= +{ 0, 1, ER_LOCK_WAIT_TIMEOUT, ER_LOCK_DEADLOCK }; + MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count, uint flags) { MYSQL_LOCK *sql_lock; TABLE *write_lock_used; int rc; /* Map the return value of thr_lock to an error from errmsg.txt */ - const static int thr_lock_errno_to_mysql[]= - { 0, 1, ER_LOCK_WAIT_TIMEOUT, ER_LOCK_DEADLOCK }; DBUG_ENTER("mysql_lock_tables"); for (;;) @@ -624,8 +625,8 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list) } /* Return 1 if table is in use */ - DBUG_RETURN(test(remove_table_from_cache(thd, db, table_list->real_name, - RTFC_NO_FLAG))) + DBUG_RETURN(test(remove_table_from_cache(thd, db, table_list->table_name, + RTFC_NO_FLAG))); } From a66928bb24d3f543593d092c085b915459ca5c88 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 22:39:11 +0300 Subject: [PATCH 066/144] store/restore sql_mode which was in force during ctrigger creation (BUG#5891) other sql_mode fixes mysql-test/r/information_schema.result: changes in information schema mysql-test/r/trigger.result: storing and restoring sql modes for triggers mysql-test/t/trigger.test: storing and restoring parsing modes for triggers sql/mysqld.cc: add length of mode names sql/parse_file.cc: new type of list (ulonglong) sql/parse_file.h: new type of list (ulonglong) sql/set_var.cc: mode output made as static method sql/set_var.h: mode output made as static method sql/sp_head.cc: added sql_mode storing/restoring during SP execution optimised sql_mode printing sql/sp_head.h: comment fixed according this changes sql/sql_show.cc: added sql_mode field sql/sql_trigger.cc: store/restore sql_mode which was in force during ctrigger creation sql/sql_trigger.h: store/restore sql_mode which was in force during ctrigger creation sql/sql_view.cc: fixed sql_mode --- mysql-test/r/information_schema.result | 17 ++--- mysql-test/r/trigger.result | 47 +++++++++++++ mysql-test/t/trigger.test | 36 ++++++++++ sql/mysqld.cc | 45 +++++++++++-- sql/parse_file.cc | 68 +++++++++++++++++-- sql/parse_file.h | 4 +- sql/set_var.cc | 29 ++++++-- sql/set_var.h | 2 + sql/sp_head.cc | 44 +++++-------- sql/sp_head.h | 2 +- sql/sql_show.cc | 22 +++++-- sql/sql_trigger.cc | 91 +++++++++++++++++++++----- sql/sql_trigger.h | 7 +- sql/sql_view.cc | 8 +-- 14 files changed, 345 insertions(+), 77 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 89b3df0a83b..2cd426ea038 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -713,6 +713,7 @@ information_schema ROUTINES SQL_MODE information_schema VIEWS VIEW_DEFINITION information_schema TRIGGERS ACTION_CONDITION information_schema TRIGGERS ACTION_STATEMENT +information_schema TRIGGERS SQL_MODE select table_name, column_name, data_type from information_schema.columns where data_type = 'datetime'; table_name column_name data_type @@ -790,45 +791,45 @@ set @fired:= "Yes"; end if; end| show triggers; -Trigger Event Table Statement Timing Created +Trigger Event Table Statement Timing Created sql_mode trg1 INSERT t1 begin if new.j > 10 then set new.j := 10; end if; -end BEFORE NULL +end BEFORE NULL trg2 UPDATE t1 begin if old.i % 2 = 0 then set new.j := -1; end if; -end BEFORE NULL +end BEFORE NULL trg3 UPDATE t1 begin if new.j = -1 then set @fired:= "Yes"; end if; -end AFTER NULL +end AFTER NULL select * from information_schema.triggers; -TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE NULL test trg1 INSERT NULL test t1 0 NULL begin if new.j > 10 then set new.j := 10; end if; -end ROW BEFORE NULL NULL OLD NEW NULL +end ROW BEFORE NULL NULL OLD NEW NULL NULL test trg2 UPDATE NULL test t1 0 NULL begin if old.i % 2 = 0 then set new.j := -1; end if; -end ROW BEFORE NULL NULL OLD NEW NULL +end ROW BEFORE NULL NULL OLD NEW NULL NULL test trg3 UPDATE NULL test t1 0 NULL begin if new.j = -1 then set @fired:= "Yes"; end if; -end ROW AFTER NULL NULL OLD NEW NULL +end ROW AFTER NULL NULL OLD NEW NULL drop trigger trg1; drop trigger trg2; drop trigger trg3; diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index 7e3a6fa65d4..d416d3c41ba 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -595,3 +595,50 @@ update t1 set col2 = 4; ERROR 42000: FUNCTION test.bug5893 does not exist drop trigger t1_bu; drop table t1; +set sql_mode='ansi'; +create table t1 ("t1 column" int); +create trigger t1_bi before insert on t1 for each row set new."t1 column" = 5; +set sql_mode=default; +insert into t1 values (0); +create trigger t1_af after insert on t1 for each row set @a=10; +insert into t1 values (0); +select * from t1; +t1 column +5 +5 +select @a; +@a +10 +show triggers; +Trigger Event Table Statement Timing Created sql_mode +t1_bi INSERT t1 set new."t1 column" = 5 BEFORE # REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI +t1_af INSERT t1 set @a=10 AFTER # +select * from information_schema.triggers; +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE +NULL test t1_bi INSERT NULL test t1 0 NULL set new."t1 column" = 5 ROW BEFORE NULL NULL OLD NEW # REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI +NULL test t1_af INSERT NULL test t1 0 NULL set @a=10 ROW AFTER NULL NULL OLD NEW # +drop table t1; +set sql_mode="traditional"; +create table t1 (a date); +insert into t1 values ('2004-01-00'); +ERROR 22007: Incorrect date value: '2004-01-00' for column 'a' at row 1 +set sql_mode=""; +create trigger t1_bi before insert on t1 for each row set new.a = '2004-01-00'; +set sql_mode="traditional"; +insert into t1 values ('2004-01-01'); +select * from t1; +a +2004-01-00 +set sql_mode=default; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +show triggers; +Trigger Event Table Statement Timing Created sql_mode +t1_bi INSERT t1 set new.a = '2004-01-00' BEFORE # +select * from information_schema.triggers; +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE +NULL test t1_bi INSERT NULL test t1 0 NULL set new.a = '2004-01-00' ROW BEFORE NULL NULL OLD NEW # +drop table t1; diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index f6b3c714d28..17f2e85f2e8 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -610,3 +610,39 @@ update t1 set col2 = 4; # This should not crash server too. drop trigger t1_bu; drop table t1; + +# +# storing and restoring parsing modes for triggers (BUG#5891) +# +set sql_mode='ansi'; +create table t1 ("t1 column" int); +create trigger t1_bi before insert on t1 for each row set new."t1 column" = 5; +set sql_mode=default; +insert into t1 values (0); +# create trigger with different sql_mode +create trigger t1_af after insert on t1 for each row set @a=10; +insert into t1 values (0); +select * from t1; +select @a; +--replace_column 6 # +show triggers; +--replace_column 17 # +select * from information_schema.triggers; +drop table t1; +# check that rigger preserve sql_mode during execution +set sql_mode="traditional"; +create table t1 (a date); +-- error 1292 +insert into t1 values ('2004-01-00'); +set sql_mode=""; +create trigger t1_bi before insert on t1 for each row set new.a = '2004-01-00'; +set sql_mode="traditional"; +insert into t1 values ('2004-01-01'); +select * from t1; +set sql_mode=default; +show create table t1; +--replace_column 6 # +show triggers; +--replace_column 17 # +select * from information_schema.triggers; +drop table t1; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 798bd25fa7c..7c55b42b48e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -220,21 +220,58 @@ extern "C" int gethostname(char *name, int namelen); /* Constants */ const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"}; -static const char *sql_mode_names[] = +static const char *sql_mode_names[]= { "REAL_AS_FLOAT", "PIPES_AS_CONCAT", "ANSI_QUOTES", "IGNORE_SPACE", "?", "ONLY_FULL_GROUP_BY", "NO_UNSIGNED_SUBTRACTION", "NO_DIR_IN_CREATE", "POSTGRESQL", "ORACLE", "MSSQL", "DB2", "MAXDB", "NO_KEY_OPTIONS", "NO_TABLE_OPTIONS", "NO_FIELD_OPTIONS", "MYSQL323", "MYSQL40", "ANSI", - "NO_AUTO_VALUE_ON_ZERO", "NO_BACKSLASH_ESCAPES", "STRICT_TRANS_TABLES", "STRICT_ALL_TABLES", - "NO_ZERO_IN_DATE", "NO_ZERO_DATE", "ALLOW_INVALID_DATES", "ERROR_FOR_DIVISION_BY_ZERO", + "NO_AUTO_VALUE_ON_ZERO", "NO_BACKSLASH_ESCAPES", "STRICT_TRANS_TABLES", + "STRICT_ALL_TABLES", + "NO_ZERO_IN_DATE", "NO_ZERO_DATE", "ALLOW_INVALID_DATES", + "ERROR_FOR_DIVISION_BY_ZERO", "TRADITIONAL", "NO_AUTO_CREATE_USER", "HIGH_NOT_PRECEDENCE", "NO_ENGINE_SUBSTITUTION", NullS }; +static const unsigned int sql_mode_names_len[]= +{ + /*REAL_AS_FLOAT*/ 13, + /*PIPES_AS_CONCAT*/ 15, + /*ANSI_QUOTES*/ 11, + /*IGNORE_SPACE*/ 12, + /*?*/ 1, + /*ONLY_FULL_GROUP_BY*/ 18, + /*NO_UNSIGNED_SUBTRACTION*/ 23, + /*NO_DIR_IN_CREATE*/ 16, + /*POSTGRESQL*/ 10, + /*ORACLE*/ 6, + /*MSSQL*/ 5, + /*DB2*/ 3, + /*MAXDB*/ 5, + /*NO_KEY_OPTIONS*/ 14, + /*NO_TABLE_OPTIONS*/ 16, + /*NO_FIELD_OPTIONS*/ 16, + /*MYSQL323*/ 8, + /*MYSQL40*/ 7, + /*ANSI*/ 4, + /*NO_AUTO_VALUE_ON_ZERO*/ 21, + /*NO_BACKSLASH_ESCAPES*/ 20, + /*STRICT_TRANS_TABLES*/ 19, + /*STRICT_ALL_TABLES*/ 17, + /*NO_ZERO_IN_DATE*/ 15, + /*NO_ZERO_DATE*/ 12, + /*ALLOW_INVALID_DATES*/ 19, + /*ERROR_FOR_DIVISION_BY_ZERO*/ 26, + /*TRADITIONAL*/ 11, + /*NO_AUTO_CREATE_USER*/ 19, + /*HIGH_NOT_PRECEDENCE*/ 19, + /*NO_ENGINE_SUBSTITUTION*/ 22 +}; TYPELIB sql_mode_typelib= { array_elements(sql_mode_names)-1,"", - sql_mode_names, NULL }; + sql_mode_names, + (unsigned int *)sql_mode_names_len }; static const char *tc_heuristic_recover_names[]= { "COMMIT", "ROLLBACK", NullS diff --git a/sql/parse_file.cc b/sql/parse_file.cc index abca8736916..82ce2f2d7b5 100644 --- a/sql/parse_file.cc +++ b/sql/parse_file.cc @@ -166,6 +166,25 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter, } break; } + case FILE_OPTIONS_ULLLIST: + { + List_iterator_fast it(*((List*) + (base + parameter->offset))); + bool first= 1; + ulonglong *val; + while ((val= it++)) + { + num.set(*val, &my_charset_bin); + // We need ' ' after string to detect list continuation + if ((!first && my_b_append(file, (const byte *)" ", 1)) || + my_b_append(file, (const byte *)num.ptr(), num.length())) + { + DBUG_RETURN(TRUE); + } + first= 0; + } + break; + } default: DBUG_ASSERT(0); // never should happened } @@ -615,6 +634,8 @@ File_parser::parse(gptr base, MEM_ROOT *mem_root, char *eol; LEX_STRING *str; List *list; + ulonglong *num; + List *nlist; DBUG_ENTER("File_parser::parse"); while (ptr < end && found < required) @@ -719,7 +740,7 @@ File_parser::parse(gptr base, MEM_ROOT *mem_root, case FILE_OPTIONS_STRLIST: { list= (List*)(base + parameter->offset); - + list->empty(); // list parsing while (ptr < end) @@ -741,17 +762,56 @@ File_parser::parse(gptr base, MEM_ROOT *mem_root, goto list_err_w_message; } } - end_of_list: + +end_of_list: if (*(ptr++) != '\n') goto list_err; break; - list_err_w_message: +list_err_w_message: my_error(ER_FPARSER_ERROR_IN_PARAMETER, MYF(0), parameter->name.str, line); - list_err: +list_err: DBUG_RETURN(TRUE); } + case FILE_OPTIONS_ULLLIST: + { + nlist= (List*)(base + parameter->offset); + nlist->empty(); + // list parsing + while (ptr < end) + { + int not_used; + char *num_end= end; + if (!(num= (ulonglong*)alloc_root(mem_root, sizeof(ulonglong))) || + nlist->push_back(num, mem_root)) + goto nlist_err; + *num= my_strtoll10(ptr, &num_end, ¬_used); + ptr= num_end; + switch (*ptr) { + case '\n': + goto end_of_nlist; + case ' ': + // we cant go over buffer bounds, because we have \0 at the end + ptr++; + break; + default: + goto nlist_err_w_message; + } + } + +end_of_nlist: + if (*(ptr++) != '\n') + goto nlist_err; + break; + +nlist_err_w_message: + my_error(ER_FPARSER_ERROR_IN_PARAMETER, MYF(0), + parameter->name.str, line); +nlist_err: + DBUG_RETURN(TRUE); + + } default: DBUG_ASSERT(0); // never should happened } diff --git a/sql/parse_file.h b/sql/parse_file.h index 82a89dffd18..cc0aa6556f6 100644 --- a/sql/parse_file.h +++ b/sql/parse_file.h @@ -27,8 +27,10 @@ enum file_opt_type { FILE_OPTIONS_REV, /* Revision version number (ulonglong) */ FILE_OPTIONS_TIMESTAMP, /* timestamp (LEX_STRING have to be allocated with length 20 (19+1) */ - FILE_OPTIONS_STRLIST /* list of escaped strings + FILE_OPTIONS_STRLIST, /* list of escaped strings (List) */ + FILE_OPTIONS_ULLLIST /* list of ulonglong values + (List) */ }; struct File_option diff --git a/sql/set_var.cc b/sql/set_var.cc index 09581aed217..d3f3f62c259 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -3196,29 +3196,46 @@ bool sys_var_thd_table_type::update(THD *thd, set_var *var) Functions to handle sql_mode ****************************************************************************/ -byte *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) +/* + Make string representation of mode + + SINOPSYS + thd thread handler + val sql_mode value + len pointer on length of string +*/ + +byte *sys_var_thd_sql_mode::symbolic_mode_representation(THD *thd, ulong val, + ulong *len) { - ulong val; char buff[256]; String tmp(buff, sizeof(buff), &my_charset_latin1); tmp.length(0); - val= ((type == OPT_GLOBAL) ? global_system_variables.*offset : - thd->variables.*offset); for (uint i= 0; val; val>>= 1, i++) { if (val & 1) { - tmp.append(enum_names->type_names[i]); + tmp.append(sql_mode_typelib.type_names[i], + sql_mode_typelib.type_lengths[i]); tmp.append(','); } } if (tmp.length()) tmp.length(tmp.length() - 1); + *len= tmp.length(); return (byte*) thd->strmake(tmp.ptr(), tmp.length()); } +byte *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type, + LEX_STRING *base) +{ + ulong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset : + thd->variables.*offset); + ulong length_unused; + return symbolic_mode_representation(thd, val, &length_unused); +} + void sys_var_thd_sql_mode::set_default(THD *thd, enum_var_type type) { diff --git a/sql/set_var.h b/sql/set_var.h index a7e680cc7fa..c8b075ddd35 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -361,6 +361,8 @@ public: } void set_default(THD *thd, enum_var_type type); byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + static byte *symbolic_mode_representation(THD *thd, ulong sql_mode, + ulong *length); }; diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 02c006d01ee..0c3a6d04598 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -574,6 +574,7 @@ sp_head::execute(THD *thd) sp_rcontext *ctx; int ret= 0; uint ip= 0; + ulong save_sql_mode; Query_arena *old_arena; query_id_t old_query_id; TABLE *old_derived_tables; @@ -626,6 +627,8 @@ sp_head::execute(THD *thd) old_query_id= thd->query_id; old_derived_tables= thd->derived_tables; thd->derived_tables= 0; + save_sql_mode= thd->variables.sql_mode; + thd->variables.sql_mode= m_sql_mode; /* It is also more efficient to save/restore current thd->lex once when do it in each instruction @@ -715,6 +718,7 @@ sp_head::execute(THD *thd) thd->query_id= old_query_id; DBUG_ASSERT(!thd->derived_tables); thd->derived_tables= old_derived_tables; + thd->variables.sql_mode= save_sql_mode; thd->current_arena= old_arena; state= EXECUTED; @@ -1245,8 +1249,6 @@ sp_head::show_create_procedure(THD *thd) String buffer(buff, sizeof(buff), system_charset_info); int res; List field_list; - ulong old_sql_mode; - sys_var *sql_mode_var; byte *sql_mode_str; ulong sql_mode_len; bool full_access; @@ -1258,19 +1260,13 @@ sp_head::show_create_procedure(THD *thd) if (check_show_routine_access(thd, this, &full_access)) return 1; - - old_sql_mode= thd->variables.sql_mode; - thd->variables.sql_mode= m_sql_mode; - sql_mode_var= find_sys_var("SQL_MODE", 8); - if (sql_mode_var) - { - sql_mode_str= sql_mode_var->value_ptr(thd, OPT_SESSION, 0); - sql_mode_len= strlen((char*) sql_mode_str); - } + sql_mode_str= + sys_var_thd_sql_mode::symbolic_mode_representation(thd, + m_sql_mode, + &sql_mode_len); field_list.push_back(new Item_empty_string("Procedure", NAME_LEN)); - if (sql_mode_var) - field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len)); + field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len)); // 1024 is for not to confuse old clients field_list.push_back(new Item_empty_string("Create Procedure", max(buffer.length(), 1024))); @@ -1282,15 +1278,13 @@ sp_head::show_create_procedure(THD *thd) } protocol->prepare_for_resend(); protocol->store(m_name.str, m_name.length, system_charset_info); - if (sql_mode_var) - protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info); + protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info); if (full_access) protocol->store(m_defstr.str, m_defstr.length, system_charset_info); res= protocol->write(); send_eof(thd); done: - thd->variables.sql_mode= old_sql_mode; DBUG_RETURN(res); } @@ -1326,7 +1320,6 @@ sp_head::show_create_function(THD *thd) String buffer(buff, sizeof(buff), system_charset_info); int res; List field_list; - ulong old_sql_mode; sys_var *sql_mode_var; byte *sql_mode_str; ulong sql_mode_len; @@ -1339,15 +1332,10 @@ sp_head::show_create_function(THD *thd) if (check_show_routine_access(thd, this, &full_access)) return 1; - old_sql_mode= thd->variables.sql_mode; - thd->variables.sql_mode= m_sql_mode; - sql_mode_var= find_sys_var("SQL_MODE", 8); - if (sql_mode_var) - { - sql_mode_str= sql_mode_var->value_ptr(thd, OPT_SESSION, 0); - sql_mode_len= strlen((char*) sql_mode_str); - } - + sql_mode_str= + sys_var_thd_sql_mode::symbolic_mode_representation(thd, + m_sql_mode, + &sql_mode_len); field_list.push_back(new Item_empty_string("Function",NAME_LEN)); if (sql_mode_var) field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len)); @@ -1361,15 +1349,13 @@ sp_head::show_create_function(THD *thd) } protocol->prepare_for_resend(); protocol->store(m_name.str, m_name.length, system_charset_info); - if (sql_mode_var) - protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info); + protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info); if (full_access) protocol->store(m_defstr.str, m_defstr.length, system_charset_info); res= protocol->write(); send_eof(thd); done: - thd->variables.sql_mode= old_sql_mode; DBUG_RETURN(res); } diff --git a/sql/sp_head.h b/sql/sp_head.h index 32dc4449174..09b9c8f47a1 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -121,7 +121,7 @@ public: uchar *m_tmp_query; // Temporary pointer to sub query string uint m_old_cmq; // Old CLIENT_MULTI_QUERIES value st_sp_chistics *m_chistics; - ulong m_sql_mode; // For SHOW CREATE + ulong m_sql_mode; // For SHOW CREATE and execution LEX_STRING m_qname; // db.name LEX_STRING m_db; LEX_STRING m_name; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 6989eacf334..cc4677bcfa1 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2983,9 +2983,13 @@ static bool store_trigger(THD *thd, TABLE *table, const char *db, const char *tname, LEX_STRING *trigger_name, enum trg_event_type event, enum trg_action_time_type timing, - LEX_STRING *trigger_stmt) + LEX_STRING *trigger_stmt, + ulong sql_mode) { CHARSET_INFO *cs= system_charset_info; + byte *sql_mode_str; + ulong sql_mode_len; + restore_record(table, s->default_values); table->field[1]->store(db, strlen(db), cs); table->field[2]->store(trigger_name->str, trigger_name->length, cs); @@ -2999,6 +3003,12 @@ static bool store_trigger(THD *thd, TABLE *table, const char *db, trg_action_time_type_names[timing].length, cs); table->field[14]->store("OLD", 3, cs); table->field[15]->store("NEW", 3, cs); + + sql_mode_str= + sys_var_thd_sql_mode::symbolic_mode_representation(thd, + sql_mode, + &sql_mode_len); + table->field[17]->store(sql_mode_str, sql_mode_len, cs); return schema_table_store_record(thd, table); } @@ -3031,13 +3041,16 @@ static int get_schema_triggers_record(THD *thd, struct st_table_list *tables, { LEX_STRING trigger_name; LEX_STRING trigger_stmt; + ulong sql_mode; if (triggers->get_trigger_info(thd, (enum trg_event_type) event, (enum trg_action_time_type)timing, - &trigger_name, &trigger_stmt)) + &trigger_name, &trigger_stmt, + &sql_mode)) continue; if (store_trigger(thd, table, base_name, file_name, &trigger_name, (enum trg_event_type) event, - (enum trg_action_time_type) timing, &trigger_stmt)) + (enum trg_action_time_type) timing, &trigger_stmt, + sql_mode)) DBUG_RETURN(1); } } @@ -3949,6 +3962,7 @@ ST_FIELD_INFO triggers_fields_info[]= {"ACTION_REFERENCE_OLD_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0}, {"ACTION_REFERENCE_NEW_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0}, {"CREATED", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Created"}, + {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 0, "sql_mode"}, {0, 0, MYSQL_TYPE_STRING, 0, 0, 0} }; @@ -4003,7 +4017,7 @@ ST_SCHEMA_TABLE schema_tables[]= fill_open_tables, make_old_format, 0, -1, -1, 1}, {"STATUS", variables_fields_info, create_schema_table, fill_status, make_old_format, 0, -1, -1, 1}, - {"TRIGGERS", triggers_fields_info, create_schema_table, + {"TRIGGERS", triggers_fields_info, create_schema_table, get_all_tables, make_old_format, get_schema_triggers_record, 5, 6, 0}, {"VARIABLES", variables_fields_info, create_schema_table, fill_variables, make_old_format, 0, -1, -1, 1}, diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index a7aee95197e..c739511dda0 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -32,8 +32,12 @@ const char * const triggers_file_ext= ".TRG"; */ static File_option triggers_file_parameters[]= { - {{(char*)"triggers", 8}, offsetof(class Table_triggers_list, definitions_list), - FILE_OPTIONS_STRLIST}, + {{(char*)"triggers", 8}, + offsetof(class Table_triggers_list, definitions_list), + FILE_OPTIONS_STRLIST}, + {{(char*)"sql_modes", 13}, + offsetof(class Table_triggers_list, definition_modes_list), + FILE_OPTIONS_ULLLIST}, {{0, 0}, 0, FILE_OPTIONS_STRING} }; @@ -127,12 +131,13 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) DBUG_RETURN(TRUE); /* - We do not allow creation of triggers on views or temporary tables. - We have to do this check here and not in - Table_triggers_list::create_trigger() because we want to avoid messing - with table cash for views and temporary tables. + We do not allow creation of triggers on temporary tables. We also don't + allow creation of triggers on views but fulfilment of this restriction + is guaranteed by open_ltable(). It is better to have this check here + than do it in Table_triggers_list::create_trigger() and mess with table + cache. */ - if (tables->view || table->s->tmp_table != NO_TMP_TABLE) + if (table->s->tmp_table != NO_TMP_TABLE) { my_error(ER_TRG_ON_VIEW_OR_TEMP_TABLE, MYF(0), tables->alias); DBUG_RETURN(TRUE); @@ -221,6 +226,7 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables) trigname_path[FN_REFLEN]; LEX_STRING dir, file, trigname_file; LEX_STRING *trg_def, *name; + ulonglong *trg_sql_mode; Item_trigger_field *trg_field; struct st_trigname trigname; @@ -307,11 +313,15 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables) */ if (!(trg_def= (LEX_STRING *)alloc_root(&table->mem_root, sizeof(LEX_STRING))) || - definitions_list.push_back(trg_def, &table->mem_root)) + definitions_list.push_back(trg_def, &table->mem_root) || + !(trg_sql_mode= (ulonglong*)alloc_root(&table->mem_root, + sizeof(ulonglong))) || + definition_modes_list.push_back(trg_sql_mode, &table->mem_root)) goto err_with_cleanup; trg_def->str= thd->query; trg_def->length= thd->query_length; + *trg_sql_mode= thd->variables.sql_mode; if (!sql_create_definition_file(&dir, &file, &triggers_file_type, (gptr)this, triggers_file_parameters, 3)) @@ -390,11 +400,13 @@ bool Table_triggers_list::drop_trigger(THD *thd, TABLE_LIST *tables) LEX_STRING *name; List_iterator_fast it_name(names_list); List_iterator it_def(definitions_list); + List_iterator it_mod(definition_modes_list); char path[FN_REFLEN]; while ((name= it_name++)) { it_def++; + it_mod++; if (my_strcasecmp(system_charset_info, lex->spname->m_name.str, name->str) == 0) @@ -404,6 +416,7 @@ bool Table_triggers_list::drop_trigger(THD *thd, TABLE_LIST *tables) clean trigger removing since table will be reopened anyway. */ it_def.remove(); + it_mod.remove(); if (definitions_list.is_empty()) { @@ -549,10 +562,48 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, if (!triggers) DBUG_RETURN(1); + /* + We don't have sql_modes in old versions of .TRG file, so we should + initialize list for safety. + */ + triggers->definition_modes_list.empty(); + if (parser->parse((gptr)triggers, &table->mem_root, - triggers_file_parameters, 1)) + triggers_file_parameters, 2)) DBUG_RETURN(1); + List_iterator_fast it(triggers->definitions_list); + LEX_STRING *trg_create_str, *trg_name_str; + ulonglong *trg_sql_mode; + + if (triggers->definition_modes_list.is_empty() && + !triggers->definitions_list.is_empty()) + { + /* + It is old file format => we should fill list of sql_modes. + + We use one mode (current) for all triggers, because we have not + information about mode in old format. + */ + if (!(trg_sql_mode= (ulonglong*)alloc_root(&table->mem_root, + sizeof(ulonglong)))) + { + DBUG_RETURN(1); // EOM + } + *trg_sql_mode= global_system_variables.sql_mode; + while ((trg_create_str= it++)) + { + if (triggers->definition_modes_list.push_back(trg_sql_mode, + &table->mem_root)) + { + DBUG_RETURN(1); // EOM + } + } + it.rewind(); + } + + DBUG_ASSERT(triggers->definition_modes_list.elements == + triggers->definitions_list.elements); table->triggers= triggers; /* @@ -574,15 +625,17 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, if (!names_only && triggers->prepare_record1_accessors(table)) DBUG_RETURN(1); - List_iterator_fast it(triggers->definitions_list); - LEX_STRING *trg_create_str, *trg_name_str; char *trg_name_buff; + List_iterator_fast itm(triggers->definition_modes_list); LEX *old_lex= thd->lex, lex; + ulong save_sql_mode= thd->variables.sql_mode; thd->lex= &lex; while ((trg_create_str= it++)) { + trg_sql_mode= itm++; + thd->variables.sql_mode= (ulong)*trg_sql_mode; lex_start(thd, (uchar*)trg_create_str->str, trg_create_str->length); if (yyparse((void *)thd) || thd->is_fatal_error) @@ -595,9 +648,11 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, goto err_with_lex_cleanup; } + lex.sphead->m_sql_mode= *trg_sql_mode; triggers->bodies[lex.trg_chistics.event] [lex.trg_chistics.action_time]= lex.sphead; - if (triggers->names_list.push_back(&lex.sphead->m_name, &table->mem_root)) + if (triggers->names_list.push_back(&lex.sphead->m_name, + &table->mem_root)) goto err_with_lex_cleanup; if (names_only) @@ -611,8 +666,9 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, in old/new versions of row in trigger to Field objects in table being opened. - We ignore errors here, because if even something is wrong we still will - be willing to open table to perform some operations (e.g. SELECT)... + We ignore errors here, because if even something is wrong we still + will be willing to open table to perform some operations (e.g. + SELECT)... Anyway some things can be checked only during trigger execution. */ for (Item_trigger_field *trg_field= @@ -624,6 +680,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, lex_end(&lex); } thd->lex= old_lex; + thd->variables.sql_mode= save_sql_mode; DBUG_RETURN(0); @@ -631,6 +688,7 @@ err_with_lex_cleanup: // QQ: anything else ? lex_end(&lex); thd->lex= old_lex; + thd->variables.sql_mode= save_sql_mode; DBUG_RETURN(1); } @@ -657,6 +715,7 @@ err_with_lex_cleanup: time_type - trigger action time name - returns name of trigger stmt - returns statement of trigger + sql_mode - returns sql_mode of trigger RETURN VALUE False - success @@ -666,7 +725,8 @@ err_with_lex_cleanup: bool Table_triggers_list::get_trigger_info(THD *thd, trg_event_type event, trg_action_time_type time_type, LEX_STRING *trigger_name, - LEX_STRING *trigger_stmt) + LEX_STRING *trigger_stmt, + ulong *sql_mode) { sp_head *body; DBUG_ENTER("get_trigger_info"); @@ -674,6 +734,7 @@ bool Table_triggers_list::get_trigger_info(THD *thd, trg_event_type event, { *trigger_name= body->m_name; *trigger_stmt= body->m_body; + *sql_mode= body->m_sql_mode; DBUG_RETURN(0); } DBUG_RETURN(1); diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h index e751741fa34..ede2cb39f0e 100644 --- a/sql/sql_trigger.h +++ b/sql/sql_trigger.h @@ -60,6 +60,10 @@ public: It have to be public because we are using it directly from parser. */ List definitions_list; + /* + List of sql modes for triggers + */ + List definition_modes_list; Table_triggers_list(TABLE *table_arg): record1_field(0), table(table_arg) @@ -123,7 +127,8 @@ public: } bool get_trigger_info(THD *thd, trg_event_type event, trg_action_time_type time_type, - LEX_STRING *trigger_name, LEX_STRING *trigger_stmt); + LEX_STRING *trigger_name, LEX_STRING *trigger_stmt, + ulong *sql_mode); static bool check_n_load(THD *thd, const char *db, const char *table_name, TABLE *table, bool names_only); diff --git a/sql/sql_view.cc b/sql/sql_view.cc index a60bf80a6d8..8b9c86a0f08 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -691,7 +691,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) view_select= &lex->select_lex; view_select->select_number= ++thd->select_number; { - ulong options= thd->options; + ulong save_mode= thd->variables.sql_mode; /* switch off modes which can prevent normal parsing of VIEW - MODE_REAL_AS_FLOAT affect only CREATE TABLE parsing + MODE_PIPES_AS_CONCAT affect expression parsing @@ -716,13 +716,13 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) ? MODE_NO_AUTO_VALUE_ON_ZERO affect UPDATEs + MODE_NO_BACKSLASH_ESCAPES affect expression parsing */ - thd->options&= ~(MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | - MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES); + thd->variables.sql_mode&= ~(MODE_PIPES_AS_CONCAT | MODE_ANSI_QUOTES | + MODE_IGNORE_SPACE | MODE_NO_BACKSLASH_ESCAPES); CHARSET_INFO *save_cs= thd->variables.character_set_client; thd->variables.character_set_client= system_charset_info; res= yyparse((void *)thd); thd->variables.character_set_client= save_cs; - thd->options= options; + thd->variables.sql_mode= save_mode; } if (!res && !thd->is_fatal_error) { From 74e523d259552645067155e2acb87e30d6068d87 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 13:31:15 -0700 Subject: [PATCH 067/144] sql_select.cc: Fixed bug #12144. Added an optimization that avoids key access with null keys for the 'ref' method when used in outer joins. The regilar optimization with adding IS NOT NULL expressions is not applied for outer join on expressions as the predicates of these expressions are not pushed down in 4.1. null_key.result, null_key.test: Added a test case for bug #12144. mysql-test/t/null_key.test: Added a test case for bug #12144. mysql-test/r/null_key.result: Added a test case for bug #12144. sql/sql_select.cc: Fixed bug #12144. Added an optimization that avoids key access with null keys for the 'ref' method when used in outer joins. The regilar optimization with adding IS NOT NULL expressions is not applied for outer join on expressions as the predicates of these expressions are not pushed down in 4.1. --- mysql-test/r/null_key.result | 31 +++++++++++++++++++++++++++++++ mysql-test/t/null_key.test | 26 ++++++++++++++++++++++++++ sql/sql_select.cc | 9 ++++++++- 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index 4b7400e5e60..9f11a0129cd 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -364,3 +364,34 @@ select * from t1; id id2 1 1 drop table t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int, b int, INDEX idx(a)); +CREATE TABLE t3 (b int, INDEX idx(b)); +INSERT INTO t1 VALUES (1), (2), (3), (4); +INSERT INTO t2 VALUES (1, 1), (3, 1); +INSERT INTO t3 VALUES +(NULL), (NULL), (NULL), (NULL), (NULL), +(NULL), (NULL), (NULL), (NULL), (NULL), +(2); +ANALYZE table t1, t2, t3; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a +LEFT JOIN t3 ON t2.b=t3.b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 +1 SIMPLE t2 ref idx idx 5 test.t1.a 1 +1 SIMPLE t3 ref idx idx 5 test.t2.b 1 Using index +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a +LEFT JOIN t3 ON t2.b=t3.b; +a a b b +1 1 1 NULL +2 NULL NULL NULL +3 3 1 NULL +4 NULL NULL NULL +SELECT FOUND_ROWS(); +FOUND_ROWS() +4 +DROP TABLE t1,t2,t3; diff --git a/mysql-test/t/null_key.test b/mysql-test/t/null_key.test index 9b346a181bf..0eff53ac371 100644 --- a/mysql-test/t/null_key.test +++ b/mysql-test/t/null_key.test @@ -191,3 +191,29 @@ select * from t1 where id2 is null or id2 > 0; delete from t1 where id <=> NULL; select * from t1; drop table t1; + +# +# Test for bug #12144: optimizations for key access with null keys +# used for outer joins +# + +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int, b int, INDEX idx(a)); +CREATE TABLE t3 (b int, INDEX idx(b)); +INSERT INTO t1 VALUES (1), (2), (3), (4); +INSERT INTO t2 VALUES (1, 1), (3, 1); +INSERT INTO t3 VALUES + (NULL), (NULL), (NULL), (NULL), (NULL), + (NULL), (NULL), (NULL), (NULL), (NULL), + (2); +ANALYZE table t1, t2, t3; + +EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a + LEFT JOIN t3 ON t2.b=t3.b; + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a + LEFT JOIN t3 ON t2.b=t3.b; + +SELECT FOUND_ROWS(); + +DROP TABLE t1,t2,t3; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 29560e8701b..6f95ca1390e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2255,7 +2255,9 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond, */ (*key_fields)->null_rejecting= (cond->functype() == Item_func::EQ_FUNC) && ((*value)->type() == Item::FIELD_ITEM) && - ((Item_field*)*value)->field->maybe_null(); + + (((Item_field*)*value)->field->maybe_null() || + ((Item_field *)*value)->field->table->maybe_null); (*key_fields)++; } @@ -6310,6 +6312,11 @@ join_read_always_key(JOIN_TAB *tab) int error; TABLE *table= tab->table; + for (uint i= 0 ; i < tab->ref.key_parts ; i++) + { + if ((tab->ref.null_rejecting & 1 << i) && tab->ref.items[i]->is_null()) + return -1; + } if (!table->file->inited) table->file->ha_index_init(tab->ref.key); if (cp_buffer_from_ref(tab->join->thd, &tab->ref)) From a54ddda4c826a4142f9fb779a58577528f525d73 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 16:04:47 -0700 Subject: [PATCH 068/144] null_key.test, null_key.result: Modified the test case for patch of the bug #12144 to display status of Handler_read_next before and after the tested query. mysql-test/r/null_key.result: Modified the test case for patch of the bug #12144 to display status of Handler_read_next before and after the tested query. mysql-test/t/null_key.test: Modified the test case for patch of the bug #12144 to display status of Handler_read_next before and after the tested query. --- mysql-test/r/null_key.result | 42 +++++++++++++++++++++++++++++++++--- mysql-test/t/null_key.test | 30 +++++++++++++++++++++++--- 2 files changed, 66 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index 9f11a0129cd..89f9663f527 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -367,23 +367,51 @@ drop table t1; CREATE TABLE t1 (a int); CREATE TABLE t2 (a int, b int, INDEX idx(a)); CREATE TABLE t3 (b int, INDEX idx(b)); +CREATE TABLE t4 (b int, INDEX idx(b)); INSERT INTO t1 VALUES (1), (2), (3), (4); INSERT INTO t2 VALUES (1, 1), (3, 1); INSERT INTO t3 VALUES (NULL), (NULL), (NULL), (NULL), (NULL), -(NULL), (NULL), (NULL), (NULL), (NULL), -(2); +(NULL), (NULL), (NULL), (NULL), (NULL); +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t3 VALUES (2), (3); ANALYZE table t1, t2, t3; Table Op Msg_type Msg_text test.t1 analyze status OK test.t2 analyze status OK test.t3 analyze status OK +SELECT COUNT(*) FROM t3; +COUNT(*) +15972 EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 1 SIMPLE t2 ref idx idx 5 test.t1.a 1 1 SIMPLE t3 ref idx idx 5 test.t2.b 1 Using index +SHOW STATUS LIKE "handler_read%"; +Variable_name Value +Handler_read_first 25 +Handler_read_key 63 +Handler_read_next 25979 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 147 SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b; a a b b @@ -391,7 +419,15 @@ a a b b 2 NULL NULL NULL 3 3 1 NULL 4 NULL NULL NULL +SHOW STATUS LIKE "handler_read%"; +Variable_name Value +Handler_read_first 25 +Handler_read_key 69 +Handler_read_next 25981 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 152 SELECT FOUND_ROWS(); FOUND_ROWS() 4 -DROP TABLE t1,t2,t3; +DROP TABLE t1,t2,t3,t4; diff --git a/mysql-test/t/null_key.test b/mysql-test/t/null_key.test index 4952d6ac8e2..228b00d528a 100644 --- a/mysql-test/t/null_key.test +++ b/mysql-test/t/null_key.test @@ -200,21 +200,45 @@ drop table t1; CREATE TABLE t1 (a int); CREATE TABLE t2 (a int, b int, INDEX idx(a)); CREATE TABLE t3 (b int, INDEX idx(b)); +CREATE TABLE t4 (b int, INDEX idx(b)); INSERT INTO t1 VALUES (1), (2), (3), (4); INSERT INTO t2 VALUES (1, 1), (3, 1); INSERT INTO t3 VALUES (NULL), (NULL), (NULL), (NULL), (NULL), - (NULL), (NULL), (NULL), (NULL), (NULL), - (2); + (NULL), (NULL), (NULL), (NULL), (NULL); +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t4 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t4; +INSERT INTO t3 VALUES (2), (3); + ANALYZE table t1, t2, t3; +SELECT COUNT(*) FROM t3; + EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b; +SHOW STATUS LIKE "handler_read%"; + SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b; +SHOW STATUS LIKE "handler_read%"; + SELECT FOUND_ROWS(); -DROP TABLE t1,t2,t3; +DROP TABLE t1,t2,t3,t4; # End of 4.1 tests From 5ce4ee3d650ef1742d3c12340ffc49cad6891a0a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jul 2005 00:32:03 +0000 Subject: [PATCH 069/144] [Patch from Konstantin] Enable InnoDB cursor view functionality. --- sql/ha_innodb.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 1c3bca08037..d40e58aa4cb 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -216,10 +216,10 @@ static handlerton innobase_hton = { innobase_xa_recover, /* recover */ innobase_commit_by_xid, /* commit_by_xid */ innobase_rollback_by_xid, /* rollback_by_xid */ - NULL, - NULL, - NULL, - HTON_CLOSE_CURSORS_AT_COMMIT + innobase_create_cursor_view, + innobase_set_cursor_view, + innobase_close_cursor_view, + HTON_NO_FLAGS }; /********************************************************************* From 0ad1836d23d67e13c88b2c45d253844303503cc0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 17:53:51 -0700 Subject: [PATCH 070/144] null_key.test, null_key.result: Made the test case for bug #12144 independent on other tests. mysql-test/r/null_key.result: Made the test case for bug #12144 independent on other tests. mysql-test/t/null_key.test: Made the test case for bug #12144 independent on other tests. --- mysql-test/r/null_key.result | 17 +++++------------ mysql-test/t/null_key.test | 6 +----- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index 89f9663f527..516894edb88 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -404,14 +404,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 1 SIMPLE t2 ref idx idx 5 test.t1.a 1 1 SIMPLE t3 ref idx idx 5 test.t2.b 1 Using index -SHOW STATUS LIKE "handler_read%"; -Variable_name Value -Handler_read_first 25 -Handler_read_key 63 -Handler_read_next 25979 -Handler_read_prev 0 -Handler_read_rnd 0 -Handler_read_rnd_next 147 +FLUSH STATUS ; SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b; a a b b @@ -421,12 +414,12 @@ a a b b 4 NULL NULL NULL SHOW STATUS LIKE "handler_read%"; Variable_name Value -Handler_read_first 25 -Handler_read_key 69 -Handler_read_next 25981 +Handler_read_first 0 +Handler_read_key 6 +Handler_read_next 2 Handler_read_prev 0 Handler_read_rnd 0 -Handler_read_rnd_next 152 +Handler_read_rnd_next 5 SELECT FOUND_ROWS(); FOUND_ROWS() 4 diff --git a/mysql-test/t/null_key.test b/mysql-test/t/null_key.test index 228b00d528a..bd37a031745 100644 --- a/mysql-test/t/null_key.test +++ b/mysql-test/t/null_key.test @@ -230,14 +230,10 @@ SELECT COUNT(*) FROM t3; EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b; -SHOW STATUS LIKE "handler_read%"; - - +FLUSH STATUS ; SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b; - SHOW STATUS LIKE "handler_read%"; - SELECT FOUND_ROWS(); DROP TABLE t1,t2,t3,t4; From fa7ed076d4453b91b6a50160e8a31ecd726550f4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 19:08:01 -0600 Subject: [PATCH 071/144] patch for bug 10780 sql/slave.cc: bug 10780 sql/slave.h: bug 10780 mysql-test/r/rpl_slave_status.result: New BitKeeper file ``mysql-test/r/rpl_slave_status.result'' --- mysql-test/r/rpl_slave_status.result | 23 +++++++++++++++++++++++ sql/slave.cc | 5 +++-- sql/slave.h | 1 + 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 mysql-test/r/rpl_slave_status.result diff --git a/mysql-test/r/rpl_slave_status.result b/mysql-test/r/rpl_slave_status.result new file mode 100644 index 00000000000..4eb2e87d221 --- /dev/null +++ b/mysql-test/r/rpl_slave_status.result @@ -0,0 +1,23 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl'; +stop slave; +change master to master_user='rpl',master_password='rpl'; +start slave; +drop table if exists t1; +create table t1 (n int); +insert into t1 values (1); +select * from t1; +n +1 +delete from mysql.user where user='rpl'; +flush privileges; +stop slave; +start slave; +show slave status; +Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master +Connecting to master 127.0.0.1 rpl MASTER_MYPORT 1 master-bin.000001 357 slave-relay-bin.000001 401 master-bin.000001 No Yes 0 0 357 401 None 0 No NULL diff --git a/sql/slave.cc b/sql/slave.cc index f25ad90487a..286bb07e4c9 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2186,7 +2186,8 @@ int show_master_info(THD* thd, MASTER_INFO* mi) &my_charset_bin); protocol->store((ulonglong) mi->rli.group_relay_log_pos); protocol->store(mi->rli.group_master_log_name, &my_charset_bin); - protocol->store(mi->slave_running ? "Yes":"No", &my_charset_bin); + protocol->store(mi->slave_running == MYSQL_SLAVE_RUN_CONNECT + ? "Yes":"No", &my_charset_bin); protocol->store(mi->rli.slave_running ? "Yes":"No", &my_charset_bin); protocol->store(&replicate_do_db); protocol->store(&replicate_ignore_db); @@ -3078,7 +3079,7 @@ slave_begin: pthread_mutex_lock(&LOCK_thread_count); threads.append(thd); pthread_mutex_unlock(&LOCK_thread_count); - mi->slave_running = 1; + mi->slave_running = MYSQL_SLAVE_RUN_INIT; mi->abort_slave = 0; pthread_mutex_unlock(&mi->run_lock); pthread_cond_broadcast(&mi->start_cond); diff --git a/sql/slave.h b/sql/slave.h index 5a85e26d9ad..6aa61c3a7e4 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -112,6 +112,7 @@ enum enum_binlog_formats { #define MYSQL_SLAVE_NOT_RUN 0 #define MYSQL_SLAVE_RUN_NOT_CONNECT 1 #define MYSQL_SLAVE_RUN_CONNECT 2 +#define MYSQL_SLAVE_RUN_INIT 3 /**************************************************************************** From 26547b33c3ab9d05e59a3255785387dd3d30426f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 19:10:49 -0600 Subject: [PATCH 072/144] testcase for bug 10780 was not added in the previous commit mysql-test/t/rpl_slave_status.test: New BitKeeper file ``mysql-test/t/rpl_slave_status.test'' --- mysql-test/t/rpl_slave_status.test | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 mysql-test/t/rpl_slave_status.test diff --git a/mysql-test/t/rpl_slave_status.test b/mysql-test/t/rpl_slave_status.test new file mode 100644 index 00000000000..6bccf6fd341 --- /dev/null +++ b/mysql-test/t/rpl_slave_status.test @@ -0,0 +1,28 @@ +# Test case for BUG #10780 +source include/master-slave.inc +connection master; +grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl'; +connection slave; +stop slave; +change master to master_user='rpl',master_password='rpl'; +start slave; +connection master; +--disable_warnings +drop table if exists t1; +--enable_warning +create table t1 (n int); +insert into t1 values (1); +save_master_pos; +connection slave; +sync_with_master; +select * from t1; +connection master; +delete from mysql.user where user='rpl'; +flush privileges; +connection slave; +stop slave; +start slave; +--replace_result $MASTER_MYPORT MASTER_MYPORT +show slave status; + +# end of 4.1 tests From 120e80f1d9d182fa0a7c52b27b1f4a9d4ffa4760 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 18:22:49 -0700 Subject: [PATCH 073/144] Fix for handling of unsigned long options on 32-bit platforms that allowed unintended overflows. (Bug #10351) mysql-test/r/select_safe.result: Update results mysql-test/r/variables.result: Update results mysql-test/t/select_safe.test: Remove "SELECT @@MAX_SEEKS_FOR_KEY;" because it depends on size of unsigned long of the system. mysql-test/t/variables.test: Fix test for #10351 to test the actual problem sql/mysqld.cc: Undo unnecessary change to default and max of max_seeks_for_key sql/set_var.cc: On platforms where SIZEOF_LONG != SIZEOF_LONGLONG, make sure to handle max values for ulong-sized options correctly. --- mysql-test/r/select_safe.result | 3 --- mysql-test/r/variables.result | 16 ++++++---------- mysql-test/t/select_safe.test | 1 - mysql-test/t/variables.test | 8 +++----- sql/mysqld.cc | 2 +- sql/set_var.cc | 6 ++++++ 6 files changed, 16 insertions(+), 20 deletions(-) diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result index 7a29db42dd9..5d458c40f34 100644 --- a/mysql-test/r/select_safe.result +++ b/mysql-test/r/select_safe.result @@ -60,9 +60,6 @@ a b 3 a 4 a 5 a -SELECT @@MAX_SEEKS_FOR_KEY; -@@MAX_SEEKS_FOR_KEY -4294967295 analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status OK diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 8ab591e18d0..932be65532b 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -526,14 +526,10 @@ ERROR HY000: Variable 'warning_count' is a read only variable set @@global.error_count=1; ERROR HY000: Variable 'error_count' is a read only variable set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; -@@max_heap_table_size -4294967296 +select @@max_heap_table_size > 0; +@@max_heap_table_size > 0 +1 set global max_heap_table_size= 4294967296; -select @@max_heap_table_size; -@@max_heap_table_size -4294967296 -set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; -@@max_heap_table_size -4294967296 +select @@global.max_heap_table_size > 0; +@@global.max_heap_table_size > 0 +1 diff --git a/mysql-test/t/select_safe.test b/mysql-test/t/select_safe.test index 5b2dfb00bb7..7515ff40ab9 100644 --- a/mysql-test/t/select_safe.test +++ b/mysql-test/t/select_safe.test @@ -56,7 +56,6 @@ SELECT * from t1; # # Test MAX_SEEKS_FOR_KEY # -SELECT @@MAX_SEEKS_FOR_KEY; analyze table t1; insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"); explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index e6efb86e325..e32a6209a2d 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -408,11 +408,9 @@ set @@warning_count=1; set @@global.error_count=1; # -# Bug #10351: Setting max_heap_table_size to 4G fails +# Bug #10351: Setting ulong variable to > MAX_ULONG fails on 32-bit platform # set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; +select @@max_heap_table_size > 0; set global max_heap_table_size= 4294967296; -select @@max_heap_table_size; -set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; +select @@global.max_heap_table_size > 0; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7afb70c32a8..798bd25fa7c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5371,7 +5371,7 @@ The minimum value for this variable is 4096.", "Limit assumed max number of seeks when looking up rows based on a key", (gptr*) &global_system_variables.max_seeks_for_key, (gptr*) &max_system_variables.max_seeks_for_key, 0, GET_ULONG, - REQUIRED_ARG, UINT_MAX32, 1, UINT_MAX32, 0, 1, 0 }, + REQUIRED_ARG, ~0L, 1, ~0L, 0, 1, 0 }, {"max_sort_length", OPT_MAX_SORT_LENGTH, "The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored).", (gptr*) &global_system_variables.max_sort_length, diff --git a/sql/set_var.cc b/sql/set_var.cc index 5cdd4081614..9526cc79c56 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1422,6 +1422,12 @@ bool sys_var_thd_ulong::update(THD *thd, set_var *var) { ulonglong tmp= var->save_result.ulonglong_value; +#if SIZEOF_LONG != SIZEOF_LONGLONG + /* Avoid overflow on 32-bit platforms. */ + if (tmp > ULONG_MAX) + tmp= ULONG_MAX; +#endif + /* Don't use bigger value than given with --maximum-variable-name=.. */ if ((ulong) tmp > max_system_variables.*offset) tmp= max_system_variables.*offset; From 0658930275b8b1f89f1972ebff22bf1635136b93 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jul 2005 03:37:06 +0200 Subject: [PATCH 074/144] Remove Item_func::NOTLIKE_FUNC and all [dead] code that uses it --- sql/ha_ndbcluster.cc | 30 ------------------------------ sql/ha_ndbcluster.h | 2 -- sql/item_func.h | 2 +- 3 files changed, 1 insertion(+), 33 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index fc68b5a2ea9..86325c2fd45 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -6568,17 +6568,6 @@ void ndb_serialize_cond(const Item *item, void *arg) context->expect(Item::FUNC_ITEM); break; } - case Item_func::NOTLIKE_FUNC: - { - DBUG_PRINT("info", ("NOTLIKE_FUNC")); - curr_cond->ndb_item= new Ndb_item(func_item->functype(), - func_item); - context->expect(Item::STRING_ITEM); - context->expect(Item::FIELD_ITEM); - context->expect_field_result(STRING_RESULT); - context->expect(Item::FUNC_ITEM); - break; - } case Item_func::ISNULL_FUNC: { DBUG_PRINT("info", ("ISNULL_FUNC")); @@ -7172,25 +7161,6 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond, cond= cond->next->next->next; DBUG_RETURN(0); } - case Item_func::NOTLIKE_FUNC: - { - if (!value || !field) break; - if ((value->qualification.value_type != Item::STRING_ITEM) && - (value->qualification.value_type != Item::VARBIN_ITEM)) - break; - // Save value in right format for the field type - value->save_in_field(field); - DBUG_PRINT("info", ("Generating NOTLIKE filter: notlike(%d,%s,%d)", - field->get_field_no(), value->get_val(), - value->pack_length())); - if (filter->cmp(NdbScanFilter::COND_NOT_LIKE, - field->get_field_no(), - value->get_val(), - value->pack_length()) == -1) - DBUG_RETURN(1); - cond= cond->next->next->next; - DBUG_RETURN(0); - } case Item_func::ISNULL_FUNC: if (!field) break; diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index b34f8dd063c..91cfdde16fe 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -103,8 +103,6 @@ static const negated_function_mapping neg_map[]= {Item_func::LE_FUNC, Item_func::GT_FUNC}, {Item_func::GT_FUNC, Item_func::LE_FUNC}, {Item_func::GE_FUNC, Item_func::LT_FUNC}, - {Item_func::LIKE_FUNC, Item_func::NOTLIKE_FUNC}, - {Item_func::NOTLIKE_FUNC, Item_func::LIKE_FUNC}, {Item_func::ISNULL_FUNC, Item_func::ISNOTNULL_FUNC}, {Item_func::ISNOTNULL_FUNC, Item_func::ISNULL_FUNC}, {Item_func::UNKNOWN_FUNC, Item_func::NOT_FUNC} diff --git a/sql/item_func.h b/sql/item_func.h index 01df7cc1289..e8db9d70ae7 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -43,7 +43,7 @@ public: bool const_item_cache; enum Functype { UNKNOWN_FUNC,EQ_FUNC,EQUAL_FUNC,NE_FUNC,LT_FUNC,LE_FUNC, GE_FUNC,GT_FUNC,FT_FUNC, - LIKE_FUNC,NOTLIKE_FUNC,ISNULL_FUNC,ISNOTNULL_FUNC, + LIKE_FUNC,ISNULL_FUNC,ISNOTNULL_FUNC, COND_AND_FUNC, COND_OR_FUNC, COND_XOR_FUNC, BETWEEN, IN_FUNC, MULT_EQUAL_FUNC, INTERVAL_FUNC, ISNOTNULLTEST_FUNC, From 90b2daa7133cfab02017ff9ffc44d5e8089c0c31 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jul 2005 05:06:35 +0300 Subject: [PATCH 075/144] Ensure we free all items for prepared statements Before the fix in ~Prepared_statments we got a memory leak when executing mysql_client_test.test Note that test 'variables.test' fails. This will be fixed when Jimw pushes the fix for Bug 10351 mysys/default.c: Fixed typo sql/item.cc: More debugging information sql/sql_prepare.cc: More debugging information Ensure we free all items for prepared statements Before the fix in ~Prepared_statments we got a memory leak when executing mysql_client_test.test --- mysys/default.c | 2 +- sql/item.cc | 2 ++ sql/sql_prepare.cc | 24 ++++++++++++++++++++---- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/mysys/default.c b/mysys/default.c index d649df48332..bde7cbf2563 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -1023,7 +1023,7 @@ static void init_default_directories() } else { - /' No parent directory (strange). Use current dir + '\' '*/ + /* No parent directory (strange). Use current dir + '\' */ last[1]= 0; } break; diff --git a/sql/item.cc b/sql/item.cc index 22c56fa5f2b..25a12bc2d67 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2188,6 +2188,7 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) void Item_param::reset() { + DBUG_ENTER("Item_param::reset"); /* Shrink string buffer if it's bigger than max possible CHAR column */ if (str_value.alloced_length() > MAX_CHAR_WIDTH) str_value.free(); @@ -2212,6 +2213,7 @@ void Item_param::reset() DBUG_ASSERTS(state != NO_VALUE) in all Item_param::get_* methods). */ + DBUG_VOID_RETURN; } diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index cec432a86be..d79f2df7c1b 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1682,10 +1682,12 @@ static bool init_param_array(Prepared_statement *stmt) static void cleanup_stmt_and_thd_after_use(Statement *stmt, THD *thd) { + DBUG_ENTER("cleanup_stmt_and_thd_after_use"); stmt->lex->unit.cleanup(); cleanup_items(stmt->free_list); thd->rollback_item_tree_changes(); thd->cleanup_after_query(); + DBUG_VOID_RETURN; } /* @@ -1982,7 +1984,8 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_execute"))) DBUG_VOID_RETURN; - DBUG_PRINT("exec_query:", ("%s", stmt->query)); + DBUG_PRINT("exec_query", ("%s", stmt->query)); + DBUG_PRINT("info",("stmt: %p", stmt)); /* Check if we got an error when sending long data */ if (stmt->state == Query_arena::ERROR) @@ -2125,6 +2128,8 @@ void mysql_sql_stmt_execute(THD *thd, LEX_STRING *stmt_name) DBUG_VOID_RETURN; } + DBUG_PRINT("info",("stmt: %p", stmt)); + /* Must go before setting variables, as it clears thd->user_var_events */ mysql_reset_thd_for_next_command(thd); thd->set_n_backup_statement(stmt, &stmt_backup); @@ -2445,19 +2450,26 @@ void Prepared_statement::setup_set_params() Prepared_statement::~Prepared_statement() { + DBUG_ENTER("Prepared_statement::~Prepared_statement"); + DBUG_PRINT("enter",("stmt: %p cursor: %p", this, cursor)); if (cursor) { if (cursor->is_open()) { cursor->close(FALSE); - free_items(); + cleanup_items(free_list); + thd->rollback_item_tree_changes(); free_root(cursor->mem_root, MYF(0)); } cursor->Cursor::~Cursor(); } - else - free_items(); + /* + We have to call free on the items even if cleanup is called as some items, + like Item_param, don't free everything until free_items() + */ + free_items(); delete lex->result; + DBUG_VOID_RETURN; } @@ -2469,6 +2481,9 @@ Query_arena::Type Prepared_statement::type() const void Prepared_statement::close_cursor() { + DBUG_ENTER("Prepared_statement::close_cursor"); + DBUG_PRINT("enter",("stmt: %p", this)); + if (cursor && cursor->is_open()) { thd->change_list= cursor->change_list; @@ -2483,4 +2498,5 @@ void Prepared_statement::close_cursor() mysql_stmt_send_long_data() call. */ reset_stmt_params(this); + DBUG_VOID_RETURN; } From 21d2fb6287347659dd6ce5835ddf16cd3be50279 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 19:11:29 -0700 Subject: [PATCH 076/144] func_gconcat.result, func_gconcat.test: Added a test case for bug #12095. sql_class.h: Fixed bug #12095: a join query with GROUP_CONCAT over a single row table. Added a flag to the TMP_TABLE_PARAM class forcing to put constant items generated after elimination of a single row table into temp table in some cases (e.g. when GROUP_CONCAT is calculated over a single row table). bk ci sql/item_sum.cc Fixed bug #12095: a join query with GROUP_CONCAT over a single row table. If GROUP_CONCAT is calculated we always put its argument into a temp table, even when the argument is a constant item. sql_select.cc: Fixed bug #12095: a join query with GROUP_CONCAT over one row table. If temp table is used to calculate GROUP_CONCAT the argument should be always put into this table, even when it is a constant item. sql/sql_select.cc: Fixed bug #12095: a join query with GROUP_CONCAT over one row table. If temp table is used to calculate GROUP_CONCAT the argument should be always put into this table, even when it is a constant item. sql/sql_class.h: Fixed bug #12095: a join query with GROUP_CONCAT over a single row table. Added a flag to the TMP_TABLE_PARAM class forcing to put constant items generated after elimination of a single row table into temp table in some cases (e.g. when GROUP_CONCAT is calculated over a single row table). bk ci sql/item_sum.cc Fixed bug #12095: a join query with GROUP_CONCAT over a single row table. If GROUP_CONCAT is calculated we always put its argument into a temp table, even when the argument is a constant item. mysql-test/t/func_gconcat.test: Added a test case for bug #12095. mysql-test/r/func_gconcat.result: Added a test case for bug #12095. --- mysql-test/r/func_gconcat.result | 31 ++++++++++++++++++++++++++++++ mysql-test/t/func_gconcat.test | 33 ++++++++++++++++++++++++++++++++ sql/sql_class.h | 4 +++- sql/sql_select.cc | 3 ++- 4 files changed, 69 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 661793821a0..9faee3cbc01 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -517,3 +517,34 @@ a group_concat(distinct b order by b) 2 3,7 NULL 1,2,3,4,7 drop table t1; +CREATE TABLE t1 ( +aID smallint(5) unsigned NOT NULL auto_increment, +sometitle varchar(255) NOT NULL default '', +bID smallint(5) unsigned NOT NULL, +PRIMARY KEY (aID), +UNIQUE KEY sometitle (sometitle) +); +INSERT INTO t1 SET sometitle = 'title1', bID = 1; +INSERT INTO t1 SET sometitle = 'title2', bID = 1; +CREATE TABLE t2 ( +bID smallint(5) unsigned NOT NULL auto_increment, +somename varchar(255) NOT NULL default '', +PRIMARY KEY (bID), +UNIQUE KEY somename (somename) +); +INSERT INTO t2 SET somename = 'test'; +SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') +FROM t1 JOIN t2 ON t1.bID = t2.bID; +COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') +2 test +INSERT INTO t2 SET somename = 'test2'; +SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') +FROM t1 JOIN t2 ON t1.bID = t2.bID; +COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') +2 test +DELETE FROM t2 WHERE somename = 'test2'; +SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') +FROM t1 JOIN t2 ON t1.bID = t2.bID; +COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') +2 test +DROP TABLE t1,t2; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index e93ffcb17b3..9793d0d0a2c 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -310,4 +310,37 @@ select a, group_concat(b order by b) from t1 group by a with rollup; select a, group_concat(distinct b order by b) from t1 group by a with rollup; drop table t1; +# +# Bug #12095: GROUP_CONCAT for one row table +# + +CREATE TABLE t1 ( + aID smallint(5) unsigned NOT NULL auto_increment, + sometitle varchar(255) NOT NULL default '', + bID smallint(5) unsigned NOT NULL, + PRIMARY KEY (aID), + UNIQUE KEY sometitle (sometitle) +); +INSERT INTO t1 SET sometitle = 'title1', bID = 1; +INSERT INTO t1 SET sometitle = 'title2', bID = 1; + +CREATE TABLE t2 ( + bID smallint(5) unsigned NOT NULL auto_increment, + somename varchar(255) NOT NULL default '', + PRIMARY KEY (bID), + UNIQUE KEY somename (somename) +); +INSERT INTO t2 SET somename = 'test'; + +SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') + FROM t1 JOIN t2 ON t1.bID = t2.bID; +INSERT INTO t2 SET somename = 'test2'; +SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') + FROM t1 JOIN t2 ON t1.bID = t2.bID; +DELETE FROM t2 WHERE somename = 'test2'; +SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') + FROM t1 JOIN t2 ON t1.bID = t2.bID; + +DROP TABLE t1,t2; + # End of 4.1 tests diff --git a/sql/sql_class.h b/sql/sql_class.h index b6bf0dcdc45..85ff901fe72 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1325,10 +1325,12 @@ public: bool using_indirect_summary_function; /* If >0 convert all blob fields to varchar(convert_blob_length) */ uint convert_blob_length; + bool need_const; /* <=> const items are saved in tmp table */ TMP_TABLE_PARAM() :copy_field(0), group_parts(0), - group_length(0), group_null_parts(0), convert_blob_length(0) + group_length(0), group_null_parts(0), convert_blob_length(0), + need_const(0) {} ~TMP_TABLE_PARAM() { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 1bde62276b8..fc85f49093d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5201,7 +5201,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, param->using_indirect_summary_function=1; continue; } - if (item->const_item() && (int) hidden_field_count <= 0) + if (item->const_item() && (int) hidden_field_count <= 0 && + !param->need_const) continue; // We don't have to store this } if (type == Item::SUM_FUNC_ITEM && !group && !save_sum_fields) From df7e030b140437564e8680897ac78037518345b6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jul 2005 21:29:45 -0700 Subject: [PATCH 077/144] Manual merge --- mysql-test/t/func_gconcat.test | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 9793d0d0a2c..e30dcfae973 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -310,6 +310,13 @@ select a, group_concat(b order by b) from t1 group by a with rollup; select a, group_concat(distinct b order by b) from t1 group by a with rollup; drop table t1; +# +# Bug #6475 +# +create table t1 (a char(3), b char(20), primary key (a, b)); +insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English'); +select group_concat(a) from t1 group by b; +drop table t1; # # Bug #12095: GROUP_CONCAT for one row table # From 68cd99bd9966a4738feb0fa55fd3b71a52d3c1a9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jul 2005 14:39:11 +0500 Subject: [PATCH 078/144] Fix for bug #12173 (show create table crash) mysql-test/r/type_newdecimal.result: test result fixed mysql-test/t/type_newdecimal.test: testcase strings/decimal.c: we always add one int-part digit even if decimal(10,10) (no int part declared) --- mysql-test/r/type_newdecimal.result | 10 ++++++++++ mysql-test/t/type_newdecimal.test | 8 ++++++++ strings/decimal.c | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 1dd1142aea8..d39d2e3401d 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -976,3 +976,13 @@ select * from t1; f1 f2 f3 f4 f5 f6 f7 f8 1 18 99 100 104 200 1000 10000 drop table t1; +create table t1 ( +f0 decimal (30,30) zerofill not null DEFAULT 0, +f1 decimal (0,0) zerofill not null default 0); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f0` decimal(30,30) unsigned zerofill NOT NULL default '0.000000000000000000000000000000', + `f1` decimal(10,0) unsigned zerofill NOT NULL default '0000000000' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index e2f247edcd3..81e06c70c7d 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1007,3 +1007,11 @@ insert into t1 (f1) values (1); select * from t1; drop table t1; +# +# Bug 12173 (show create table fails) +# +create table t1 ( + f0 decimal (30,30) zerofill not null DEFAULT 0, + f1 decimal (0,0) zerofill not null default 0); +show create table t1; +drop table t1; diff --git a/strings/decimal.c b/strings/decimal.c index ca92ace92e1..4dc5fa91e0a 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -351,7 +351,8 @@ int decimal2string(decimal_t *from, char *to, int *to_len, buf0=&tmp; } - intg_len= fixed_precision ? fixed_intg : (intg ? intg : 1); + if (!(intg_len= fixed_precision ? fixed_intg : intg)) + intg_len= 1; frac_len= fixed_precision ? fixed_decimals : frac; len= from->sign + intg_len + test(frac) + frac_len; if (fixed_precision) From 3fee068e02b7e122db3b787fc266506167d2f63b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jul 2005 11:54:22 +0200 Subject: [PATCH 079/144] Increase version number (prepare for new build including security fixes in "zlib"). BitKeeper/etc/config: Using licensed version now. --- BitKeeper/etc/config | 2 +- configure.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BitKeeper/etc/config b/BitKeeper/etc/config index c609fcdbd49..6ddd492ebc4 100644 --- a/BitKeeper/etc/config +++ b/BitKeeper/etc/config @@ -24,7 +24,7 @@ description: MySQL - fast and reliable SQL database # repository is commercial it can be an internal email address or "none" # to disable logging. # -logging: logging@openlogging.org +logging: none # # If this field is set, all checkins will appear to be made by this user, # in effect making this a single user package. Single user packages are diff --git a/configure.in b/configure.in index 314283f6012..60b91f5cc60 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 4.1.10a) +AM_INIT_AUTOMAKE(mysql, 4.1.10b) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 From 8cec845876ffb77eb110e94f9de748097734b20e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jul 2005 12:37:27 +0200 Subject: [PATCH 080/144] - fixed a typo in C++Files/client/mysqlclient_ia64.dsp: ctype-cp963.c -> ctype-cp932.c (thanks to JoergB for spotting it) VC++Files/client/mysqlclient_ia64.dsp: - fixed a typo: ctype-cp963.c -> ctype-cp932.c (thanks to JoergB for spotting it) --- VC++Files/client/mysqlclient_ia64.dsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VC++Files/client/mysqlclient_ia64.dsp b/VC++Files/client/mysqlclient_ia64.dsp index 3edc979b9dc..ea67e1bf514 100644 --- a/VC++Files/client/mysqlclient_ia64.dsp +++ b/VC++Files/client/mysqlclient_ia64.dsp @@ -151,7 +151,7 @@ SOURCE="..\strings\ctype-czech.c" # End Source File # Begin Source File -SOURCE="..\strings\ctype-cp963.c" +SOURCE="..\strings\ctype-cp932.c" # End Source File # Begin Source File From 0f867ef74b77b225aed2773516b6e2cd808e61e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jul 2005 13:49:25 +0200 Subject: [PATCH 081/144] Security fix in "zlib": - upgrade zlib to 1.2.2 (originally: 2005/03/23 21:08:13+01:00 serg@serg.mylan ) - fixed linking with zlib (originally: 2005/05/24 22:42:43+02:00 lenz@mysql.com ) - one more build fix for zlib.lib - added libpath to the mysql_test_run_new project files (originally: 2005/05/25 10:55:21+02:00 lenz@mysql.com ) - Do not build the RPMs statically on i386 by default, only when adding either "--with static" or "--define '_with_static 1'" to the RPM build options. Static linking really only makes sense when linking against the specially patched glibc 2.2.5. (originally: 2005/06/14 21:39:08+02:00 lenz@mysql.com ) - Apply security patch to bundled zlib for CAN-2005-2096. (Bug #11844) (originally: 2005/07/11 10:37:21-07:00 jimw@mysql.com ) - applied a security fix to inftrees.h from the bundled zlib to resolve a second potential zlib security vulnerability (CAN-2005-1849). Fix was taken from the official zlib-1.2.3 distribution (no other zlib-1.2.3 changes were applied) (originally: 2005/07/27 14:55:08+02:00 lenz@mysql.com ) - build the RPM binaries against the bundled zlib, when static linking is requested (originally: 2005/07/27 16:42:13+02:00 lenz@mysql.com ) VC++Files/client/mysql.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqladmin.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqlcheck.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqldump.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqlimport.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqlshow.dsp: - added zlib.lib to the LINK32 options VC++Files/client/mysqltest.dsp: - added zlib.lib to the LINK32 options VC++Files/mysql-test/mysql_test_run_new.dsp: - added zlib.lib to the LINK32 options - added libpath option so that zlib.lib will be found VC++Files/mysqlbinlog/mysqlbinlog.dsp: - added zlib.lib to the LINK32 options VC++Files/mysqlcheck/mysqlcheck.dsp: - added zlib.lib to the LINK32 options VC++Files/mysqlmanager/mysqlmanager.dsp: - added zlib.lib to the LINK32 options acinclude.m4: clarify help text support-files/mysql.spec.sh: - Do not build statically on i386 by default, only when adding either "--with static" or "--define '_with_static 1'" to the RPM build options. Static linking really only makes sense when linking against the specially patched glibc 2.2.5. - build against the bundled zlib, when linking statically zlib/ChangeLog: upgrade zlib to 1.2.2 zlib/FAQ: upgrade zlib to 1.2.2 zlib/INDEX: upgrade zlib to 1.2.2 zlib/README: upgrade zlib to 1.2.2 zlib/crc32.c: upgrade zlib to 1.2.2 zlib/deflate.c: upgrade zlib to 1.2.2 zlib/deflate.h: upgrade zlib to 1.2.2 zlib/gzio.c: upgrade zlib to 1.2.2 zlib/infback.c: upgrade zlib to 1.2.2 zlib/inffast.c: upgrade zlib to 1.2.2 zlib/inflate.c: upgrade zlib to 1.2.2 zlib/inftrees.c: upgrade zlib to 1.2.2 Apply security patch for CAN-2005-2096 zlib/inftrees.h: upgrade zlib to 1.2.2 applied another security fix to resolve CAN-2005-1849, taken from the 1.2.3 zlib sources zlib/trees.c: upgrade zlib to 1.2.2 zlib/zconf.h: upgrade zlib to 1.2.2 zlib/zlib.3: upgrade zlib to 1.2.2 zlib/zlib.h: upgrade zlib to 1.2.2 zlib/zutil.h: upgrade zlib to 1.2.2 --- VC++Files/client/mysql.dsp | 6 +- VC++Files/client/mysqladmin.dsp | 6 +- VC++Files/client/mysqlcheck.dsp | 2 +- VC++Files/client/mysqldump.dsp | 6 +- VC++Files/client/mysqlimport.dsp | 6 +- VC++Files/client/mysqlshow.dsp | 6 +- VC++Files/client/mysqltest.dsp | 4 +- VC++Files/mysql-test/mysql_test_run_new.dsp | 4 +- VC++Files/mysqlbinlog/mysqlbinlog.dsp | 6 +- VC++Files/mysqlcheck/mysqlcheck.dsp | 6 +- VC++Files/mysqlmanager/mysqlmanager.dsp | 4 +- acinclude.m4 | 5 +- support-files/mysql.spec.sh | 16 +++- zlib/ChangeLog | 42 ++++++++++ zlib/FAQ | 88 +++++++++++++-------- zlib/INDEX | 3 + zlib/README | 8 +- zlib/crc32.c | 74 +++++++++++------ zlib/deflate.c | 4 +- zlib/deflate.h | 1 - zlib/gzio.c | 4 + zlib/infback.c | 3 + zlib/inffast.c | 4 +- zlib/inflate.c | 4 + zlib/inftrees.c | 19 +++-- zlib/inftrees.h | 10 +-- zlib/trees.c | 4 +- zlib/zconf.h | 83 +++++++++---------- zlib/zlib.3 | 6 +- zlib/zlib.h | 30 +++---- zlib/zutil.h | 7 +- 31 files changed, 299 insertions(+), 172 deletions(-) diff --git a/VC++Files/client/mysql.dsp b/VC++Files/client/mysql.dsp index ec16e780d3e..8298e62d8ad 100644 --- a/VC++Files/client/mysql.dsp +++ b/VC++Files/client/mysql.dsp @@ -52,7 +52,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../client_release/mysql.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /debug /machine:I386 /out:"../client_release/mysql.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /incremental:yes !ELSEIF "$(CFG)" == "mysql - Win32 Debug" @@ -78,7 +78,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysql.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysql.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysql - Win32 classic" @@ -106,7 +106,7 @@ BSC32=bscmake.exe LINK32=xilink6.exe # ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../client_release/mysql.exe" /libpath:"..\lib_release\\" # SUBTRACT BASE LINK32 /incremental:yes -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../client_classic/mysql.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /debug /machine:I386 /out:"../client_classic/mysql.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /incremental:yes !ENDIF diff --git a/VC++Files/client/mysqladmin.dsp b/VC++Files/client/mysqladmin.dsp index 7a0b3bec1a7..b473d104a76 100644 --- a/VC++Files/client/mysqladmin.dsp +++ b/VC++Files/client/mysqladmin.dsp @@ -52,7 +52,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqladmin.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqladmin.exe" /libpath:"..\lib_release\\" !ELSEIF "$(CFG)" == "mysqladmin - Win32 Debug" @@ -77,7 +77,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqladmin.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqladmin.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqladmin - Win32 classic" @@ -104,7 +104,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqladmin.exe" /libpath:"..\lib_release\\" -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqladmin.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqladmin.exe" /libpath:"..\lib_release\\" !ENDIF diff --git a/VC++Files/client/mysqlcheck.dsp b/VC++Files/client/mysqlcheck.dsp index 30e7a365f04..399b18d16fc 100644 --- a/VC++Files/client/mysqlcheck.dsp +++ b/VC++Files/client/mysqlcheck.dsp @@ -46,7 +46,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /pdb:"release/mysqlcheck.pdb" /machine:I386 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /pdb:"release/mysqlcheck.pdb" /machine:I386 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /pdb:none # Begin Target diff --git a/VC++Files/client/mysqldump.dsp b/VC++Files/client/mysqldump.dsp index 3c955639596..45d1d8777aa 100644 --- a/VC++Files/client/mysqldump.dsp +++ b/VC++Files/client/mysqldump.dsp @@ -52,7 +52,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" !ELSEIF "$(CFG)" == "mysqldump - Win32 Debug" @@ -77,7 +77,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqldump - Win32 classic" @@ -104,7 +104,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\" !ENDIF diff --git a/VC++Files/client/mysqlimport.dsp b/VC++Files/client/mysqlimport.dsp index d5fd8557397..1a9b64a0383 100644 --- a/VC++Files/client/mysqlimport.dsp +++ b/VC++Files/client/mysqlimport.dsp @@ -52,7 +52,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlimport.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlimport.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /incremental:yes !ELSEIF "$(CFG)" == "mysqlimport - Win32 Debug" @@ -78,7 +78,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlimport.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlimport.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqlimport - Win32 classic" @@ -106,7 +106,7 @@ BSC32=bscmake.exe LINK32=xilink6.exe # ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlimport.exe" /libpath:"..\lib_release\\" # SUBTRACT BASE LINK32 /incremental:yes -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlimport.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlimport.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /incremental:yes !ENDIF diff --git a/VC++Files/client/mysqlshow.dsp b/VC++Files/client/mysqlshow.dsp index b9fd0d27e46..855c2dcdf34 100644 --- a/VC++Files/client/mysqlshow.dsp +++ b/VC++Files/client/mysqlshow.dsp @@ -52,7 +52,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlshow.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlshow.exe" /libpath:"..\lib_release\\" !ELSEIF "$(CFG)" == "mysqlshow - Win32 Debug" @@ -77,7 +77,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlshow.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlshow.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqlshow - Win32 classic" @@ -104,7 +104,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlshow.exe" /libpath:"..\lib_release\\" -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlshow.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlshow.exe" /libpath:"..\lib_release\\" !ENDIF diff --git a/VC++Files/client/mysqltest.dsp b/VC++Files/client/mysqltest.dsp index d04dc5bfce8..e705b17b0f0 100644 --- a/VC++Files/client/mysqltest.dsp +++ b/VC++Files/client/mysqltest.dsp @@ -78,7 +78,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib zlib.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 !ELSEIF "$(CFG)" == "mysqltest - Win32 Release" @@ -103,7 +103,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib zlib.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 !ENDIF diff --git a/VC++Files/mysql-test/mysql_test_run_new.dsp b/VC++Files/mysql-test/mysql_test_run_new.dsp index 61392b00b94..467ff939502 100644 --- a/VC++Files/mysql-test/mysql_test_run_new.dsp +++ b/VC++Files/mysql-test/mysql_test_run_new.dsp @@ -52,7 +52,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib zlib.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console !ELSEIF "$(CFG)" == "mysql_test_run_new - Win32 Release" @@ -77,7 +77,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:console -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib zlib.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:console !ENDIF diff --git a/VC++Files/mysqlbinlog/mysqlbinlog.dsp b/VC++Files/mysqlbinlog/mysqlbinlog.dsp index 8b8895d6f17..1b129072d8e 100644 --- a/VC++Files/mysqlbinlog/mysqlbinlog.dsp +++ b/VC++Files/mysqlbinlog/mysqlbinlog.dsp @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlbinlog.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlbinlog.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /pdb:none /debug !ELSEIF "$(CFG)" == "mysqlbinlog - Win32 Debug" @@ -76,7 +76,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlbinlog.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlbinlog.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqlbinlog - Win32 classic" @@ -102,7 +102,7 @@ BSC32=bscmake.exe LINK32=xilink6.exe # ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlbinlog.exe" /libpath:"..\lib_release\\" # SUBTRACT BASE LINK32 /pdb:none /debug -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlbinlog.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlbinlog.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /pdb:none /debug !ENDIF diff --git a/VC++Files/mysqlcheck/mysqlcheck.dsp b/VC++Files/mysqlcheck/mysqlcheck.dsp index bd24a14128d..51a817cc067 100644 --- a/VC++Files/mysqlcheck/mysqlcheck.dsp +++ b/VC++Files/mysqlcheck/mysqlcheck.dsp @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" !ELSEIF "$(CFG)" == "mysqlcheck - Win32 Debug" @@ -75,7 +75,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlcheck.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlcheck.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqlcheck - Win32 classic" @@ -100,7 +100,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlcheck.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib zlib.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqlcheck.exe" /libpath:"..\lib_release\\" !ENDIF diff --git a/VC++Files/mysqlmanager/mysqlmanager.dsp b/VC++Files/mysqlmanager/mysqlmanager.dsp index 7f92e091904..27aa1a77024 100644 --- a/VC++Files/mysqlmanager/mysqlmanager.dsp +++ b/VC++Files/mysqlmanager/mysqlmanager.dsp @@ -54,7 +54,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 /nologo /subsystem:windows /machine:I386 /out:"../client_release/MySqlManager.exe" +# ADD LINK32 zlib.lib /nologo /subsystem:windows /machine:I386 /out:"../client_release/MySqlManager.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /nodefaultlib !ELSEIF "$(CFG)" == "MySqlManager - Win32 Debug" @@ -83,7 +83,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /out:"../client_debug/MySqlManager.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib zlib.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /out:"../client_debug/MySqlManager.exe" /pdbtype:sept /libpath:"..\lib_debug\\" # SUBTRACT LINK32 /pdb:none !ENDIF diff --git a/acinclude.m4 b/acinclude.m4 index 5ddd8952c42..c1803c5c0e1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -256,9 +256,10 @@ case $SYSTEM_TYPE in AC_ARG_WITH([zlib-dir], AC_HELP_STRING([--with-zlib-dir=DIR], [Provide MySQL with a custom location of - compression library. Given DIR, zlib binary is + compression library. Given DIR, zlib library is assumed to be in $DIR/lib and header files - in $DIR/include.]), + in $DIR/include. Specify "bundled" to use + bundled zlib.]), [mysql_zlib_dir=${withval}], [mysql_zlib_dir=""]) case "$mysql_zlib_dir" in diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 07c8e6a46fb..4586b880845 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -1,5 +1,9 @@ %define mysql_version @VERSION@ -%ifarch i386 +# use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x) +# to enable static linking (off by default) +%{?_with_static:%define STATIC_BUILD 1} +%{!?_with_static:%define STATIC_BUILD 0} +%if %{STATIC_BUILD} %define release 0 %else %define release 0.glibc23 @@ -374,9 +378,10 @@ mv Docs/manual.ps.save Docs/manual.ps # so don't link statically there # BuildMySQL "--disable-shared \ -%ifarch i386 +%if %{STATIC_BUILD} --with-mysqld-ldflags='-all-static' \ --with-client-ldflags='-all-static' \ + --with-zlib-dir=bundled \ $USE_OTHER_LIBC_DIR \ %endif --with-comment=\"MySQL Community Edition - Standard (GPL)\" \ @@ -695,6 +700,13 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Tue Jun 14 2005 Lenz Grimmer + +- Do not build statically on i386 by default, only when adding either "--with + static" or "--define '_with_static 1'" to the RPM build options. Static + linking really only makes sense when linking against the specially patched + glibc 2.2.5. + * Mon Feb 14 2005 Lenz Grimmer * Fixed the compilation comments and moved them into the separate build sections diff --git a/zlib/ChangeLog b/zlib/ChangeLog index 243a5062fae..1af7633d668 100644 --- a/zlib/ChangeLog +++ b/zlib/ChangeLog @@ -6,6 +6,48 @@ in MySQL distribution. If you are working on porting MySQL to one of rare platforms, you might find worth looking at the original zlib distribution and using appropriate Makefiles/project files from it. +Changes in 1.2.2 (3 October 2004) +- Update zlib.h comments on gzip in-memory processing +- Set adler to 1 in inflateReset() to support Java test suite [Walles] +- Add contrib/dotzlib [Ravn] +- Update win32/DLL_FAQ.txt [Truta] +- Update contrib/minizip [Vollant] +- Move contrib/visual-basic.txt to old/ [Truta] +- Fix assembler builds in projects/visualc6/ [Truta] + +Changes in 1.2.1.2 (9 September 2004) +- Update INDEX file +- Fix trees.c to update strm->data_type (no one ever noticed!) +- Fix bug in error case in inflate.c, infback.c, and infback9.c [Brown] +- Add "volatile" to crc table flag declaration (for DYNAMIC_CRC_TABLE) +- Add limited multitasking protection to DYNAMIC_CRC_TABLE +- Add NO_vsnprintf for VMS in zutil.h [Mozilla] +- Don't declare strerror() under VMS [Mozilla] +- Add comment to DYNAMIC_CRC_TABLE to use get_crc_table() to initialize +- Update contrib/ada [Anisimkov] +- Update contrib/minizip [Vollant] +- Fix configure to not hardcode directories for Darwin [Peterson] +- Fix gzio.c to not return error on empty files [Brown] +- Fix indentation; update version in contrib/delphi/ZLib.pas and + contrib/pascal/zlibpas.pas [Truta] +- Update mkasm.bat in contrib/masmx86 [Truta] +- Update contrib/untgz [Truta] +- Add projects/README.projects [Truta] +- Add project for MS Visual C++ 6.0 in projects/visualc6 [Cadieux, Truta] +- Update win32/DLL_FAQ.txt [Truta] +- Update list of Z_PREFIX symbols in zconf.h [Randers-Pehrson, Truta] +- Remove an unnecessary assignment to curr in inftrees.c [Truta] +- Add OS/2 to exe builds in configure [Poltorak] +- Remove err dummy parameter in zlib.h [Kientzle] + +Changes in 1.2.1.1 (9 January 2004) +- Update email address in README +- Several FAQ updates +- Fix a big fat bug in inftrees.c that prevented decoding valid + dynamic blocks with only literals and no distance codes -- + Thanks to "Hot Emu" for the bug report and sample file +- Add a note to puff.c on no distance codes case. + Changes in 1.2.1 (17 November 2003) - Remove a tab in contrib/gzappend/gzappend.c - Update some interfaces in contrib for new zlib functions diff --git a/zlib/FAQ b/zlib/FAQ index 7115ec38d60..4f61f1094e6 100644 --- a/zlib/FAQ +++ b/zlib/FAQ @@ -21,18 +21,18 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html 3. Where can I get a Visual Basic interface to zlib? See - * http://www.winimage.com/zLibDll/ * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm * contrib/visual-basic.txt in the zlib distribution + * win32/DLL_FAQ.txt in the zlib distribution - 4. compress() returns Z_BUF_ERROR + 4. compress() returns Z_BUF_ERROR. Make sure that before the call of compress, the length of the compressed buffer is equal to the total size of the compressed buffer and not zero. For Visual Basic, check that this parameter is passed by reference ("as any"), not by value ("as long"). - 5. deflate() or inflate() returns Z_BUF_ERROR + 5. deflate() or inflate() returns Z_BUF_ERROR. Before making the call, make sure that avail_in and avail_out are not zero. When setting the parameter flush equal to Z_FINISH, also make sure @@ -47,8 +47,8 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html It's in zlib.h for the moment, and Francis S. Lin has converted it to a web page zlib.html. Volunteers to transform this to Unix-style man pages, - please contact Jean-loup Gailly (jloup@gzip.org). Examples of zlib usage - are in the files example.c and minigzip.c. + please contact us (zlib@gzip.org). Examples of zlib usage are in the files + example.c and minigzip.c. 7. Why don't you use GNU autoconf or libtool or ...? @@ -77,7 +77,8 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html 11. Can zlib handle .zip archives? - See the directory contrib/minizip in the zlib distribution. + Not by itself, no. See the directory contrib/minizip in the zlib + distribution. 12. Can zlib handle .Z files? @@ -92,6 +93,8 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html 14. How do I install a shared zlib library on Unix? + After the above, then: + make install However, many flavors of Unix come with a shared zlib already installed. @@ -99,12 +102,31 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html trying to install it, you may want to check if it's already there! If you can #include , it's there. The -lz option will probably link to it. -15. I have a question about OttoPDF +15. I have a question about OttoPDF. We are not the authors of OttoPDF. The real author is on the OttoPDF web - site Joel Hainley jhainley@myndkryme.com. + site: Joel Hainley, jhainley@myndkryme.com. -16. Why does gzip give an error on a file I make with compress/deflate? +16. Can zlib decode Flate data in an Adobe PDF file? + + Yes. See http://www.fastio.com/ (ClibPDF), or http://www.pdflib.com/ . + To modify PDF forms, see http://sourceforge.net/projects/acroformtool/ . + +17. Why am I getting this "register_frame_info not found" error on Solaris? + + After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib + generates an error such as: + + ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so: + symbol __register_frame_info: referenced symbol not found + + The symbol __register_frame_info is not part of zlib, it is generated by + the C compiler (cc or gcc). You must recompile applications using zlib + which have this problem. This problem is specific to Solaris. See + http://www.sunfreeware.com for Solaris versions of zlib and applications + using zlib. + +18. Why does gzip give an error on a file I make with compress/deflate? The compress and deflate functions produce data in the zlib format, which is different and incompatible with the gzip format. The gz* functions in @@ -112,7 +134,7 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html formats use the same compressed data format internally, but have different headers and trailers around the compressed data. -17. Ok, so why are there two different formats? +19. Ok, so why are there two different formats? The gzip format was designed to retain the directory information about a single file, such as the name and last modification date. The zlib @@ -120,7 +142,7 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html channel applications, and has a much more compact header and trailer and uses a faster integrity check than gzip. -18. Well that's nice, but how do I make a gzip file in memory? +20. Well that's nice, but how do I make a gzip file in memory? You can request that deflate write the gzip format instead of the zlib format using deflateInit2(). You can also request that inflate decode @@ -133,7 +155,7 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html function and roll your own gzip encoding and decoding. Read the gzip RFC 1952 for details of the header and trailer format. -19. Is zlib thread-safe? +21. Is zlib thread-safe? Yes. However any library routines that zlib uses and any application- provided memory allocation routines must also be thread-safe. zlib's gz* @@ -144,15 +166,15 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html Of course, you should only operate on any given zlib or gzip stream from a single thread at a time. -20. Can I use zlib in my commercial application? +22. Can I use zlib in my commercial application? Yes. Please read the license in zlib.h. -21. Is zlib under the GNU license? +23. Is zlib under the GNU license? No. Please read the license in zlib.h. -22. The license says that altered source versions must be "plainly marked". So +24. The license says that altered source versions must be "plainly marked". So what exactly do I need to do to meet that requirement? You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In @@ -175,24 +197,24 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html ZLIB_VERSION and ZLIB_VERNUM and note the origin and nature of the changes in zlib.h as you would for a full source distribution. -23. Will zlib work on a big-endian or little-endian architecture, and can I +25. Will zlib work on a big-endian or little-endian architecture, and can I exchange compressed data between them? Yes and yes. -24. Will zlib work on a 64-bit machine? +26. Will zlib work on a 64-bit machine? It should. It has been tested on 64-bit machines, and has no dependence on any data types being limited to 32-bits in length. If you have any difficulties, please provide a complete problem report to zlib@gzip.org -25. Will zlib decompress data from the PKWare Data Compression Library? +27. Will zlib decompress data from the PKWare Data Compression Library? No. The PKWare DCL uses a completely different compressed data format than does PKZIP and zlib. However, you can look in zlib's contrib/blast directory for a possible solution to your problem. -26. Can I access data randomly in a compressed stream? +28. Can I access data randomly in a compressed stream? No, not without some preparation. If when compressing you periodically use Z_FULL_FLUSH, carefully write all the pending data at those points, @@ -200,27 +222,27 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html at those points. You have to be careful to not use Z_FULL_FLUSH too often, since it can significantly degrade compression. -27. Does zlib work on MVS, OS/390, CICS, etc.? +29. Does zlib work on MVS, OS/390, CICS, etc.? We don't know for sure. We have heard occasional reports of success on these systems. If you do use it on one of these, please provide us with a report, instructions, and patches that we can reference when we get these questions. Thanks. -28. Is there some simpler, easier to read version of inflate I can look at +30. Is there some simpler, easier to read version of inflate I can look at to understand the deflate format? First off, you should read RFC 1951. Second, yes. Look in zlib's contrib/puff directory. -29. Does zlib infringe on any patents? +31. Does zlib infringe on any patents? As far as we know, no. In fact, that was originally the whole point behind zlib. Look here for some more information: http://www.gzip.org/#faq11 -30. Can zlib work with greater than 4 GB of data? +32. Can zlib work with greater than 4 GB of data? Yes. inflate() and deflate() will process any amount of data correctly. Each call of inflate() or deflate() is limited to input and output chunks @@ -238,7 +260,7 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html only if the compiler's "long" type is 32 bits. If the compiler's "long" type is 64 bits, then the limit is 16 exabytes. -31. Does zlib have any security vulnerabilities? +33. Does zlib have any security vulnerabilities? The only one that we are aware of is potentially in gzprintf(). If zlib is compiled to use sprintf() or vsprintf(), then there is no protection @@ -258,35 +280,35 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html Note that you should be using the most recent version of zlib. Versions 1.1.3 and before were subject to a double-free vulnerability. -32. Is there a Java version of zlib? +34. Is there a Java version of zlib? Probably what you want is to use zlib in Java. zlib is already included as part of the Java SDK in the java.util.zip package. If you really want a version of zlib written in the Java language, look on the zlib home page for links: http://www.zlib.org/ -33. I get this or that compiler or source-code scanner warning when I crank it - up to maximally-pendantic. Can't you guys write proper code? +35. I get this or that compiler or source-code scanner warning when I crank it + up to maximally-pedantic. Can't you guys write proper code? Many years ago, we gave up attempting to avoid warnings on every compiler in the universe. It just got to be a waste of time, and some compilers were downright silly. So now, we simply make sure that the code always works. -34. Will zlib read the (insert any ancient or arcane format here) compressed +36. Will zlib read the (insert any ancient or arcane format here) compressed data format? Probably not. Look in the comp.compression FAQ for pointers to various formats and associated software. -35. How can I encrypt/decrypt zip files with zlib? +37. How can I encrypt/decrypt zip files with zlib? zlib doesn't support encryption. The original PKZIP encryption is very weak and can be broken with freely available programs. To get strong encryption, - use gpg ( http://www.gnupg.org/ ) which already includes zlib compression. + use GnuPG, http://www.gnupg.org/ , which already includes zlib compression. For PKZIP compatible "encryption", look at http://www.info-zip.org/ -36. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? +38. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? "gzip" is the gzip format, and "deflate" is the zlib format. They should probably have called the second one "zlib" instead to avoid confusion @@ -302,14 +324,14 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html Bottom line: use the gzip format for HTTP 1.1 encoding. -37. Does zlib support the new "Deflate64" format introduced by PKWare? +39. Does zlib support the new "Deflate64" format introduced by PKWare? No. PKWare has apparently decided to keep that format proprietary, since they have not documented it as they have previous compression formats. In any case, the compression improvements are so modest compared to other more modern approaches, that it's not worth the effort to implement. -38. Can you please sign these lengthy legal documents and fax them back to us +40. Can you please sign these lengthy legal documents and fax them back to us so that we can use your software in our product? No. Go away. Shoo. diff --git a/zlib/INDEX b/zlib/INDEX index a9de7844d16..0587e5902bd 100644 --- a/zlib/INDEX +++ b/zlib/INDEX @@ -8,9 +8,12 @@ algorithm.txt description of the (de)compression algorithm configure configure script for Unix zconf.in.h template for zconf.h (used by configure) +amiga/ makefiles for Amiga SAS C +as400/ makefiles for IBM AS/400 msdos/ makefiles for MSDOS old/ makefiles for various architectures and zlib documentation files that have not yet been updated for zlib 1.2.x +projects/ projects for various Integrated Development Environments qnx/ makefiles for QNX win32/ makefiles for Windows diff --git a/zlib/README b/zlib/README index 0f1205481c1..df95ae13f54 100644 --- a/zlib/README +++ b/zlib/README @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.1 is a general purpose data compression library. All the code is +zlib 1.2.2 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) @@ -34,7 +34,7 @@ Mark Nelson wrote an article about zlib for the Jan. 1997 issue of Dr. Dobb's Journal; a copy of the article is available in http://dogma.net/markn/articles/zlibtool/zlibtool.htm -The changes made in version 1.2.1 are documented in the file ChangeLog. +The changes made in version 1.2.2 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory "contrib". @@ -46,7 +46,7 @@ A Perl interface to zlib written by Paul Marquess is in the CPAN (Comprehensive Perl Archive Network) sites http://www.cpan.org/modules/by-module/Compress/ -A Python interface to zlib written by A.M. Kuchling is +A Python interface to zlib written by A.M. Kuchling is available in Python 1.5 and later versions, see http://www.python.org/doc/lib/module-zlib.html @@ -93,7 +93,7 @@ Acknowledgments: Copyright notice: - (C) 1995-2003 Jean-loup Gailly and Mark Adler + (C) 1995-2004 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/zlib/crc32.c b/zlib/crc32.c index 689b2883b43..b39c7e1253e 100644 --- a/zlib/crc32.c +++ b/zlib/crc32.c @@ -11,6 +11,14 @@ /* @(#) $Id$ */ +/* + Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore + protection on the static variables used to control the first-use generation + of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should + first call get_crc_table() to initialize the tables before allowing more than + one thread to use crc32(). + */ + #ifdef MAKECRCH # include # ifndef DYNAMIC_CRC_TABLE @@ -58,7 +66,7 @@ #ifdef DYNAMIC_CRC_TABLE -local int crc_table_empty = 1; +local volatile int crc_table_empty = 1; local unsigned long FAR crc_table[TBLS][256]; local void make_crc_table OF((void)); #ifdef MAKECRCH @@ -95,38 +103,51 @@ local void make_crc_table() { unsigned long c; int n, k; - unsigned long poly; /* polynomial exclusive-or pattern */ + unsigned long poly; /* polynomial exclusive-or pattern */ /* terms of polynomial defining this crc (except x^32): */ + static volatile int first = 1; /* flag to limit concurrent making */ static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - /* make exclusive-or pattern from polynomial (0xedb88320UL) */ - poly = 0UL; - for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) - poly |= 1UL << (31 - p[n]); + /* See if another task is already doing this (not thread-safe, but better + than nothing -- significantly reduces duration of vulnerability in + case the advice about DYNAMIC_CRC_TABLE is ignored) */ + if (first) { + first = 0; - /* generate a crc for every 8-bit value */ - for (n = 0; n < 256; n++) { - c = (unsigned long)n; - for (k = 0; k < 8; k++) - c = c & 1 ? poly ^ (c >> 1) : c >> 1; - crc_table[0][n] = c; - } + /* make exclusive-or pattern from polynomial (0xedb88320UL) */ + poly = 0UL; + for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) + poly |= 1UL << (31 - p[n]); + + /* generate a crc for every 8-bit value */ + for (n = 0; n < 256; n++) { + c = (unsigned long)n; + for (k = 0; k < 8; k++) + c = c & 1 ? poly ^ (c >> 1) : c >> 1; + crc_table[0][n] = c; + } #ifdef BYFOUR - /* generate crc for each value followed by one, two, and three zeros, and - then the byte reversal of those as well as the first table */ - for (n = 0; n < 256; n++) { - c = crc_table[0][n]; - crc_table[4][n] = REV(c); - for (k = 1; k < 4; k++) { - c = crc_table[0][c & 0xff] ^ (c >> 8); - crc_table[k][n] = c; - crc_table[k + 4][n] = REV(c); + /* generate crc for each value followed by one, two, and three zeros, + and then the byte reversal of those as well as the first table */ + for (n = 0; n < 256; n++) { + c = crc_table[0][n]; + crc_table[4][n] = REV(c); + for (k = 1; k < 4; k++) { + c = crc_table[0][c & 0xff] ^ (c >> 8); + crc_table[k][n] = c; + crc_table[k + 4][n] = REV(c); + } } - } #endif /* BYFOUR */ - crc_table_empty = 0; + crc_table_empty = 0; + } + else { /* not first */ + /* wait for the other guy to finish (not efficient, but rare) */ + while (crc_table_empty) + ; + } #ifdef MAKECRCH /* write out CRC tables to crc32.h */ @@ -180,9 +201,10 @@ local void write_table(out, table) const unsigned long FAR * ZEXPORT get_crc_table() { #ifdef DYNAMIC_CRC_TABLE - if (crc_table_empty) make_crc_table(); + if (crc_table_empty) + make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ - return (const unsigned long FAR *)crc_table; + return (const unsigned long FAR *)crc_table; } /* ========================================================================= */ diff --git a/zlib/deflate.c b/zlib/deflate.c index 0525b2f33ca..0fc53bc1e82 100644 --- a/zlib/deflate.c +++ b/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2003 Jean-loup Gailly. + * Copyright (C) 1995-2004 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.1 Copyright 1995-2003 Jean-loup Gailly "; + " deflate 1.2.2 Copyright 1995-2004 Jean-loup Gailly "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot diff --git a/zlib/deflate.h b/zlib/deflate.h index e31f66be521..410681d18a4 100644 --- a/zlib/deflate.h +++ b/zlib/deflate.h @@ -95,7 +95,6 @@ typedef struct internal_state { Bytef *pending_out; /* next pending byte to output to the stream */ int pending; /* nb of bytes in the pending buffer */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - Byte data_type; /* UNKNOWN, BINARY or ASCII */ Byte method; /* STORED (for zip only) or DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ diff --git a/zlib/gzio.c b/zlib/gzio.c index 4afd102b3f3..5e71b0ab3ae 100644 --- a/zlib/gzio.c +++ b/zlib/gzio.c @@ -455,6 +455,10 @@ int ZEXPORT gzread (file, buf, len) s->z_err = Z_ERRNO; break; } + if (feof(s->file)) { /* avoid error for empty file */ + s->z_err = Z_STREAM_END; + break; + } } s->stream.next_in = s->inbuf; } diff --git a/zlib/infback.c b/zlib/infback.c index 110b03b857f..262f97c73ac 100644 --- a/zlib/infback.c +++ b/zlib/infback.c @@ -434,6 +434,9 @@ void FAR *out_desc; } } + /* handle error breaks in while */ + if (state->mode == BAD) break; + /* build code tables */ state->next = state->codes; state->lencode = (code const FAR *)(state->next); diff --git a/zlib/inffast.c b/zlib/inffast.c index c716440a92a..8c02a178d04 100644 --- a/zlib/inffast.c +++ b/zlib/inffast.c @@ -1,5 +1,5 @@ /* inffast.c -- fast decoding - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2004 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -19,7 +19,7 @@ - none No measurable difference: - Pentium III (Anderson) - - 68060 (Nikl) + - M68060 (Nikl) */ #ifdef POSTINC # define OFF 0 diff --git a/zlib/inflate.c b/zlib/inflate.c index a53b5c7446e..c6d38266d07 100644 --- a/zlib/inflate.c +++ b/zlib/inflate.c @@ -109,6 +109,7 @@ z_streamp strm; state = (struct inflate_state FAR *)strm->state; strm->total_in = strm->total_out = state->total = 0; strm->msg = Z_NULL; + strm->adler = 1; /* to support ill-conceived Java test suite */ state->mode = HEAD; state->last = 0; state->havedict = 0; @@ -861,6 +862,9 @@ int flush; } } + /* handle error breaks in while */ + if (state->mode == BAD) break; + /* build code tables */ state->next = state->codes; state->lencode = (code const FAR *)(state->next); diff --git a/zlib/inftrees.c b/zlib/inftrees.c index 3bb56398e1c..509461d9273 100644 --- a/zlib/inftrees.c +++ b/zlib/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2004 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.1 Copyright 1995-2003 Mark Adler "; + " inflate 1.2.2 Copyright 1995-2004 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -62,7 +62,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 76, 66}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 198}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, @@ -114,7 +114,15 @@ unsigned short FAR *work; for (max = MAXBITS; max >= 1; max--) if (count[max] != 0) break; if (root > max) root = max; - if (max == 0) return -1; /* no codes! */ + if (max == 0) { /* no symbols to code at all */ + this.op = (unsigned char)64; /* invalid code marker */ + this.bits = (unsigned char)1; + this.val = (unsigned short)0; + *(*table)++ = this; /* make a table to force an error */ + *(*table)++ = this; + *bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } for (min = 1; min <= MAXBITS; min++) if (count[min] != 0) break; if (root < min) root = min; @@ -126,7 +134,7 @@ unsigned short FAR *work; left -= count[len]; if (left < 0) return -1; /* over-subscribed */ } - if (left > 0 && (type == CODES || (codes - count[0] != 1))) + if (left > 0 && (type == CODES || max != 1)) return -1; /* incomplete set */ /* generate offsets into symbol table for each length for sorting */ @@ -295,7 +303,6 @@ unsigned short FAR *work; drop = 0; len = root; next = *table; - curr = root; this.bits = (unsigned char)len; } diff --git a/zlib/inftrees.h b/zlib/inftrees.h index 82d365a7e90..b1104c87e76 100644 --- a/zlib/inftrees.h +++ b/zlib/inftrees.h @@ -1,5 +1,5 @@ /* inftrees.h -- header to use inftrees.c - * Copyright (C) 1995-2003 Mark Adler + * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -36,12 +36,12 @@ typedef struct { */ /* Maximum size of dynamic tree. The maximum found in a long but non- - exhaustive search was 1004 code structures (850 for length/literals - and 154 for distances, the latter actually the result of an + exhaustive search was 1444 code structures (852 for length/literals + and 592 for distances, the latter actually the result of an exhaustive search). The true maximum is not known, but the value below is more than safe. */ -#define ENOUGH 1440 -#define MAXD 154 +#define ENOUGH 2048 +#define MAXD 592 /* Type of code to build for inftable() */ typedef enum { diff --git a/zlib/trees.c b/zlib/trees.c index bb09554938b..52c820fa2e9 100644 --- a/zlib/trees.c +++ b/zlib/trees.c @@ -931,7 +931,7 @@ void _tr_flush_block(s, buf, stored_len, eof) if (s->level > 0) { /* Check if the file is ascii or binary */ - if (s->data_type == Z_UNKNOWN) set_data_type(s); + if (s->strm->data_type == Z_UNKNOWN) set_data_type(s); /* Construct the literal and distance trees */ build_tree(s, (tree_desc *)(&(s->l_desc))); @@ -1131,7 +1131,7 @@ local void set_data_type(s) while (n < 7) bin_freq += s->dyn_ltree[n++].Freq; while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq; while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq; - s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII); + s->strm->data_type = bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII; } /* =========================================================================== diff --git a/zlib/zconf.h b/zlib/zconf.h index 3cea897eda7..3c21403fce6 100644 --- a/zlib/zconf.h +++ b/zlib/zconf.h @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2003 Jean-loup Gailly. + * Copyright (C) 1995-2004 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -13,43 +13,46 @@ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. */ #ifdef Z_PREFIX -# define deflateInit_ z_deflateInit_ -# define deflate z_deflate -# define deflateEnd z_deflateEnd -# define inflateInit_ z_inflateInit_ -# define inflate z_inflate -# define inflateEnd z_inflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateSetDictionary z_deflateSetDictionary -# define deflateCopy z_deflateCopy -# define deflateReset z_deflateReset -# define deflatePrime z_deflatePrime -# define deflateParams z_deflateParams -# define deflateBound z_deflateBound -# define inflateInit2_ z_inflateInit2_ -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateCopy z_inflateCopy -# define inflateReset z_inflateReset -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# define uncompress z_uncompress -# define adler32 z_adler32 -# define crc32 z_crc32 -# define get_crc_table z_get_crc_table +# define deflateInit_ z_deflateInit_ +# define deflate z_deflate +# define deflateEnd z_deflateEnd +# define inflateInit_ z_inflateInit_ +# define inflate z_inflate +# define inflateEnd z_inflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateSetDictionary z_deflateSetDictionary +# define deflateCopy z_deflateCopy +# define deflateReset z_deflateReset +# define deflateParams z_deflateParams +# define deflateBound z_deflateBound +# define deflatePrime z_deflatePrime +# define inflateInit2_ z_inflateInit2_ +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateCopy z_inflateCopy +# define inflateReset z_inflateReset +# define inflateBack z_inflateBack +# define inflateBackEnd z_inflateBackEnd +# define compress z_compress +# define compress2 z_compress2 +# define compressBound z_compressBound +# define uncompress z_uncompress +# define adler32 z_adler32 +# define crc32 z_crc32 +# define get_crc_table z_get_crc_table +# define zError z_zError -# define Byte z_Byte -# define uInt z_uInt -# define uLong z_uLong -# define Bytef z_Bytef -# define charf z_charf -# define intf z_intf -# define uIntf z_uIntf -# define uLongf z_uLongf -# define voidpf z_voidpf -# define voidp z_voidp +# define Byte z_Byte +# define uInt z_uInt +# define uLong z_uLong +# define Bytef z_Bytef +# define charf z_charf +# define intf z_intf +# define uIntf z_uIntf +# define uLongf z_uLongf +# define voidpf z_voidpf +# define voidp z_voidp #endif #if defined(__MSDOS__) && !defined(MSDOS) @@ -281,7 +284,7 @@ typedef uLong FAR uLongf; # ifdef VMS # include /* for off_t */ # endif -# define z_off_t off_t +# define z_off_t off_t #endif #ifndef SEEK_SET # define SEEK_SET 0 /* Seek from beginning of file. */ @@ -289,11 +292,11 @@ typedef uLong FAR uLongf; # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #ifndef z_off_t -# define z_off_t long +# define z_off_t long #endif #if defined(__OS400__) -#define NO_vsnprintf +# define NO_vsnprintf #endif #if defined(__MVS__) diff --git a/zlib/zlib.3 b/zlib/zlib.3 index 890098449dd..3139e2467f2 100644 --- a/zlib/zlib.3 +++ b/zlib/zlib.3 @@ -1,4 +1,4 @@ -.TH ZLIB 3 "17 November 2003" +.TH ZLIB 3 "3 October 2004" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -133,8 +133,8 @@ before asking for help. Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS -Version 1.2.1 -Copyright (C) 1995-2003 Jean-loup Gailly (jloup@gzip.org) +Version 1.2.2 +Copyright (C) 1995-2004 Jean-loup Gailly (jloup@gzip.org) and Mark Adler (madler@alumni.caltech.edu). .LP This software is provided "as-is," diff --git a/zlib/zlib.h b/zlib/zlib.h index 92edf96ff3e..b4ddd34395c 100644 --- a/zlib/zlib.h +++ b/zlib/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.1, November 17th, 2003 + version 1.2.2, October 3rd, 2004 - Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,8 +37,8 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.1" -#define ZLIB_VERNUM 0x1210 +#define ZLIB_VERSION "1.2.2" +#define ZLIB_VERNUM 0x1220 /* The 'zlib' compression library provides in-memory compression and @@ -53,24 +53,22 @@ extern "C" { application must provide more input and/or consume the output (providing more output space) before each call. - The compressed data format used by the in-memory functions is the zlib - format, which is a zlib wrapper documented in RFC 1950, wrapped around a - deflate stream, which is itself documented in RFC 1951. + The compressed data format used by default by the in-memory functions is + the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped + around a deflate stream, which is itself documented in RFC 1951. The library also supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + This library can optionally read and write gzip streams in memory as well. + The zlib format was designed to be compact and fast for use in memory and on communications channels. The gzip format was designed for single- file compression on file systems, has a larger header than zlib to maintain directory information, and uses a different, slower check method than zlib. - This library does not provide any functions to write gzip files in memory. - However such functions could be easily written using zlib's deflate function, - the documentation in the gzip RFC, and the examples in gzio.c. - The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash even in case of corrupted input. @@ -401,7 +399,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); because Z_BLOCK is used. If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm-adler to the adler32 checksum of the dictionary + below), inflate sets strm->adler to the adler32 checksum of the dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the adler32 checksum of all output produced so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described @@ -478,7 +476,8 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), - no header crc, and the operating system will be set to 255 (unknown). + no header crc, and the operating system will be set to 255 (unknown). If a + gzip stream is being written, strm->adler is a crc32 instead of an adler32. The memLevel parameter specifies how much memory should be allocated for the internal compression state. memLevel=1 uses minimum memory but @@ -649,7 +648,8 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). + return a Z_DATA_ERROR. If a gzip stream is being decoded, strm->adler is + a crc32 instead of an adler32. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative @@ -1189,7 +1189,7 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_stream FAR *strm, int windowBits, struct internal_state {int dummy;}; /* hack for buggy compilers */ #endif -ZEXTERN const char * ZEXPORT zError OF((int err)); +ZEXTERN const char * ZEXPORT zError OF((int)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); diff --git a/zlib/zutil.h b/zlib/zutil.h index 87b70acec23..7b42edcaa98 100644 --- a/zlib/zutil.h +++ b/zlib/zutil.h @@ -189,9 +189,14 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define NO_vsnprintf # endif #endif +#ifdef VMS +# define NO_vsnprintf +#endif #ifdef HAVE_STRERROR - extern char *strerror OF((int)); +# ifndef VMS + extern char *strerror OF((int)); +# endif # define zstrerror(errnum) strerror(errnum) #else # define zstrerror(errnum) "" From 6d63bc0eedab9292535e78840f29a39186545593 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jul 2005 17:14:21 +0500 Subject: [PATCH 082/144] Fix for bug #9508 (query_cache test fails) notembedded-specific part moved to the new test mysql-test/r/query_cache.result: test result fixed mysql-test/t/query_cache.test: notembedded-only part of the test removed --- mysql-test/r/query_cache.result | 76 ------------------- mysql-test/r/query_cache_notembedded.result | 83 +++++++++++++++++++++ mysql-test/t/query_cache.test | 62 --------------- mysql-test/t/query_cache_notembedded.test | 81 ++++++++++++++++++++ 4 files changed, 164 insertions(+), 138 deletions(-) create mode 100644 mysql-test/r/query_cache_notembedded.result create mode 100644 mysql-test/t/query_cache_notembedded.test diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 2884b9b3fe4..13ba2f3b0ca 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -152,82 +152,6 @@ show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 drop table t1, t2, t3; -create table t1 (a int not null); -insert into t1 values (1),(2),(3); -create table t2 (a int not null); -insert into t2 values (1),(2),(3); -select * from t1; -a -1 -2 -3 -select * from t2; -a -1 -2 -3 -insert into t1 values (4); -show status like "Qcache_free_blocks"; -Variable_name Value -Qcache_free_blocks 2 -flush query cache; -show status like "Qcache_free_blocks"; -Variable_name Value -Qcache_free_blocks 1 -drop table t1, t2; -create table t1 (a text not null); -create table t11 (a text not null); -create table t2 (a text not null); -create table t21 (a text not null); -create table t3 (a text not null); -insert into t1 values("1111111111111111111111111111111111111111111111111111"); -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t11 select * from t1; -insert into t21 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t3 select * from t1; -insert into t3 select * from t2; -insert into t3 select * from t1; -select * from t11; -select * from t21; -show status like "Qcache_total_blocks"; -Variable_name Value -Qcache_total_blocks 7 -show status like "Qcache_free_blocks"; -Variable_name Value -Qcache_free_blocks 1 -insert into t11 values(""); -select * from t3; -show status like "Qcache_total_blocks"; -Variable_name Value -Qcache_total_blocks 8 -show status like "Qcache_free_blocks"; -Variable_name Value -Qcache_free_blocks 1 -flush query cache; -show status like "Qcache_total_blocks"; -Variable_name Value -Qcache_total_blocks 7 -show status like "Qcache_free_blocks"; -Variable_name Value -Qcache_free_blocks 1 -drop table t1, t2, t3, t11, t21; set query_cache_type=demand; create table t1 (a int not null); insert into t1 values (1),(2),(3); diff --git a/mysql-test/r/query_cache_notembedded.result b/mysql-test/r/query_cache_notembedded.result new file mode 100644 index 00000000000..16a397f78b6 --- /dev/null +++ b/mysql-test/r/query_cache_notembedded.result @@ -0,0 +1,83 @@ +set GLOBAL query_cache_size=1355776; +flush query cache; +flush query cache; +reset query cache; +flush status; +drop table if exists t1, t2, t3, t11, t21; +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +create table t2 (a int not null); +insert into t2 values (1),(2),(3); +select * from t1; +a +1 +2 +3 +select * from t2; +a +1 +2 +3 +insert into t1 values (4); +show status like "Qcache_free_blocks"; +Variable_name Value +Qcache_free_blocks 2 +flush query cache; +show status like "Qcache_free_blocks"; +Variable_name Value +Qcache_free_blocks 1 +drop table t1, t2; +create table t1 (a text not null); +create table t11 (a text not null); +create table t2 (a text not null); +create table t21 (a text not null); +create table t3 (a text not null); +insert into t1 values("1111111111111111111111111111111111111111111111111111"); +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t11 select * from t1; +insert into t21 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t3 select * from t1; +insert into t3 select * from t2; +insert into t3 select * from t1; +select * from t11; +select * from t21; +show status like "Qcache_total_blocks"; +Variable_name Value +Qcache_total_blocks 7 +show status like "Qcache_free_blocks"; +Variable_name Value +Qcache_free_blocks 1 +insert into t11 values(""); +select * from t3; +show status like "Qcache_total_blocks"; +Variable_name Value +Qcache_total_blocks 8 +show status like "Qcache_free_blocks"; +Variable_name Value +Qcache_free_blocks 1 +flush query cache; +show status like "Qcache_total_blocks"; +Variable_name Value +Qcache_total_blocks 7 +show status like "Qcache_free_blocks"; +Variable_name Value +Qcache_free_blocks 1 +drop table t1, t2, t3, t11, t21; +set GLOBAL query_cache_size=0; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index b44c517acb9..4c2711ae833 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -79,68 +79,6 @@ delete from t3 where a=10; show status like "Qcache_queries_in_cache"; drop table t1, t2, t3; # -# FLUSH QUERY CACHE -# -create table t1 (a int not null); -insert into t1 values (1),(2),(3); -create table t2 (a int not null); -insert into t2 values (1),(2),(3); -select * from t1; -select * from t2; -insert into t1 values (4); -show status like "Qcache_free_blocks"; -flush query cache; -show status like "Qcache_free_blocks"; -drop table t1, t2; -# With join results... -create table t1 (a text not null); -create table t11 (a text not null); -create table t2 (a text not null); -create table t21 (a text not null); -create table t3 (a text not null); -insert into t1 values("1111111111111111111111111111111111111111111111111111"); -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -# t11 and t21 must be over 4Kb (QUERY_CACHE_MIN_RESULT_DATA_SIZE) -insert into t11 select * from t1; -insert into t21 select * from t1; -insert into t1 select * from t2; -insert into t2 select * from t1; -insert into t1 select * from t2; -#results of t3 must be > 0.5Mb -insert into t3 select * from t1; -insert into t3 select * from t2; -insert into t3 select * from t1; -disable_result_log; -select * from t11; -select * from t21; -enable_result_log; -show status like "Qcache_total_blocks"; -show status like "Qcache_free_blocks"; -disable_result_log; -insert into t11 values(""); -select * from t3; -enable_result_log; -show status like "Qcache_total_blocks"; -show status like "Qcache_free_blocks"; -flush query cache; -show status like "Qcache_total_blocks"; -show status like "Qcache_free_blocks"; -drop table t1, t2, t3, t11, t21; -# # SELECT SQL_CACHE ... # set query_cache_type=demand; diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test new file mode 100644 index 00000000000..d29dc10ccae --- /dev/null +++ b/mysql-test/t/query_cache_notembedded.test @@ -0,0 +1,81 @@ +-- source include/have_query_cache.inc +-- source include/not_embedded.inc + +# +# Tests with query cache +# +set GLOBAL query_cache_size=1355776; + +# Reset query cache variables. + +flush query cache; # This crashed in some versions +flush query cache; # This crashed in some versions +reset query cache; +flush status; +--disable_warnings +drop table if exists t1, t2, t3, t11, t21; +--enable_warnings +# +# FLUSH QUERY CACHE +# +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +create table t2 (a int not null); +insert into t2 values (1),(2),(3); +select * from t1; +select * from t2; +insert into t1 values (4); +show status like "Qcache_free_blocks"; +flush query cache; +show status like "Qcache_free_blocks"; +drop table t1, t2; +# With join results... +create table t1 (a text not null); +create table t11 (a text not null); +create table t2 (a text not null); +create table t21 (a text not null); +create table t3 (a text not null); +insert into t1 values("1111111111111111111111111111111111111111111111111111"); +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +# t11 and t21 must be over 4Kb (QUERY_CACHE_MIN_RESULT_DATA_SIZE) +insert into t11 select * from t1; +insert into t21 select * from t1; +insert into t1 select * from t2; +insert into t2 select * from t1; +insert into t1 select * from t2; +#results of t3 must be > 0.5Mb +insert into t3 select * from t1; +insert into t3 select * from t2; +insert into t3 select * from t1; +disable_result_log; +select * from t11; +select * from t21; +enable_result_log; +show status like "Qcache_total_blocks"; +show status like "Qcache_free_blocks"; +disable_result_log; +insert into t11 values(""); +select * from t3; +enable_result_log; +show status like "Qcache_total_blocks"; +show status like "Qcache_free_blocks"; +flush query cache; +show status like "Qcache_total_blocks"; +show status like "Qcache_free_blocks"; +drop table t1, t2, t3, t11, t21; + +set GLOBAL query_cache_size=0; From 52dfa3b89181c06738afd79b046712bdd342d165 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jul 2005 14:51:08 +0200 Subject: [PATCH 083/144] fix for bug#12665 macro floatget was missing in config-win.h --- include/config-win.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/config-win.h b/include/config-win.h index 86704c4740b..0899d961d14 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -283,6 +283,7 @@ inline double ulonglong2double(ulonglong value) #define doublestore(T,V) { *((long *) T) = *((long*) &V); \ *(((long *) T)+1) = *(((long*) &V)+1); } #define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); } +#define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float)) #define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float)) #define float8get(V,M) doubleget((V),(M)) #define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) From b66ffdcbda177da67dd85f3eb8f6114253581897 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jul 2005 15:40:39 +0200 Subject: [PATCH 084/144] fixed two bugs that break Windows build libmysql/libmysql.def: "get_defaults_files" has been renamed to "get_defaults_options" but was not removed here sql/sql_select.cc: pulled variable out of for() scope to satisfy dumb MSVC6 compiler --- libmysql/libmysql.def | 1 - sql/sql_select.cc | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index 5d8c2309063..a469c67c466 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -148,7 +148,6 @@ EXPORTS mysql_embedded mysql_server_init mysql_server_end - get_defaults_files mysql_set_character_set mysql_get_character_set_info get_defaults_options diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 117e16a2db3..793ce76b0f4 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1842,6 +1842,7 @@ Cursor::fetch(ulong num_rows) JOIN_TAB *join_tab= join->join_tab + join->const_tables; enum_nested_loop_state error= NESTED_LOOP_OK; Query_arena backup_arena; + Engine_info *info; DBUG_ENTER("Cursor::fetch"); DBUG_PRINT("enter",("rows: %lu", num_rows)); @@ -1856,7 +1857,7 @@ Cursor::fetch(ulong num_rows) /* save references to memory, allocated during fetch */ thd->set_n_backup_item_arena(this, &backup_arena); - for (Engine_info *info= ht_info; info->read_view ; info++) + for (info= ht_info; info->read_view ; info++) (info->ht->set_cursor_read_view)(info->read_view); join->fetch_limit+= num_rows; @@ -1875,7 +1876,7 @@ Cursor::fetch(ulong num_rows) /* Grab free_list here to correctly free it in close */ thd->restore_backup_item_arena(this, &backup_arena); - for (Engine_info *info= ht_info; info->read_view; info++) + for (info= ht_info; info->read_view; info++) (info->ht->set_cursor_read_view)(0); if (error == NESTED_LOOP_CURSOR_LIMIT) From 675c4bb48c584dd263934f3774f9e7438a376203 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jul 2005 23:39:08 +0300 Subject: [PATCH 085/144] Added sql_mode saving to mysql_dump (BUG#5891, part 2) client/client_priv.h: add OPT_ for --trigger parameter client/mysqldump.c: fixed short simbol for trigger fixed lines break for more compiler compatibility added sql_mode output added comments made protection of trigger and view restoring commands from execution by old versions of mysql mysql-test/r/mysqldump.result: changed test, to test sql_mode mysql-test/r/sp.result: now sql_mode preserved in SP mysql-test/t/mysqldump.test: changed test, to test sql_mode mysql-test/t/sp.test: now sql_mode preserved in SP sql/set_var.cc: fixed comment --- client/client_priv.h | 3 +- client/mysqldump.c | 35 ++++++++------ mysql-test/r/mysqldump.result | 86 +++++++++++++++++++++++------------ mysql-test/r/sp.result | 8 ++-- mysql-test/t/mysqldump.test | 4 ++ mysql-test/t/sp.test | 2 +- sql/set_var.cc | 11 +++-- 7 files changed, 97 insertions(+), 52 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index c8aa7385276..27e0f838995 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -49,5 +49,6 @@ enum options_client #ifdef HAVE_NDBCLUSTER_DB OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, #endif - OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE + OPT_IGNORE_TABLE, OPT_INSERT_IGNORE, OPT_SHOW_WARNINGS, OPT_DROP_DATABASE, + OPT_TRIGGER }; diff --git a/client/mysqldump.c b/client/mysqldump.c index be9eb5ef58b..48e5d8c52dd 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -372,7 +372,7 @@ static struct my_option my_long_options[] = (gptr*) &path, (gptr*) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"triggers", '/0', "Dump triggers for each dumped table", + {"triggers", OPT_TRIGGER, "Dump triggers for each dumped table", (gptr*) &opt_dump_triggers, (gptr*) &opt_dump_triggers, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE @@ -1296,10 +1296,11 @@ static uint get_table_structure(char *table, char *db) row= mysql_fetch_row(tableRes); if (opt_drop) - fprintf(sql_file, "DROP VIEW IF EXISTS %s;\n",opt_quoted_table); + fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n", + opt_quoted_table); /* Print CREATE statement but remove TEMPORARY */ - fprintf(sql_file, "CREATE %s;\n", row[1]+17); + fprintf(sql_file, "/*!50001 CREATE %s*/;\n", row[1]+17); check_io(sql_file); mysql_free_result(tableRes); @@ -1335,19 +1336,23 @@ static uint get_table_structure(char *table, char *db) DBUG_RETURN(0); } if (mysql_num_rows(tableRes)) - fprintf(sql_file, "\nDELIMITER //;\n"); + fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n\ +DELIMITER //;\n"); while ((row=mysql_fetch_row(tableRes))) { - fprintf(sql_file, "CREATE TRIGGER %s %s %s ON %s\n" - "FOR EACH ROW%s//\n\n", - quote_name(row[0], name_buff, 0), - row[4], - row[1], + fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\"*/ //\n\ +/*!50003 CREATE TRIGGER %s %s %s ON %s FOR EACH ROW%s*/ //\n\n", + row[6], /* sql_mode */ + quote_name(row[0], name_buff, 0), /* Trigger */ + row[4], /* Timing */ + row[1], /* Event */ result_table, - row[3]); + row[3] /* Statement */); } if (mysql_num_rows(tableRes)) - fprintf(sql_file, "DELIMITER ;//"); + fprintf(sql_file, + "DELIMITER ;//\n\ +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;"); mysql_free_result(tableRes); } } @@ -2957,13 +2962,15 @@ static my_bool get_view_structure(char *table, char* db) } if (opt_drop) { - fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", opt_quoted_table); - fprintf(sql_file, "DROP VIEW IF EXISTS %s;\n", opt_quoted_table); + fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n", + opt_quoted_table); + fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n", + opt_quoted_table); check_io(sql_file); } row= mysql_fetch_row(table_res); - fprintf(sql_file, "%s;\n", row[1]); + fprintf(sql_file, "/*!50001 %s*/;\n", row[1]); check_io(sql_file); mysql_free_result(table_res); diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index bf783402921..8d6febdef64 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -379,13 +379,13 @@ LOCK TABLES `t1` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; DROP TABLE IF EXISTS `v1`; -DROP VIEW IF EXISTS `v1`; -CREATE TABLE `v1` ( +/*!50001 DROP VIEW IF EXISTS `v1`*/; +/*!50001 CREATE TABLE `v1` ( `a` int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -DROP TABLE IF EXISTS `v1`; -DROP VIEW IF EXISTS `v1`; -CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from `test`.`t1`; +) ENGINE=MyISAM DEFAULT CHARSET=latin1*/; +/*!50001 DROP TABLE IF EXISTS `v1`*/; +/*!50001 DROP VIEW IF EXISTS `v1`*/; +/*!50001 CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from `test`.`t1`*/; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1462,13 +1462,13 @@ INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon'); UNLOCK TABLES; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; DROP TABLE IF EXISTS `v2`; -DROP VIEW IF EXISTS `v2`; -CREATE TABLE `v2` ( +/*!50001 DROP VIEW IF EXISTS `v2`*/; +/*!50001 CREATE TABLE `v2` ( `a` varchar(30) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -DROP TABLE IF EXISTS `v2`; -DROP VIEW IF EXISTS `v2`; -CREATE ALGORITHM=UNDEFINED VIEW `db1`.`v2` AS select `db1`.`t2`.`a` AS `a` from `db1`.`t2` where (`db1`.`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION; +) ENGINE=MyISAM DEFAULT CHARSET=latin1*/; +/*!50001 DROP TABLE IF EXISTS `v2`*/; +/*!50001 DROP VIEW IF EXISTS `v2`*/; +/*!50001 CREATE ALGORITHM=UNDEFINED VIEW `db1`.`v2` AS select `db1`.`t2`.`a` AS `a` from `db1`.`t2` where (`db1`.`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION*/; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1685,6 +1685,7 @@ end| create trigger trg2 before update on t1 for each row begin if old.a % 2 = 0 then set new.b := 12; end if; end| +set sql_mode="traditional"| create trigger trg3 after update on t1 for each row begin if new.a = -1 then @@ -1697,24 +1698,25 @@ if new.a > 10 then set @fired:= "No"; end if; end| +set sql_mode=default| show triggers like "t1"; -Trigger Event Table Statement Timing Created +Trigger Event Table Statement Timing Created sql_mode trg1 INSERT t1 begin if new.a > 10 then set new.a := 10; set new.a := 11; end if; -end BEFORE 0000-00-00 00:00:00 +end BEFORE 0000-00-00 00:00:00 trg2 UPDATE t1 begin if old.a % 2 = 0 then set new.b := 12; end if; -end BEFORE 0000-00-00 00:00:00 +end BEFORE 0000-00-00 00:00:00 trg3 UPDATE t1 begin if new.a = -1 then set @fired:= "Yes"; end if; -end AFTER 0000-00-00 00:00:00 +end AFTER 0000-00-00 00:00:00 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER INSERT INTO t1 (a) VALUES (1),(2),(3),(22); update t1 set a = 4 where a=3; @@ -1736,30 +1738,32 @@ CREATE TABLE `t1` ( `b` bigint(20) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/; DELIMITER //; -CREATE TRIGGER `trg1` BEFORE INSERT ON `t1` -FOR EACH ROW +/*!50003 SET SESSION SQL_MODE=""*/ // +/*!50003 CREATE TRIGGER `trg1` BEFORE INSERT ON `t1` FOR EACH ROW begin if new.a > 10 then set new.a := 10; set new.a := 11; end if; -end// +end*/ // -CREATE TRIGGER `trg2` BEFORE UPDATE ON `t1` -FOR EACH ROW begin +/*!50003 SET SESSION SQL_MODE=""*/ // +/*!50003 CREATE TRIGGER `trg2` BEFORE UPDATE ON `t1` FOR EACH ROW begin if old.a % 2 = 0 then set new.b := 12; end if; -end// +end*/ // -CREATE TRIGGER `trg3` AFTER UPDATE ON `t1` -FOR EACH ROW +/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER"*/ // +/*!50003 CREATE TRIGGER `trg3` AFTER UPDATE ON `t1` FOR EACH ROW begin if new.a = -1 then set @fired:= "Yes"; end if; -end// +end*/ // DELIMITER ;// +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/; /*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; @@ -1771,16 +1775,18 @@ CREATE TABLE `t2` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/; DELIMITER //; -CREATE TRIGGER `trg4` BEFORE INSERT ON `t2` -FOR EACH ROW +/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER"*/ // +/*!50003 CREATE TRIGGER `trg4` BEFORE INSERT ON `t2` FOR EACH ROW begin if new.a > 10 then set @fired:= "No"; end if; -end// +end*/ // DELIMITER ;// +/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/; /*!40000 ALTER TABLE `t2` DISABLE KEYS */; LOCK TABLES `t2` WRITE; @@ -1844,4 +1850,28 @@ show tables; Tables_in_test t1 t2 +show triggers; +Trigger Event Table Statement Timing Created sql_mode +trg1 INSERT t1 +begin +if new.a > 10 then +set new.a := 10; +set new.a := 11; +end if; +end BEFORE # +trg2 UPDATE t1 begin +if old.a % 2 = 0 then set new.b := 12; end if; +end BEFORE # +trg3 UPDATE t1 +begin +if new.a = -1 then +set @fired:= "Yes"; +end if; +end AFTER # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER +trg4 INSERT t2 +begin +if new.a > 10 then +set @fired:= "No"; +end if; +end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER DROP TABLE t1, t2; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 69900edf3d9..04d49bf4b3b 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -2658,20 +2658,20 @@ call avg ()| drop procedure avg| drop procedure if exists bug6129| set @old_mode= @@sql_mode; -set @@sql_mode= ""; +set @@sql_mode= "ERROR_FOR_DIVISION_BY_ZERO"; create procedure bug6129() select @@sql_mode| call bug6129()| @@sql_mode - +ERROR_FOR_DIVISION_BY_ZERO set @@sql_mode= "NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO"| call bug6129()| @@sql_mode -NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO +ERROR_FOR_DIVISION_BY_ZERO set @@sql_mode= "NO_ZERO_IN_DATE"| call bug6129()| @@sql_mode -NO_ZERO_IN_DATE +ERROR_FOR_DIVISION_BY_ZERO set @@sql_mode=@old_mode; drop procedure bug6129| drop procedure if exists bug9856| diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 81000c17d98..0fe5b473b23 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -726,6 +726,7 @@ end| create trigger trg2 before update on t1 for each row begin if old.a % 2 = 0 then set new.b := 12; end if; end| +set sql_mode="traditional"| create trigger trg3 after update on t1 for each row begin if new.a = -1 then @@ -738,6 +739,7 @@ begin set @fired:= "No"; end if; end| +set sql_mode=default| delimiter ;| --replace_column 6 '0000-00-00 00:00:00' show triggers like "t1"; @@ -753,4 +755,6 @@ drop table t1; --exec $MYSQL test < var/tmp/mysqldump.sql # Check that tables have been reloaded show tables; +--replace_column 6 # +show triggers; DROP TABLE t1, t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 1a35df40a17..ecc9c3c12a2 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -3378,7 +3378,7 @@ drop procedure avg| drop procedure if exists bug6129| --enable_warnings set @old_mode= @@sql_mode; -set @@sql_mode= ""; +set @@sql_mode= "ERROR_FOR_DIVISION_BY_ZERO"; create procedure bug6129() select @@sql_mode| call bug6129()| diff --git a/sql/set_var.cc b/sql/set_var.cc index d3f3f62c259..20d383d0025 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -3199,10 +3199,13 @@ bool sys_var_thd_table_type::update(THD *thd, set_var *var) /* Make string representation of mode - SINOPSYS - thd thread handler - val sql_mode value - len pointer on length of string + SYNOPSIS + thd in thread handler + val in sql_mode value + len out pointer on length of string + + RETURN + pointer to string with sql_mode representation */ byte *sys_var_thd_sql_mode::symbolic_mode_representation(THD *thd, ulong val, From a292b42436e476de109c2ffce6a3b469d738ca44 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 30 Jul 2005 05:53:35 +0400 Subject: [PATCH 086/144] Fix bug #11335 View redefines TinyInt(1) column definition Item_type_holder doesn't store information about length and exact type of original item which results in redefining length to max_length and geometry type to longtext. Changed the way derived tables except unions are built. Now they are created from original field list instead of list of Item_type_holder. mysql-test/r/subselect.result: Fixed wrong test case result. bug#11335 mysql-test/r/view_grant.result: Fixed wrong test case result. bug#11335 mysql-test/r/view.result: Added test case for bug #11335. Fixed wrong test case result. mysql-test/t/view.test: Test case for bug #11335 View redefines TinyInt(1) column definition. sql/sql_union.cc: Fix bug #11335 View redefines TinyInt(1) column definition. Changed the way derived tables except unions are built. Now they are created from original field list instead of list of Item_type_holders. sql/sql_select.cc: Fix bug #11335 View redefines TinyInt(1) column definition. Added special handling of DATE/TIME fields to preserve field's type in tmp field creation. In create_tmp_field() for Item_field added special handling of case when item have to be able to store NULLs but underlaid field is NOT NULL. sql/item_sum.cc: Fix bug #11335 View redefines TinyInt(1) column definition. Added special handling of DATE/TIME fields to preserve field's type while tmp field created in Item_sum_hybrid::create_tmp_field(). --- mysql-test/r/subselect.result | 12 ++++++------ mysql-test/r/view.result | 13 ++++++++++++- mysql-test/r/view_grant.result | 8 ++++---- mysql-test/t/view.test | 9 +++++++++ sql/item_sum.cc | 16 ++++++++++++++++ sql/sql_select.cc | 24 +++++++++++++++++++++++- sql/sql_union.cc | 8 +++++++- 7 files changed, 77 insertions(+), 13 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 693146c869e..bbca9c905df 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1087,24 +1087,24 @@ CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bigint(20) NOT NULL default '0', - `(SELECT 1)` bigint(20) NOT NULL default '0' + `a` bigint(1) NOT NULL default '0', + `(SELECT 1)` bigint(1) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bigint(20) NOT NULL default '0', - `(SELECT a)` bigint(20) NOT NULL default '0' + `a` bigint(1) NOT NULL default '0', + `(SELECT a)` bigint(1) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bigint(20) NOT NULL default '0', - `(SELECT a+0)` bigint(20) NOT NULL default '0' + `a` bigint(1) NOT NULL default '0', + `(SELECT a+0)` bigint(3) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index ef40a408932..d3270661b52 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -566,7 +566,7 @@ select * from v1; col1 describe v1; Field Type Null Key Default Extra -col1 varchar(2) YES NULL +col1 char(2) YES NULL drop view v1; drop table `t1a``b`; create table t1 (col1 char(5),col2 char(5)); @@ -1977,3 +1977,14 @@ A B DROP VIEW v1; DROP TABLE t1; +create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime); +create view v1 as select * from t1; +desc v1; +Field Type Null Key Default Extra +f1 tinyint(1) YES NULL +f2 char(1) YES NULL +f3 varchar(1) YES NULL +f4 geometry YES NULL +f5 datetime YES NULL +drop view v1; +drop table t1; diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result index b77ee59b3ff..71f0f28e59f 100644 --- a/mysql-test/r/view_grant.result +++ b/mysql-test/r/view_grant.result @@ -72,12 +72,12 @@ select c from mysqltest.v4; c show columns from mysqltest.v1; Field Type Null Key Default Extra -c bigint(20) YES NULL -d bigint(20) YES NULL +c bigint(12) YES NULL +d bigint(12) YES NULL show columns from mysqltest.v2; Field Type Null Key Default Extra -c bigint(20) YES NULL -d bigint(20) YES NULL +c bigint(12) YES NULL +d bigint(12) YES NULL explain select c from mysqltest.v1; ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table show create view mysqltest.v1; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index d296d5ebee5..50a19627246 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -1815,3 +1815,12 @@ SELECT * FROM t1; DROP VIEW v1; DROP TABLE t1; + +# +# Bug #11335 View redefines column types +# +create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime); +create view v1 as select * from t1; +desc v1; +drop view v1; +drop table t1; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index d2f1016891b..2dedc6b6bc5 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -321,6 +321,22 @@ Field *Item_sum_hybrid::create_tmp_field(bool group, TABLE *table, field->flags&= ~NOT_NULL_FLAG; return field; } + /* + DATE/TIME fields have STRING_RESULT result types. + In order to preserve field type, it's needed to handle DATE/TIME + fields creations separately. + */ + switch (args[0]->field_type()) { + case MYSQL_TYPE_DATE: + return new Field_date(maybe_null, name, table, collation.collation); + case MYSQL_TYPE_TIME: + return new Field_time(maybe_null, name, table, collation.collation); + case MYSQL_TYPE_TIMESTAMP: + case MYSQL_TYPE_DATETIME: + return new Field_datetime(maybe_null, name, table, collation.collation); + default: + break; + } return Item_sum::create_tmp_field(group, table, convert_blob_length); } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 66e783a2103..f7e487ec40f 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7875,7 +7875,15 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, item->name, table, item->unsigned_flag); break; case STRING_RESULT: - if (item->max_length > 255 && convert_blob_length) + enum enum_field_types type; + /* + DATE/TIME fields have STRING_RESULT result type. To preserve + type they needed to be handled separately. + */ + if ((type= item->field_type()) == MYSQL_TYPE_DATETIME || + type == MYSQL_TYPE_TIME || type == MYSQL_TYPE_DATE) + new_field= item->tmp_table_field_from_field_type(table); + else if (item->max_length > 255 && convert_blob_length) new_field= new Field_varstring(convert_blob_length, maybe_null, item->name, table, item->collation.collation); @@ -7981,6 +7989,20 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, if (table_cant_handle_bit_fields && field->field->type() == FIELD_TYPE_BIT) return create_tmp_field_from_item(thd, item, table, copy_func, modify_item, convert_blob_length); + /* + If item have to be able to store NULLs but underlaid field can't do it, + create_tmp_field_from_field() can't be used for tmp field creation. + */ + if (field->maybe_null && !field->field->maybe_null()) + { + Field *res= create_tmp_field_from_item(thd, item, table, NULL, + modify_item, convert_blob_length); + *from_field= field->field; + if (res && modify_item) + ((Item_field*)item)->result_field= res; + return res; + } + return create_tmp_field_from_field(thd, (*from_field= field->field), item->name, table, modify_item ? (Item_field*) item : NULL, diff --git a/sql/sql_union.cc b/sql/sql_union.cc index f2b637dc5f4..c414f5e9e72 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -235,7 +235,13 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, if ((res= (res || thd_arg->is_fatal_error))) goto err; - if (sl == first_select) + /* + Use items list of underlaid select for derived tables to preserve + information about fields lengths and exact types + */ + if (!is_union) + types= first_select_in_union()->item_list; + else if (sl == first_select) { /* We need to create an empty table object. It is used From 63e9a87af7323e7f9c46813caadafe31a3a17d6e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jul 2005 21:00:28 -0600 Subject: [PATCH 087/144] updates for BUG#10780 - fixed slave I/O thread running status to No while attempting to connect mysql-test/r/rpl_slave_status.result: updated result mysql-test/t/rpl_slave_status.test: user vertical result sql/slave.cc: reversed an unnecessary change for BUG#10780 sql/slave.h: reversed an unnecessary change for BUG#10780 --- mysql-test/r/rpl_slave_status.result | 35 ++++++++++++++++++++++++++-- mysql-test/t/rpl_slave_status.test | 1 + sql/slave.cc | 2 +- sql/slave.h | 1 - 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/rpl_slave_status.result b/mysql-test/r/rpl_slave_status.result index 4eb2e87d221..5e9b6ab31ad 100644 --- a/mysql-test/r/rpl_slave_status.result +++ b/mysql-test/r/rpl_slave_status.result @@ -19,5 +19,36 @@ flush privileges; stop slave; start slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -Connecting to master 127.0.0.1 rpl MASTER_MYPORT 1 master-bin.000001 357 slave-relay-bin.000001 401 master-bin.000001 No Yes 0 0 357 401 None 0 No NULL +Slave_IO_State Connecting to master +Master_Host 127.0.0.1 +Master_User rpl +Master_Port MASTER_MYPORT +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos 357 +Relay_Log_File slave-relay-bin.000001 +Relay_Log_Pos 401 +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running No +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos 357 +Relay_Log_Space 401 +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master NULL diff --git a/mysql-test/t/rpl_slave_status.test b/mysql-test/t/rpl_slave_status.test index 6bccf6fd341..4e0d7dae35c 100644 --- a/mysql-test/t/rpl_slave_status.test +++ b/mysql-test/t/rpl_slave_status.test @@ -23,6 +23,7 @@ connection slave; stop slave; start slave; --replace_result $MASTER_MYPORT MASTER_MYPORT +--vertical_results show slave status; # end of 4.1 tests diff --git a/sql/slave.cc b/sql/slave.cc index 286bb07e4c9..a0cc773d44f 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3079,7 +3079,7 @@ slave_begin: pthread_mutex_lock(&LOCK_thread_count); threads.append(thd); pthread_mutex_unlock(&LOCK_thread_count); - mi->slave_running = MYSQL_SLAVE_RUN_INIT; + mi->slave_running = 1; mi->abort_slave = 0; pthread_mutex_unlock(&mi->run_lock); pthread_cond_broadcast(&mi->start_cond); diff --git a/sql/slave.h b/sql/slave.h index 6aa61c3a7e4..5a85e26d9ad 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -112,7 +112,6 @@ enum enum_binlog_formats { #define MYSQL_SLAVE_NOT_RUN 0 #define MYSQL_SLAVE_RUN_NOT_CONNECT 1 #define MYSQL_SLAVE_RUN_CONNECT 2 -#define MYSQL_SLAVE_RUN_INIT 3 /**************************************************************************** From b6dd299df966435f5e445cf5468fffb9924fab57 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 30 Jul 2005 09:24:51 +0300 Subject: [PATCH 088/144] postmerge-fix --- mysql-test/r/mysqldump.result | 24 ++++++++++++------------ mysql-test/r/trigger.result | 9 +-------- mysql-test/t/trigger.test | 6 +----- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 4bfafb327a6..917724580cf 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1543,13 +1543,13 @@ LOCK TABLES `t1` WRITE; UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; DROP TABLE IF EXISTS `v1`; -DROP VIEW IF EXISTS `v1`; -CREATE TABLE `v1` ( +/*!50001 DROP VIEW IF EXISTS `v1`*/; +/*!50001 CREATE TABLE `v1` ( `a` int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -DROP TABLE IF EXISTS `v1`; -DROP VIEW IF EXISTS `v1`; -CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from `test`.`t1`; +) ENGINE=MyISAM DEFAULT CHARSET=latin1*/; +/*!50001 DROP TABLE IF EXISTS `v1`*/; +/*!50001 DROP VIEW IF EXISTS `v1`*/; +/*!50001 CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from `test`.`t1`*/; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1595,13 +1595,13 @@ INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon'); UNLOCK TABLES; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; DROP TABLE IF EXISTS `v2`; -DROP VIEW IF EXISTS `v2`; -CREATE TABLE `v2` ( +/*!50001 DROP VIEW IF EXISTS `v2`*/; +/*!50001 CREATE TABLE `v2` ( `a` varchar(30) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -DROP TABLE IF EXISTS `v2`; -DROP VIEW IF EXISTS `v2`; -CREATE ALGORITHM=UNDEFINED VIEW `mysqldump_test_db`.`v2` AS select `mysqldump_test_db`.`t2`.`a` AS `a` from `mysqldump_test_db`.`t2` where (`mysqldump_test_db`.`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION; +) ENGINE=MyISAM DEFAULT CHARSET=latin1*/; +/*!50001 DROP TABLE IF EXISTS `v2`*/; +/*!50001 DROP VIEW IF EXISTS `v2`*/; +/*!50001 CREATE ALGORITHM=UNDEFINED VIEW `mysqldump_test_db`.`v2` AS select `mysqldump_test_db`.`t2`.`a` AS `a` from `mysqldump_test_db`.`t2` where (`mysqldump_test_db`.`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION*/; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index d416d3c41ba..52bf307a686 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -598,7 +598,7 @@ drop table t1; set sql_mode='ansi'; create table t1 ("t1 column" int); create trigger t1_bi before insert on t1 for each row set new."t1 column" = 5; -set sql_mode=default; +set sql_mode=""; insert into t1 values (0); create trigger t1_af after insert on t1 for each row set @a=10; insert into t1 values (0); @@ -613,10 +613,6 @@ show triggers; Trigger Event Table Statement Timing Created sql_mode t1_bi INSERT t1 set new."t1 column" = 5 BEFORE # REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI t1_af INSERT t1 set @a=10 AFTER # -select * from information_schema.triggers; -TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE -NULL test t1_bi INSERT NULL test t1 0 NULL set new."t1 column" = 5 ROW BEFORE NULL NULL OLD NEW # REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI -NULL test t1_af INSERT NULL test t1 0 NULL set @a=10 ROW AFTER NULL NULL OLD NEW # drop table t1; set sql_mode="traditional"; create table t1 (a date); @@ -638,7 +634,4 @@ t1 CREATE TABLE `t1` ( show triggers; Trigger Event Table Statement Timing Created sql_mode t1_bi INSERT t1 set new.a = '2004-01-00' BEFORE # -select * from information_schema.triggers; -TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE -NULL test t1_bi INSERT NULL test t1 0 NULL set new.a = '2004-01-00' ROW BEFORE NULL NULL OLD NEW # drop table t1; diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 17f2e85f2e8..7bf8b1a4e2b 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -617,7 +617,7 @@ drop table t1; set sql_mode='ansi'; create table t1 ("t1 column" int); create trigger t1_bi before insert on t1 for each row set new."t1 column" = 5; -set sql_mode=default; +set sql_mode=""; insert into t1 values (0); # create trigger with different sql_mode create trigger t1_af after insert on t1 for each row set @a=10; @@ -626,8 +626,6 @@ select * from t1; select @a; --replace_column 6 # show triggers; ---replace_column 17 # -select * from information_schema.triggers; drop table t1; # check that rigger preserve sql_mode during execution set sql_mode="traditional"; @@ -643,6 +641,4 @@ set sql_mode=default; show create table t1; --replace_column 6 # show triggers; ---replace_column 17 # -select * from information_schema.triggers; drop table t1; From 11abe15eab3f444b600200e965cf18539af55392 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 30 Jul 2005 08:19:57 +0000 Subject: [PATCH 089/144] Added Non-prelocked SP execution: Now a PROCEDURE doesn't enter/leave prelocked mode for its body, but lets each statement to get/release its own locks. This allows a broader set of statements to be executed inside PROCEDUREs (but breaks replication) This patch should fix BUG#8072, BUG#8766, BUG#9563, BUG#11126 mysql-test/r/sp-security.result: Drop tables this test attempts to create mysql-test/r/sp-threads.result: Update test results mysql-test/r/sp.result: Disabled a test that triggers BUG#11986, cleanup used tables when tests start. mysql-test/r/view.result: Enabled a test case that now works with prelocking-free SPs mysql-test/t/sp-security.test: Drop tables this test attempts to create mysql-test/t/sp.test: Disabled a test that triggers BUG#11986, cleanup used tables when tests start. mysql-test/t/view.test: Enabled a test case that now works with prelocking-free SPs sql/handler.cc: Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt sql/item_func.cc: Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt sql/sp.cc: Non-prelocked SP execution: Added support for skipping prelocking of procedure body for "CALL proc(...)" statements. sql/sp.h: Non-prelocked SP execution: Added support for skipping prelocking of procedure body for "CALL proc(...)" statements. sql/sp_cache.h: Added comments sql/sp_head.cc: Non-prelocked SP execution: * Try to unlock tables after PROCEDURE arguments have been evaluated. * Make sp_lex_keeper be able to execute in 2 modes: A) when already in prelocked mode B) when its statement enters/leaves prelocked mode itself. sql/sp_head.h: Non-prelocked SP execution: Make sp_lex_keeper to additionally keep list of tables it needs to prelock when its statement enters/leaves prelocked mode on its own. sql/sql_base.cc: Non-prelocked SP execution: Make open_tables() to * detect 'CALL proc(...)' and not to do prelocking for procedure body statements. * Make lex->query_tables_last to point precisely to a boundary in lex->query_tables list where 'own' tables and views' tables end and added-for-prelocking tables begin. (it was not true before - view's tables could end up after query_tables_own_last) sql/sql_class.cc: Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt sql/sql_class.h: Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt sql/sql_lex.cc: Non-prelocked SP execution: More rigourous cleanup in st_lex::cleanup_after_one_table_open() sql/sql_parse.cc: Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt, remove outdated comments sql/sql_trigger.h: Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt --- mysql-test/r/sp-prelocking.result | 219 +++++++++++++++++++++++++++ mysql-test/r/sp-security.result | 2 +- mysql-test/r/sp-threads.result | 2 +- mysql-test/r/sp.result | 29 +--- mysql-test/r/view.result | 5 + mysql-test/t/sp-prelocking.test | 236 ++++++++++++++++++++++++++++++ mysql-test/t/sp-security.test | 2 +- mysql-test/t/sp.test | 46 +++--- mysql-test/t/view.test | 18 +-- sql/handler.cc | 4 +- sql/item_func.cc | 6 +- sql/sp.cc | 84 ++++++++--- sql/sp.h | 5 +- sql/sp_cache.h | 16 +- sql/sp_head.cc | 71 ++++++++- sql/sp_head.h | 26 +++- sql/sql_base.cc | 56 +++++-- sql/sql_class.cc | 2 +- sql/sql_class.h | 6 +- sql/sql_lex.cc | 1 + sql/sql_parse.cc | 22 +-- sql/sql_trigger.h | 6 +- 22 files changed, 736 insertions(+), 128 deletions(-) create mode 100644 mysql-test/r/sp-prelocking.result create mode 100644 mysql-test/t/sp-prelocking.test diff --git a/mysql-test/r/sp-prelocking.result b/mysql-test/r/sp-prelocking.result new file mode 100644 index 00000000000..da5c95cc2dd --- /dev/null +++ b/mysql-test/r/sp-prelocking.result @@ -0,0 +1,219 @@ +drop database if exists testdb; +drop table if exists t1, t2, t3, t4; +drop procedure if exists sp1; +drop procedure if exists sp2; +drop procedure if exists sp3; +drop procedure if exists sp4; +drop function if exists f1; +drop function if exists f2; +drop function if exists f3; +create database testdb; +use testdb// +create procedure sp1 () +begin +drop table if exists t1; +select 1 as "my-col"; +end; +// +select database(); +database() +testdb +call sp1(); +my-col +1 +Warnings: +Note 1051 Unknown table 't1' +select database(); +database() +testdb +use test; +select database(); +database() +test +call testdb.sp1(); +my-col +1 +Warnings: +Note 1051 Unknown table 't1' +select database(); +database() +test +drop procedure testdb.sp1; +drop database testdb; +create procedure sp1() +begin +create table t1 (a int); +insert into t1 values (10); +end// +create procedure sp2() +begin +create table t2(a int); +insert into t2 values(1); +call sp1(); +end// +create function f1() returns int +begin +return (select max(a) from t1); +end// +create procedure sp3() +begin +call sp1(); +select 'func', f1(); +end// +call sp1(); +select 't1',a from t1; +t1 a +t1 10 +drop table t1; +call sp2(); +select 't1',a from t1; +t1 a +t1 10 +select 't2',a from t2; +t2 a +t2 1 +drop table t1, t2; +call sp3(); +func f1() +func 10 +select 't1',a from t1; +t1 a +t1 10 +drop table t1; +drop procedure sp1; +drop procedure sp2; +drop procedure sp3; +drop function f1; +create procedure sp1() +begin +create temporary table t2(a int); +insert into t2 select * from t1; +end// +create procedure sp2() +begin +create temporary table t1 (a int); +insert into t1 values(1); +call sp1(); +select 't1', a from t1; +select 't2', b from t2; +drop table t1; +drop table t2; +end// +call sp2(); +t1 a +t1 1 +drop procedure sp1; +drop procedure sp2; +create table t1 (a int); +insert into t1 values(1),(2); +create table t2 as select * from t1; +create table t3 as select * from t1; +create table t4 as select * from t1; +create procedure sp1(a int) +begin +select a; +end // +create function f1() returns int +begin +return (select max(a) from t1); +end // +CALL sp1(f1()); +a +2 +create procedure sp2(a int) +begin +select * from t3; +select a; +end // +create procedure sp3() +begin +select * from t1; +call sp2(5); +end // +create procedure sp4() +begin +select * from t2; +call sp3(); +end // +call sp4(); +a +1 +1 +1 +2 +a +1 +1 +2 +a +1 +1 +2 +a +5 +drop temporary table t1; +drop temporary table t2; +drop procedure sp1; +drop procedure sp2; +drop procedure sp3; +drop procedure sp4; +drop function f1; +drop view if exists v1; +create function f1(ab int) returns int +begin +declare i int; +set i= (select max(a) from t1 where a < ab) ; +return i; +end // +create function f2(ab int) returns int +begin +declare i int; +set i= (select max(a) from t2 where a < ab) ; +return i; +end // +create view v1 as +select t3.a as x, t4.a as y, f2(3) as z +from t3, t4 where t3.a = t4.a // +create procedure sp1() +begin +declare a int; +set a= (select f1(4) + count(*) A from t1, v1); +end // +create function f3() returns int +begin +call sp1(); +return 1; +end // +call sp1() // +select f3() // +f3() +1 +select f3() // +f3() +1 +call sp1() // +drop procedure sp1// +drop function f3// +create procedure sp1() +begin +declare x int; +declare c cursor for select f1(3) + count(*) from v1; +open c; +fetch c into x; +end;// +create function f3() returns int +begin +call sp1(); +return 1; +end // +call sp1() // +call sp1() // +select f3() // +f3() +1 +call sp1() // +drop table t1,t2,t3; +drop function f1; +drop function f2; +drop function f3; +drop procedure sp1; diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index 184978e4a0d..75ae19eed91 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -1,7 +1,7 @@ use test; grant usage on *.* to user1@localhost; flush privileges; -drop table if exists t1; +drop table if exists t1,t2; drop database if exists db1_secret; create database db1_secret; create procedure db1_secret.dummy() begin end; diff --git a/mysql-test/r/sp-threads.result b/mysql-test/r/sp-threads.result index e6b8128c336..2f7e8021aa7 100644 --- a/mysql-test/r/sp-threads.result +++ b/mysql-test/r/sp-threads.result @@ -35,7 +35,7 @@ lock tables t2 write; show processlist; Id User Host db Command Time State Info # root localhost test Sleep # NULL -# root localhost test Query # Locked call bug9486() +# root localhost test Query # Locked update t1, t2 set val= 1 where id1=id2 # root localhost test Query # NULL show processlist unlock tables; drop procedure bug9486; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index fd63204e32f..1d5cd689676 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -1,10 +1,9 @@ use test; -drop table if exists t1; +drop table if exists t1,t2,t3,t4; create table t1 ( id char(16) not null default '', data int not null ); -drop table if exists t2; create table t2 ( s char(16), i int, @@ -3042,32 +3041,6 @@ drop procedure bug11529| drop procedure if exists bug6063| drop procedure if exists bug7088_1| drop procedure if exists bug7088_2| -create procedure bug6063() -lâbel: begin end| -call bug6063()| -show create procedure bug6063| -Procedure sql_mode Create Procedure -bug6063 CREATE PROCEDURE `test`.`bug6063`() -l?bel: begin end -set character set utf8| -create procedure bug7088_1() -label1: begin end label1| -create procedure bug7088_2() -läbel1: begin end| -call bug7088_1()| -call bug7088_2()| -set character set default| -show create procedure bug7088_1| -Procedure sql_mode Create Procedure -bug7088_1 CREATE PROCEDURE `test`.`bug7088_1`() -label1: begin end label1 -show create procedure bug7088_2| -Procedure sql_mode Create Procedure -bug7088_2 CREATE PROCEDURE `test`.`bug7088_2`() -läbel1: begin end -drop procedure bug6063| -drop procedure bug7088_1| -drop procedure bug7088_2| drop procedure if exists bug9565_sub| drop procedure if exists bug9565| create procedure bug9565_sub() diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index c8078a0604e..4445756d37a 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -581,6 +581,11 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function drop view v1; create view v1 (a,a) as select 'a','a'; ERROR 42S21: Duplicate column name 'a' +drop procedure if exists p1; +create procedure p1 () begin declare v int; create view v1 as select v; end;// +call p1(); +ERROR HY000: View's SELECT contains a variable or parameter +drop procedure p1; create table t1 (col1 int,col2 char(22)); insert into t1 values(5,'Hello, world of views'); create view v1 as select * from t1; diff --git a/mysql-test/t/sp-prelocking.test b/mysql-test/t/sp-prelocking.test new file mode 100644 index 00000000000..9dbf4f4af7e --- /dev/null +++ b/mysql-test/t/sp-prelocking.test @@ -0,0 +1,236 @@ +--disable_warnings +drop database if exists testdb; +drop table if exists t1, t2, t3, t4; +drop procedure if exists sp1; +drop procedure if exists sp2; +drop procedure if exists sp3; +drop procedure if exists sp4; +drop function if exists f1; +drop function if exists f2; +drop function if exists f3; +--enable_warnings + +# BUG#8072 + +create database testdb; +delimiter //; +use testdb// +create procedure sp1 () +begin + drop table if exists t1; + select 1 as "my-col"; +end; +// +delimiter ;// + +select database(); +call sp1(); +select database(); + +use test; +select database(); +call testdb.sp1(); +select database(); + +drop procedure testdb.sp1; +drop database testdb; + +# BUG#8766 + +delimiter //; +create procedure sp1() +begin + create table t1 (a int); + insert into t1 values (10); +end// + +create procedure sp2() +begin + create table t2(a int); + insert into t2 values(1); + call sp1(); +end// + +create function f1() returns int +begin + return (select max(a) from t1); +end// + +create procedure sp3() +begin + call sp1(); + select 'func', f1(); +end// + +delimiter ;// + +call sp1(); +select 't1',a from t1; + +drop table t1; +call sp2(); +select 't1',a from t1; +select 't2',a from t2; +drop table t1, t2; + +call sp3(); +select 't1',a from t1; + +drop table t1; + +drop procedure sp1; +drop procedure sp2; +drop procedure sp3; +drop function f1; + +delimiter //; +create procedure sp1() +begin + create temporary table t2(a int); + insert into t2 select * from t1; +end// + +create procedure sp2() +begin + create temporary table t1 (a int); + insert into t1 values(1); + call sp1(); + select 't1', a from t1; + select 't2', b from t2; + drop table t1; + drop table t2; +end// + +delimiter ;// +call sp2(); + +drop procedure sp1; +drop procedure sp2; + +# Miscelaneous tests +create table t1 (a int); +insert into t1 values(1),(2); +create table t2 as select * from t1; +create table t3 as select * from t1; +create table t4 as select * from t1; +delimiter //; +create procedure sp1(a int) +begin + select a; +end // + +create function f1() returns int +begin + return (select max(a) from t1); +end // + +delimiter ;// + +CALL sp1(f1()); + +############# +delimiter //; +create procedure sp2(a int) +begin + select * from t3; + select a; +end // + +create procedure sp3() +begin + select * from t1; + call sp2(5); +end // + +create procedure sp4() +begin + select * from t2; + call sp3(); +end // + +delimiter ;// +call sp4(); + +drop temporary table t1; +drop temporary table t2; +drop procedure sp1; +drop procedure sp2; +drop procedure sp3; +drop procedure sp4; +drop function f1; + +# Test that prelocking state restoration works with cursors +--disable_warnings +drop view if exists v1; +--enable_warnings +delimiter //; + +create function f1(ab int) returns int +begin + declare i int; + set i= (select max(a) from t1 where a < ab) ; + return i; +end // + +create function f2(ab int) returns int +begin + declare i int; + set i= (select max(a) from t2 where a < ab) ; + return i; +end // + +create view v1 as + select t3.a as x, t4.a as y, f2(3) as z + from t3, t4 where t3.a = t4.a // + +create procedure sp1() +begin + declare a int; + set a= (select f1(4) + count(*) A from t1, v1); +end // + + +create function f3() returns int +begin + call sp1(); + return 1; +end // + +call sp1() // + +select f3() // +select f3() // + +call sp1() // + +--------------- +drop procedure sp1// +drop function f3// + +create procedure sp1() +begin + declare x int; + declare c cursor for select f1(3) + count(*) from v1; + open c; + fetch c into x; +end;// + +create function f3() returns int +begin + call sp1(); + return 1; +end // + +call sp1() // +call sp1() // + +select f3() // +call sp1() // + +delimiter ;// +drop table t1,t2,t3; +drop function f1; +drop function f2; +drop function f3; +drop procedure sp1; + diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index 15fcba5ebe9..69529fd1ed0 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -15,7 +15,7 @@ grant usage on *.* to user1@localhost; flush privileges; --disable_warnings -drop table if exists t1; +drop table if exists t1,t2; drop database if exists db1_secret; --enable_warnings # Create our secret database diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index d9e6163cbc7..d70ce702daf 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -22,15 +22,12 @@ use test; # t3 and up are created and dropped when needed. # --disable_warnings -drop table if exists t1; +drop table if exists t1,t2,t3,t4; --enable_warnings create table t1 ( id char(16) not null default '', data int not null ); ---disable_warnings -drop table if exists t2; ---enable_warnings create table t2 ( s char(16), i int, @@ -3812,26 +3809,27 @@ drop procedure if exists bug7088_1| drop procedure if exists bug7088_2| --enable_warnings -create procedure bug6063() - lâbel: begin end| -call bug6063()| -# QQ Known bug: this will not show the label correctly. -show create procedure bug6063| - -set character set utf8| -create procedure bug7088_1() - label1: begin end label1| -create procedure bug7088_2() - läbel1: begin end| -call bug7088_1()| -call bug7088_2()| -set character set default| -show create procedure bug7088_1| -show create procedure bug7088_2| - -drop procedure bug6063| -drop procedure bug7088_1| -drop procedure bug7088_2| +# psergey: temporarily disabled until Bar fixes BUG#11986 +# create procedure bug6063() +# lâbel: begin end| +# call bug6063()| +# # QQ Known bug: this will not show the label correctly. +# show create procedure bug6063| +# +# set character set utf8| +# create procedure bug7088_1() +# label1: begin end label1| +# create procedure bug7088_2() +# läbel1: begin end| +# call bug7088_1()| +# call bug7088_2()| +# set character set default| +# show create procedure bug7088_1| +# show create procedure bug7088_2| +# +# drop procedure bug6063| +# drop procedure bug7088_1| +# drop procedure bug7088_2| # # BUG#9565: "Wrong locking in stored procedure if a sub-sequent procedure diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 16a94820596..61695319bc1 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -490,15 +490,15 @@ create view v1 (a,a) as select 'a','a'; # # SP variables inside view test # -# QQ This can't be tested with the new table locking for functions, -# QQ since views created in an SP can't be used within the same SP -# QQ (just as for tables). Instead it fails with error 1146. -#delimiter //; -#create procedure p1 () begin declare v int; create view v1 as select v; end;// -#delimiter ;// -#-- error 1351 -#call p1(); -#drop procedure p1; +--disable_warnings +drop procedure if exists p1; +--enable_warnings +delimiter //; +create procedure p1 () begin declare v int; create view v1 as select v; end;// +delimiter ;// +-- error 1351 +call p1(); +drop procedure p1; # # updatablity should be transitive diff --git a/sql/handler.cc b/sql/handler.cc index 2731cb8480d..1f13f0d5e36 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -598,7 +598,7 @@ int ha_commit_trans(THD *thd, bool all) my_xid xid= thd->transaction.xid.get_my_xid(); DBUG_ENTER("ha_commit_trans"); - if (thd->transaction.in_sub_stmt) + if (thd->in_sub_stmt) { /* Since we don't support nested statement transactions in 5.0, @@ -717,7 +717,7 @@ int ha_rollback_trans(THD *thd, bool all) THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; bool is_real_trans=all || thd->transaction.all.nht == 0; DBUG_ENTER("ha_rollback_trans"); - if (thd->transaction.in_sub_stmt) + if (thd->in_sub_stmt) { /* If we are inside stored function or trigger we should not commit or diff --git a/sql/item_func.cc b/sql/item_func.cc index 53895cc7331..fb39a62810c 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4844,7 +4844,7 @@ Item_func_sp::execute(Item **itp) THD *thd= current_thd; ulong old_client_capabilites; int res= -1; - bool save_in_sub_stmt= thd->transaction.in_sub_stmt; + bool save_in_sub_stmt= thd->in_sub_stmt; my_bool save_no_send_ok; #ifndef NO_EMBEDDED_ACCESS_CHECKS st_sp_security_context save_ctx; @@ -4882,11 +4882,11 @@ Item_func_sp::execute(Item **itp) */ tmp_disable_binlog(thd); /* don't binlog the substatements */ - thd->transaction.in_sub_stmt= TRUE; + thd->in_sub_stmt= TRUE; res= m_sp->execute_function(thd, args, arg_count, itp); - thd->transaction.in_sub_stmt= save_in_sub_stmt; + thd->in_sub_stmt= save_in_sub_stmt; reenable_binlog(thd); if (res && mysql_bin_log.is_open() && (m_sp->m_chistics->daccess == SP_CONTAINS_SQL || diff --git a/sql/sp.cc b/sql/sp.cc index a277c6bd253..3d513b16d07 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1175,6 +1175,44 @@ extern "C" byte* sp_sroutine_key(const byte *ptr, uint *plen, my_bool first) } +/* + Check if routines in routines_list require sp_cache_routines_and_add_tables + call. + + SYNOPSIS + sp_need_cache_routines() + thd + routines + need_skip_first OUT TRUE - don't do prelocking for the 1st element in + routines list. + FALSE- otherwise + NOTES + This function assumes that for any "CALL proc(...)" statement routines_list + will have 'proc' as first element (it may have several, consider e.g. + "proc(sp_func(...)))". This property is currently guaranted by the parser. + + RETURN + TRUE Need to sp_cache_routines_and_add_tables call for this statement. + FALSE Otherwise. +*/ + +bool sp_need_cache_routines(THD *thd, SQL_LIST *routines_list, bool *need_skip_first) +{ + Sroutine_hash_entry *routine; + routine= (Sroutine_hash_entry*)routines_list->first; + + *need_skip_first= FALSE; + if (!routine) + return FALSE; + + if (routine->key.str[0] != TYPE_ENUM_PROCEDURE) + return TRUE; + + *need_skip_first= TRUE; + return TRUE; +} + + /* Auxilary function that adds new element to the set of stored routines used by statement. @@ -1312,11 +1350,13 @@ static void sp_update_stmt_used_routines(THD *thd, LEX *lex, HASH *src) SYNOPSIS sp_cache_routines_and_add_tables_aux() - thd - thread context - lex - LEX representing statement - start - first routine from the list of routines to be cached - (this list defines mentioned sub-set). - + thd - thread context + lex - LEX representing statement + start - first routine from the list of routines to be cached + (this list defines mentioned sub-set). + first_no_prelock - If true, don't add tables or cache routines used by + the body of the first routine (i.e. *start) + will be executed in non-prelocked mode. NOTE If some function is missing this won't be reported here. Instead this fact will be discovered during query execution. @@ -1328,10 +1368,11 @@ static void sp_update_stmt_used_routines(THD *thd, LEX *lex, HASH *src) static bool sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex, - Sroutine_hash_entry *start) + Sroutine_hash_entry *start, + bool first_no_prelock) { bool result= FALSE; - + bool first= TRUE; DBUG_ENTER("sp_cache_routines_and_add_tables_aux"); for (Sroutine_hash_entry *rt= start; rt; rt= rt->next) @@ -1367,9 +1408,13 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex, } if (sp) { - sp_update_stmt_used_routines(thd, lex, &sp->m_sroutines); - result|= sp->add_used_tables_to_table_list(thd, &lex->query_tables_last); + if (!(first && first_no_prelock)) + { + sp_update_stmt_used_routines(thd, lex, &sp->m_sroutines); + result|= sp->add_used_tables_to_table_list(thd, &lex->query_tables_last); + } } + first= FALSE; } DBUG_RETURN(result); } @@ -1382,20 +1427,22 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex, SYNOPSIS sp_cache_routines_and_add_tables() - thd - thread context - lex - LEX representing statement - + thd - thread context + lex - LEX representing statement + first_no_prelock - If true, don't add tables or cache routines used by + the body of the first routine (i.e. *start) + RETURN VALUE TRUE - some tables were added FALSE - no tables were added. */ bool -sp_cache_routines_and_add_tables(THD *thd, LEX *lex) +sp_cache_routines_and_add_tables(THD *thd, LEX *lex, bool first_no_prelock) { - return sp_cache_routines_and_add_tables_aux(thd, lex, - (Sroutine_hash_entry *)lex->sroutines_list.first); + (Sroutine_hash_entry *)lex->sroutines_list.first, + first_no_prelock); } @@ -1417,8 +1464,8 @@ sp_cache_routines_and_add_tables_for_view(THD *thd, LEX *lex, LEX *aux_lex) Sroutine_hash_entry **last_cached_routine_ptr= (Sroutine_hash_entry **)lex->sroutines_list.next; sp_update_stmt_used_routines(thd, lex, &aux_lex->sroutines); - (void)sp_cache_routines_and_add_tables_aux(thd, lex, - *last_cached_routine_ptr); + (void)sp_cache_routines_and_add_tables_aux(thd, lex, + *last_cached_routine_ptr, FALSE); } @@ -1453,7 +1500,8 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex, } (void)sp_cache_routines_and_add_tables_aux(thd, lex, - *last_cached_routine_ptr); + *last_cached_routine_ptr, + FALSE); } } diff --git a/sql/sp.h b/sql/sp.h index b8af8d3a321..716f3d90f55 100644 --- a/sql/sp.h +++ b/sql/sp.h @@ -79,10 +79,13 @@ sp_show_status_function(THD *thd, const char *wild); Procedures for pre-caching of stored routines and building table list for prelocking. */ +bool sp_need_cache_routines(THD *thd, SQL_LIST *routines_list, + bool *need_skip_first); void sp_add_used_routine(LEX *lex, Query_arena *arena, sp_name *rt, char rt_type); void sp_update_sp_used_routines(HASH *dst, HASH *src); -bool sp_cache_routines_and_add_tables(THD *thd, LEX *lex); +bool sp_cache_routines_and_add_tables(THD *thd, LEX *lex, + bool first_no_prelock); void sp_cache_routines_and_add_tables_for_view(THD *thd, LEX *lex, LEX *aux_lex); void sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex, diff --git a/sql/sp_cache.h b/sql/sp_cache.h index e9efe5b2a8c..5873c763289 100644 --- a/sql/sp_cache.h +++ b/sql/sp_cache.h @@ -22,6 +22,12 @@ #pragma interface /* gcc class implementation */ #endif +/* + Stored procedures/functions cache. This is used as follows: + * Each thread has its own cache. + * When SP is used it is always in some thread's cache. +*/ + class sp_head; class sp_cache; @@ -31,16 +37,20 @@ void sp_cache_init(); /* Clear the cache *cp and set *cp to NULL */ void sp_cache_clear(sp_cache **cp); -/* Insert an SP to cache. If 'cp' points to NULL, it's set to a new cache */ +/* Insert an SP into cache. If 'cp' points to NULL, it's set to a new cache */ void sp_cache_insert(sp_cache **cp, sp_head *sp); /* Lookup an SP in cache */ sp_head *sp_cache_lookup(sp_cache **cp, sp_name *name); -/* Remove an SP from cache. Returns true if something was removed */ +/* + Remove an SP from cache, and also bump the Cversion number so all other + caches are invalidated. + Returns true if something was removed. +*/ bool sp_cache_remove(sp_cache **cp, sp_name *name); -/* Invalidate a cache */ +/* Invalidate all existing SP caches by bumping Cversion number. */ void sp_cache_invalidate(); diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 02c006d01ee..8d56e2a0b38 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -879,7 +879,10 @@ sp_head::execute_procedure(THD *thd, List *args) octx= new sp_rcontext(csize, hmax, cmax); tmp_octx= TRUE; } + + /* Evaluate SP arguments (i.e. get the values passed as parameters) */ // QQ: Should do type checking? + DBUG_PRINT("info",(" %.*s: eval args", m_name.length, m_name.str)); for (i = 0 ; (it= li++) && i < params ; i++) { sp_pvar_t *pvar= m_pcont->find_pvar(i); @@ -916,6 +919,14 @@ sp_head::execute_procedure(THD *thd, List *args) } } + /* + Okay, got values for all arguments. Close tables that might be used by + arguments evaluation. + */ + if (!thd->in_sub_stmt) + close_thread_tables(thd, 0, 0, 0); + + DBUG_PRINT("info",(" %.*s: eval args done", m_name.length, m_name.str)); // The rest of the frame are local variables which are all IN. // Default all variables to null (those with default clauses will // be set by an set instruction). @@ -1480,8 +1491,37 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, implemented at the same time as ability not to store LEX for instruction if it is not really used. */ - reinit_stmt_before_use(thd, m_lex); + bool collect_prelocking_tail= FALSE; + + if (thd->prelocked_mode == NON_PRELOCKED) + { + /* + This statement will enter/leave prelocked mode on its own. + Entering prelocked mode changes table list and related members + of LEX, so we'll need to restore them. + */ + if (lex_query_tables_own_last) + { + /* + We've already entered/left prelocked mode with this statement. + Attach the list of tables that need to be prelocked and mark m_lex + as having such list attached. + */ + *lex_query_tables_own_last= prelocking_tables; + m_lex->mark_as_requiring_prelocking(lex_query_tables_own_last); + } + else + { + /* + Let open_tables_calculate list of tables that this statement needs + to have prelocked. + */ + collect_prelocking_tail= TRUE; + } + } + + reinit_stmt_before_use(thd, m_lex); /* If requested check whenever we have access to tables in LEX's table list and open and lock them before executing instructtions core function. @@ -1499,6 +1539,35 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, thd->proc_info="closing tables"; close_thread_tables(thd); + if (thd->prelocked_mode == NON_PRELOCKED) + { + if (!lex_query_tables_own_last) + lex_query_tables_own_last= thd->lex->query_tables_own_last; + + if (lex_query_tables_own_last) + { + if (collect_prelocking_tail) + { + /* + This is the first time this statement has entered/left prelocked + mode on its own. open_tables() has calculated the set of tables this + statement needs to have prelocked and added them to the end of + m_lex->query_tables(->next_global)*. + Save this "tail" for subsequent calls (and restore original list + below) + */ + lex_query_tables_own_last= m_lex->query_tables_own_last; + prelocking_tables= *lex_query_tables_own_last; + } + /* + The table list now has list of tables that need to be prelocked + when this statement executes, chop it off, and mark this statement + as not requiring prelocking. + */ + *lex_query_tables_own_last= NULL; + m_lex->mark_as_requiring_prelocking(NULL); + } + } thd->rollback_item_tree_changes(); /* diff --git a/sql/sp_head.h b/sql/sp_head.h index 32dc4449174..724cbcc7fc5 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -282,6 +282,10 @@ private: /* Multi-set representing optimized list of tables to be locked by this routine. Does not include tables which are used by invoked routines. + + Note: for prelocking-free SPs this multiset is constructed too. + We do so because the same instance of sp_head may be called both + in prelocked mode and in non-prelocked mode. */ HASH m_sptabs; @@ -383,7 +387,8 @@ class sp_lex_keeper public: sp_lex_keeper(LEX *lex, bool lex_resp) - : m_lex(lex), m_lex_resp(lex_resp) + : m_lex(lex), m_lex_resp(lex_resp), + lex_query_tables_own_last(NULL) { lex->sp_lex_in_use= TRUE; } @@ -418,6 +423,25 @@ private: for LEX deletion. */ bool m_lex_resp; + + /* + Support for being able to execute this statement in two modes: + a) inside prelocked mode set by the calling procedure or its ancestor. + b) outside of prelocked mode, when this statement enters/leaves + prelocked mode itself. + */ + + /* + List of additional tables this statement needs to lock when it + enters/leaves prelocked mode on its own. + */ + TABLE_LIST *prelocking_tables; + + /* + The value m_lex->query_tables_own_last should be set to this when the + statement enters/leaves prelocked mode on its own. + */ + TABLE_LIST **lex_query_tables_own_last; }; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 65bb0ec047b..367bd2c5ade 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -391,6 +391,8 @@ static void mark_used_tables_as_free_for_reuse(THD *thd, TABLE *table) LOCK_open skip_derived Set to 1 (0 = default) if we should not free derived tables. + stopper When closing tables from thd->open_tables(->next)*, + don't close/remove tables starting from stopper. IMPLEMENTATION Unlocks tables and frees derived tables. @@ -474,6 +476,7 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived, We are in prelocked mode, so we have to leave it now with doing implicit UNLOCK TABLES if need. */ + DBUG_PRINT("info",("thd->prelocked_mode= NON_PRELOCKED")); thd->prelocked_mode= NON_PRELOCKED; if (prelocked_mode == PRELOCKED_UNDER_LOCK_TABLES) @@ -1792,6 +1795,7 @@ err: DBUG_RETURN(1); } + /* Open all tables in list @@ -1843,10 +1847,6 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter) statement for which table list for prelocking is already built, let us cache routines and try to build such table list. - NOTE: If we want queries with functions to work under explicit - LOCK TABLES we have to additionaly lock mysql.proc table in it. - At least until Monty will fix SP loading :) - NOTE: We can't delay prelocking until we will met some sub-statement which really uses tables, since this will imply that we have to restore its table list to be able execute it in some other context. @@ -1860,19 +1860,28 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter) mode we will have some locked tables, because queries which use only derived/information schema tables and views possible. Thus "counter" may be still zero for prelocked statement... + + NOTE: The above notes may be out of date. Please wait for psergey to + document new prelocked behavior. */ - if (!thd->prelocked_mode && !thd->lex->requires_prelocking() && - thd->lex->sroutines.records) + + if (!thd->prelocked_mode && !thd->lex->requires_prelocking()) { - TABLE_LIST **save_query_tables_last= thd->lex->query_tables_last; - - DBUG_ASSERT(thd->lex->query_tables == *start); - - if (sp_cache_routines_and_add_tables(thd, thd->lex) || - *start) + bool first_no_prelocking; + if (sp_need_cache_routines(thd, &thd->lex->sroutines_list, + &first_no_prelocking)) { - query_tables_last_own= save_query_tables_last; - *start= thd->lex->query_tables; + TABLE_LIST **save_query_tables_last= thd->lex->query_tables_last; + + DBUG_ASSERT(thd->lex->query_tables == *start); + + if (sp_cache_routines_and_add_tables(thd, thd->lex, + first_no_prelocking) || + *start) + { + query_tables_last_own= save_query_tables_last; + *start= thd->lex->query_tables; + } } } @@ -1891,14 +1900,31 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter) DBUG_RETURN(-1); } (*counter)++; + if (!tables->table && !(tables->table= open_table(thd, tables, &new_frm_mem, &refresh, 0))) { free_root(&new_frm_mem, MYF(MY_KEEP_PREALLOC)); + if (tables->view) { /* VIEW placeholder */ (*counter)--; + + /* + tables->next_global list consists of two parts: + 1) Query tables and underlying tables of views. + 2) Tables used by all stored routines that this statement invokes on + execution. + We need to know where the bound between these two parts is. If we've + just opened the last table in part #1, and it added tables after + itself, adjust the boundary pointer accordingly. + */ + if (query_tables_last_own && + query_tables_last_own == &(tables->next_global) && + tables->view->query_tables) + query_tables_last_own= tables->view->query_tables_last; + /* Again if needed we have to get cache all routines used by this view and add tables used by them to table list. @@ -2323,6 +2349,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count) and was marked as occupied during open_tables() as free for reuse. */ mark_real_tables_as_free_for_reuse(first_not_own); + DBUG_PRINT("info",("prelocked_mode= PRELOCKED")); thd->prelocked_mode= PRELOCKED; } } @@ -2346,6 +2373,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count) if (thd->lex->requires_prelocking()) { mark_real_tables_as_free_for_reuse(first_not_own); + DBUG_PRINT("info", ("thd->prelocked_mode= PRELOCKED_UNDER_LOCK_TABLES")); thd->prelocked_mode= PRELOCKED_UNDER_LOCK_TABLES; } } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 89d5b543dfc..81cdc6562e9 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -178,7 +178,7 @@ THD::THD() rand_used(0), time_zone_used(0), last_insert_id_used(0), insert_id_used(0), clear_next_insert_id(0), in_lock_tables(0), bootstrap(0), derived_tables_processing(FALSE), - spcont(NULL) + spcont(NULL), in_sub_stmt(FALSE) { current_arena= this; host= user= priv_user= db= ip= 0; diff --git a/sql/sql_class.h b/sql/sql_class.h index d6847f5fb35..26a861bcc5d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1132,6 +1132,10 @@ public: thr_lock_type update_lock_default; delayed_insert *di; my_bool tablespace_op; /* This is TRUE in DISCARD/IMPORT TABLESPACE */ + + /* TRUE if we are inside of trigger or stored function. */ + bool in_sub_stmt; + /* container for handler's private per-connection data */ void *ha_data[MAX_HA]; struct st_transactions { @@ -1139,8 +1143,6 @@ public: THD_TRANS all; // Trans since BEGIN WORK THD_TRANS stmt; // Trans for current statement bool on; // see ha_enable_transaction() - /* TRUE if we are inside of trigger or stored function. */ - bool in_sub_stmt; XID xid; // transaction identifier enum xa_states xa_state; // used by external XA only /* diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 630a7e950f7..c66bfcbe78d 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -2008,6 +2008,7 @@ void st_lex::cleanup_after_one_table_open() time_zone_tables_used= 0; if (sroutines.records) my_hash_reset(&sroutines); + sroutines_list.empty(); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 23403e6e00a..6a0b5586598 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -27,6 +27,7 @@ #include "sp_head.h" #include "sp.h" +#include "sp_cache.h" #ifdef HAVE_OPENSSL /* @@ -124,7 +125,7 @@ static bool end_active_trans(THD *thd) { int error=0; DBUG_ENTER("end_active_trans"); - if (unlikely(thd->transaction.in_sub_stmt)) + if (unlikely(thd->in_sub_stmt)) { my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0)); DBUG_RETURN(1); @@ -147,11 +148,7 @@ static bool end_active_trans(THD *thd) static bool begin_trans(THD *thd) { int error=0; - /* - QQ: May be it is better to simply prohibit COMMIT and ROLLBACK in - stored routines as SQL2003 suggests? - */ - if (unlikely(thd->transaction.in_sub_stmt)) + if (unlikely(thd->in_sub_stmt)) { my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0)); return 1; @@ -1340,11 +1337,7 @@ int end_trans(THD *thd, enum enum_mysql_completiontype completion) int res= 0; DBUG_ENTER("end_trans"); - /* - QQ: May be it is better to simply prohibit COMMIT and ROLLBACK in - stored routines as SQL2003 suggests? - */ - if (unlikely(thd->transaction.in_sub_stmt)) + if (unlikely(thd->in_sub_stmt)) { my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0)); DBUG_RETURN(1); @@ -4128,9 +4121,8 @@ end_with_restore_list: goto error; /* - By this moment all needed SPs should be in cache so no need - to look into DB. Moreover we may be unable to do it becuase - we may don't have read lock on mysql.proc + By this moment all needed SPs should be in cache so no need to look + into DB. */ if (!(sp= sp_find_procedure(thd, lex->spname, TRUE))) { @@ -4195,7 +4187,7 @@ end_with_restore_list: select_limit= thd->variables.select_limit; thd->variables.select_limit= HA_POS_ERROR; - thd->row_count_func= 0; + thd->row_count_func= 0; tmp_disable_binlog(thd); /* don't binlog the substatements */ res= sp->execute_procedure(thd, &lex->value_list); reenable_binlog(thd); diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h index e751741fa34..e74297461d3 100644 --- a/sql/sql_trigger.h +++ b/sql/sql_trigger.h @@ -78,7 +78,7 @@ public: if (bodies[event][time_type]) { - bool save_in_sub_stmt= thd->transaction.in_sub_stmt; + bool save_in_sub_stmt= thd->in_sub_stmt; #ifndef EMBEDDED_LIBRARY /* Surpress OK packets in case if we will execute statements */ my_bool nsok= thd->net.no_send_ok; @@ -107,11 +107,11 @@ public: does NOT go into binlog. */ tmp_disable_binlog(thd); - thd->transaction.in_sub_stmt= TRUE; + thd->in_sub_stmt= TRUE; res= bodies[event][time_type]->execute_function(thd, 0, 0, 0); - thd->transaction.in_sub_stmt= save_in_sub_stmt; + thd->in_sub_stmt= save_in_sub_stmt; reenable_binlog(thd); #ifndef EMBEDDED_LIBRARY From 2f47bc19d7149eadf660a876d289491b7dbe93fe Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 31 Jul 2005 02:32:33 -0700 Subject: [PATCH 090/144] Fixed bug #12095: a join query with GROUP_CONCAT over a single row table. If GROUP_CONCAT is calculated we always put its argument into a temp table, even when the argument is a constant item. --- sql/item_sum.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 6ca3f024f61..1ee48dfb763 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1986,6 +1986,7 @@ bool Item_func_group_concat::setup(THD *thd) } count_field_types(tmp_table_param,all_fields,0); + tmp_table_param->need_const= 1; if (table) { /* From 6b3478ec1248825122f837411704ab387651b715 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 31 Jul 2005 12:49:55 +0300 Subject: [PATCH 091/144] Fixes during review of new pushed code Change bool in C code to my_bool Added to mysqltest --enable_parsning and --disable_parsing to avoid to have to comment parts of tests Added comparison of LEX_STRING's and use this to compare file types for view and trigger files. client/client_priv.h: Added OPT_TRIGGERS (to get rid of compiler warning) client/mysql.cc: Added cast to get rid of compiler warning client/mysqldump.c: Added OPT_TRIGGERS (to get rid of compiler warning) Abort if we can't write to outfile (even if --ignore-errors is given) client/mysqltest.c: Added --enable_parsning and --disable_parsing to avoid to have to comment parts of tests include/my_sys.h: Make my_progname const include/my_time.h: Avoid using 'bool' in C programs mysql-test/lib/init_db.sql: Align with mysql_create_system_tables (Ideally this file should be auto-generated from the above script) mysql-test/r/mysqltest.result: Test for --enable_parsing mysql-test/r/variables.result: Update results after fix for overflow checking of max_heap_table_size mysql-test/t/information_schema.test: USe --enable/disable parsing instead of comments mysql-test/t/mysqltest.test: Test for --enable_parsing mysql-test/t/sp.test: USe --enable/disable parsing instead of comments mysql-test/t/variables.test: Portability fix for 64 bit systems mysql-test/t/view.test: USe --enable/disable parsing instead of comments mysys/my_init.c: May my_progname const mysys/my_static.c: May my_progname const mysys/thr_lock.c: Remove not needed casts sql-common/my_time.c: Change bool -> my_bool as bool is not portable in C programs sql/field.cc: Test number_to_datetime() for -1 instead of < 0 (Safety fix) New prototype for TIME_to_timestamp() sql/item.h: Don't have prototypes for both uint32 and ulong as these 'may' be the same thing sql/item_timefunc.cc: New prototype for TIME_to_timestamp() sql/log.cc: Remove compiler warnings sql/mysql_priv.h: New prototype for TIME_to_timestamp() Added function for comparing LEX_STRING sql/set_var.cc: Added overflow checking when setting ulong variable sql/sql_base.cc: Added function is_equal() Changed strncmp -> is_equal() as strncmp() to not match "V" (instead of "VIEW") sql/sql_class.cc: Added comment sql/sql_select.cc: Portability fixes After review fixes sql/sql_trigger.cc: Use 'tables_alias_charset' for comparing database name Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly) sql/sql_view.cc: Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly) sql/time.cc: New prototype for TIME_to_timestamp() to allow easyer mapping to C function sql/tztime.cc: bool -> my_bool (to allow calling C code from C++ code) sql/tztime.h: bool -> my_bool (to allow calling C code from C++ code) --- client/client_priv.h | 3 +- client/mysql.cc | 2 +- client/mysqldump.c | 8 +- client/mysqltest.c | 50 ++++- include/my_sys.h | 2 +- include/my_time.h | 7 +- mysql-test/lib/init_db.sql | 8 +- mysql-test/r/mysqltest.result | 2 + mysql-test/r/variables.result | 18 +- mysql-test/t/information_schema.test | 40 ++-- mysql-test/t/mysqltest.test | 11 + mysql-test/t/sp.test | 294 ++++++++++++++------------- mysql-test/t/variables.test | 7 +- mysql-test/t/view.test | 9 +- mysys/my_init.c | 2 +- mysys/my_static.c | 3 +- mysys/thr_lock.c | 6 +- sql-common/my_time.c | 33 ++- sql/field.cc | 22 +- sql/item.h | 3 +- sql/item_timefunc.cc | 4 +- sql/log.cc | 6 +- sql/mysql_priv.h | 6 +- sql/set_var.cc | 10 +- sql/sql_base.cc | 8 +- sql/sql_class.cc | 4 + sql/sql_select.cc | 43 ++-- sql/sql_trigger.cc | 22 +- sql/sql_view.cc | 9 +- sql/time.cc | 2 +- sql/tztime.cc | 34 ++-- sql/tztime.h | 2 +- 32 files changed, 384 insertions(+), 296 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index c8aa7385276..997f9ffe552 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -49,5 +49,6 @@ enum options_client #ifdef HAVE_NDBCLUSTER_DB OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, #endif - OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE + OPT_TRIGGERS, + OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE, }; diff --git a/client/mysql.cc b/client/mysql.cc index 871936d7800..b8655d7c5f5 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -432,7 +432,7 @@ int main(int argc,char *argv[]) put_info((char*) glob_buffer.ptr(),INFO_INFO); #ifdef HAVE_READLINE - initialize_readline(my_progname); + initialize_readline((char*) my_progname); if (!status.batch && !quick && !opt_html && !opt_xml) { /* read-history from file, default ~/.mysql_history*/ diff --git a/client/mysqldump.c b/client/mysqldump.c index be9eb5ef58b..61b301adbed 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -372,7 +372,7 @@ static struct my_option my_long_options[] = (gptr*) &path, (gptr*) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"triggers", '/0', "Dump triggers for each dumped table", + {"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table", (gptr*) &opt_dump_triggers, (gptr*) &opt_dump_triggers, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE @@ -424,6 +424,7 @@ void check_io(FILE *file) if (ferror(file)) { fprintf(stderr, "%s: Got errno %d on write\n", my_progname, errno); + ignore_errors= 0; /* We can't ignore this error */ safe_exit(EX_EOF); } } @@ -2610,7 +2611,7 @@ static int do_show_master_status(MYSQL *mysql_con) { /* SHOW MASTER STATUS reports nothing and --force is not enabled */ my_printf_error(0, "Error: Binlogging on server not active", - MYF(0), mysql_error(mysql_con)); + MYF(0)); mysql_free_result(master); return 1; } @@ -2979,11 +2980,12 @@ static my_bool get_view_structure(char *table, char* db) int main(int argc, char **argv) { + MY_INIT("mysqldump"); + compatible_mode_normal_str[0]= 0; default_charset= (char *)mysql_universal_client_charset; bzero((char*) &ignore_table, sizeof(ignore_table)); - MY_INIT("mysqldump"); if (get_options(&argc, &argv)) { my_end(0); diff --git a/client/mysqltest.c b/client/mysqltest.c index 4b8bb047e47..8e72bc8edb8 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -42,7 +42,7 @@ **********************************************************************/ -#define MTEST_VERSION "2.4" +#define MTEST_VERSION "2.5" #include #include @@ -151,6 +151,7 @@ const char* user = 0, *host = 0, *unix_sock = 0, *opt_basedir="./"; static int port = 0; static my_bool opt_big_test= 0, opt_compress= 0, silent= 0, verbose = 0; static my_bool tty_password= 0, ps_protocol= 0, ps_protocol_enabled= 0; +static int parsing_disabled= 0; static uint start_lineno, *lineno; const char* manager_user="root",*manager_host=0; char *manager_pass=0; @@ -308,6 +309,7 @@ Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL, Q_EXIT, Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT, Q_IF, +Q_DISABLE_PARSING, Q_ENABLE_PARSING, Q_UNKNOWN, /* Unknown command. */ Q_COMMENT, /* Comments, ignored. */ @@ -399,6 +401,8 @@ const char *command_names[]= "disable_reconnect", "enable_reconnect", "if", + "disable_parsing", + "enable_parsing", 0 }; @@ -2141,7 +2145,7 @@ int read_line(char* buf, int size) } break; case R_LINE_START: - if (c == '#' || c == '-') + if (c == '#' || c == '-' || parsing_disabled) { state = R_COMMENT; } @@ -2268,18 +2272,22 @@ int read_query(struct st_query** q_ptr) /* This goto is to avoid losing the "expected error" info. */ goto end; } - memcpy((gptr) q->expected_errno, (gptr) global_expected_errno, - sizeof(global_expected_errno)); - q->expected_errors= global_expected_errors; - q->abort_on_error= (global_expected_errors == 0 && abort_on_error); - bzero((gptr) global_expected_errno, sizeof(global_expected_errno)); - global_expected_errors=0; + if (!parsing_disabled) + { + memcpy((gptr) q->expected_errno, (gptr) global_expected_errno, + sizeof(global_expected_errno)); + q->expected_errors= global_expected_errors; + q->abort_on_error= (global_expected_errors == 0 && abort_on_error); + bzero((gptr) global_expected_errno, sizeof(global_expected_errno)); + global_expected_errors=0; + } + if (p[0] == '-' && p[1] == '-') { q->type= Q_COMMENT_WITH_COMMAND; p+= 2; /* To calculate first word */ } - else + else if (!parsing_disabled) { if (*p == '!') { @@ -3586,20 +3594,29 @@ void get_query_type(struct st_query* q) uint type; DBUG_ENTER("get_query_type"); - if (*q->query == '}') + if (!parsing_disabled && *q->query == '}') { q->type = Q_END_BLOCK; DBUG_VOID_RETURN; } if (q->type != Q_COMMENT_WITH_COMMAND) - q->type = Q_QUERY; + q->type= parsing_disabled ? Q_COMMENT : Q_QUERY; save=q->query[q->first_word_len]; q->query[q->first_word_len]=0; type=find_type(q->query, &command_typelib, 1+2); q->query[q->first_word_len]=save; if (type > 0) + { q->type=(enum enum_commands) type; /* Found command */ + /* + If queries are disabled, only recognize + --enable-queries and --disable-queries + */ + if (parsing_disabled && q->type != Q_ENABLE_PARSING && + q->type != Q_DISABLE_PARSING) + q->type= Q_COMMENT; + } DBUG_VOID_RETURN; } @@ -3963,6 +3980,17 @@ int main(int argc, char **argv) case Q_ENABLE_RECONNECT: cur_con->mysql.reconnect= 1; break; + case Q_DISABLE_PARSING: + parsing_disabled++; + break; + case Q_ENABLE_PARSING: + /* + Ensure we don't get parsing_disabled < 0 as this would accidently + disable code we don't want to have disabled + */ + if (parsing_disabled > 0) + parsing_disabled--; + break; case Q_EXIT: abort_flag= 1; diff --git a/include/my_sys.h b/include/my_sys.h index 6747733da9c..d5488ce12fa 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -218,7 +218,7 @@ extern int errno; /* declare errno */ #endif /* #ifndef errno */ extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; extern char *home_dir; /* Home directory for user */ -extern char *my_progname; /* program-name (printed in errors) */ +extern const char *my_progname; /* program-name (printed in errors) */ extern char NEAR curr_dir[]; /* Current directory for user */ extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); extern int (*fatal_error_handler_hook)(uint my_err, const char *str, diff --git a/include/my_time.h b/include/my_time.h index aa68a6f0bbd..e52ef69475d 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -60,8 +60,8 @@ ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *time); ulonglong TIME_to_ulonglong(const MYSQL_TIME *time); -bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time, - int *was_cut); +my_bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time, + int *was_cut); long calc_daynr(uint year,uint month,uint day); uint calc_days_in_year(uint year); @@ -69,7 +69,8 @@ uint calc_days_in_year(uint year); void init_time(void); my_time_t -my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap); +my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, + my_bool *in_dst_time_gap); void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type); diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql index fa02b350425..a71de229ee9 100644 --- a/mysql-test/lib/init_db.sql +++ b/mysql-test/lib/init_db.sql @@ -504,7 +504,7 @@ comment='Procedure privileges'; CREATE TABLE proc ( - db char(64) binary DEFAULT '' NOT NULL, + db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, @@ -519,7 +519,7 @@ CREATE TABLE proc ( param_list blob DEFAULT '' NOT NULL, returns char(64) DEFAULT '' NOT NULL, body blob DEFAULT '' NOT NULL, - definer char(77) binary DEFAULT '' NOT NULL, + definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( @@ -554,6 +554,6 @@ CREATE TABLE proc ( 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, - comment char(64) binary DEFAULT '' NOT NULL, + comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) -) comment='Stored Procedures'; +) character set utf8 comment='Stored Procedures'; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 2b171229096..256576704b5 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -164,3 +164,5 @@ root@localhost . - is longer then 80 characters and . - consists of several lines -------------------------------------------------------------------------------- +this will be executed +this will be executed diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 8ab591e18d0..7307f911dbf 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -526,14 +526,14 @@ ERROR HY000: Variable 'warning_count' is a read only variable set @@global.error_count=1; ERROR HY000: Variable 'error_count' is a read only variable set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; -@@max_heap_table_size -4294967296 +select @@max_heap_table_size > 0; +@@max_heap_table_size > 0 +1 set global max_heap_table_size= 4294967296; -select @@max_heap_table_size; -@@max_heap_table_size -4294967296 +select @@max_heap_table_size > 0; +@@max_heap_table_size > 0 +1 set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; -@@max_heap_table_size -4294967296 +select @@max_heap_table_size > 0; +@@max_heap_table_size > 0 +1 diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index a8fc75f8aa4..cfbd86a018f 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -249,25 +249,27 @@ flush privileges; # QQ This results in NULLs instead of the version numbers when # QQ a LOCK TABLES is in effect when selecting from -# QQ information_schema.tables. Until this bug has been fixed, -# QQ this test is disabled /pem -#delimiter //; -#create procedure px5 () -#begin -#declare v int; -#declare c cursor for select version from -#information_schema.tables where table_schema <> 'information_schema'; -#open c; -#fetch c into v; -#select v; -#close c; -#end;// -# -#call px5()// -#call px5()// -#delimiter ;// -#select sql_mode from information_schema.ROUTINES; -#drop procedure px5; +# QQ information_schema.tables. + +--disable_parsing until bug is fixes +delimiter //; +create procedure px5 () +begin +declare v int; +declare c cursor for select version from +information_schema.tables where table_schema <> 'information_schema'; +open c; +fetch c into v; +select v; +close c; +end;// + +call px5()// +call px5()// +delimiter ;// +select sql_mode from information_schema.ROUTINES; +drop procedure px5; +--enable_parsing create table t1 (a int not null auto_increment,b int, primary key (a)); insert into t1 values (1,1),(NULL,3),(NULL,4); diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 29588419642..08e51aadc24 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -324,3 +324,14 @@ let $message= . Here comes a very very long message that . - consists of several lines; --source include/show_msg80.inc +# +# Test --enable_parsning / disable_parsning +# +--disable_query_log +--disable_parsing +# The following will not enable query logging +--enable_query_log +select "this will not be executed"; +--enable_parsing +select "this will be executed"; +--enable_query_log diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 1a35df40a17..9e41cd23d4b 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -1232,12 +1232,14 @@ begin end| select f5(1)| # This should generate an error about insuficient number of tables locked -# Nuw this crash server, comented until bug#11394 fix -#--error 1100 -#select f5(2)| +# Now this crash server +--disable_parsing until bug#11394 fix +--error 1100 +select f5(2)| # But now it simply miserably fails because we are trying to use the same # lex on the next iteration :/ It should generate some error too... -# select f5(3)| +select f5(3)| +--enable_parsing # OTOH this should work create function f6() returns int @@ -1285,9 +1287,11 @@ create function f1() returns int return (select sum(data) from t1) + (select sum(data) from v1)| # This queries will crash server because we can't use LEX in # reenterable fashion yet. Patch disabling recursion will heal this. -#select f1()| -#select * from v1| -#select * from v2| +--disable_parsing +select f1()| +select * from v1| +select * from v2| +--enable_parsing # Back to the normal cases drop function f1| create function f1() returns int @@ -1499,54 +1503,55 @@ show procedure status like '%p%'| # # This part of test is disabled until we implement support for # recursive stored procedures. -#--disable_warnings -#drop table if exists fib| -#--enable_warnings -#create table fib ( f bigint unsigned not null )| -# -## We deliberately do it the awkward way, fetching the last two -## values from the table, in order to exercise various statements -## and table accesses at each turn. -#--disable_warnings -#drop procedure if exists fib| -#--enable_warnings -#create procedure fib(n int unsigned) -#begin -# if n > 1 then -# begin -# declare x, y bigint unsigned; -# declare c cursor for select f from fib order by f desc limit 2; -# -# open c; -# fetch c into y; -# fetch c into x; -# close c; -# insert into fib values (x+y); -# call fib(n-1); -# end; -# end if; -#end| -# -## Minimum test: recursion of 3 levels -# -#insert into fib values (0), (1)| -# -#call fib(3)| -# -#select * from fib order by f asc| -# -#delete from fib| -# -## Original test: 20 levels (may run into memory limits!) -# -#insert into fib values (0), (1)| -# -#call fib(20)| -# -#select * from fib order by f asc| -#drop table fib| -#drop procedure fib| +--disable_parsing +--disable_warnings +drop table if exists fib| +--enable_warnings +create table fib ( f bigint unsigned not null )| +# We deliberately do it the awkward way, fetching the last two +# values from the table, in order to exercise various statements +# and table accesses at each turn. +--disable_warnings +drop procedure if exists fib| +--enable_warnings +create procedure fib(n int unsigned) +begin + if n > 1 then + begin + declare x, y bigint unsigned; + declare c cursor for select f from fib order by f desc limit 2; + + open c; + fetch c into y; + fetch c into x; + close c; + insert into fib values (x+y); + call fib(n-1); + end; + end if; +end| + +# Minimum test: recursion of 3 levels + +insert into fib values (0), (1)| + +call fib(3)| + +select * from fib order by f asc| + +delete from fib| + +# Original test: 20 levels (may run into memory limits!) + +insert into fib values (0), (1)| + +call fib(20)| + +select * from fib order by f asc| +drop table fib| +drop procedure fib| +--enable_parsing # # Comment & suid @@ -1830,49 +1835,51 @@ drop procedure bug2260| # FIXME: Other solution would be to use preopened proc table # instead of opening it anew. # -#--disable_warnings -#drop procedure if exists bug2267_1| -#--enable_warnings -#create procedure bug2267_1() -#begin -# show procedure status; -#end| -# -#--disable_warnings -#drop procedure if exists bug2267_2| -#--enable_warnings -#create procedure bug2267_2() -#begin -# show function status; -#end| -# -#--disable_warnings -#drop procedure if exists bug2267_3| -#--enable_warnings -#create procedure bug2267_3() -#begin -# show create procedure bug2267_1; -#end| -# -#--disable_warnings -#drop procedure if exists bug2267_4| -#--enable_warnings -#create procedure bug2267_4() -#begin -# show create function fac; -#end| -# -#--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' -#call bug2267_1()| -#--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' -#call bug2267_2()| -#call bug2267_3()| -#call bug2267_4()| -# -#drop procedure bug2267_1| -#drop procedure bug2267_2| -#drop procedure bug2267_3| -#drop procedure bug2267_4| +--disable_parsing +--disable_warnings +drop procedure if exists bug2267_1| +--enable_warnings +create procedure bug2267_1() +begin + show procedure status; +end| + +--disable_warnings +drop procedure if exists bug2267_2| +--enable_warnings +create procedure bug2267_2() +begin + show function status; +end| + +--disable_warnings +drop procedure if exists bug2267_3| +--enable_warnings +create procedure bug2267_3() +begin + show create procedure bug2267_1; +end| + +--disable_warnings +drop procedure if exists bug2267_4| +--enable_warnings +create procedure bug2267_4() +begin + show create function fac; +end| + +--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' +call bug2267_1()| +--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00' +call bug2267_2()| +call bug2267_3()| +call bug2267_4()| + +drop procedure bug2267_1| +drop procedure bug2267_2| +drop procedure bug2267_3| +drop procedure bug2267_4| +--enable_parsing # # BUG#2227 @@ -1901,23 +1908,25 @@ drop procedure bug2227| # QQ For this reason we can't run this test any more (i.e., if we modify # QQ it, it's no longer a test case for the bug), but we keep it here # QQ anyway, for tracability. -#--disable_warnings -#drop procedure if exists bug2614| -#--enable_warnings -#create procedure bug2614() -#begin -# drop temporary table if exists t3; -# create temporary table t3 (id int default '0' not null); -# insert into t3 select 12; -# insert into t3 select * from t3; -#end| -# -#--disable_warnings -#call bug2614()| -#--enable_warnings -#call bug2614()| -#drop temporary table t3| -#drop procedure bug2614| +--disable_parsing +--disable_warnings +drop procedure if exists bug2614| +--enable_warnings +create procedure bug2614() +begin + drop temporary table if exists t3; + create temporary table t3 (id int default '0' not null); + insert into t3 select 12; + insert into t3 select * from t3; +end| + +--disable_warnings +call bug2614()| +--enable_warnings +call bug2614()| +drop temporary table t3| +drop procedure bug2614| +--enable_parsing # # BUG#2674 @@ -2508,27 +2517,29 @@ drop table t3| # BUG#4318 # #QQ Don't know if HANDLER commands can work with SPs, or at all... -#--disable_warnings -#drop table if exists t3| -#--enable_warnings -# -#create table t3 (s1 int)| -#insert into t3 values (3), (4)| -# -#--disable_warnings -#drop procedure if exists bug4318| -#--enable_warnings -#create procedure bug4318() -# handler t3 read next| -# -#handler t3 open| -## Expect no results, as tables are closed, but there shouldn't be any errors -#call bug4318()| -#call bug4318()| -#handler t3 close| -# -#drop procedure bug4318| -#drop table t3| +--disable_parsing +--disable_warnings +drop table if exists t3| +--enable_warnings + +create table t3 (s1 int)| +insert into t3 values (3), (4)| + +--disable_warnings +drop procedure if exists bug4318| +--enable_warnings +create procedure bug4318() + handler t3 read next| + +handler t3 open| +# Expect no results, as tables are closed, but there shouldn't be any errors +call bug4318()| +call bug4318()| +handler t3 close| + +drop procedure bug4318| +drop table t3| +--enable_parsing # # BUG#4902: Stored procedure with SHOW WARNINGS leads to packet error @@ -2563,11 +2574,13 @@ begin show variables like 'foo'; show warnings; end| -#show binlog events; -#show storage engines; -#show master status; -#show slave hosts; -#show slave status; +--disable_parsing +show binlog events; +show storage engines; +show master status; +show slave hosts; +show slave status; +--enable_parsing call bug4902()| call bug4902()| @@ -3912,7 +3925,6 @@ drop table t3| #--enable_warnings #create procedure bugNNNN... - # Add bugs above this line. Use existing tables t1 and t2 when # practical, or create table t3, t4 etc temporarily (and drop them). delimiter ;| diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 1dae1812347..f606d80e317 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -413,8 +413,9 @@ set @@global.error_count=1; # Bug #10351: Setting max_heap_table_size to 4G fails # set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; +select @@max_heap_table_size > 0; set global max_heap_table_size= 4294967296; -select @@max_heap_table_size; +select @@max_heap_table_size > 0; set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; +select @@max_heap_table_size > 0; + diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 5454b3409da..b278383ecef 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -147,10 +147,11 @@ insert into t1 values (1), (2), (3); create view v1 (a) as select a+1 from t1; create view v2 (a) as select a-1 from t1; -# WL #2486 should enable these tests -#select * from t1 natural left join v1; -#select * from v2 natural left join t1; -#select * from v2 natural left join v1; +--disable_parsing WL #2486 should enable these tests +select * from t1 natural left join v1; +select * from v2 natural left join t1; +select * from v2 natural left join v1; +--enable_parsing drop view v1, v2; drop table t1; diff --git a/mysys/my_init.c b/mysys/my_init.c index bee485c3bed..410cb2e7ee7 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -96,7 +96,7 @@ my_bool my_init(void) #endif { DBUG_ENTER("my_init"); - DBUG_PROCESS(my_progname ? my_progname : (char*) "unknown"); + DBUG_PROCESS((char*) (my_progname ? my_progname : "unknown")); if (!home_dir) { /* Don't initialize twice */ my_win_init(); diff --git a/mysys/my_static.c b/mysys/my_static.c index 8207463ea50..8448afdc158 100644 --- a/mysys/my_static.c +++ b/mysys/my_static.c @@ -28,7 +28,8 @@ my_bool timed_mutexes= 0; /* from my_init */ -my_string home_dir=0,my_progname=0; +my_string home_dir=0; +const char *my_progname=0; char NEAR curr_dir[FN_REFLEN]= {0}, NEAR home_dir_buff[FN_REFLEN]= {0}; ulong my_stream_opened=0,my_file_opened=0, my_tmp_file_created=0; diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 1a47a061b97..c076e8934ad 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -509,7 +509,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner, (*lock->read.last)=data; /* Add to running FIFO */ data->prev=lock->read.last; lock->read.last= &data->next; - if ((int) lock_type == (int) TL_READ_NO_INSERT) + if (lock_type == TL_READ_NO_INSERT) lock->read_no_write_count++; check_locks(lock,"read lock with old write lock",0); if (lock->get_status) @@ -535,14 +535,14 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner, lock->read.last= &data->next; if (lock->get_status) (*lock->get_status)(data->status_param, 0); - if ((int) lock_type == (int) TL_READ_NO_INSERT) + if (lock_type == TL_READ_NO_INSERT) lock->read_no_write_count++; check_locks(lock,"read lock with no write locks",0); statistic_increment(locks_immediate,&THR_LOCK_lock); goto end; } /* - We're here if there is an active write lock or no write + We're here if there is an active write lock or no write lock but a high priority write waiting in the write_wait queue. In the latter case we should yield the lock to the writer. */ diff --git a/sql-common/my_time.c b/sql-common/my_time.c index c00c0e7be83..ed02021011b 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -60,11 +60,11 @@ uint calc_days_in_year(uint year) SYNOPSIS check_date() - ltime - Date to check. - not_zero_date - ltime is not the zero date - flags - flags to check - was_cut - set to whether the value was truncated - + ltime Date to check. + not_zero_date ltime is not the zero date + flags flags to check + was_cut set to 2 if value was truncated. + NOTE: This is not touched if value was not truncated NOTES Here we assume that year and month is ok ! If month is 0 we allow any date. (This only happens if we allow zero @@ -75,10 +75,9 @@ uint calc_days_in_year(uint year) 1 error */ -bool check_date(const MYSQL_TIME *ltime, bool not_zero_date, ulong flags, - int *was_cut) +static my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, + ulong flags, int *was_cut) { - if (not_zero_date) { if ((((flags & TIME_NO_ZERO_IN_DATE) || !(flags & TIME_FUZZY_DATE)) && @@ -165,11 +164,11 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, uint date[MAX_DATE_PARTS], date_len[MAX_DATE_PARTS]; uint add_hours= 0, start_loop; ulong not_zero_date, allow_space; - bool is_internal_format; + my_bool is_internal_format; const char *pos, *last_field_pos; const char *end=str+length; const uchar *format_position; - bool found_delimitier= 0, found_space= 0; + my_bool found_delimitier= 0, found_space= 0; uint frac_pos, frac_len; DBUG_ENTER("str_to_datetime"); DBUG_PRINT("ENTER",("str: %.*s",length,str)); @@ -472,12 +471,12 @@ err: 1 error */ -bool str_to_time(const char *str, uint length, MYSQL_TIME *l_time, - int *was_cut) +my_bool str_to_time(const char *str, uint length, MYSQL_TIME *l_time, + int *was_cut) { long date[5],value; const char *end=str+length, *end_of_days; - bool found_days,found_hours; + my_bool found_days,found_hours; uint state; l_time->neg=0; @@ -644,7 +643,7 @@ void init_time(void) time_t seconds; struct tm *l_time,tm_tmp; MYSQL_TIME my_time; - bool not_used; + my_bool not_used; seconds= (time_t) time((time_t*) 0); localtime_r(&seconds,&tm_tmp); @@ -710,7 +709,8 @@ long calc_daynr(uint year,uint month,uint day) Time in UTC seconds since Unix Epoch representation. */ my_time_t -my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) +my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, + my_bool *in_dst_time_gap) { uint loop; time_t tmp; @@ -961,11 +961,10 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, return nr; /* Don't want to have was_cut get set if NO_ZERO_DATE was violated. */ - if (!nr && flags & TIME_NO_ZERO_DATE) + if (!nr && (flags & TIME_NO_ZERO_DATE)) return LL(-1); err: - *was_cut= 1; return LL(-1); } diff --git a/sql/field.cc b/sql/field.cc index 61c0a71b742..224b6c279f3 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4468,7 +4468,7 @@ int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs) my_time_t tmp= 0; int error; bool have_smth_to_conv; - bool in_dst_time_gap; + my_bool in_dst_time_gap; THD *thd= table->in_use; /* We don't want to store invalid or fuzzy datetime values in TIMESTAMP */ @@ -4539,14 +4539,14 @@ int Field_timestamp::store(longlong nr) TIME l_time; my_time_t timestamp= 0; int error; - bool in_dst_time_gap; + my_bool in_dst_time_gap; THD *thd= table->in_use; /* We don't want to store invalid or fuzzy datetime values in TIMESTAMP */ longlong tmp= number_to_datetime(nr, &l_time, (thd->variables.sql_mode & MODE_NO_ZERO_DATE) | MODE_NO_ZERO_IN_DATE, &error); - if (tmp < 0) + if (tmp == LL(-1)) { error= 2; } @@ -5215,7 +5215,7 @@ int Field_date::store(longlong nr) MODE_NO_ZERO_DATE | MODE_INVALID_DATES))), &error); - if (nr < 0) + if (nr == LL(-1)) { nr= 0; error= 2; @@ -5391,12 +5391,12 @@ int Field_newdate::store(longlong nr) TIME l_time; longlong tmp; int error; - if ((tmp= number_to_datetime(nr, &l_time, - (TIME_FUZZY_DATE | - (table->in_use->variables.sql_mode & - (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE | - MODE_INVALID_DATES))), - &error) < 0)) + if (number_to_datetime(nr, &l_time, + (TIME_FUZZY_DATE | + (table->in_use->variables.sql_mode & + (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE | + MODE_INVALID_DATES))), + &error) == LL(-1)) { tmp= 0L; error= 2; @@ -5593,7 +5593,7 @@ int Field_datetime::store(longlong nr) MODE_NO_ZERO_DATE | MODE_INVALID_DATES))), &error); - if (nr < 0) + if (nr == LL(-1)) { nr= 0; error= 2; diff --git a/sql/item.h b/sql/item.h index d3e920faa68..f0ffb160553 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1150,8 +1150,7 @@ class Item_uint :public Item_int { public: Item_uint(const char *str_arg, uint length); - Item_uint(uint32 i) :Item_int((ulonglong) i, 10) {} - Item_uint(ulong i) :Item_int((ulonglong) i, 10) {} + Item_uint(ulonglong i) :Item_int((ulonglong) i, 10) {} Item_uint(const char *str_arg, longlong i, uint length); double val_real() { DBUG_ASSERT(fixed == 1); return ulonglong2double((ulonglong)value); } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index aa377d0bdd8..a6fbbee6f23 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1070,7 +1070,7 @@ longlong Item_func_year::val_int() longlong Item_func_unix_timestamp::val_int() { TIME ltime; - bool not_used; + my_bool not_used; DBUG_ASSERT(fixed == 1); if (arg_count == 0) @@ -1798,7 +1798,6 @@ bool Item_func_convert_tz::get_date(TIME *ltime, uint fuzzy_date __attribute__((unused))) { my_time_t my_time_tmp; - bool not_used; String str; if (!from_tz_cached) @@ -1824,6 +1823,7 @@ bool Item_func_convert_tz::get_date(TIME *ltime, ltime->year==TIMESTAMP_MAX_YEAR && ltime->month==1 && ltime->day==1 || ltime->year==TIMESTAMP_MIN_YEAR && ltime->month==12 && ltime->day==31) { + my_bool not_used; my_time_tmp= from_tz->TIME_to_gmt_sec(ltime, ¬_used); if (my_time_tmp >= TIMESTAMP_MIN_VALUE && my_time_tmp <= TIMESTAMP_MAX_VALUE) to_tz->gmt_sec_to_TIME(ltime, my_time_tmp); diff --git a/sql/log.cc b/sql/log.cc index 540e482f578..5ad8ec818ef 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -58,7 +58,11 @@ static handlerton binlog_hton = { binlog_prepare, NULL, /* recover */ NULL, /* commit_by_xid */ - NULL /* rollback_by_xid */ + NULL, /* rollback_by_xid */ + NULL, /* create_cursor_read_view */ + NULL, /* set_cursor_read_view */ + NULL, /* close_cursor_read_view */ + HTON_NO_FLAGS }; /* diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index cafb15971b5..2190c4a1b24 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -823,8 +823,6 @@ bool mysqld_show_column_types(THD *thd); bool mysqld_help (THD *thd, const char *text); void calc_sum_of_all_status(STATUS_VAR *to); - - /* information schema */ extern LEX_STRING information_schema_name; LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str, @@ -952,6 +950,7 @@ bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db, const char *table_name); void remove_db_from_cache(const char *db); void flush_tables(); +bool is_equal(const LEX_STRING *a, const LEX_STRING *b); /* bits for last argument to remove_table_from_cache() */ #define RTFC_NO_FLAG 0x0000 @@ -1191,6 +1190,7 @@ extern TABLE *unused_tables; extern I_List binlog_do_db, binlog_ignore_db; extern const char* any_db; extern struct my_option my_long_options[]; +extern const LEX_STRING view_type; /* optional things, have_* variables */ @@ -1273,7 +1273,7 @@ ulong convert_period_to_month(ulong period); ulong convert_month_to_period(ulong month); void get_date_from_daynr(long daynr,uint *year, uint *month, uint *day); -my_time_t TIME_to_timestamp(THD *thd, const TIME *t, bool *not_exist); +my_time_t TIME_to_timestamp(THD *thd, const TIME *t, my_bool *not_exist); bool str_to_time_with_warn(const char *str,uint length,TIME *l_time); timestamp_type str_to_datetime_with_warn(const char *str, uint length, TIME *l_time, uint flags); diff --git a/sql/set_var.cc b/sql/set_var.cc index 5cdd4081614..68bd9654df0 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1426,6 +1426,12 @@ bool sys_var_thd_ulong::update(THD *thd, set_var *var) if ((ulong) tmp > max_system_variables.*offset) tmp= max_system_variables.*offset; +#if SIZEOF_LONG == 4 + /* Avoid overflows on 32 bit systems */ + if (tmp > (ulonglong) ~(ulong) 0) + tmp= ((ulonglong) ~(ulong) 0); +#endif + if (option_limits) tmp= (ulong) getopt_ull_limit_value(tmp, option_limits); if (var->type == OPT_GLOBAL) @@ -1679,7 +1685,7 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base) pthread_mutex_lock(&LOCK_global_system_variables); value= *(uint*) value_ptr(thd, var_type, base); pthread_mutex_unlock(&LOCK_global_system_variables); - return new Item_uint((uint32) value); + return new Item_uint((ulonglong) value); } case SHOW_LONG: { @@ -1687,7 +1693,7 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base) pthread_mutex_lock(&LOCK_global_system_variables); value= *(ulong*) value_ptr(thd, var_type, base); pthread_mutex_unlock(&LOCK_global_system_variables); - return new Item_uint(value); + return new Item_uint((ulonglong) value); } case SHOW_LONGLONG: { diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 45b99bfee1b..b79748c18e2 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4258,7 +4258,7 @@ open_new_frm(const char *path, const char *alias, if ((parser= sql_parse_prepare(&pathstr, mem_root, 1))) { - if (!strncmp("VIEW", parser->type()->str, parser->type()->length)) + if (is_equal(&view_type, parser->type())) { if (table_desc == 0 || table_desc->required_type == FRMTYPE_TABLE) { @@ -4281,3 +4281,9 @@ err: bzero(outparam, sizeof(TABLE)); // do not run repair DBUG_RETURN(1); } + + +bool is_equal(const LEX_STRING *a, const LEX_STRING *b) +{ + return a->length == b->length && !strncmp(a->str, b->str, a->length); +} diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 89d5b543dfc..512c6bd71d4 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -523,6 +523,10 @@ bool THD::store_globals() if this is the slave SQL thread. */ variables.pseudo_thread_id= thread_id; + /* + We have to call thr_lock_info_init() again here as THD may have been + created in another thread + */ thr_lock_info_init(&lock_info); return 0; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8aced3c1da6..000fa0790b7 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1762,7 +1762,7 @@ Cursor::init_from_thd(THD *thd) for (handlerton **pht= thd->transaction.stmt.ht; *pht; pht++) { const handlerton *ht= *pht; - close_at_commit|= (ht->flags & HTON_CLOSE_CURSORS_AT_COMMIT); + close_at_commit|= test(ht->flags & HTON_CLOSE_CURSORS_AT_COMMIT); if (ht->create_cursor_read_view) { info->ht= ht; @@ -8033,11 +8033,13 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, bool table_cant_handle_bit_fields, uint convert_blob_length) { - Item *org_item= item; - if (item->real_item()->type() == Item::FIELD_ITEM) + if (type != Item::FIELD_ITEM && + item->real_item()->type() == Item::FIELD_ITEM && + (item->type() != Item::REF_ITEM || + !((Item_ref *) item)->depended_from)) { item= item->real_item(); - type= item->type(); + type= Item::FIELD_ITEM; } switch (type) { case Item::SUM_FUNC_ITEM: @@ -8051,23 +8053,18 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, case Item::FIELD_ITEM: case Item::DEFAULT_VALUE_ITEM: { - if (org_item->type() != Item::REF_ITEM || - !((Item_ref *)org_item)->depended_from) - { - Item_field *field= (Item_field*) item; - if (table_cant_handle_bit_fields && - field->field->type() == FIELD_TYPE_BIT) - return create_tmp_field_from_item(thd, item, table, copy_func, - modify_item, convert_blob_length); - return create_tmp_field_from_field(thd, (*from_field= field->field), - item->name, table, - modify_item ? (Item_field*) item : - NULL, - convert_blob_length); - } - else - item= org_item; + Item_field *field= (Item_field*) item; + if (table_cant_handle_bit_fields && + field->field->type() == FIELD_TYPE_BIT) + return create_tmp_field_from_item(thd, item, table, copy_func, + modify_item, convert_blob_length); + return create_tmp_field_from_field(thd, (*from_field= field->field), + item->name, table, + modify_item ? (Item_field*) item : + NULL, + convert_blob_length); } + /* Fall through */ case Item::FUNC_ITEM: case Item::COND_ITEM: case Item::FIELD_AVG_ITEM: @@ -10910,13 +10907,13 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, usable_keys.set_all(); for (ORDER *tmp_order=order; tmp_order ; tmp_order=tmp_order->next) { - if ((*tmp_order->item)->real_item()->type() != Item::FIELD_ITEM) + Item *item= (*tmp_order->item)->real_item(); + if (item->type() != Item::FIELD_ITEM) { usable_keys.clear_all(); DBUG_RETURN(0); } - usable_keys.intersect(((Item_field*) (*tmp_order->item)->real_item())-> - field->part_of_sortkey); + usable_keys.intersect(((Item_field*) item)->field->part_of_sortkey); if (usable_keys.is_clear_all()) DBUG_RETURN(0); // No usable keys } diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 976fac3d9c9..34bd0eababe 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -226,7 +226,7 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables) /* Trigger must be in the same schema as target table. */ - if (my_strcasecmp(system_charset_info, table->s->db, + if (my_strcasecmp(table_alias_charset, table->s->db, lex->spname->m_db.str ? lex->spname->m_db.str : thd->db)) { @@ -396,7 +396,7 @@ bool Table_triggers_list::drop_trigger(THD *thd, TABLE_LIST *tables) { it_def++; - if (my_strcasecmp(system_charset_info, lex->spname->m_name.str, + if (my_strcasecmp(table_alias_charset, lex->spname->m_name.str, name->str) == 0) { /* @@ -541,8 +541,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, if ((parser= sql_parse_prepare(&path, &table->mem_root, 1))) { - if (!strncmp(triggers_file_type.str, parser->type()->str, - parser->type()->length)) + if (is_equal(&triggers_file_type, parser->type())) { Table_triggers_list *triggers= new (&table->mem_root) Table_triggers_list(table); @@ -601,7 +600,8 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, triggers->bodies[lex.trg_chistics.event] [lex.trg_chistics.action_time]= lex.sphead; - if (triggers->names_list.push_back(&lex.sphead->m_name, &table->mem_root)) + if (triggers->names_list.push_back(&lex.sphead->m_name, + &table->mem_root)) goto err_with_lex_cleanup; if (names_only) @@ -615,8 +615,9 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, in old/new versions of row in trigger to Field objects in table being opened. - We ignore errors here, because if even something is wrong we still will - be willing to open table to perform some operations (e.g. SELECT)... + We ignore errors here, because if even something is wrong we still + will be willing to open table to perform some operations + (e.g. SELECT)... Anyway some things can be checked only during trigger execution. */ for (Item_trigger_field *trg_field= @@ -647,7 +648,7 @@ err_with_lex_cleanup: be merged into .FRM anyway. */ my_error(ER_WRONG_OBJECT, MYF(0), - table_name, triggers_file_ext, "TRIGGER"); + table_name, triggers_file_ext+1, "TRIGGER"); DBUG_RETURN(1); } @@ -726,10 +727,9 @@ static TABLE_LIST *add_table_for_trigger(THD *thd, sp_name *trig) if (!(parser= sql_parse_prepare(&path, thd->mem_root, 1))) DBUG_RETURN(0); - if (strncmp(trigname_file_type.str, parser->type()->str, - parser->type()->length)) + if (!is_equal(&trigname_file_type, parser->type())) { - my_error(ER_WRONG_OBJECT, MYF(0), trig->m_name.str, trigname_file_ext, + my_error(ER_WRONG_OBJECT, MYF(0), trig->m_name.str, trigname_file_ext+1, "TRIGGERNAME"); DBUG_RETURN(0); } diff --git a/sql/sql_view.cc b/sql/sql_view.cc index a60bf80a6d8..c7f2047aac6 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -24,6 +24,8 @@ #define MD5_BUFF_LENGTH 33 +const LEX_STRING view_type= { (char*) STRING_WITH_LEN("VIEW") }; + static int mysql_register_view(THD *thd, TABLE_LIST *view, enum_view_create_mode mode); @@ -431,7 +433,7 @@ static File_option view_parameters[]= FILE_OPTIONS_STRING} }; -static LEX_STRING view_file_type[]= {{(char*)"VIEW", 4}}; +static LEX_STRING view_file_type[]= {{(char*) STRING_WITH_LEN("VIEW") }}; /* @@ -470,7 +472,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, thd->variables.sql_mode|= sql_mode; } str.append('\0'); - DBUG_PRINT("VIEW", ("View: %s", str.ptr())); + DBUG_PRINT("info", ("View: %s", str.ptr())); /* print file name */ (void) my_snprintf(dir_buff, FN_REFLEN, "%s/%s/", @@ -507,8 +509,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, if (!(parser= sql_parse_prepare(&path, thd->mem_root, 0))) DBUG_RETURN(1); - if (!parser->ok() || - strncmp("VIEW", parser->type()->str, parser->type()->length)) + if (!parser->ok() || !is_equal(&view_type, parser->type())) { my_error(ER_WRONG_OBJECT, MYF(0), (view->db ? view->db : thd->db), view->table_name, "VIEW"); diff --git a/sql/time.cc b/sql/time.cc index a3ec2283860..5069031081d 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -223,7 +223,7 @@ str_to_datetime_with_warn(const char *str, uint length, TIME *l_time, 0 - t contains datetime value which is out of TIMESTAMP range. */ -my_time_t TIME_to_timestamp(THD *thd, const TIME *t, bool *in_dst_time_gap) +my_time_t TIME_to_timestamp(THD *thd, const TIME *t, my_bool *in_dst_time_gap) { my_time_t timestamp; diff --git a/sql/tztime.cc b/sql/tztime.cc index f5111459da2..5a907f0d170 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -880,12 +880,12 @@ sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec) 0 in case of error. */ static my_time_t -TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, bool *in_dst_time_gap) +TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, + my_bool *in_dst_time_gap) { my_time_t local_t; uint saved_seconds; uint i; - DBUG_ENTER("TIME_to_gmt_sec"); /* We need this for correct leap seconds handling */ @@ -962,7 +962,7 @@ class Time_zone_system : public Time_zone { public: virtual my_time_t TIME_to_gmt_sec(const TIME *t, - bool *in_dst_time_gap) const; + my_bool *in_dst_time_gap) const; virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; virtual const String * get_name() const; }; @@ -994,7 +994,7 @@ public: Corresponding my_time_t value or 0 in case of error */ my_time_t -Time_zone_system::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const +Time_zone_system::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const { long not_used; return my_system_gmt_sec(t, ¬_used, in_dst_time_gap); @@ -1055,7 +1055,7 @@ class Time_zone_utc : public Time_zone { public: virtual my_time_t TIME_to_gmt_sec(const TIME *t, - bool *in_dst_time_gap) const; + my_bool *in_dst_time_gap) const; virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; virtual const String * get_name() const; }; @@ -1081,7 +1081,7 @@ public: 0 */ my_time_t -Time_zone_utc::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const +Time_zone_utc::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const { /* Should be never called */ DBUG_ASSERT(0); @@ -1144,7 +1144,7 @@ class Time_zone_db : public Time_zone public: Time_zone_db(TIME_ZONE_INFO *tz_info_arg, const String * tz_name_arg); virtual my_time_t TIME_to_gmt_sec(const TIME *t, - bool *in_dst_time_gap) const; + my_bool *in_dst_time_gap) const; virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; virtual const String * get_name() const; private: @@ -1193,7 +1193,7 @@ Time_zone_db::Time_zone_db(TIME_ZONE_INFO *tz_info_arg, Corresponding my_time_t value or 0 in case of error */ my_time_t -Time_zone_db::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const +Time_zone_db::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const { return ::TIME_to_gmt_sec(t, tz_info, in_dst_time_gap); } @@ -1240,7 +1240,7 @@ class Time_zone_offset : public Time_zone public: Time_zone_offset(long tz_offset_arg); virtual my_time_t TIME_to_gmt_sec(const TIME *t, - bool *in_dst_time_gap) const; + my_bool *in_dst_time_gap) const; virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; virtual const String * get_name() const; /* @@ -1292,7 +1292,7 @@ Time_zone_offset::Time_zone_offset(long tz_offset_arg): Corresponding my_time_t value or 0 in case of error */ my_time_t -Time_zone_offset::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const +Time_zone_offset::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const { return sec_since_epoch(t->year, t->month, t->day, t->hour, t->minute, t->second) - @@ -2549,8 +2549,6 @@ main(int argc, char **argv) time_t t, t1, t2; char fullname[FN_REFLEN+1]; char *str_end; - long not_used; - bool not_used_2; MEM_ROOT tz_storage; MY_INIT(argv[0]); @@ -2660,14 +2658,21 @@ main(int argc, char **argv) dates. */ for (time_tmp.year= 1980; time_tmp.year < 2010; time_tmp.year++) + { for (time_tmp.month= 1; time_tmp.month < 13; time_tmp.month++) + { for (time_tmp.day= 1; time_tmp.day < mon_lengths[isleap(time_tmp.year)][time_tmp.month-1]; time_tmp.day++) + { for (time_tmp.hour= 0; time_tmp.hour < 24; time_tmp.hour++) + { for (time_tmp.minute= 0; time_tmp.minute < 60; time_tmp.minute+= 5) + { for (time_tmp.second=0; time_tmp.second<60; time_tmp.second+=25) { + long not_used; + my_bool not_used_2; t= (time_t)my_system_gmt_sec(&time_tmp, ¬_used, ¬_used_2); t1= (time_t)TIME_to_gmt_sec(&time_tmp, &tz_info, ¬_used_2); if (t != t1) @@ -2699,6 +2704,11 @@ main(int argc, char **argv) return 1; } } + } + } + } + } + } printf("TIME_to_gmt_sec = my_system_gmt_sec for test range\n"); diff --git a/sql/tztime.h b/sql/tztime.h index cbf359e8961..a168fe4fb73 100644 --- a/sql/tztime.h +++ b/sql/tztime.h @@ -37,7 +37,7 @@ public: falls into spring time-gap (or lefts it untouched otherwise). */ virtual my_time_t TIME_to_gmt_sec(const TIME *t, - bool *in_dst_time_gap) const = 0; + my_bool *in_dst_time_gap) const = 0; /* Converts time in my_time_t representation to local time in broken down TIME representation. From 846277d899955acee595688ea1108a317cf205b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 31 Jul 2005 04:28:01 -0700 Subject: [PATCH 092/144] null_key.result, null_key.test: Modified test case for bug #12144. mysql-test/t/null_key.test: Modified test case for bug #12144. mysql-test/r/null_key.result: Modified test case for bug #12144. --- mysql-test/r/null_key.result | 6 +++--- mysql-test/t/null_key.test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index 516894edb88..36d3e005828 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -412,6 +412,9 @@ a a b b 2 NULL NULL NULL 3 3 1 NULL 4 NULL NULL NULL +SELECT FOUND_ROWS(); +FOUND_ROWS() +4 SHOW STATUS LIKE "handler_read%"; Variable_name Value Handler_read_first 0 @@ -420,7 +423,4 @@ Handler_read_next 2 Handler_read_prev 0 Handler_read_rnd 0 Handler_read_rnd_next 5 -SELECT FOUND_ROWS(); -FOUND_ROWS() -4 DROP TABLE t1,t2,t3,t4; diff --git a/mysql-test/t/null_key.test b/mysql-test/t/null_key.test index bd37a031745..a43916d6397 100644 --- a/mysql-test/t/null_key.test +++ b/mysql-test/t/null_key.test @@ -233,8 +233,8 @@ EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a FLUSH STATUS ; SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b; -SHOW STATUS LIKE "handler_read%"; SELECT FOUND_ROWS(); +SHOW STATUS LIKE "handler_read%"; DROP TABLE t1,t2,t3,t4; # End of 4.1 tests From 35fd6415062743163b8a0e81e7f6a515c0f2bc93 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 31 Jul 2005 21:33:46 +0200 Subject: [PATCH 093/144] Fix for bug#12021 --- mysql-test/r/ndb_condition_pushdown.result | 2 +- mysql-test/t/disabled.def | 2 +- sql/ha_ndbcluster.cc | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result index 14cd4666528..1c3da1b486f 100644 --- a/mysql-test/r/ndb_condition_pushdown.result +++ b/mysql-test/r/ndb_condition_pushdown.result @@ -1514,7 +1514,7 @@ select auto from t1 where '1901-01-01 01:01:01' in(date_time) order by auto; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort +1 SIMPLE t1 ref medium_index medium_index 3 const 10 Using where with pushed condition; Using filesort select auto from t1 where "aaaa" in(string) and "aaaa" in(vstring) and diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 7d397ff2112..60543fe55f9 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -11,4 +11,4 @@ ############################################################################## sp-goto:GOTO is currently is disabled - will be fixed in the future -ndb_condition_pushdown:Bug #12021 + diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 9e6725178d5..76e14b3d8fe 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -6350,12 +6350,14 @@ void ndb_serialize_cond(const Item *item, void *arg) // result type if (context->expecting(Item::FIELD_ITEM) && (context->expecting_field_result(field->result_type()) || - // Date and year can be written as strings + // Date and year can be written as string or int ((type == MYSQL_TYPE_TIME || type == MYSQL_TYPE_DATE || type == MYSQL_TYPE_YEAR || type == MYSQL_TYPE_DATETIME) - ? context->expecting_field_result(STRING_RESULT) : true)) && + ? (context->expecting_field_result(STRING_RESULT) || + context->expecting_field_result(INT_RESULT)) + : true)) && // Bit fields no yet supported in scan filter type != MYSQL_TYPE_BIT) { @@ -6423,8 +6425,8 @@ void ndb_serialize_cond(const Item *item, void *arg) } else { - DBUG_PRINT("info", ("Was not expecting field of type %u", - field->result_type())); + DBUG_PRINT("info", ("Was not expecting field of type %u(%u)", + field->result_type(), type)); context->supported= FALSE; } } From a560a9f3b3452b0c7960af86d85da1f5a9b5df21 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 31 Jul 2005 22:56:24 +0300 Subject: [PATCH 094/144] After merge fixes Review of new pushed code client/mysqlbinlog.cc: After merge fixes sql/set_var.cc: After merge fixes sql/sql_select.cc: Removed not needed test (field->maybe_null() also tests field->table->maybe_null) --- client/mysqlbinlog.cc | 2 +- sql/set_var.cc | 18 ++++++++---------- sql/sql_select.cc | 8 +++----- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 1a628bd08c7..d074fa19122 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -805,7 +805,7 @@ static my_time_t convert_str_to_timestamp(const char* str) int was_cut; MYSQL_TIME l_time; long dummy_my_timezone; - bool dummy_in_dst_time_gap; + my_bool dummy_in_dst_time_gap; /* We require a total specification (date AND time) */ if (str_to_datetime(str, strlen(str), &l_time, 0, &was_cut) != MYSQL_TIMESTAMP_DATETIME || was_cut) diff --git a/sql/set_var.cc b/sql/set_var.cc index 92948ea0ff6..ff37c46349d 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1422,12 +1422,6 @@ bool sys_var_thd_ulong::update(THD *thd, set_var *var) { ulonglong tmp= var->save_result.ulonglong_value; -#if SIZEOF_LONG != SIZEOF_LONGLONG - /* Avoid overflow on 32-bit platforms. */ - if (tmp > ULONG_MAX) - tmp= ULONG_MAX; -#endif - /* Don't use bigger value than given with --maximum-variable-name=.. */ if ((ulong) tmp > max_system_variables.*offset) tmp= max_system_variables.*offset; @@ -3225,6 +3219,7 @@ byte *sys_var_thd_sql_mode::symbolic_mode_representation(THD *thd, ulong val, { char buff[256]; String tmp(buff, sizeof(buff), &my_charset_latin1); + ulong length; tmp.length(0); for (uint i= 0; val; val>>= 1, i++) @@ -3236,12 +3231,14 @@ byte *sys_var_thd_sql_mode::symbolic_mode_representation(THD *thd, ulong val, tmp.append(','); } } - if (tmp.length()) - tmp.length(tmp.length() - 1); - *len= tmp.length(); - return (byte*) thd->strmake(tmp.ptr(), tmp.length()); + + if ((length= tmp.length())) + length--; + *len= length; + return (byte*) thd->strmake(tmp.ptr(), length); } + byte *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) { @@ -3260,6 +3257,7 @@ void sys_var_thd_sql_mode::set_default(THD *thd, enum_var_type type) thd->variables.*offset= global_system_variables.*offset; } + void fix_sql_mode_var(THD *thd, enum_var_type type) { if (type == OPT_GLOBAL) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index bd22f6bcc2a..5c0ab06935b 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2757,11 +2757,9 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond, We use null_rejecting in add_not_null_conds() to add 'othertbl.field IS NOT NULL' to tab->select_cond. */ - (*key_fields)->null_rejecting= (cond->functype() == Item_func::EQ_FUNC) && - ((*value)->type() == Item::FIELD_ITEM) && - - (((Item_field*)*value)->field->maybe_null() || - ((Item_field *)*value)->field->table->maybe_null); + (*key_fields)->null_rejecting= ((cond->functype() == Item_func::EQ_FUNC) && + ((*value)->type() == Item::FIELD_ITEM) && + ((Item_field*)*value)->field->maybe_null()); (*key_fields)++; } From 7478e9df63275395fb7c932f25b474cf229dc874 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Aug 2005 11:50:43 +0200 Subject: [PATCH 095/144] Fixed handling of NOT LIKE after Item_func::NOTLIKE_FUNC has been removed --- sql/ha_ndbcluster.cc | 47 +++++++++++++++++------- sql/ha_ndbcluster.h | 87 +++++++++++++++++++++++++++++++++----------- 2 files changed, 99 insertions(+), 35 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 86325c2fd45..922a7be9921 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -7010,7 +7010,7 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond, switch ((negated) ? Ndb_item::negate(cond->ndb_item->qualification.function_type) : cond->ndb_item->qualification.function_type) { - case Item_func::EQ_FUNC: + case NDB_EQ_FUNC: { if (!value || !field) break; // Save value in right format for the field type @@ -7024,7 +7024,7 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond, cond= cond->next->next->next; DBUG_RETURN(0); } - case Item_func::NE_FUNC: + case NDB_NE_FUNC: { if (!value || !field) break; // Save value in right format for the field type @@ -7038,7 +7038,7 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond, cond= cond->next->next->next; DBUG_RETURN(0); } - case Item_func::LT_FUNC: + case NDB_LT_FUNC: { if (!value || !field) break; // Save value in right format for the field type @@ -7064,7 +7064,7 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond, cond= cond->next->next->next; DBUG_RETURN(0); } - case Item_func::LE_FUNC: + case NDB_LE_FUNC: { if (!value || !field) break; // Save value in right format for the field type @@ -7090,7 +7090,7 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond, cond= cond->next->next->next; DBUG_RETURN(0); } - case Item_func::GE_FUNC: + case NDB_GE_FUNC: { if (!value || !field) break; // Save value in right format for the field type @@ -7116,7 +7116,7 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond, cond= cond->next->next->next; DBUG_RETURN(0); } - case Item_func::GT_FUNC: + case NDB_GT_FUNC: { if (!value || !field) break; // Save value in right format for the field type @@ -7142,7 +7142,7 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond, cond= cond->next->next->next; DBUG_RETURN(0); } - case Item_func::LIKE_FUNC: + case NDB_LIKE_FUNC: { if (!value || !field) break; if ((value->qualification.value_type != Item::STRING_ITEM) && @@ -7161,7 +7161,26 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond, cond= cond->next->next->next; DBUG_RETURN(0); } - case Item_func::ISNULL_FUNC: + case NDB_NOTLIKE_FUNC: + { + if (!value || !field) break; + if ((value->qualification.value_type != Item::STRING_ITEM) && + (value->qualification.value_type != Item::VARBIN_ITEM)) + break; + // Save value in right format for the field type + value->save_in_field(field); + DBUG_PRINT("info", ("Generating NOTLIKE filter: notlike(%d,%s,%d)", + field->get_field_no(), value->get_val(), + value->pack_length())); + if (filter->cmp(NdbScanFilter::COND_NOT_LIKE, + field->get_field_no(), + value->get_val(), + value->pack_length()) == -1) + DBUG_RETURN(1); + cond= cond->next->next->next; + DBUG_RETURN(0); + } + case NDB_ISNULL_FUNC: if (!field) break; DBUG_PRINT("info", ("Generating ISNULL filter")); @@ -7169,7 +7188,7 @@ ha_ndbcluster::build_scan_filter_predicate(Ndb_cond * &cond, DBUG_RETURN(1); cond= cond->next->next; DBUG_RETURN(0); - case Item_func::ISNOTNULL_FUNC: + case NDB_ISNOTNULL_FUNC: { if (!field) break; @@ -7206,7 +7225,7 @@ ha_ndbcluster::build_scan_filter_group(Ndb_cond* &cond, NdbScanFilter *filter) case NDB_FUNCTION: { switch (cond->ndb_item->qualification.function_type) { - case Item_func::COND_AND_FUNC: + case NDB_COND_AND_FUNC: { level++; DBUG_PRINT("info", ("Generating %s group %u", (negated)?"NAND":"AND", @@ -7218,7 +7237,7 @@ ha_ndbcluster::build_scan_filter_group(Ndb_cond* &cond, NdbScanFilter *filter) cond= cond->next; break; } - case Item_func::COND_OR_FUNC: + case NDB_COND_OR_FUNC: { level++; DBUG_PRINT("info", ("Generating %s group %u", (negated)?"NOR":"OR", @@ -7230,7 +7249,7 @@ ha_ndbcluster::build_scan_filter_group(Ndb_cond* &cond, NdbScanFilter *filter) cond= cond->next; break; } - case Item_func::NOT_FUNC: + case NDB_NOT_FUNC: { DBUG_PRINT("info", ("Generating negated query")); cond= cond->next; @@ -7273,8 +7292,8 @@ ha_ndbcluster::build_scan_filter(Ndb_cond * &cond, NdbScanFilter *filter) switch (cond->ndb_item->type) { case NDB_FUNCTION: switch (cond->ndb_item->qualification.function_type) { - case Item_func::COND_AND_FUNC: - case Item_func::COND_OR_FUNC: + case NDB_COND_AND_FUNC: + case NDB_COND_OR_FUNC: simple_cond= FALSE; break; default: diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 91cfdde16fe..034bb9292e8 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -72,10 +72,28 @@ typedef enum ndb_item_type { NDB_END_COND = 3 // End marker for condition group } NDB_ITEM_TYPE; +typedef enum ndb_func_type { + NDB_EQ_FUNC = 0, + NDB_NE_FUNC = 1, + NDB_LT_FUNC = 2, + NDB_LE_FUNC = 3, + NDB_GT_FUNC = 4, + NDB_GE_FUNC = 5, + NDB_ISNULL_FUNC = 6, + NDB_ISNOTNULL_FUNC = 7, + NDB_LIKE_FUNC = 8, + NDB_NOTLIKE_FUNC = 9, + NDB_NOT_FUNC = 10, + NDB_UNKNOWN_FUNC = 11, + NDB_COND_AND_FUNC = 12, + NDB_COND_OR_FUNC = 13, + NDB_UNSUPPORTED_FUNC = 14 +} NDB_FUNC_TYPE; + typedef union ndb_item_qualification { Item::Type value_type; - enum_field_types field_type; // Instead of Item::FIELD_ITEM - Item_func::Functype function_type; // Instead of Item::FUNC_ITEM + enum_field_types field_type; // Instead of Item::FIELD_ITEM + NDB_FUNC_TYPE function_type; // Instead of Item::FUNC_ITEM } NDB_ITEM_QUALIFICATION; typedef struct ndb_item_field_value { @@ -91,21 +109,31 @@ typedef union ndb_item_value { struct negated_function_mapping { - Item_func::Functype pos_fun; - Item_func::Functype neg_fun; + NDB_FUNC_TYPE pos_fun; + NDB_FUNC_TYPE neg_fun; }; +/* + Define what functions can be negated in condition pushdown. + Note, these HAVE to be in the same order as in definition enum +*/ static const negated_function_mapping neg_map[]= { - {Item_func::EQ_FUNC, Item_func::NE_FUNC}, - {Item_func::NE_FUNC, Item_func::EQ_FUNC}, - {Item_func::LT_FUNC, Item_func::GE_FUNC}, - {Item_func::LE_FUNC, Item_func::GT_FUNC}, - {Item_func::GT_FUNC, Item_func::LE_FUNC}, - {Item_func::GE_FUNC, Item_func::LT_FUNC}, - {Item_func::ISNULL_FUNC, Item_func::ISNOTNULL_FUNC}, - {Item_func::ISNOTNULL_FUNC, Item_func::ISNULL_FUNC}, - {Item_func::UNKNOWN_FUNC, Item_func::NOT_FUNC} + {NDB_EQ_FUNC, NDB_NE_FUNC}, + {NDB_NE_FUNC, NDB_EQ_FUNC}, + {NDB_LT_FUNC, NDB_GE_FUNC}, + {NDB_LE_FUNC, NDB_GT_FUNC}, + {NDB_GT_FUNC, NDB_LE_FUNC}, + {NDB_GE_FUNC, NDB_LT_FUNC}, + {NDB_ISNULL_FUNC, NDB_ISNOTNULL_FUNC}, + {NDB_ISNOTNULL_FUNC, NDB_ISNULL_FUNC}, + {NDB_LIKE_FUNC, NDB_NOTLIKE_FUNC}, + {NDB_NOTLIKE_FUNC, NDB_LIKE_FUNC}, + {NDB_NOT_FUNC, NDB_UNSUPPORTED_FUNC}, + {NDB_UNKNOWN_FUNC, NDB_UNSUPPORTED_FUNC}, + {NDB_COND_AND_FUNC, NDB_UNSUPPORTED_FUNC}, + {NDB_COND_OR_FUNC, NDB_UNSUPPORTED_FUNC}, + {NDB_UNSUPPORTED_FUNC, NDB_UNSUPPORTED_FUNC} }; /* @@ -160,14 +188,14 @@ class Ndb_item { Ndb_item(Item_func::Functype func_type, const Item *item_value) : type(NDB_FUNCTION) { - qualification.function_type= func_type; + qualification.function_type= item_func_to_ndb_func(func_type); value.item= item_value; value.arg_count= ((Item_func *) item_value)->argument_count(); }; Ndb_item(Item_func::Functype func_type, uint no_args) : type(NDB_FUNCTION) { - qualification.function_type= func_type; + qualification.function_type= item_func_to_ndb_func(func_type); value.arg_count= no_args; }; ~Ndb_item() @@ -229,13 +257,30 @@ class Ndb_item { ((Item *)item)->save_in_field(field, false); }; - static Item_func::Functype negate(Item_func::Functype fun) + static NDB_FUNC_TYPE item_func_to_ndb_func(Item_func::Functype fun) { - uint i; - for (i=0; - fun != neg_map[i].pos_fun && - neg_map[i].pos_fun != Item_func::UNKNOWN_FUNC; - i++); + switch (fun) { + case (Item_func::EQ_FUNC): { return NDB_EQ_FUNC; } + case (Item_func::NE_FUNC): { return NDB_NE_FUNC; } + case (Item_func::LT_FUNC): { return NDB_LT_FUNC; } + case (Item_func::LE_FUNC): { return NDB_LE_FUNC; } + case (Item_func::GT_FUNC): { return NDB_GT_FUNC; } + case (Item_func::GE_FUNC): { return NDB_GE_FUNC; } + case (Item_func::ISNULL_FUNC): { return NDB_ISNULL_FUNC; } + case (Item_func::ISNOTNULL_FUNC): { return NDB_ISNOTNULL_FUNC; } + case (Item_func::LIKE_FUNC): { return NDB_LIKE_FUNC; } + case (Item_func::NOT_FUNC): { return NDB_NOT_FUNC; } + case (Item_func::UNKNOWN_FUNC): { return NDB_UNKNOWN_FUNC; } + case (Item_func::COND_AND_FUNC): { return NDB_COND_AND_FUNC; } + case (Item_func::COND_OR_FUNC): { return NDB_COND_OR_FUNC; } + default: { return NDB_UNSUPPORTED_FUNC; } + } + }; + + static NDB_FUNC_TYPE negate(NDB_FUNC_TYPE fun) + { + uint i= (uint) fun; + DBUG_ASSERT(fun == neg_map[i].pos_fun); return neg_map[i].neg_fun; }; From 22c89ac45125c5f33cfa7d4e75a4e84db0673125 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Aug 2005 17:07:19 -0500 Subject: [PATCH 096/144] fix compile warning in Visual Studio 2003 --- include/config-win.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/config-win.h b/include/config-win.h index 04f79e95c80..4eaf97cd4f5 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -284,7 +284,6 @@ inline double ulonglong2double(ulonglong value) #define doublestore(T,V) { *((long *) T) = *((long*) &V); \ *(((long *) T)+1) = *(((long*) &V)+1); } #define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); } -#define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float)) #define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float)) #define floatget(V,M) memcpy((byte*)(&V), (byte*)(M), sizeof(float)) #define float8get(V,M) doubleget((V),(M)) From e53419b45334ddcfd964dd2fd9fec0e82c3fe24a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Aug 2005 15:43:40 -0700 Subject: [PATCH 097/144] Fix crash in 'SHOW CREATE FUNCTION' introduced by Monty's last cleanup. sql/sp_head.cc: Remove unused variable and always add sql_mode to fields in sp_head::show_create_function(). --- sql/sp_head.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 0c3a6d04598..18cf9f17b88 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1320,7 +1320,6 @@ sp_head::show_create_function(THD *thd) String buffer(buff, sizeof(buff), system_charset_info); int res; List field_list; - sys_var *sql_mode_var; byte *sql_mode_str; ulong sql_mode_len; bool full_access; @@ -1337,8 +1336,7 @@ sp_head::show_create_function(THD *thd) m_sql_mode, &sql_mode_len); field_list.push_back(new Item_empty_string("Function",NAME_LEN)); - if (sql_mode_var) - field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len)); + field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len)); field_list.push_back(new Item_empty_string("Create Function", max(buffer.length(),1024))); if (protocol->send_fields(&field_list, From c33f7f9f9064d95a73778c0e962e20a267bccaad Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Aug 2005 17:00:03 -0700 Subject: [PATCH 098/144] Fix crash in 'INSERT DELAYED' statement that failed due to a conflict in a unique key. (Bug #12226) mysql-test/r/delayed.result: Add results mysql-test/t/delayed.test: Add new regression test sql/sql_insert.cc: Fix crash in error handling of 'INSERT DELAYED' statement --- mysql-test/r/delayed.result | 7 +++++++ mysql-test/t/delayed.test | 9 +++++++++ sql/sql_insert.cc | 4 +++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result index e9766622cf6..f8ae61b03fb 100644 --- a/mysql-test/r/delayed.result +++ b/mysql-test/r/delayed.result @@ -32,3 +32,10 @@ a b 3 d 4 e drop table t1; +create table t1 (a int not null primary key); +insert into t1 values (1); +insert delayed into t1 values (1); +select * from t1; +a +1 +drop table t1; diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index 3030ac20304..ca34cc020f3 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -38,3 +38,12 @@ select * from t1; drop table t1; # End of 4.1 tests + +# +# Bug #12226: Crash when a delayed insert fails due to a duplicate key +# +create table t1 (a int not null primary key); +insert into t1 values (1); +insert delayed into t1 values (1); +select * from t1; +drop table t1; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 125390e4411..27342287fcd 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1088,7 +1088,9 @@ ok_or_after_trg_err: err: info->last_errno= error; - thd->lex->current_select->no_error= 0; // Give error + /* current_select is NULL if this is a delayed insert */ + if (thd->lex->current_select) + thd->lex->current_select->no_error= 0; // Give error table->file->print_error(error,MYF(0)); before_trg_err: From 421dd5f1c27109ca84dd1d1ce92c8d9559773e3b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Aug 2005 19:21:56 -0700 Subject: [PATCH 099/144] Fix two test results that were merged out-of-order. mysql-test/r/func_math.result: Fix incorrect merge of test results mysql-test/r/user_var.result: Fix incorrect merge --- mysql-test/r/func_math.result | 10 ++++++++ mysql-test/r/user_var.result | 48 +++++++++++++++++------------------ 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index c84b26ce24e..0149911e36b 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -152,6 +152,16 @@ ceil(0.09) select ceil(0.000000000000000009); ceil(0.000000000000000009) 1 +create table t1 select round(1, 6); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `round(1, 6)` decimal(7,6) NOT NULL default '0.000000' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t1; +round(1, 6) +1.000000 +drop table t1; select abs(-2) * -2; abs(-2) * -2 -4 diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 893e024719b..acdc793fb69 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -183,6 +183,30 @@ set session @honk=99; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@honk=99' at line 1 set one_shot @honk=99; ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server +select @@local.max_allowed_packet; +@@local.max_allowed_packet +# +select @@session.max_allowed_packet; +@@session.max_allowed_packet +# +select @@global.max_allowed_packet; +@@global.max_allowed_packet +# +select @@max_allowed_packet; +@@max_allowed_packet +# +select @@Max_Allowed_Packet; +@@Max_Allowed_Packet +# +select @@version; +@@version +# +select @@global.version; +@@global.version +# +select @@session.VERSION; +@@session.VERSION +# set @first_var= NULL; create table t1 select @first_var; show create table t1; @@ -224,27 +248,3 @@ t1 CREATE TABLE `t1` ( `@first_var` longtext ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; -select @@local.max_allowed_packet; -@@local.max_allowed_packet -# -select @@session.max_allowed_packet; -@@session.max_allowed_packet -# -select @@global.max_allowed_packet; -@@global.max_allowed_packet -# -select @@max_allowed_packet; -@@max_allowed_packet -# -select @@Max_Allowed_Packet; -@@Max_Allowed_Packet -# -select @@version; -@@version -# -select @@global.version; -@@global.version -# -select @@session.VERSION; -@@session.VERSION -# From 451ec64db9acb6c4a590b64b5077ca72041e6cdf Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Aug 2005 11:33:26 +0500 Subject: [PATCH 100/144] BUG#11684 fix. Repair crashes mysql when table has fulltext index. myisam/sort.c: Use static ft_buf instead of dynamic mergebuf. Latter could be NULL if record has long words. mysql-test/r/fulltext.result: Test case for BUG#11684 - repair crashes mysql when table has fulltext index. mysql-test/t/fulltext.test: Test case for BUG#11684 - repair crashes mysql when table has fulltext index. --- myisam/sort.c | 14 ++++++++------ mysql-test/r/fulltext.result | 8 ++++++++ mysql-test/t/fulltext.test | 11 +++++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/myisam/sort.c b/myisam/sort.c index 95ede6ddaa1..45a670c3f6b 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -532,13 +532,15 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) while (!got_error && !my_b_read(&sinfo->tempfile_for_exceptions,(byte*)&key_length, - sizeof(key_length)) && - !my_b_read(&sinfo->tempfile_for_exceptions,(byte*)mergebuf, - (uint) key_length)) + sizeof(key_length))) { - if (_mi_ck_write(info,sinfo->key,(uchar*) mergebuf, - key_length - info->s->rec_reflength)) - got_error=1; + byte ft_buf[HA_FT_MAXLEN + HA_FT_WLEN + 10]; + if (key_length > sizeof(ft_buf) || + my_b_read(&sinfo->tempfile_for_exceptions, (byte*)ft_buf, + (uint)key_length) || + _mi_ck_write(info, sinfo->key, (uchar*)ft_buf, + key_length - info->s->rec_reflength)) + got_error=1; } } } diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index ce1703fca0e..c94a9bbee85 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -321,3 +321,11 @@ SELECT MATCH(a) AGAINST ('nosuchword') FROM t1; MATCH(a) AGAINST ('nosuchword') 0 DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(30), FULLTEXT(a)); +INSERT INTO t1 VALUES('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'); +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; +DROP TABLE t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 90020e9468e..f9f61bb14a0 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -260,3 +260,14 @@ CREATE TABLE t1 ( a TEXT, FULLTEXT (a) ); INSERT INTO t1 VALUES ('testing ft_nlq_find_relevance'); SELECT MATCH(a) AGAINST ('nosuchword') FROM t1; DROP TABLE t1; + +# +# BUG#11684 - repair crashes mysql when table has fulltext index +# + +CREATE TABLE t1 (a VARCHAR(30), FULLTEXT(a)); +INSERT INTO t1 VALUES('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'); +SET myisam_repair_threads=2; +REPAIR TABLE t1; +SET myisam_repair_threads=@@global.myisam_repair_threads; +DROP TABLE t1; From ad26ba2543687bc7ff2d143e1bdb3122951ae61c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Aug 2005 12:57:26 +0500 Subject: [PATCH 101/144] After merge fix. --- myisam/sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myisam/sort.c b/myisam/sort.c index 0bbf7efa659..e8cd9938e42 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -589,7 +589,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) !my_b_read(&sinfo->tempfile_for_exceptions,(byte*)&key_length, sizeof(key_length))) { - byte ft_buf[HA_FT_MAXLEN + HA_FT_WLEN + 10]; + byte ft_buf[HA_FT_MAXBYTELEN + HA_FT_WLEN + 10]; if (key_length > sizeof(ft_buf) || my_b_read(&sinfo->tempfile_for_exceptions, (byte*)ft_buf, (uint)key_length) || From b9ccc653ea97368d162e5e473931134bb1cf1ef2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Aug 2005 14:27:52 +0500 Subject: [PATCH 102/144] Fix for BUG#12075. FULLTEXT non-functional for big5 strings mysql-test/r/ctype_big5.result: Test case for BUG#12075. mysql-test/t/ctype_big5.test: Test case for BUG#12075. strings/ctype-big5.c: hack: (to be fixed properly later) all multi-byte sequences are considered isalpha() now --- mysql-test/r/ctype_big5.result | 6 ++++++ mysql-test/t/ctype_big5.test | 8 ++++++++ strings/ctype-big5.c | 12 ++++++------ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 8d2c39df853..01b59b93b52 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -128,3 +128,9 @@ SELECT * FROM t1; a ùØ DROP TABLE t1; +CREATE TABLE t1 (a CHAR(50) CHARACTER SET big5 NOT NULL, FULLTEXT(a)); +INSERT INTO t1 VALUES(0xA741ADCCA66EB6DC20A7DAADCCABDCA66E); +SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE); +HEX(a) +A741ADCCA66EB6DC20A7DAADCCABDCA66E +DROP TABLE t1; diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test index e4fb1d2a32b..73d9f06042c 100644 --- a/mysql-test/t/ctype_big5.test +++ b/mysql-test/t/ctype_big5.test @@ -28,4 +28,12 @@ INSERT INTO t1 VALUES (' SELECT * FROM t1; DROP TABLE t1; +# +# BUG#12075 - FULLTEXT non-functional for big5 strings +# +CREATE TABLE t1 (a CHAR(50) CHARACTER SET big5 NOT NULL, FULLTEXT(a)); +INSERT INTO t1 VALUES(0xA741ADCCA66EB6DC20A7DAADCCABDCA66E); +SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE); +DROP TABLE t1; + # End of 4.1 tests diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index b467c8c5ba3..73e3efd09a7 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -61,12 +61,12 @@ static uchar NEAR ctype_big5[257] = 2,2,2,2,2,2,2,2,2,2,2,16,16,16,16,32, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0, }; static uchar NEAR to_lower_big5[]= From acfc848e0103838f27b02aacfbcc1e8747dd553c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Aug 2005 13:59:02 +0200 Subject: [PATCH 103/144] - Fixed the Requires: tag for the server RPM (BUG#12233), make sure to list all required commands/packages so the installation succeeds. Removed the superflouus Requires field from the source RPM. --- support-files/mysql.spec.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index e4cd3027b8a..3c58e642a1d 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -29,7 +29,6 @@ Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql URL: http://www.mysql.com/ Packager: Lenz Grimmer Vendor: MySQL AB -Requires: fileutils sh-utils Provides: msqlormysql MySQL-server mysql BuildRequires: ncurses-devel Obsoletes: mysql @@ -60,7 +59,7 @@ documentation and the manual for more information. %package server Summary: MySQL: a very fast and reliable SQL database server Group: Applications/Databases -Requires: fileutils sh-utils +Requires: coreutils grep procps /usr/sbin/useradd /usr/sbin/groupadd /sbin/chkconfig Provides: msqlormysql mysql-server mysql MySQL Obsoletes: MySQL mysql mysql-server @@ -669,6 +668,10 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Tue Aug 02 2005 Lenz Grimmer + +- Fixed the Requires: tag for the server RPM (BUG 12233) + * Fri Jul 15 2005 Lenz Grimmer - create a "mysql" user group and assign the mysql user account to that group From 015165add56c53c9aeba6a986058658e090244db Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Aug 2005 11:31:01 -0700 Subject: [PATCH 104/144] Fix parsing of dates with 'T' between date and time, as in ISO-8601 date format. (Bug #7308) mysql-test/r/type_datetime.result: Add new results mysql-test/t/type_datetime.test: Add new test sql-common/my_time.c: Fix handling of field_length for each field in date, especially for dates not in the internal_format. --- mysql-test/r/type_datetime.result | 10 ++++++++++ mysql-test/t/type_datetime.test | 10 ++++++++++ sql-common/my_time.c | 12 +++++++----- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 7b101d31fc5..8d28504d790 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -153,3 +153,13 @@ dt 0000-00-00 00:00:00 0000-00-00 00:00:00 drop table t1; +create table t1 (dt datetime); +insert into t1 values ("20010101T010101"); +insert into t1 values ("2001-01-01T01:01:01"); +insert into t1 values ("2001-1-1T1:01:01"); +select * from t1; +dt +2001-01-01 01:01:01 +2001-01-01 01:01:01 +2001-01-01 01:01:01 +drop table t1; diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index f60bc5adb16..ca70e35d3cd 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -102,4 +102,14 @@ insert into t1 values ("00-00-00"), ("00-00-00 00:00:00"); select * from t1; drop table t1; +# +# Bug #7308: ISO-8601 date format not handled correctly +# +create table t1 (dt datetime); +insert into t1 values ("20010101T010101"); +insert into t1 values ("2001-01-01T01:01:01"); +insert into t1 values ("2001-1-1T1:01:01"); +select * from t1; +drop table t1; + # End of 4.1 tests diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 8dd4801b562..1726a9a6e78 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -147,7 +147,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, { /* Found date in internal format (only numbers like YYYYMMDD) */ year_length= (digits == 4 || digits == 8 || digits >= 14) ? 4 : 2; - field_length=year_length-1; + field_length= year_length; is_internal_format= 1; format_position= internal_format_positions; } @@ -177,6 +177,8 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, start_loop= 5; /* Start with first date part */ } } + + field_length= format_position[0] == 0 ? 4 : 2; } /* @@ -201,7 +203,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, const char *start= str; ulong tmp_value= (uint) (uchar) (*str++ - '0'); while (str != end && my_isdigit(&my_charset_latin1,str[0]) && - (!is_internal_format || field_length--)) + --field_length) { tmp_value=tmp_value*10 + (ulong) (uchar) (*str - '0'); str++; @@ -215,8 +217,8 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, date[i]=tmp_value; not_zero_date|= tmp_value; - /* Length-1 of next field */ - field_length= format_position[i+1] == 0 ? 3 : 1; + /* Length of next field */ + field_length= format_position[i+1] == 0 ? 4 : 2; if ((last_field_pos= str) == end) { @@ -234,7 +236,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, if (*str == '.') /* Followed by part seconds */ { str++; - field_length= 5; /* 5 digits after first (=6) */ + field_length= 6; /* 6 digits */ } continue; From c2b83502f9eac1ac06049aacbf68a70c342f2b27 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Aug 2005 11:58:52 -0700 Subject: [PATCH 105/144] sql_select.cc, sql_class.h: Reversed the changes to fix bug #12095 after review done by SergeyG. Applied a fix suggested by him. sql/sql_class.h: Reversed the changes to fix bug #12095 after review done by SergeyG. Applied a fix suggested by him. sql/sql_select.cc: Reversed the changes to fix bug #12095 after review done by SergeyG. Applied a fix suggested by him. --- sql/sql_class.h | 4 +--- sql/sql_select.cc | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sql/sql_class.h b/sql/sql_class.h index 85ff901fe72..b6bf0dcdc45 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1325,12 +1325,10 @@ public: bool using_indirect_summary_function; /* If >0 convert all blob fields to varchar(convert_blob_length) */ uint convert_blob_length; - bool need_const; /* <=> const items are saved in tmp table */ TMP_TABLE_PARAM() :copy_field(0), group_parts(0), - group_length(0), group_null_parts(0), convert_blob_length(0), - need_const(0) + group_length(0), group_null_parts(0), convert_blob_length(0) {} ~TMP_TABLE_PARAM() { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index fc85f49093d..1bde62276b8 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5201,8 +5201,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, param->using_indirect_summary_function=1; continue; } - if (item->const_item() && (int) hidden_field_count <= 0 && - !param->need_const) + if (item->const_item() && (int) hidden_field_count <= 0) continue; // We don't have to store this } if (type == Item::SUM_FUNC_ITEM && !group && !save_sum_fields) From bcaff83722efd083d4ccba37fe7b35cb4464b0f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Aug 2005 13:12:41 -0700 Subject: [PATCH 106/144] item_sum.cc: Reversed the changes to fix bug #12095 after review done by SergeyG. Applied a fix suggested by him. Added my comment. sql/item_sum.cc: Reversed the changes to fix bug #12095 after review done by SergeyG. Applied a fix suggested by him. Added my comment. --- sql/item_sum.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 1ee48dfb763..74a7fee113e 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1577,7 +1577,11 @@ int group_concat_key_cmp_with_distinct(void* arg, byte* key1, the temporary table, not the original field */ Field *field= (*field_item)->get_tmp_table_field(); - if (field) + /* + If field_item is a const item then either get_tp_table_field returns 0 + or it is an item over a const table. + */ + if (field && !(*field_item)->const_item()) { int res; uint offset= field->offset(); @@ -1610,7 +1614,11 @@ int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2) the temporary table, not the original field */ Field *field= item->get_tmp_table_field(); - if (field) + /* + If item is a const item then either get_tp_table_field returns 0 + or it is an item over a const table. + */ + if (field && !item->const_item()) { int res; uint offset= field->offset(); @@ -1986,7 +1994,6 @@ bool Item_func_group_concat::setup(THD *thd) } count_field_types(tmp_table_param,all_fields,0); - tmp_table_param->need_const= 1; if (table) { /* From 5792c4d162e333698ca9596b52caebd30616fc00 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 02:01:27 +0400 Subject: [PATCH 107/144] Fix bug #11934 Two sequential FLUSH TABLES WITH READ LOCK hangs client Bug was introduced by cset 1.1659.14.1. Before it server was silently ignoring that lock can't be acquired because it already acquired. This patch makes make_global_read_lock_block_commit() return without error if lock already acquired. mysql-test/t/flush_table.test: Test case for bug#11934 FLUSH TABLES WITH READ LOCK hangs client. mysql-test/r/flush_table.result: Test case for bug#11934 FLUSH TABLES WITH READ LOCK hangs client. sql/lock.cc: Fix bug #11934 Two sequential FLUSH TABLES WITH READ LOCK hangs client. Make make_global_read_lock_block_commit() return without error if lock already acquired. --- mysql-test/r/flush_table.result | 3 +++ mysql-test/t/flush_table.test | 7 +++++++ sql/lock.cc | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/flush_table.result b/mysql-test/r/flush_table.result index 2ef4ab5b52b..db54d2e53ef 100644 --- a/mysql-test/r/flush_table.result +++ b/mysql-test/r/flush_table.result @@ -101,3 +101,6 @@ table_id Record-02 handler t1 close; drop table t1; +FLUSH TABLES WITH READ LOCK ; +FLUSH TABLES WITH READ LOCK ; +UNLOCK TABLES; diff --git a/mysql-test/t/flush_table.test b/mysql-test/t/flush_table.test index 0330582bc34..e46b67ad3d0 100644 --- a/mysql-test/t/flush_table.test +++ b/mysql-test/t/flush_table.test @@ -73,4 +73,11 @@ handler t1 read next limit 1; handler t1 close; drop table t1; +# +# Bug #11934 Two sequential FLUSH TABLES WITH READ LOCK hangs client +# +FLUSH TABLES WITH READ LOCK ; +FLUSH TABLES WITH READ LOCK ; +UNLOCK TABLES; + # End of 4.1 tests diff --git a/sql/lock.cc b/sql/lock.cc index d51d9083058..568ca2b68af 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -990,7 +990,7 @@ bool make_global_read_lock_block_commit(THD *thd) make_global_read_lock_block_commit(), do nothing. */ if (thd->global_read_lock != GOT_GLOBAL_READ_LOCK) - DBUG_RETURN(1); + DBUG_RETURN(0); pthread_mutex_lock(&LOCK_global_read_lock); /* increment this BEFORE waiting on cond (otherwise race cond) */ global_read_lock_blocks_commit++; From 5e92ebd43670edb35af22dcb4bc9115c72ed6e5a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Aug 2005 17:25:40 -0500 Subject: [PATCH 108/144] fix VC compile error --- sql/sql_show.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 7ccf475b65e..56272b4fdaf 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3008,7 +3008,7 @@ static bool store_trigger(THD *thd, TABLE *table, const char *db, sys_var_thd_sql_mode::symbolic_mode_representation(thd, sql_mode, &sql_mode_len); - table->field[17]->store(sql_mode_str, sql_mode_len, cs); + table->field[17]->store((const char*)sql_mode_str, sql_mode_len, cs); return schema_table_store_record(thd, table); } From 3ca4fc499e473a19166592bd926f7856bf6e7ebb Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Aug 2005 15:58:41 -0700 Subject: [PATCH 109/144] Make lowercase_table3 get skipped on Windows, as intended. (Bug #11568) mysql-test/t/lowercase_table3.test: Move requirements into include files --- mysql-test/include/have_lowercase0.inc | 4 ++++ mysql-test/include/not_windows.inc | 4 ++++ mysql-test/t/lowercase_table3.test | 8 ++------ 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 mysql-test/include/have_lowercase0.inc create mode 100644 mysql-test/include/not_windows.inc diff --git a/mysql-test/include/have_lowercase0.inc b/mysql-test/include/have_lowercase0.inc new file mode 100644 index 00000000000..f967c18928b --- /dev/null +++ b/mysql-test/include/have_lowercase0.inc @@ -0,0 +1,4 @@ +--require r/lowercase0.require +--disable_query_log; +show variables like "lower_case_%"; +--enable_query_log; diff --git a/mysql-test/include/not_windows.inc b/mysql-test/include/not_windows.inc new file mode 100644 index 00000000000..0db231ddb81 --- /dev/null +++ b/mysql-test/include/not_windows.inc @@ -0,0 +1,4 @@ +--require r/true.require +--disable_query_log; +select convert(@@version_compile_os using latin1) NOT IN ("Win32","Win64","Windows") as "TRUE"; +--enable_query_log; diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test index 7d34ba649cf..75f6e5188c5 100644 --- a/mysql-test/t/lowercase_table3.test +++ b/mysql-test/t/lowercase_table3.test @@ -5,12 +5,8 @@ # --source include/have_innodb.inc ---require r/lowercase0.require -disable_query_log; -show variables like "lower_case_%"; ---require r/true.require -select convert(@@version_compile_os using latin1) NOT IN ("NT","WIN2000","Win95/Win98","XP") as "TRUE"; -enable_query_log; +--source include/have_lowercase0.inc +--source include/not_windows.inc --disable_warnings DROP TABLE IF EXISTS t1,T1; From d67bd2104c7f96e48890c5650878048b41b9cd98 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Aug 2005 18:47:02 -0500 Subject: [PATCH 110/144] Conversions of dsp files to vcproj. These files are compatible with Visual Studio 2003. I have not yet changed the windows build scripts to use these. VC++Files/bdb/bdb.vcproj: New BitKeeper file ``VC++Files/bdb/bdb.vcproj'' VC++Files/client/mysql.vcproj: New BitKeeper file ``VC++Files/client/mysql.vcproj'' VC++Files/client/mysqladmin.vcproj: New BitKeeper file ``VC++Files/client/mysqladmin.vcproj'' VC++Files/client/mysqlclient.vcproj: New BitKeeper file ``VC++Files/client/mysqlclient.vcproj'' VC++Files/client/mysqldump.vcproj: New BitKeeper file ``VC++Files/client/mysqldump.vcproj'' VC++Files/client/mysqlimport.vcproj: New BitKeeper file ``VC++Files/client/mysqlimport.vcproj'' VC++Files/client/mysqlshow.vcproj: New BitKeeper file ``VC++Files/client/mysqlshow.vcproj'' VC++Files/client/mysqltest.vcproj: New BitKeeper file ``VC++Files/client/mysqltest.vcproj'' VC++Files/comp_err/comp_err.vcproj: New BitKeeper file ``VC++Files/comp_err/comp_err.vcproj'' VC++Files/dbug/dbug.vcproj: New BitKeeper file ``VC++Files/dbug/dbug.vcproj'' VC++Files/heap/heap.vcproj: New BitKeeper file ``VC++Files/heap/heap.vcproj'' VC++Files/innobase/innobase.vcproj: New BitKeeper file ``VC++Files/innobase/innobase.vcproj'' VC++Files/libmysql/libmysql.vcproj: New BitKeeper file ``VC++Files/libmysql/libmysql.vcproj'' VC++Files/libmysqld/examples/test_libmysqld.vcproj: New BitKeeper file ``VC++Files/libmysqld/examples/test_libmysqld.vcproj'' VC++Files/libmysqld/libmysqld.vcproj: New BitKeeper file ``VC++Files/libmysqld/libmysqld.vcproj'' VC++Files/libmysqltest/myTest.vcproj: New BitKeeper file ``VC++Files/libmysqltest/myTest.vcproj'' VC++Files/my_print_defaults/my_print_defaults.vcproj: New BitKeeper file ``VC++Files/my_print_defaults/my_print_defaults.vcproj'' VC++Files/myisam/myisam.vcproj: New BitKeeper file ``VC++Files/myisam/myisam.vcproj'' VC++Files/myisam_ftdump/myisam_ftdump.vcproj: New BitKeeper file ``VC++Files/myisam_ftdump/myisam_ftdump.vcproj'' VC++Files/myisamchk/myisamchk.vcproj: New BitKeeper file ``VC++Files/myisamchk/myisamchk.vcproj'' VC++Files/myisamlog/myisamlog.vcproj: New BitKeeper file ``VC++Files/myisamlog/myisamlog.vcproj'' VC++Files/myisammrg/myisammrg.vcproj: New BitKeeper file ``VC++Files/myisammrg/myisammrg.vcproj'' VC++Files/myisampack/myisampack.vcproj: New BitKeeper file ``VC++Files/myisampack/myisampack.vcproj'' VC++Files/mysql-test/mysql_test_run_new.vcproj: New BitKeeper file ``VC++Files/mysql-test/mysql_test_run_new.vcproj'' VC++Files/mysql.sln: New BitKeeper file ``VC++Files/mysql.sln'' VC++Files/mysqlbinlog/mysqlbinlog.vcproj: New BitKeeper file ``VC++Files/mysqlbinlog/mysqlbinlog.vcproj'' VC++Files/mysqlcheck/mysqlcheck.vcproj: New BitKeeper file ``VC++Files/mysqlcheck/mysqlcheck.vcproj'' VC++Files/mysqldemb/mysqldemb.vcproj: New BitKeeper file ``VC++Files/mysqldemb/mysqldemb.vcproj'' VC++Files/mysqlserver/mysqlserver.vcproj: New BitKeeper file ``VC++Files/mysqlserver/mysqlserver.vcproj'' VC++Files/mysys/mysys.vcproj: New BitKeeper file ``VC++Files/mysys/mysys.vcproj'' VC++Files/perror/perror.vcproj: New BitKeeper file ``VC++Files/perror/perror.vcproj'' VC++Files/regex/regex.vcproj: New BitKeeper file ``VC++Files/regex/regex.vcproj'' VC++Files/replace/replace.vcproj: New BitKeeper file ``VC++Files/replace/replace.vcproj'' VC++Files/sql/mysqld.vcproj: New BitKeeper file ``VC++Files/sql/mysqld.vcproj'' VC++Files/strings/strings.vcproj: New BitKeeper file ``VC++Files/strings/strings.vcproj'' VC++Files/test1/test1.vcproj: New BitKeeper file ``VC++Files/test1/test1.vcproj'' VC++Files/tests/mysql_client_test.vcproj: New BitKeeper file ``VC++Files/tests/mysql_client_test.vcproj'' VC++Files/thr_test/thr_test.vcproj: New BitKeeper file ``VC++Files/thr_test/thr_test.vcproj'' VC++Files/vio/vio.vcproj: New BitKeeper file ``VC++Files/vio/vio.vcproj'' VC++Files/zlib/zlib.vcproj: New BitKeeper file ``VC++Files/zlib/zlib.vcproj'' extra/yassl/taocrypt/taocrypt.vcproj: New BitKeeper file ``extra/yassl/taocrypt/taocrypt.vcproj'' extra/yassl/yassl.vcproj: New BitKeeper file ``extra/yassl/yassl.vcproj'' --- VC++Files/bdb/bdb.vcproj | 3227 +++++++ VC++Files/client/mysql.vcproj | 318 + VC++Files/client/mysqladmin.vcproj | 232 + VC++Files/client/mysqlclient.vcproj | 3330 +++++++ VC++Files/client/mysqldump.vcproj | 232 + VC++Files/client/mysqlimport.vcproj | 232 + VC++Files/client/mysqlshow.vcproj | 232 + VC++Files/client/mysqltest.vcproj | 264 + VC++Files/comp_err/comp_err.vcproj | 93 + VC++Files/dbug/dbug.vcproj | 249 + VC++Files/heap/heap.vcproj | 1061 ++ VC++Files/innobase/innobase.vcproj | 2958 ++++++ VC++Files/libmysql/libmysql.vcproj | 2298 +++++ .../libmysqld/examples/test_libmysqld.vcproj | 130 + VC++Files/libmysqld/libmysqld.vcproj | 4500 +++++++++ VC++Files/libmysqltest/myTest.vcproj | 162 + .../my_print_defaults.vcproj | 245 + VC++Files/myisam/myisam.vcproj | 2094 ++++ VC++Files/myisam_ftdump/myisam_ftdump.vcproj | 174 + VC++Files/myisamchk/myisamchk.vcproj | 244 + VC++Files/myisamlog/myisamlog.vcproj | 244 + VC++Files/myisammrg/myisammrg.vcproj | 968 ++ VC++Files/myisampack/myisampack.vcproj | 247 + .../mysql-test/mysql_test_run_new.vcproj | 204 + VC++Files/mysql.sln | 1211 +++ VC++Files/mysqlbinlog/mysqlbinlog.vcproj | 271 + VC++Files/mysqlcheck/mysqlcheck.vcproj | 244 + VC++Files/mysqldemb/mysqldemb.vcproj | 2960 ++++++ VC++Files/mysqlserver/mysqlserver.vcproj | 123 + VC++Files/mysys/mysys.vcproj | 4789 +++++++++ VC++Files/perror/perror.vcproj | 255 + VC++Files/regex/regex.vcproj | 252 + VC++Files/replace/replace.vcproj | 229 + VC++Files/sql/mysqld.vcproj | 8584 +++++++++++++++++ VC++Files/strings/strings.vcproj | 1031 ++ VC++Files/test1/test1.vcproj | 161 + VC++Files/tests/mysql_client_test.vcproj | 163 + VC++Files/thr_test/thr_test.vcproj | 162 + VC++Files/vio/vio.vcproj | 204 + VC++Files/zlib/zlib.vcproj | 483 + extra/yassl/taocrypt/taocrypt.vcproj | 602 ++ extra/yassl/yassl.vcproj | 425 + 42 files changed, 46087 insertions(+) create mode 100755 VC++Files/bdb/bdb.vcproj create mode 100755 VC++Files/client/mysql.vcproj create mode 100755 VC++Files/client/mysqladmin.vcproj create mode 100755 VC++Files/client/mysqlclient.vcproj create mode 100755 VC++Files/client/mysqldump.vcproj create mode 100755 VC++Files/client/mysqlimport.vcproj create mode 100755 VC++Files/client/mysqlshow.vcproj create mode 100755 VC++Files/client/mysqltest.vcproj create mode 100755 VC++Files/comp_err/comp_err.vcproj create mode 100755 VC++Files/dbug/dbug.vcproj create mode 100755 VC++Files/heap/heap.vcproj create mode 100755 VC++Files/innobase/innobase.vcproj create mode 100755 VC++Files/libmysql/libmysql.vcproj create mode 100755 VC++Files/libmysqld/examples/test_libmysqld.vcproj create mode 100755 VC++Files/libmysqld/libmysqld.vcproj create mode 100755 VC++Files/libmysqltest/myTest.vcproj create mode 100755 VC++Files/my_print_defaults/my_print_defaults.vcproj create mode 100755 VC++Files/myisam/myisam.vcproj create mode 100755 VC++Files/myisam_ftdump/myisam_ftdump.vcproj create mode 100755 VC++Files/myisamchk/myisamchk.vcproj create mode 100755 VC++Files/myisamlog/myisamlog.vcproj create mode 100755 VC++Files/myisammrg/myisammrg.vcproj create mode 100755 VC++Files/myisampack/myisampack.vcproj create mode 100755 VC++Files/mysql-test/mysql_test_run_new.vcproj create mode 100755 VC++Files/mysql.sln create mode 100755 VC++Files/mysqlbinlog/mysqlbinlog.vcproj create mode 100755 VC++Files/mysqlcheck/mysqlcheck.vcproj create mode 100755 VC++Files/mysqldemb/mysqldemb.vcproj create mode 100755 VC++Files/mysqlserver/mysqlserver.vcproj create mode 100755 VC++Files/mysys/mysys.vcproj create mode 100755 VC++Files/perror/perror.vcproj create mode 100755 VC++Files/regex/regex.vcproj create mode 100755 VC++Files/replace/replace.vcproj create mode 100755 VC++Files/sql/mysqld.vcproj create mode 100755 VC++Files/strings/strings.vcproj create mode 100755 VC++Files/test1/test1.vcproj create mode 100755 VC++Files/tests/mysql_client_test.vcproj create mode 100755 VC++Files/thr_test/thr_test.vcproj create mode 100755 VC++Files/vio/vio.vcproj create mode 100755 VC++Files/zlib/zlib.vcproj create mode 100755 extra/yassl/taocrypt/taocrypt.vcproj create mode 100755 extra/yassl/yassl.vcproj diff --git a/VC++Files/bdb/bdb.vcproj b/VC++Files/bdb/bdb.vcproj new file mode 100755 index 00000000000..6258da3cb3a --- /dev/null +++ b/VC++Files/bdb/bdb.vcproj @@ -0,0 +1,3227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysql.vcproj b/VC++Files/client/mysql.vcproj new file mode 100755 index 00000000000..72cc4ba6b89 --- /dev/null +++ b/VC++Files/client/mysql.vcproj @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysqladmin.vcproj b/VC++Files/client/mysqladmin.vcproj new file mode 100755 index 00000000000..188bf61dff7 --- /dev/null +++ b/VC++Files/client/mysqladmin.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysqlclient.vcproj b/VC++Files/client/mysqlclient.vcproj new file mode 100755 index 00000000000..8e01db86c70 --- /dev/null +++ b/VC++Files/client/mysqlclient.vcproj @@ -0,0 +1,3330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysqldump.vcproj b/VC++Files/client/mysqldump.vcproj new file mode 100755 index 00000000000..b6a33596083 --- /dev/null +++ b/VC++Files/client/mysqldump.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysqlimport.vcproj b/VC++Files/client/mysqlimport.vcproj new file mode 100755 index 00000000000..ef440c2fe5a --- /dev/null +++ b/VC++Files/client/mysqlimport.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysqlshow.vcproj b/VC++Files/client/mysqlshow.vcproj new file mode 100755 index 00000000000..a0707680728 --- /dev/null +++ b/VC++Files/client/mysqlshow.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/client/mysqltest.vcproj b/VC++Files/client/mysqltest.vcproj new file mode 100755 index 00000000000..5c075740fbd --- /dev/null +++ b/VC++Files/client/mysqltest.vcproj @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/comp_err/comp_err.vcproj b/VC++Files/comp_err/comp_err.vcproj new file mode 100755 index 00000000000..b12ef8b0af1 --- /dev/null +++ b/VC++Files/comp_err/comp_err.vcproj @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/dbug/dbug.vcproj b/VC++Files/dbug/dbug.vcproj new file mode 100755 index 00000000000..57257451aea --- /dev/null +++ b/VC++Files/dbug/dbug.vcproj @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/heap/heap.vcproj b/VC++Files/heap/heap.vcproj new file mode 100755 index 00000000000..b2afd752acf --- /dev/null +++ b/VC++Files/heap/heap.vcproj @@ -0,0 +1,1061 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/innobase/innobase.vcproj b/VC++Files/innobase/innobase.vcproj new file mode 100755 index 00000000000..9d972366440 --- /dev/null +++ b/VC++Files/innobase/innobase.vcproj @@ -0,0 +1,2958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/libmysql/libmysql.vcproj b/VC++Files/libmysql/libmysql.vcproj new file mode 100755 index 00000000000..9ba877e0520 --- /dev/null +++ b/VC++Files/libmysql/libmysql.vcproj @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/libmysqld/examples/test_libmysqld.vcproj b/VC++Files/libmysqld/examples/test_libmysqld.vcproj new file mode 100755 index 00000000000..bf26fbd6588 --- /dev/null +++ b/VC++Files/libmysqld/examples/test_libmysqld.vcproj @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/libmysqld/libmysqld.vcproj b/VC++Files/libmysqld/libmysqld.vcproj new file mode 100755 index 00000000000..6d75a2c34cd --- /dev/null +++ b/VC++Files/libmysqld/libmysqld.vcproj @@ -0,0 +1,4500 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/libmysqltest/myTest.vcproj b/VC++Files/libmysqltest/myTest.vcproj new file mode 100755 index 00000000000..06ce20bf021 --- /dev/null +++ b/VC++Files/libmysqltest/myTest.vcproj @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/my_print_defaults/my_print_defaults.vcproj b/VC++Files/my_print_defaults/my_print_defaults.vcproj new file mode 100755 index 00000000000..e49039b6a1e --- /dev/null +++ b/VC++Files/my_print_defaults/my_print_defaults.vcproj @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/myisam/myisam.vcproj b/VC++Files/myisam/myisam.vcproj new file mode 100755 index 00000000000..b63b7ffaccc --- /dev/null +++ b/VC++Files/myisam/myisam.vcproj @@ -0,0 +1,2094 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/myisam_ftdump/myisam_ftdump.vcproj b/VC++Files/myisam_ftdump/myisam_ftdump.vcproj new file mode 100755 index 00000000000..4d1013775fa --- /dev/null +++ b/VC++Files/myisam_ftdump/myisam_ftdump.vcproj @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/myisamchk/myisamchk.vcproj b/VC++Files/myisamchk/myisamchk.vcproj new file mode 100755 index 00000000000..ce2435bc34a --- /dev/null +++ b/VC++Files/myisamchk/myisamchk.vcproj @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/myisamlog/myisamlog.vcproj b/VC++Files/myisamlog/myisamlog.vcproj new file mode 100755 index 00000000000..6189a54d33b --- /dev/null +++ b/VC++Files/myisamlog/myisamlog.vcproj @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/myisammrg/myisammrg.vcproj b/VC++Files/myisammrg/myisammrg.vcproj new file mode 100755 index 00000000000..3075f8ef9f6 --- /dev/null +++ b/VC++Files/myisammrg/myisammrg.vcproj @@ -0,0 +1,968 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/myisampack/myisampack.vcproj b/VC++Files/myisampack/myisampack.vcproj new file mode 100755 index 00000000000..27a8653cc5a --- /dev/null +++ b/VC++Files/myisampack/myisampack.vcproj @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysql-test/mysql_test_run_new.vcproj b/VC++Files/mysql-test/mysql_test_run_new.vcproj new file mode 100755 index 00000000000..12d502e5768 --- /dev/null +++ b/VC++Files/mysql-test/mysql_test_run_new.vcproj @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysql.sln b/VC++Files/mysql.sln new file mode 100755 index 00000000000..c7378231ae6 --- /dev/null +++ b/VC++Files/mysql.sln @@ -0,0 +1,1211 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdb", "bdb\bdb.vcproj", "{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "comp_err", "comp_err\comp_err.vcproj", "{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dbug", "dbug\dbug.vcproj", "{FC369DF4-AEB7-4531-BF34-A638C4363BFE}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "heap", "heap\heap.vcproj", "{C70A6DC7-7D45-4C16-8654-7E57713A4C04}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "innobase", "innobase\innobase.vcproj", "{13D37150-54D0-46C5-9519-03923243C7C7}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmysql", "libmysql\libmysql.vcproj", "{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}" + ProjectSection(ProjectDependencies) = postProject + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmysqld", "libmysqld\libmysqld.vcproj", "{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} = {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} + {13D37150-54D0-46C5-9519-03923243C7C7} = {13D37150-54D0-46C5-9519-03923243C7C7} + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3} = {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3} + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} = {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {C70A6DC7-7D45-4C16-8654-7E57713A4C04} = {C70A6DC7-7D45-4C16-8654-7E57713A4C04} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myTest", "libmysqltest\myTest.vcproj", "{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}" + ProjectSection(ProjectDependencies) = postProject + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F} = {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "my_print_defaults", "my_print_defaults\my_print_defaults.vcproj", "{B0EC3594-CD67-4364-826E-BA75EF2050F8}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisam", "myisam\myisam.vcproj", "{262280A8-37D5-4037-BDFB-242468DFB3D2}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisam_ftdump", "myisam_ftdump\myisam_ftdump.vcproj", "{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisamchk", "myisamchk\myisamchk.vcproj", "{87CD9881-D234-4306-BBC6-0668C6168C0F}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisamlog", "myisamlog\myisamlog.vcproj", "{194F5EE6-9440-4298-A6FE-A9B4B480B44C}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisammrg", "myisammrg\myisammrg.vcproj", "{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "myisampack", "myisampack\myisampack.vcproj", "{EF833A1E-E358-4B6C-9C27-9489E85041CC}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql", "client\mysql.vcproj", "{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}" + ProjectSection(ProjectDependencies) = postProject + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqladmin", "client\mysqladmin.vcproj", "{D2B00DE0-F6E9-40AF-B90D-A257D014F098}" + ProjectSection(ProjectDependencies) = postProject + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlbinlog", "mysqlbinlog\mysqlbinlog.vcproj", "{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}" + ProjectSection(ProjectDependencies) = postProject + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlcheck", "mysqlcheck\mysqlcheck.vcproj", "{67154F28-D076-419E-B149-819EF548E670}" + ProjectSection(ProjectDependencies) = postProject + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlclient", "client\mysqlclient.vcproj", "{26383276-4843-494B-8BE0-8936ED3EBAAB}" + ProjectSection(ProjectDependencies) = postProject + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqld", "sql\mysqld.vcproj", "{62E85884-3ACF-4F4C-873B-60B878147890}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} = {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} + {13D37150-54D0-46C5-9519-03923243C7C7} = {13D37150-54D0-46C5-9519-03923243C7C7} + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3} = {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3} + {DB28DE80-837F-4497-9AA9-CC0A20584C98} = {DB28DE80-837F-4497-9AA9-CC0A20584C98} + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} = {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B} = {F74653C4-8003-4A79-8F53-FC69E0AD7A9B} + {C70A6DC7-7D45-4C16-8654-7E57713A4C04} = {C70A6DC7-7D45-4C16-8654-7E57713A4C04} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqldemb", "mysqldemb\mysqldemb.vcproj", "{37D9BA79-302E-4582-A545-CB5FF7982EA3}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqldump", "client\mysqldump.vcproj", "{89F24ECE-9953-40EF-BDF4-B41F5631E92B}" + ProjectSection(ProjectDependencies) = postProject + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlimport", "client\mysqlimport.vcproj", "{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}" + ProjectSection(ProjectDependencies) = postProject + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlserver", "mysqlserver\mysqlserver.vcproj", "{94B86159-C581-42CD-825D-C69CBC237E5C}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} = {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} + {13D37150-54D0-46C5-9519-03923243C7C7} = {13D37150-54D0-46C5-9519-03923243C7C7} + {37D9BA79-302E-4582-A545-CB5FF7982EA3} = {37D9BA79-302E-4582-A545-CB5FF7982EA3} + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} = {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0} + {262280A8-37D5-4037-BDFB-242468DFB3D2} = {262280A8-37D5-4037-BDFB-242468DFB3D2} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {C70A6DC7-7D45-4C16-8654-7E57713A4C04} = {C70A6DC7-7D45-4C16-8654-7E57713A4C04} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlshow", "client\mysqlshow.vcproj", "{3737BFE2-EF25-464F-994D-BD28A9F84528}" + ProjectSection(ProjectDependencies) = postProject + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yassl", "extra\yassl\yassl.vcproj", "{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}" + ProjectSection(ProjectDependencies) = postProject + {DB28DE80-837F-4497-9AA9-CC0A20584C98} = {DB28DE80-837F-4497-9AA9-CC0A20584C98} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "taocrypt", "extra\yassl\taocrypt\taocrypt.vcproj", "{DB28DE80-837F-4497-9AA9-CC0A20584C98}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysys", "mysys\mysys.vcproj", "{44D9C7DC-6636-4B82-BD01-6876C64017DF}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "perror", "perror\perror.vcproj", "{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regex", "regex\regex.vcproj", "{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "replace", "replace\replace.vcproj", "{16699B52-ECC6-4A96-A99F-A043059BA2E7}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "strings", "strings\strings.vcproj", "{EEC1300B-85A5-497C-B3E1-F708021DF859}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test1", "test1\test1.vcproj", "{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}" + ProjectSection(ProjectDependencies) = postProject + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F} = {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_libmysqld", "libmysqld\examples\test_libmysqld.vcproj", "{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}" + ProjectSection(ProjectDependencies) = postProject + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9} = {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thr_test", "thr_test\thr_test.vcproj", "{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}" + ProjectSection(ProjectDependencies) = postProject + {EEC1300B-85A5-497C-B3E1-F708021DF859} = {EEC1300B-85A5-497C-B3E1-F708021DF859} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + {FC369DF4-AEB7-4531-BF34-A638C4363BFE} = {FC369DF4-AEB7-4531-BF34-A638C4363BFE} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vio", "vio\vio.vcproj", "{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcproj", "{8762A9B8-72A9-462E-A9A2-F3265081F8AF}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqltest", "client\mysqltest.vcproj", "{8961F149-C68A-4154-A499-A2AB39E607E8}" + ProjectSection(ProjectDependencies) = postProject + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} = {207E9014-C4D1-4F6D-B76F-BC7DD7E31113} + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} = {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB} + {26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB} + {8762A9B8-72A9-462E-A9A2-F3265081F8AF} = {8762A9B8-72A9-462E-A9A2-F3265081F8AF} + {44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql_client_test", "tests\mysql_client_test.vcproj", "{DA224DAB-5006-42BE-BB77-16E8BE5326D5}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql_test_run_new", "mysql-test\mysql_test_run_new.vcproj", "{6189F838-21C6-42A1-B2D0-9146316573F7}" + ProjectSection(ProjectDependencies) = postProject + {8961F149-C68A-4154-A499-A2AB39E607E8} = {8961F149-C68A-4154-A499-A2AB39E607E8} + {DA224DAB-5006-42BE-BB77-16E8BE5326D5} = {DA224DAB-5006-42BE-BB77-16E8BE5326D5} + {D2B00DE0-F6E9-40AF-B90D-A257D014F098} = {D2B00DE0-F6E9-40AF-B90D-A257D014F098} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + classic = classic + classic nt = classic nt + Debug = Debug + Embedded_Classic = Embedded_Classic + Embedded_Debug = Embedded_Debug + Embedded_Pro = Embedded_Pro + Embedded_Release = Embedded_Release + Max = Max + Max nt = Max nt + nt = nt + pro = pro + pro nt = pro nt + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic nt.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Debug.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Debug.Build.0 = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.Build.0 = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Debug.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Debug.Build.0 = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Pro.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Release.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max nt.ActiveCfg = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max nt.Build.0 = Max|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.nt.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro nt.ActiveCfg = Debug|Win32 + {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Release.ActiveCfg = Debug|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.classic.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.classic nt.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.classic nt.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Debug.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Classic.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Debug.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Pro.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Release.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max nt.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max nt.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.nt.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.nt.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro nt.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro nt.Build.0 = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Release.ActiveCfg = Release|Win32 + {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Release.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic nt.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic nt.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Debug.ActiveCfg = Debug|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Debug.Build.0 = Debug|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Classic.ActiveCfg = Debug|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Debug.ActiveCfg = TLS_DEBUG|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Pro.ActiveCfg = Debug|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Release.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max nt.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max nt.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.nt.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.nt.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro nt.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro nt.Build.0 = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Release.ActiveCfg = Release|Win32 + {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Release.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic nt.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic nt.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Debug.ActiveCfg = Debug|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Debug.Build.0 = Debug|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Classic.ActiveCfg = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Classic.Build.0 = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Debug.ActiveCfg = TLS_DEBUG|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Pro.ActiveCfg = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Pro.Build.0 = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Release.ActiveCfg = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Release.Build.0 = TLS|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max nt.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max nt.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.nt.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.nt.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro nt.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro nt.Build.0 = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Release.ActiveCfg = Release|Win32 + {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Release.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.classic.ActiveCfg = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.classic nt.ActiveCfg = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Debug.ActiveCfg = Debug|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Debug.Build.0 = Debug|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Classic.ActiveCfg = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Debug.ActiveCfg = Debug|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Debug.Build.0 = Debug|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Pro.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Pro.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Release.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Release.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Max.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Max.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Max nt.ActiveCfg = Max nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Max nt.Build.0 = Max nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.nt.ActiveCfg = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.nt.Build.0 = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.pro.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.pro.Build.0 = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.pro nt.ActiveCfg = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.pro nt.Build.0 = nt|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Release.ActiveCfg = Release|Win32 + {13D37150-54D0-46C5-9519-03923243C7C7}.Release.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic nt.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic nt.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Debug.ActiveCfg = Debug|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Debug.Build.0 = Debug|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Classic.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Debug.ActiveCfg = Debug|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Pro.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Release.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max nt.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max nt.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.nt.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.nt.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro nt.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro nt.Build.0 = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Release.ActiveCfg = Release|Win32 + {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Release.Build.0 = Release|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.classic.ActiveCfg = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.classic nt.ActiveCfg = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Debug.ActiveCfg = Debug|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Classic.ActiveCfg = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Classic.Build.0 = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Debug.ActiveCfg = Debug|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Debug.Build.0 = Debug|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Pro.ActiveCfg = pro|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Pro.Build.0 = pro|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Release.ActiveCfg = Release|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Release.Build.0 = Release|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Max.ActiveCfg = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Max nt.ActiveCfg = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.nt.ActiveCfg = classic|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro.ActiveCfg = pro|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro nt.ActiveCfg = pro|Win32 + {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Release.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic.ActiveCfg = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic.Build.0 = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic nt.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic nt.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Debug.ActiveCfg = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Debug.Build.0 = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Classic.ActiveCfg = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Debug.ActiveCfg = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Pro.ActiveCfg = Debug|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Release.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max nt.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max nt.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.nt.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.nt.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro nt.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro nt.Build.0 = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Release.ActiveCfg = Release|Win32 + {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Release.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic.ActiveCfg = classic|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic.Build.0 = classic|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic nt.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic nt.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Debug.ActiveCfg = Debug|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Debug.Build.0 = Debug|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Classic.ActiveCfg = Debug|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Debug.ActiveCfg = Debug|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Pro.ActiveCfg = Debug|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Release.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max nt.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max nt.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.nt.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.nt.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro nt.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro nt.Build.0 = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Release.ActiveCfg = Release|Win32 + {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Release.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.classic nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Debug.ActiveCfg = Debug|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Debug.Build.0 = Debug|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Classic.ActiveCfg = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Classic.Build.0 = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Debug.ActiveCfg = Debug|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Pro.ActiveCfg = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Pro.Build.0 = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Release.ActiveCfg = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Release.Build.0 = TLS|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Max nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro nt.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro nt.Build.0 = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.ActiveCfg = Release|Win32 + {262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic nt.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic nt.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Debug.ActiveCfg = Debug|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Debug.Build.0 = Debug|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Classic.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Debug.ActiveCfg = Debug|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Pro.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Release.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max nt.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max nt.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.nt.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.nt.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro nt.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro nt.Build.0 = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Release.ActiveCfg = Release|Win32 + {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Release.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic.ActiveCfg = classic|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic.Build.0 = classic|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.classic nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Debug.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Debug.Build.0 = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Classic.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Debug.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Pro.ActiveCfg = Debug|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Release.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Max nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro nt.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro nt.Build.0 = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.ActiveCfg = Release|Win32 + {87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic.ActiveCfg = classic|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic.Build.0 = classic|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic nt.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic nt.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Debug.ActiveCfg = Debug|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Debug.Build.0 = Debug|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Classic.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Debug.ActiveCfg = Debug|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Pro.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Release.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max nt.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max nt.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.nt.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.nt.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro nt.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro nt.Build.0 = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Release.ActiveCfg = Release|Win32 + {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Release.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic.ActiveCfg = Debug|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic.Build.0 = Debug|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic nt.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic nt.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Debug.ActiveCfg = Debug|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Debug.Build.0 = Debug|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Classic.ActiveCfg = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Classic.Build.0 = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Debug.ActiveCfg = Debug|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Pro.ActiveCfg = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Pro.Build.0 = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Release.ActiveCfg = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Release.Build.0 = TLS|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max nt.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max nt.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.nt.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.nt.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro nt.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro nt.Build.0 = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Release.ActiveCfg = Release|Win32 + {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Release.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic.ActiveCfg = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic.Build.0 = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Debug.ActiveCfg = Debug|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Debug.Build.0 = Debug|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Classic.ActiveCfg = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Debug.ActiveCfg = Debug|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Pro.ActiveCfg = classic|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Release.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro nt.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro nt.Build.0 = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.ActiveCfg = Release|Win32 + {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic.ActiveCfg = classic|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic.Build.0 = classic|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic nt.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic nt.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Debug.ActiveCfg = Debug|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Debug.Build.0 = Debug|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Classic.ActiveCfg = Debug|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Debug.ActiveCfg = Debug|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Pro.ActiveCfg = Debug|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Release.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max nt.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max nt.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.nt.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.nt.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro nt.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro nt.Build.0 = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Release.ActiveCfg = Release|Win32 + {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Release.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic.ActiveCfg = classic|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic.Build.0 = classic|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic nt.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic nt.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Debug.ActiveCfg = Debug|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Debug.Build.0 = Debug|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Classic.ActiveCfg = Debug|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Debug.ActiveCfg = Debug|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Pro.ActiveCfg = Debug|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Release.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max nt.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max nt.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.nt.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.nt.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro nt.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro nt.Build.0 = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Release.ActiveCfg = Release|Win32 + {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Release.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic.ActiveCfg = classic|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic.Build.0 = classic|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic nt.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic nt.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Debug.ActiveCfg = Debug|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Debug.Build.0 = Debug|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Classic.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Debug.ActiveCfg = Debug|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Pro.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Release.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max nt.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max nt.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.nt.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.nt.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro nt.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro nt.Build.0 = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Release.ActiveCfg = Release|Win32 + {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Release.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.classic.ActiveCfg = classic|Win32 + {67154F28-D076-419E-B149-819EF548E670}.classic.Build.0 = classic|Win32 + {67154F28-D076-419E-B149-819EF548E670}.classic nt.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.classic nt.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Debug.ActiveCfg = Debug|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Debug.Build.0 = Debug|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Embedded_Classic.ActiveCfg = Debug|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Embedded_Debug.ActiveCfg = Debug|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Embedded_Pro.ActiveCfg = Debug|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Embedded_Release.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Max.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Max.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Max nt.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Max nt.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.nt.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.nt.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.pro.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.pro.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.pro nt.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.pro nt.Build.0 = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Release.ActiveCfg = Release|Win32 + {67154F28-D076-419E-B149-819EF548E670}.Release.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic.ActiveCfg = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic.Build.0 = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic nt.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.classic nt.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Debug.ActiveCfg = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Debug.Build.0 = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Classic.ActiveCfg = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Debug.ActiveCfg = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Pro.ActiveCfg = Debug|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Release.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max nt.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Max nt.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.nt.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.nt.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro nt.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro nt.Build.0 = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Release.ActiveCfg = Release|Win32 + {26383276-4843-494B-8BE0-8936ED3EBAAB}.Release.Build.0 = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.classic.ActiveCfg = classic|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.classic.Build.0 = classic|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.classic nt.ActiveCfg = classic nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.classic nt.Build.0 = classic nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Debug.ActiveCfg = Debug|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Debug.Build.0 = Debug|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Classic.ActiveCfg = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Debug.ActiveCfg = Debug|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Pro.ActiveCfg = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Release.ActiveCfg = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Max.ActiveCfg = Max|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Max.Build.0 = Max|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Max nt.ActiveCfg = Max nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Max nt.Build.0 = Max nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.nt.ActiveCfg = nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.nt.Build.0 = nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.pro.ActiveCfg = pro|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.pro.Build.0 = pro|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.pro nt.ActiveCfg = pro nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.pro nt.Build.0 = pro nt|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Release.ActiveCfg = Release|Win32 + {62E85884-3ACF-4F4C-873B-60B878147890}.Release.Build.0 = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic.ActiveCfg = classic|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic.Build.0 = classic|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic nt.ActiveCfg = classic|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic nt.Build.0 = classic|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Debug.ActiveCfg = Debug|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Debug.Build.0 = Debug|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Classic.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Debug.ActiveCfg = Debug|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Pro.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Release.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max.Build.0 = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max nt.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max nt.Build.0 = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.nt.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.nt.Build.0 = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro.ActiveCfg = pro|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro.Build.0 = pro|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro nt.ActiveCfg = pro|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro nt.Build.0 = pro|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Release.ActiveCfg = Release|Win32 + {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Release.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic.ActiveCfg = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic.Build.0 = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic nt.ActiveCfg = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic nt.Build.0 = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Debug.ActiveCfg = Debug|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Debug.Build.0 = Debug|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Classic.ActiveCfg = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Debug.ActiveCfg = Debug|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Pro.ActiveCfg = classic|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Release.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro nt.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro nt.Build.0 = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.ActiveCfg = Release|Win32 + {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic.ActiveCfg = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic.Build.0 = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic nt.ActiveCfg = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic nt.Build.0 = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Debug.ActiveCfg = Debug|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Debug.Build.0 = Debug|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Classic.ActiveCfg = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Debug.ActiveCfg = Debug|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Pro.ActiveCfg = classic|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Release.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max nt.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max nt.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.nt.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.nt.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro nt.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro nt.Build.0 = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Release.ActiveCfg = Release|Win32 + {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Release.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.classic.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.classic.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.classic nt.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.classic nt.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Debug.ActiveCfg = Debug|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Debug.Build.0 = Debug|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Classic.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Debug.ActiveCfg = Debug|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Pro.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Release.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Max.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Max.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Max nt.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Max nt.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.nt.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.nt.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.pro.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.pro.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.pro nt.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.pro nt.Build.0 = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Release.ActiveCfg = Release|Win32 + {94B86159-C581-42CD-825D-C69CBC237E5C}.Release.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic.ActiveCfg = classic|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic.Build.0 = classic|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic nt.ActiveCfg = classic|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.classic nt.Build.0 = classic|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Debug.ActiveCfg = Debug|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Debug.Build.0 = Debug|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Classic.ActiveCfg = Debug|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Debug.ActiveCfg = Debug|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Pro.ActiveCfg = Debug|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Release.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max nt.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Max nt.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.nt.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.nt.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro nt.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro nt.Build.0 = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Release.ActiveCfg = Release|Win32 + {3737BFE2-EF25-464F-994D-BD28A9F84528}.Release.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.classic.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.classic.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.classic nt.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.classic nt.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Debug.ActiveCfg = Debug|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Debug.Build.0 = Debug|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Classic.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Classic.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Debug.ActiveCfg = Debug|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Debug.Build.0 = Debug|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Pro.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Pro.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Release.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Release.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Max.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Max.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Max nt.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Max nt.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.nt.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.nt.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro nt.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro nt.Build.0 = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Release.ActiveCfg = Release|Win32 + {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Release.Build.0 = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.classic.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.classic.Build.0 = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.classic nt.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.classic nt.Build.0 = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Debug.ActiveCfg = Debug|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Debug.Build.0 = Debug|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Classic.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Debug.ActiveCfg = Debug|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Pro.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Release.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Max.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Max.Build.0 = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Max nt.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Max nt.Build.0 = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.nt.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.nt.Build.0 = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro.Build.0 = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro nt.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro nt.Build.0 = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Release.ActiveCfg = Release|Win32 + {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Release.Build.0 = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic.ActiveCfg = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic.Build.0 = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic nt.ActiveCfg = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic nt.Build.0 = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Debug.ActiveCfg = Debug|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Debug.Build.0 = Debug|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Classic.ActiveCfg = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Classic.Build.0 = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Debug.ActiveCfg = TLS_DEBUG|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Pro.ActiveCfg = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Pro.Build.0 = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.ActiveCfg = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.Build.0 = TLS|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max.ActiveCfg = Max|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max.Build.0 = Max|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max nt.ActiveCfg = Max|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max nt.Build.0 = Max|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.nt.ActiveCfg = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.nt.Build.0 = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro.ActiveCfg = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro.Build.0 = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro nt.ActiveCfg = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro nt.Build.0 = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Release.ActiveCfg = Release|Win32 + {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Release.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic.ActiveCfg = classic|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic.Build.0 = classic|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic nt.ActiveCfg = classic|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic nt.Build.0 = classic|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Debug.ActiveCfg = Debug|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Debug.Build.0 = Debug|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Classic.ActiveCfg = Debug|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Debug.ActiveCfg = Debug|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Pro.ActiveCfg = Debug|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Release.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max nt.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max nt.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.nt.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.nt.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro nt.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro nt.Build.0 = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Release.ActiveCfg = Release|Win32 + {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Release.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic nt.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic nt.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Debug.ActiveCfg = Debug|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Debug.Build.0 = Debug|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Classic.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Classic.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Debug.ActiveCfg = Debug|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Debug.Build.0 = Debug|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Pro.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Pro.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Release.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Release.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max nt.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max nt.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.nt.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.nt.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro nt.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro nt.Build.0 = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Release.ActiveCfg = Release|Win32 + {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Release.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic.ActiveCfg = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic.Build.0 = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic nt.ActiveCfg = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic nt.Build.0 = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Debug.ActiveCfg = Debug|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Debug.Build.0 = Debug|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Classic.ActiveCfg = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Debug.ActiveCfg = Debug|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Pro.ActiveCfg = classic|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Release.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max nt.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max nt.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.nt.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.nt.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro nt.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro nt.Build.0 = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Release.ActiveCfg = Release|Win32 + {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Release.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic.ActiveCfg = Debug|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic.Build.0 = Debug|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic nt.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.classic nt.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Debug.ActiveCfg = Debug|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Debug.Build.0 = Debug|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Classic.ActiveCfg = Debug|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Classic.Build.0 = Debug|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Debug.ActiveCfg = Debug|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Debug.Build.0 = Debug|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Pro.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Pro.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Release.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Release.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max nt.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Max nt.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.nt.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.nt.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro nt.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro nt.Build.0 = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Release.ActiveCfg = Release|Win32 + {EEC1300B-85A5-497C-B3E1-F708021DF859}.Release.Build.0 = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic.Build.0 = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic nt.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Debug.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Debug.Build.0 = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Classic.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Debug.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Pro.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Release.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Max.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Max nt.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.nt.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro nt.ActiveCfg = Debug|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Release.ActiveCfg = Release|Win32 + {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Release.Build.0 = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.classic.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.classic.Build.0 = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.classic nt.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Debug.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Classic.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Debug.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Pro.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Release.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Max.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Max nt.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Max nt.Build.0 = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.nt.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro nt.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Release.ActiveCfg = Release|Win32 + {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Release.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic nt.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic nt.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Debug.ActiveCfg = Debug|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Debug.Build.0 = Debug|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Classic.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Debug.ActiveCfg = Debug|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Pro.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Release.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max nt.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max nt.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.nt.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.nt.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro nt.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro nt.Build.0 = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Release.ActiveCfg = Release|Win32 + {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Release.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic.ActiveCfg = Debug|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic.Build.0 = Debug|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic nt.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic nt.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Debug.ActiveCfg = Debug|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Debug.Build.0 = Debug|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Classic.ActiveCfg = Debug|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Debug.ActiveCfg = Debug|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Pro.ActiveCfg = Debug|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Release.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max nt.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max nt.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.nt.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.nt.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro nt.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro nt.Build.0 = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Release.ActiveCfg = Release|Win32 + {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Release.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic nt.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic nt.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Debug.ActiveCfg = Debug|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Debug.Build.0 = Debug|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Classic.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Classic.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Debug.ActiveCfg = Debug|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Pro.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Pro.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Release.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Release.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max nt.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max nt.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.nt.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.nt.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro nt.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro nt.Build.0 = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Release.ActiveCfg = Release|Win32 + {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Release.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.classic.ActiveCfg = classic|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.classic.Build.0 = classic|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.classic nt.ActiveCfg = classic|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.classic nt.Build.0 = classic|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Debug.ActiveCfg = Debug|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Debug.Build.0 = Debug|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Classic.ActiveCfg = Debug|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Debug.ActiveCfg = Debug|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Pro.ActiveCfg = Debug|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Release.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Max.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Max.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Max nt.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Max nt.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.nt.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.nt.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.pro.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.pro.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.pro nt.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.pro nt.Build.0 = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Release.ActiveCfg = Release|Win32 + {8961F149-C68A-4154-A499-A2AB39E607E8}.Release.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic.ActiveCfg = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic.Build.0 = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic nt.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic nt.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Debug.ActiveCfg = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Debug.Build.0 = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Classic.ActiveCfg = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Debug.ActiveCfg = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Pro.ActiveCfg = Debug|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Release.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max nt.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max nt.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.nt.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.nt.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro nt.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro nt.Build.0 = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Release.ActiveCfg = Release|Win32 + {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Release.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.classic.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.classic.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.classic nt.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.classic nt.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Debug.ActiveCfg = Debug|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Debug.Build.0 = Debug|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Classic.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Debug.ActiveCfg = Debug|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Pro.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Release.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Max.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Max.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Max nt.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Max nt.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.nt.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.nt.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.pro.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.pro.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.pro nt.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.pro nt.Build.0 = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Release.ActiveCfg = Release|Win32 + {6189F838-21C6-42A1-B2D0-9146316573F7}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/VC++Files/mysqlbinlog/mysqlbinlog.vcproj b/VC++Files/mysqlbinlog/mysqlbinlog.vcproj new file mode 100755 index 00000000000..9d5d4db2565 --- /dev/null +++ b/VC++Files/mysqlbinlog/mysqlbinlog.vcproj @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysqlcheck/mysqlcheck.vcproj b/VC++Files/mysqlcheck/mysqlcheck.vcproj new file mode 100755 index 00000000000..f47e171fd65 --- /dev/null +++ b/VC++Files/mysqlcheck/mysqlcheck.vcproj @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysqldemb/mysqldemb.vcproj b/VC++Files/mysqldemb/mysqldemb.vcproj new file mode 100755 index 00000000000..52081adb214 --- /dev/null +++ b/VC++Files/mysqldemb/mysqldemb.vcproj @@ -0,0 +1,2960 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysqlserver/mysqlserver.vcproj b/VC++Files/mysqlserver/mysqlserver.vcproj new file mode 100755 index 00000000000..2c587e0a2d7 --- /dev/null +++ b/VC++Files/mysqlserver/mysqlserver.vcproj @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/mysys/mysys.vcproj b/VC++Files/mysys/mysys.vcproj new file mode 100755 index 00000000000..3d53fd3923c --- /dev/null +++ b/VC++Files/mysys/mysys.vcproj @@ -0,0 +1,4789 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/perror/perror.vcproj b/VC++Files/perror/perror.vcproj new file mode 100755 index 00000000000..2a7bb6407c0 --- /dev/null +++ b/VC++Files/perror/perror.vcproj @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/regex/regex.vcproj b/VC++Files/regex/regex.vcproj new file mode 100755 index 00000000000..1b52017ca3b --- /dev/null +++ b/VC++Files/regex/regex.vcproj @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/replace/replace.vcproj b/VC++Files/replace/replace.vcproj new file mode 100755 index 00000000000..270ff494539 --- /dev/null +++ b/VC++Files/replace/replace.vcproj @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/sql/mysqld.vcproj b/VC++Files/sql/mysqld.vcproj new file mode 100755 index 00000000000..b96ce83246d --- /dev/null +++ b/VC++Files/sql/mysqld.vcproj @@ -0,0 +1,8584 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/strings/strings.vcproj b/VC++Files/strings/strings.vcproj new file mode 100755 index 00000000000..42099bd79ed --- /dev/null +++ b/VC++Files/strings/strings.vcproj @@ -0,0 +1,1031 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/test1/test1.vcproj b/VC++Files/test1/test1.vcproj new file mode 100755 index 00000000000..6a850f7b2e3 --- /dev/null +++ b/VC++Files/test1/test1.vcproj @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/tests/mysql_client_test.vcproj b/VC++Files/tests/mysql_client_test.vcproj new file mode 100755 index 00000000000..adcc680b6e7 --- /dev/null +++ b/VC++Files/tests/mysql_client_test.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/thr_test/thr_test.vcproj b/VC++Files/thr_test/thr_test.vcproj new file mode 100755 index 00000000000..ede9bd04de8 --- /dev/null +++ b/VC++Files/thr_test/thr_test.vcproj @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/vio/vio.vcproj b/VC++Files/vio/vio.vcproj new file mode 100755 index 00000000000..3f50c1546fb --- /dev/null +++ b/VC++Files/vio/vio.vcproj @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC++Files/zlib/zlib.vcproj b/VC++Files/zlib/zlib.vcproj new file mode 100755 index 00000000000..ee17d915a1a --- /dev/null +++ b/VC++Files/zlib/zlib.vcproj @@ -0,0 +1,483 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extra/yassl/taocrypt/taocrypt.vcproj b/extra/yassl/taocrypt/taocrypt.vcproj new file mode 100755 index 00000000000..603fafd4090 --- /dev/null +++ b/extra/yassl/taocrypt/taocrypt.vcproj @@ -0,0 +1,602 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extra/yassl/yassl.vcproj b/extra/yassl/yassl.vcproj new file mode 100755 index 00000000000..e2915e3f575 --- /dev/null +++ b/extra/yassl/yassl.vcproj @@ -0,0 +1,425 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 31febd54596106350e9d935b9a8d775ee6bb7b5e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Aug 2005 16:50:10 -0700 Subject: [PATCH 111/144] Fix test to avoid spurious failure message. (Bug #11233) mysql-test/t/information_schema.test: Stub out column in results that we don't care about, and may vary mysql-test/r/information_schema.result: Update results --- mysql-test/r/information_schema.result | 2 +- mysql-test/t/information_schema.test | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 1781492af8b..e073b1facd4 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -689,7 +689,7 @@ show variables where variable_name like "skip_show_databas"; Variable_name Value show global status like "Threads_running"; Variable_name Value -Threads_running 1 +Threads_running # create table t1(f1 int); create table t2(f2 int); create view v1 as select * from t1, t2; diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index cfbd86a018f..cf089f0089e 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -411,6 +411,8 @@ show variables where variable_name like "skip_show_databas"; # # Bug #7981:SHOW GLOBAL STATUS crashes server # +# We don't actually care about the value, just that it doesn't crash. +--replace_column 2 # show global status like "Threads_running"; # From ec9470b5525b33bacd77f279a0a975e529373bf5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Aug 2005 18:27:05 -0700 Subject: [PATCH 112/144] Update out-of-date test result mysql-test/r/information_schema.result: Update test results --- mysql-test/r/information_schema.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index e073b1facd4..e6a929d7e3e 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -545,7 +545,7 @@ proc is_deterministic enum('YES','NO') proc security_type enum('INVOKER','DEFINER') proc param_list blob proc returns char(64) -proc body blob +proc body longblob proc definer char(77) proc created timestamp proc modified timestamp From b323667ffc7176482073ca7d626560dcd8d7ee75 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 03:37:32 +0000 Subject: [PATCH 113/144] Prelocking-free SPs, post-review fixes: * Don't activate prelocking mode for evaluating procedure arguments when it is not necessary. * Code structure simplification and cleanup. * Cleanup in .test files mysql-test/r/sp-prelocking.result: Prelocking-free SPs, post-review fixes: Added comment, s/testdb/mysqltest/, fixed a wrong test (error wasnt reported because of known bug in mysqltestrun) mysql-test/r/sp-security.result: Don't drop the table we're not using. mysql-test/r/sp.result: Prelocking-free SPs, post-review fixes: remove redundant "drop table if exists t3" statements mysql-test/t/sp-prelocking.test: Prelocking-free SPs, post-review fixes: Added comment, s/testdb/mysqltest/, fixed a wrong test (error wasnt reported because of known bug in mysqltestrun) mysql-test/t/sp-security.test: Don't drop the table we're not using. mysql-test/t/sp.test: Prelocking-free SPs, post-review fixes: remove redundant "drop table if exists t3" statements sql/sp.cc: New, better defined, sp_get_prelocking_info() function to get info about statement prelocking options sql/sp.h: Prelocking-free SPs, post-review fixes: New, better defined, sp_get_prelocking_info() function to get info about statement prelocking options sql/sp_cache.h: Prelocking-free SPs, post-review fixes: Amended the comments sql/sp_head.cc: Prelocking-free SPs, post-review fixes: Amend the comments, simplify the code that attaches removes statement's prelocking tables. sql/sql_base.cc: Prelocking-free SPs, post-review fixes: * Use a better defined sp_get_prelocking_info() function to get info about statement prelocking options * Don't activate prelocked mode for evaluation of SP arguments that use tables but don't need prelocking. sql/sql_class.cc: Prelocking-free SPs, post-review fixes: Initialize THD members in the order they are declared. --- mysql-test/r/sp-prelocking.result | 26 ++++++------- mysql-test/r/sp-security.result | 2 +- mysql-test/r/sp.result | 22 +---------- mysql-test/t/sp-prelocking.test | 24 +++++++----- mysql-test/t/sp-security.test | 2 +- mysql-test/t/sp.test | 62 +------------------------------ sql/sp.cc | 43 +++++++++++---------- sql/sp.h | 4 +- sql/sp_cache.h | 3 +- sql/sp_head.cc | 58 ++++++++++------------------- sql/sql_base.cc | 33 ++++++++-------- sql/sql_class.cc | 4 +- 12 files changed, 93 insertions(+), 190 deletions(-) diff --git a/mysql-test/r/sp-prelocking.result b/mysql-test/r/sp-prelocking.result index da5c95cc2dd..32d6d4e6264 100644 --- a/mysql-test/r/sp-prelocking.result +++ b/mysql-test/r/sp-prelocking.result @@ -1,4 +1,4 @@ -drop database if exists testdb; +drop database if exists mysqltest; drop table if exists t1, t2, t3, t4; drop procedure if exists sp1; drop procedure if exists sp2; @@ -7,8 +7,8 @@ drop procedure if exists sp4; drop function if exists f1; drop function if exists f2; drop function if exists f3; -create database testdb; -use testdb// +create database mysqltest; +use mysqltest// create procedure sp1 () begin drop table if exists t1; @@ -17,7 +17,7 @@ end; // select database(); database() -testdb +mysqltest call sp1(); my-col 1 @@ -25,12 +25,12 @@ Warnings: Note 1051 Unknown table 't1' select database(); database() -testdb +mysqltest use test; select database(); database() test -call testdb.sp1(); +call mysqltest.sp1(); my-col 1 Warnings: @@ -38,8 +38,8 @@ Note 1051 Unknown table 't1' select database(); database() test -drop procedure testdb.sp1; -drop database testdb; +drop procedure mysqltest.sp1; +drop database mysqltest; create procedure sp1() begin create table t1 (a int); @@ -95,13 +95,15 @@ create temporary table t1 (a int); insert into t1 values(1); call sp1(); select 't1', a from t1; -select 't2', b from t2; +select 't2', a from t2; drop table t1; drop table t2; end// call sp2(); t1 a t1 1 +t2 a +t2 1 drop procedure sp1; drop procedure sp2; create table t1 (a int); @@ -138,21 +140,15 @@ end // call sp4(); a 1 -1 -1 2 a 1 -1 2 a 1 -1 2 a 5 -drop temporary table t1; -drop temporary table t2; drop procedure sp1; drop procedure sp2; drop procedure sp3; diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index 75ae19eed91..184978e4a0d 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -1,7 +1,7 @@ use test; grant usage on *.* to user1@localhost; flush privileges; -drop table if exists t1,t2; +drop table if exists t1; drop database if exists db1_secret; create database db1_secret; create procedure db1_secret.dummy() begin end; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 1d5cd689676..b4b0424c2a7 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -84,7 +84,6 @@ foo 1 kaka 3 delete from t1| drop procedure setcontext| -drop table if exists t3| create table t3 ( d date, i int, f double, s varchar(32) )| drop procedure if exists nullset| create procedure nullset() @@ -520,7 +519,6 @@ select data into x from test.t1 limit 1; insert into test.t3 values ("into4", x); end| delete from t1| -drop table if exists t3| create table t3 ( s char(16), d int)| call into_test4()| Warnings: @@ -564,13 +562,12 @@ insert into test.t1 values (x, y); create temporary table test.t3 select * from test.t1; insert into test.t3 values (concat(x, "2"), y+2); end| -drop table if exists t3| call create_select("cs", 90)| select * from t1, t3| id data id data cs 90 cs 90 cs 90 cs2 92 -drop table if exists t3| +drop table t3| delete from t1| drop procedure create_select| drop function if exists e| @@ -701,7 +698,6 @@ id data hndlr3 13 delete from t1| drop procedure hndlr3| -drop table if exists t3| create table t3 ( id char(16), data int )| drop procedure if exists hndlr4| create procedure hndlr4() @@ -744,7 +740,6 @@ foo 40 bar 15 zap 663 drop procedure cur1| -drop table if exists t3| create table t3 ( s char(16), i int )| drop procedure if exists cur2| create procedure cur2() @@ -1308,7 +1303,6 @@ select t1max()| t1max() 5 drop function t1max| -drop table if exists t3| create table t3 ( v char(16) not null primary key, c int unsigned not null @@ -1429,7 +1423,6 @@ select @1, @2| 2 NULL drop table t70| drop procedure bug1656| -drop table if exists t3| create table t3(a int)| drop procedure if exists bug1862| create procedure bug1862() @@ -1554,7 +1547,6 @@ select @x| 42 drop procedure bug2776_1| drop procedure bug2776_2| -drop table if exists t3| create table t3 (s1 smallint)| insert into t3 values (123456789012)| Warnings: @@ -1615,7 +1607,6 @@ f1 rc t3 drop procedure bug1863| drop temporary table temp_t1; drop table t3, t4| -drop table if exists t3, t4| create table t3 ( OrderID int not null, MarketID int, @@ -1693,7 +1684,6 @@ select @i, from_unixtime(@stamped_time, '%d-%m-%Y %h:%i:%s') as time| @i time 2 01-01-1970 03:16:40 drop procedure bug3426| -drop table if exists t3, t4| create table t3 ( a int primary key, ach char(1) @@ -1723,7 +1713,6 @@ a ach b bch 1 a 1 b drop procedure bug3448| drop table t3, t4| -drop table if exists t3| create table t3 ( id int unsigned auto_increment not null primary key, title VARCHAR(200), @@ -1872,7 +1861,6 @@ select 1+2| 1+2 3 drop procedure bug3843| -drop table if exists t3| create table t3 ( s1 char(10) )| insert into t3 values ('a'), ('b')| drop procedure if exists bug3368| @@ -1888,7 +1876,6 @@ group_concat(v) yz,yz drop procedure bug3368| drop table t3| -drop table if exists t3| create table t3 (f1 int, f2 int)| insert into t3 values (1,1)| drop procedure if exists bug4579_1| @@ -1913,7 +1900,6 @@ Warning 1329 No data to FETCH drop procedure bug4579_1| drop procedure bug4579_2| drop table t3| -drop table if exists t3| drop procedure if exists bug2773| create function bug2773() returns int return null| create table t3 as select bug2773()| @@ -1935,7 +1921,6 @@ select bug3788()| bug3788() 5 drop function bug3788| -drop table if exists t3| create table t3 (f1 int, f2 int, f3 int)| insert into t3 values (1,1,1)| drop procedure if exists bug4726| @@ -2096,7 +2081,6 @@ call bug4902_2()| Id User Host db Command Time State Info # root localhost test Query # NULL show processlist drop procedure bug4902_2| -drop table if exists t3| drop procedure if exists bug4904| create procedure bug4904() begin @@ -2285,7 +2269,6 @@ flush status| flush query cache| delete from t1| drop procedure bug3583| -drop table if exists t3| drop procedure if exists bug4905| create table t3 (s1 int,primary key (s1))| drop procedure if exists bug4905| @@ -2343,7 +2326,6 @@ call bug8540()| y z 1 1 drop procedure bug8540| -drop table if exists t3| create table t3 (s1 int)| drop procedure if exists bug6642| create procedure bug6642() @@ -2426,7 +2408,6 @@ call bug7992_2()| drop procedure bug7992_1| drop procedure bug7992_2| drop table t3| -drop table if exists t3| create table t3 ( userid bigint(20) not null default 0 )| drop procedure if exists bug8116| create procedure bug8116(in _userid int) @@ -2587,7 +2568,6 @@ delete from t1| drop procedure if exists bug6900| drop procedure if exists bug9074| drop procedure if exists bug6900_9074| -drop table if exists t3| create table t3 (w char unique, x char)| insert into t3 values ('a', 'b')| create procedure bug6900() diff --git a/mysql-test/t/sp-prelocking.test b/mysql-test/t/sp-prelocking.test index 9dbf4f4af7e..e5f35b19fa7 100644 --- a/mysql-test/t/sp-prelocking.test +++ b/mysql-test/t/sp-prelocking.test @@ -1,5 +1,13 @@ +# +# Tests of prelocking-free execution of stored procedures. +# Currently two properties of prelocking-free SP execution are checked: +# - It is possible to execute DDL statements in prelocking-free stored +# procedure +# - The same procedure can be called in prelocking-free mode and +# in prelocked mode (from within a function). + --disable_warnings -drop database if exists testdb; +drop database if exists mysqltest; drop table if exists t1, t2, t3, t4; drop procedure if exists sp1; drop procedure if exists sp2; @@ -12,9 +20,9 @@ drop function if exists f3; # BUG#8072 -create database testdb; +create database mysqltest; delimiter //; -use testdb// +use mysqltest// create procedure sp1 () begin drop table if exists t1; @@ -29,11 +37,11 @@ select database(); use test; select database(); -call testdb.sp1(); +call mysqltest.sp1(); select database(); -drop procedure testdb.sp1; -drop database testdb; +drop procedure mysqltest.sp1; +drop database mysqltest; # BUG#8766 @@ -96,7 +104,7 @@ begin insert into t1 values(1); call sp1(); select 't1', a from t1; - select 't2', b from t2; + select 't2', a from t2; drop table t1; drop table t2; end// @@ -151,8 +159,6 @@ end // delimiter ;// call sp4(); -drop temporary table t1; -drop temporary table t2; drop procedure sp1; drop procedure sp2; drop procedure sp3; diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index 69529fd1ed0..15fcba5ebe9 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -15,7 +15,7 @@ grant usage on *.* to user1@localhost; flush privileges; --disable_warnings -drop table if exists t1,t2; +drop table if exists t1; drop database if exists db1_secret; --enable_warnings # Create our secret database diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index d70ce702daf..a41e54deb1a 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -147,9 +147,6 @@ drop procedure setcontext| # Set things to null ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 ( d date, i int, f double, s varchar(32) )| --disable_warnings @@ -683,9 +680,6 @@ begin end| delete from t1| ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 ( s char(16), d int)| call into_test4()| select * from t3| @@ -741,14 +735,9 @@ begin insert into test.t3 values (concat(x, "2"), y+2); end| ---disable_warnings -drop table if exists t3| ---enable_warnings call create_select("cs", 90)| select * from t1, t3| ---disable_warnings -drop table if exists t3| ---enable_warnings +drop table t3| delete from t1| drop procedure create_select| @@ -922,9 +911,6 @@ drop procedure hndlr3| # Variables might be uninitialized when using handlers # (Otherwise the compiler can detect if a variable is not set, but # not in this case.) ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 ( id char(16), data int )| --disable_warnings @@ -977,9 +963,6 @@ call cur1()| select * from t1| drop procedure cur1| ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 ( s char(16), i int )| --disable_warnings @@ -1611,9 +1594,6 @@ insert into t1 values ("foo", 3), ("bar", 2), ("zip", 5), ("zap", 1)| select t1max()| drop function t1max| ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 ( v char(16) not null primary key, c int unsigned not null @@ -1747,9 +1727,6 @@ drop procedure bug1656| # # BUG#1862 # ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3(a int)| --disable_warnings @@ -2006,9 +1983,6 @@ drop procedure bug2776_2| # # BUG#2780 # ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 (s1 smallint)| insert into t3 values (123456789012)| @@ -2082,9 +2056,6 @@ drop table t3, t4| # # BUG#2656 # ---disable_warnings -drop table if exists t3, t4| ---enable_warnings create table t3 ( OrderID int not null, @@ -2172,8 +2143,6 @@ drop procedure bug3426| # BUG#3448 # --disable_warnings -drop table if exists t3, t4| - create table t3 ( a int primary key, ach char(1) @@ -2205,9 +2174,6 @@ drop table t3, t4| # # BUG#3734 # ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 ( id int unsigned auto_increment not null primary key, title VARCHAR(200), @@ -2383,9 +2349,6 @@ drop procedure bug3843| # # BUG#3368 # ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 ( s1 char(10) )| insert into t3 values ('a'), ('b')| @@ -2405,9 +2368,6 @@ drop table t3| # # BUG#4579 # ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 (f1 int, f2 int)| insert into t3 values (1,1)| @@ -2442,7 +2402,6 @@ drop table t3| # BUG#2773: Function's data type ignored in stored procedures # --disable_warnings -drop table if exists t3| drop procedure if exists bug2773| --enable_warnings @@ -2471,10 +2430,6 @@ drop function bug3788| # # BUG#4726 # ---disable_warnings -drop table if exists t3| ---enable_warnings - create table t3 (f1 int, f2 int, f3 int)| insert into t3 values (1,1,1)| @@ -2505,9 +2460,6 @@ drop table t3| # BUG#4318 # #QQ Don't know if HANDLER commands can work with SPs, or at all... -#--disable_warnings -#drop table if exists t3| -#--enable_warnings # #create table t3 (s1 int)| #insert into t3 values (3), (4)| @@ -2588,10 +2540,6 @@ drop procedure bug4902_2| # # BUG#4904 # ---disable_warnings -drop table if exists t3| ---enable_warnings - --disable_warnings drop procedure if exists bug4904| --enable_warnings @@ -2845,7 +2793,6 @@ drop procedure bug3583| # BUG#4905: Stored procedure doesn't clear for "Rows affected" # --disable_warnings -drop table if exists t3| drop procedure if exists bug4905| --enable_warnings @@ -2945,9 +2892,6 @@ drop procedure bug8540| # # BUG#6642: Stored procedure crash if expression with set function # ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 (s1 int)| --disable_warnings @@ -3035,9 +2979,6 @@ drop table t3| # BUG#8116: calling simple stored procedure twice in a row results # in server crash # ---disable_warnings -drop table if exists t3| ---enable_warnings create table t3 ( userid bigint(20) not null default 0 )| --disable_warnings @@ -3280,7 +3221,6 @@ delete from t1| drop procedure if exists bug6900| drop procedure if exists bug9074| drop procedure if exists bug6900_9074| -drop table if exists t3| --enable_warnings create table t3 (w char unique, x char)| diff --git a/sql/sp.cc b/sql/sp.cc index 3d513b16d07..0cc1c988217 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1176,40 +1176,39 @@ extern "C" byte* sp_sroutine_key(const byte *ptr, uint *plen, my_bool first) /* - Check if routines in routines_list require sp_cache_routines_and_add_tables - call. + Check if + - current statement (the one in thd->lex) needs table prelocking + - first routine in thd->lex->sroutines_list needs to execute its body in + prelocked mode. SYNOPSIS - sp_need_cache_routines() - thd - routines - need_skip_first OUT TRUE - don't do prelocking for the 1st element in - routines list. - FALSE- otherwise + sp_get_prelocking_info() + thd Current thread, thd->lex is the statement to be + checked. + need_prelocking OUT TRUE - prelocked mode should be activated + before executing the statement + FALSE - Don't activate prelocking + first_no_prelocking OUT TRUE - Tables used by first routine in + thd->lex->sroutines_list should be + prelocked. + FALSE - Otherwise. NOTES This function assumes that for any "CALL proc(...)" statement routines_list will have 'proc' as first element (it may have several, consider e.g. "proc(sp_func(...)))". This property is currently guaranted by the parser. - - RETURN - TRUE Need to sp_cache_routines_and_add_tables call for this statement. - FALSE Otherwise. */ -bool sp_need_cache_routines(THD *thd, SQL_LIST *routines_list, bool *need_skip_first) +void sp_get_prelocking_info(THD *thd, bool *need_prelocking, + bool *first_no_prelocking) { Sroutine_hash_entry *routine; - routine= (Sroutine_hash_entry*)routines_list->first; + routine= (Sroutine_hash_entry*)thd->lex->sroutines_list.first; - *need_skip_first= FALSE; - if (!routine) - return FALSE; + DBUG_ASSERT(routine); + bool first_is_procedure= (routine->key.str[0] == TYPE_ENUM_PROCEDURE); - if (routine->key.str[0] != TYPE_ENUM_PROCEDURE) - return TRUE; - - *need_skip_first= TRUE; - return TRUE; + *first_no_prelocking= first_is_procedure; + *need_prelocking= !first_is_procedure || test(routine->next); } diff --git a/sql/sp.h b/sql/sp.h index 716f3d90f55..3c837f8b586 100644 --- a/sql/sp.h +++ b/sql/sp.h @@ -79,8 +79,8 @@ sp_show_status_function(THD *thd, const char *wild); Procedures for pre-caching of stored routines and building table list for prelocking. */ -bool sp_need_cache_routines(THD *thd, SQL_LIST *routines_list, - bool *need_skip_first); +void sp_get_prelocking_info(THD *thd, bool *need_prelocking, + bool *first_no_prelocking); void sp_add_used_routine(LEX *lex, Query_arena *arena, sp_name *rt, char rt_type); void sp_update_sp_used_routines(HASH *dst, HASH *src); diff --git a/sql/sp_cache.h b/sql/sp_cache.h index 5873c763289..1ea71160a3a 100644 --- a/sql/sp_cache.h +++ b/sql/sp_cache.h @@ -25,7 +25,8 @@ /* Stored procedures/functions cache. This is used as follows: * Each thread has its own cache. - * When SP is used it is always in some thread's cache. + * Each sp_head object is put into its thread cache after creation and is + removed from there on its deletion. */ class sp_head; diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 8d56e2a0b38..7002bc7b020 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -921,7 +921,8 @@ sp_head::execute_procedure(THD *thd, List *args) /* Okay, got values for all arguments. Close tables that might be used by - arguments evaluation. + arguments evaluation. If arguments evaluation required prelocking mode, + we'll leave it here. */ if (!thd->in_sub_stmt) close_thread_tables(thd, 0, 0, 0); @@ -1492,8 +1493,6 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, instruction if it is not really used. */ - bool collect_prelocking_tail= FALSE; - if (thd->prelocked_mode == NON_PRELOCKED) { /* @@ -1511,14 +1510,6 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, *lex_query_tables_own_last= prelocking_tables; m_lex->mark_as_requiring_prelocking(lex_query_tables_own_last); } - else - { - /* - Let open_tables_calculate list of tables that this statement needs - to have prelocked. - */ - collect_prelocking_tail= TRUE; - } } reinit_stmt_before_use(thd, m_lex); @@ -1539,34 +1530,25 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, thd->proc_info="closing tables"; close_thread_tables(thd); - if (thd->prelocked_mode == NON_PRELOCKED) + if (m_lex->query_tables_own_last) { - if (!lex_query_tables_own_last) - lex_query_tables_own_last= thd->lex->query_tables_own_last; - - if (lex_query_tables_own_last) - { - if (collect_prelocking_tail) - { - /* - This is the first time this statement has entered/left prelocked - mode on its own. open_tables() has calculated the set of tables this - statement needs to have prelocked and added them to the end of - m_lex->query_tables(->next_global)*. - Save this "tail" for subsequent calls (and restore original list - below) - */ - lex_query_tables_own_last= m_lex->query_tables_own_last; - prelocking_tables= *lex_query_tables_own_last; - } - /* - The table list now has list of tables that need to be prelocked - when this statement executes, chop it off, and mark this statement - as not requiring prelocking. - */ - *lex_query_tables_own_last= NULL; - m_lex->mark_as_requiring_prelocking(NULL); - } + /* + We've entered and left prelocking mode when executing statement + stored in m_lex. + m_lex->query_tables(->next_global)* list now has a 'tail' - a list + of tables that are added for prelocking. (If this is the first + execution, the 'tail' was added by open_tables(), otherwise we've + attached it above in this function). + Now we'll save the 'tail', and detach it. + */ + DBUG_ASSERT(!lex_query_tables_own_last || + lex_query_tables_own_last == m_lex->query_tables_own_last && + prelocking_tables == *(m_lex->query_tables_own_last)); + + lex_query_tables_own_last= m_lex->query_tables_own_last; + prelocking_tables= *lex_query_tables_own_last; + *lex_query_tables_own_last= NULL; + m_lex->mark_as_requiring_prelocking(NULL); } thd->rollback_item_tree_changes(); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 367bd2c5ade..90e31edd9bb 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1865,23 +1865,21 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter) document new prelocked behavior. */ - if (!thd->prelocked_mode && !thd->lex->requires_prelocking()) + if (!thd->prelocked_mode && !thd->lex->requires_prelocking() && + thd->lex->sroutines_list.elements) { - bool first_no_prelocking; - if (sp_need_cache_routines(thd, &thd->lex->sroutines_list, - &first_no_prelocking)) + bool first_no_prelocking, need_prelocking; + TABLE_LIST **save_query_tables_last= thd->lex->query_tables_last; + + DBUG_ASSERT(thd->lex->query_tables == *start); + sp_get_prelocking_info(thd, &need_prelocking, &first_no_prelocking); + + if ((sp_cache_routines_and_add_tables(thd, thd->lex, + first_no_prelocking) || + *start) && need_prelocking) { - TABLE_LIST **save_query_tables_last= thd->lex->query_tables_last; - - DBUG_ASSERT(thd->lex->query_tables == *start); - - if (sp_cache_routines_and_add_tables(thd, thd->lex, - first_no_prelocking) || - *start) - { - query_tables_last_own= save_query_tables_last; - *start= thd->lex->query_tables; - } + query_tables_last_own= save_query_tables_last; + *start= thd->lex->query_tables; } } @@ -1917,8 +1915,9 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter) 2) Tables used by all stored routines that this statement invokes on execution. We need to know where the bound between these two parts is. If we've - just opened the last table in part #1, and it added tables after - itself, adjust the boundary pointer accordingly. + just opened a view, which was the last table in part #1, and it + has added its base tables after itself, adjust the boundary pointer + accordingly. */ if (query_tables_last_own && query_tables_last_own == &(tables->next_global) && diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 81cdc6562e9..9b0decb3950 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -174,11 +174,11 @@ THD::THD() :Statement(CONVENTIONAL_EXECUTION, 0, ALLOC_ROOT_MIN_BLOCK_SIZE, 0), Open_tables_state(), lock_id(&main_lock_id), - user_time(0), global_read_lock(0), is_fatal_error(0), + user_time(0), in_sub_stmt(FALSE), global_read_lock(0), is_fatal_error(0), rand_used(0), time_zone_used(0), last_insert_id_used(0), insert_id_used(0), clear_next_insert_id(0), in_lock_tables(0), bootstrap(0), derived_tables_processing(FALSE), - spcont(NULL), in_sub_stmt(FALSE) + spcont(NULL) { current_arena= this; host= user= priv_user= db= ip= 0; From 7c173395614d70592eb33c968f5280bb5cf7cc23 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 07:29:48 +0200 Subject: [PATCH 114/144] Fix for bug #6859 (after Sanja's review) Added check which throws ER_WRONG_OBJECT error in case the .frm doesn't contain a valid table type (e.g. view or trigger) mysql-test/r/create.result: Added test case for bug #6859 mysql-test/t/create.test: Add testcase for bug #6850 --- mysql-test/r/create.result | 7 +++++++ mysql-test/t/create.test | 10 ++++++++++ sql/sql_table.cc | 9 +++++++++ 3 files changed, 26 insertions(+) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index eba8dddfe72..293be36e5ab 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -602,3 +602,10 @@ drop database mysqltest; create table test.t1 like x; ERROR 42000: Incorrect database name 'NULL' drop table if exists test.t1; +create database mysqltest; +use mysqltest; +create view v1 as select 'foo' from dual; +create table t1 like v1; +ERROR HY000: 'mysqltest.v1' is not a table +drop view v1; +drop database mysqltest; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 4e86a51e131..bc281d1e027 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -515,4 +515,14 @@ create table test.t1 like x; drop table if exists test.t1; --enable_warnings +# +# Bug #6859: Bogus error message on attempt to CREATE TABLE t LIKE view +# +create database mysqltest; +use mysqltest; +create view v1 as select 'foo' from dual; +--error 1347 +create table t1 like v1; +drop view v1; +drop database mysqltest; # End of 4.1 tests diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b5d48f3dc3b..1437c1d382c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2629,6 +2629,15 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, } } + /* + create like should be not allowed for Views, Triggers, ... + */ + if (mysql_frm_type(src_path) != FRMTYPE_TABLE) + { + my_error(ER_WRONG_OBJECT, MYF(0), src_db, src_table, "a table"); + goto err; + } + /* Validate the destination table From 91ad19d26c76250b1f0107fb69bab12d111f5858 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 10:12:31 +0000 Subject: [PATCH 115/144] Fixed comment --- sql/sp_cache.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sp_cache.h b/sql/sp_cache.h index 1ea71160a3a..14b2db97f5f 100644 --- a/sql/sp_cache.h +++ b/sql/sp_cache.h @@ -25,8 +25,8 @@ /* Stored procedures/functions cache. This is used as follows: * Each thread has its own cache. - * Each sp_head object is put into its thread cache after creation and is - removed from there on its deletion. + * Each sp_head object is put into its thread cache before it is used, and + then remains in the cache until deleted. */ class sp_head; From 820a9c5f3464d85a8998ecde16fca332522239a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 13:46:38 +0200 Subject: [PATCH 116/144] Portability fixes: - Moved a few DBUG_ENTER statements after the variable declarations to satisfy some compilers (e.g. gcc-2.95.x, gcc-2.96, IBM xlc_r) in ndb/src/common/portlib/NdbMutex.c and ndb/src/common/portlib/NdbThread.c - portability fix for FreeBSD 4.x and HPUX: replaced atoll() with strtoll() in ndb/tools/config.cpp ndb/src/common/portlib/NdbMutex.c: - Moved a few DBUG_ENTER statements after the variable declarations to satisfy some compilers (e.g. gcc-2.95.x, gcc-2.96, IBM xlc_r) ndb/src/common/portlib/NdbThread.c: - Moved a DBUG_ENTER statement after the variable declarations to satisfy some compilers (e.g. gcc-2.95.x, gcc-2.96, IBM xlc_r) ndb/tools/config.cpp: - portability fix for FreeBSD 4.x and HPUX: replaced atoll() with strtoll() --- ndb/src/common/portlib/NdbMutex.c | 4 ++-- ndb/src/common/portlib/NdbThread.c | 2 +- ndb/tools/config.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ndb/src/common/portlib/NdbMutex.c b/ndb/src/common/portlib/NdbMutex.c index 18f8548e4e6..4a170d87e5c 100644 --- a/ndb/src/common/portlib/NdbMutex.c +++ b/ndb/src/common/portlib/NdbMutex.c @@ -23,9 +23,9 @@ NdbMutex* NdbMutex_Create(void) { - DBUG_ENTER("NdbMutex_Create"); NdbMutex* pNdbMutex; int result; + DBUG_ENTER("NdbMutex_Create"); pNdbMutex = (NdbMutex*)NdbMem_Allocate(sizeof(NdbMutex)); DBUG_PRINT("info",("NdbMem_Allocate 0x%lx",pNdbMutex)); @@ -42,8 +42,8 @@ NdbMutex* NdbMutex_Create(void) int NdbMutex_Destroy(NdbMutex* p_mutex) { - DBUG_ENTER("NdbMutex_Destroy"); int result; + DBUG_ENTER("NdbMutex_Destroy"); if (p_mutex == NULL) DBUG_RETURN(-1); diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c index cee4ec018a0..55ebc4c8111 100644 --- a/ndb/src/common/portlib/NdbThread.c +++ b/ndb/src/common/portlib/NdbThread.c @@ -71,10 +71,10 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, const char* p_thread_name, NDB_THREAD_PRIO thread_prio) { - DBUG_ENTER("NdbThread_Create"); struct NdbThread* tmpThread; int result; pthread_attr_t thread_attr; + DBUG_ENTER("NdbThread_Create"); (void)thread_prio; /* remove warning for unused parameter */ diff --git a/ndb/tools/config.cpp b/ndb/tools/config.cpp index 7944f66f71c..d188aec1337 100644 --- a/ndb/tools/config.cpp +++ b/ndb/tools/config.cpp @@ -359,7 +359,7 @@ Match::eval(NdbMgmHandle h, const Iter& iter) } else if(iter.get(m_key, &val64) == 0) { - if(atoll(m_value.c_str()) != val64) + if(strtoll(m_value.c_str(), (char **)NULL, 10) != val64) return 0; } else if(iter.get(m_key, &valc) == 0) From a8bb376fc7ecc3e26623c897c4ec99739a3d1a29 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 17:09:21 +0300 Subject: [PATCH 117/144] Many files: Push the patch of Jan Lindstrom: better comments ha_innodb.cc: Partial fix for Bug #12263 : we let InnoDB always to perform a rollback on the trx object if MySQL closes a connection; but we do print a warning to the .err log if an InnoDB transaction was active; we may remove that print later, since the situation really is not a bug; MySQL just is not aware that some cursor operation started an InnoDB transaction sql/ha_innodb.cc: Partial fix for Bug #12263 : we let InnoDB always to perform a rollback on the trx object if MySQL closes a connection; but we do print a warning to the .err log if an InnoDB transaction was active; we may remove that print later, since the situation really is not a bug; MySQL just is not aware that some cursor operation started an InnoDB transaction sql/ha_innodb.h: Push the patch of Jan Lindstrom: better comments innobase/trx/trx0trx.c: Push the patch of Jan Lindstrom: better comments innobase/srv/srv0srv.c: Push the patch of Jan Lindstrom: better comments innobase/srv/srv0start.c: Push the patch of Jan Lindstrom: better comments innobase/row/row0sel.c: Push the patch of Jan Lindstrom: better comments innobase/read/read0read.c: Push the patch of Jan Lindstrom: better comments innobase/include/read0read.h: Push the patch of Jan Lindstrom: better comments innobase/include/trx0trx.h: Push the patch of Jan Lindstrom: better comments --- innobase/include/read0read.h | 8 ++---- innobase/include/trx0trx.h | 11 ++++---- innobase/read/read0read.c | 6 ++-- innobase/row/row0sel.c | 12 ++++++-- innobase/srv/srv0srv.c | 4 +++ innobase/srv/srv0start.c | 10 +++++++ innobase/trx/trx0trx.c | 20 +++---------- sql/ha_innodb.cc | 54 +++++++++++++++++++++++++----------- sql/ha_innodb.h | 21 ++++++++------ 9 files changed, 89 insertions(+), 57 deletions(-) diff --git a/innobase/include/read0read.h b/innobase/include/read0read.h index 1a7a86470a8..b5edcefb544 100644 --- a/innobase/include/read0read.h +++ b/innobase/include/read0read.h @@ -68,7 +68,6 @@ void read_view_print( /*============*/ read_view_t* view); /* in: read view */ - /************************************************************************* Create a consistent cursor view for mysql to be used in cursors. In this consistent read view modifications done by the creating transaction or future @@ -78,10 +77,9 @@ cursor_view_t* read_cursor_view_create_for_mysql( /*==============================*/ trx_t* cr_trx);/* in: trx where cursor view is created */ - /************************************************************************* -Close a given consistent cursor view for and restore global read view -back to a transaction. */ +Close a given consistent cursor view for mysql and restore global read view +back to a transaction read view. */ void read_cursor_view_close_for_mysql( @@ -90,7 +88,7 @@ read_cursor_view_close_for_mysql( cursor_view_t* curview); /* in: cursor view to be closed */ /************************************************************************* This function sets a given consistent cursor view to a transaction -read view if given consistent cursor view is not null. Otherwice, function +read view if given consistent cursor view is not NULL. Otherwise, function restores a global read view to a transaction read view. */ void diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 2fc4d5a289f..a3ef755348c 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -606,14 +606,13 @@ struct trx_struct{ /* memory heap for the global read view */ read_view_t* global_read_view; - /* consistent read view used in the - transaction is stored here if - transaction is using a consistent - read view associated to a cursor */ + /* consistent read view associated + to a transaction or NULL */ read_view_t* read_view; /* consistent read view used in the transaction or NULL, this read view - can be normal read view associated - to a transaction or read view + if defined can be normal read view + associated to a transaction (i.e. + same as global_read_view) or read view associated to a cursor */ /*------------------------------*/ UT_LIST_BASE_NODE_T(trx_named_savept_t) diff --git a/innobase/read/read0read.c b/innobase/read/read0read.c index 76df7cdbee0..334f9a8a85a 100644 --- a/innobase/read/read0read.c +++ b/innobase/read/read0read.c @@ -347,8 +347,8 @@ read_cursor_view_create_for_mysql( } /************************************************************************* -Close a given consistent cursor view for and restore global read view -back to a transaction. */ +Close a given consistent cursor view for mysql and restore global read view +back to a transaction read view. */ void read_cursor_view_close_for_mysql( @@ -372,7 +372,7 @@ read_cursor_view_close_for_mysql( /************************************************************************* This function sets a given consistent cursor view to a transaction -read view if given consistent cursor view is not null. Otherwice, function +read view if given consistent cursor view is not NULL. Otherwise, function restores a global read view to a transaction read view. */ void diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 0b563eb147e..15881cb8c5d 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -3100,6 +3100,13 @@ row_search_for_mysql( "http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" "InnoDB: how you can resolve the problem.\n", prebuilt->table->name); + + /* Restore a global read view back to a transaction. This + forces MySQL always to set a cursor view before fetch from + a cursor. */ + + trx->read_view = trx->global_read_view; + return(DB_ERROR); } @@ -4091,8 +4098,9 @@ normal_return: } func_exit: - /* Restore a global read view back to transaction. This forces - MySQL always to set cursor view before fetch if it is used. */ + /* Restore a global read view back to a transaction. This + forces MySQL always to set a cursor view before fetch from + a cursor. */ trx->read_view = trx->global_read_view; diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 837c5be2bb6..dc85750f0be 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -1711,6 +1711,10 @@ srv_printf_innodb_monitor( fprintf(file, "%ld queries inside InnoDB, %lu queries in queue\n", (long) srv_conc_n_threads, (ulong) srv_conc_n_waiting_threads); + + fprintf(file, "%lu read views open inside InnoDB\n", + UT_LIST_GET_LEN(trx_sys->view_list)); + n_reserved = fil_space_get_n_reserved_extents(0); if (n_reserved > 0) { fprintf(file, diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 7798e0c8e32..ffe4ba08ee9 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -1833,6 +1833,16 @@ innobase_shutdown_for_mysql(void) srv_free(); os_sync_free(); + /* Check that all read views are closed except read view owned + by a purge. */ + + if (UT_LIST_GET_LEN(trx_sys->view_list) > 1) { + fprintf(stderr, +"InnoDB: Error: all read views were not closed before shutdown:\n" +"InnoDB: %lu read views open \n", + UT_LIST_GET_LEN(trx_sys->view_list) - 1); + } + /* 5. Free all allocated memory and the os_fast_mutex created in ut0mem.c */ diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index f95491443ee..1681bed9af2 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -833,26 +833,14 @@ trx_commit_off_kernel( lock_release_off_kernel(trx); - if (trx->read_view) { - /* If transaction has a global read view this case - means that transaction has been using a consistent - read view associated to a cursor. Only the global - read view associated to a transaction is closed - and read view is then removed from the transaction. - If read view associated to a cursor is still used - it must be re-registered to another transaction. */ - - if (UNIV_LIKELY_NULL(trx->global_read_view)) { - trx->read_view = trx->global_read_view; - } - - read_view_close(trx->read_view); - + if (trx->global_read_view) { + read_view_close(trx->global_read_view); mem_heap_empty(trx->global_read_view_heap); - trx->read_view = NULL; trx->global_read_view = NULL; } + trx->read_view = NULL; + if (must_flush_log) { mutex_exit(&kernel_mutex); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index d40e58aa4cb..a6edb2ea20f 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -538,7 +538,7 @@ innobase_mysql_prepare_print_arbitrary_thd(void) } /***************************************************************** -Relases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd(). +Releases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd(). NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this function! */ extern "C" @@ -1700,7 +1700,7 @@ innobase_store_binlog_offset_and_flush_log( /* Commits the mini-transaction */ mtr_commit(&mtr); - /* Syncronous flush of the log buffer to disk */ + /* Synchronous flush of the log buffer to disk */ log_buffer_flush_to_disk(); } #endif @@ -2132,15 +2132,34 @@ innobase_savepoint( /********************************************************************* Frees a possible InnoDB trx object associated with the current THD. */ - -static int +static +int innobase_close_connection( /*======================*/ /* out: 0 or error number */ THD* thd) /* in: handle to the MySQL thread of the user whose resources should be free'd */ { - trx_free_for_mysql((trx_t*)thd->ha_data[innobase_hton.slot]); + trx_t* trx; + + trx = (trx_t*)thd->ha_data[innobase_hton.slot]; + + ut_a(trx); + + if (trx->conc_state != TRX_NOT_STARTED) { + ut_print_timestamp(stderr); + + fprintf(stderr, +" InnoDB: Warning: MySQL is closing a connection" +"InnoDB: that has an active InnoDB transaction. We roll back that\n" +"InnoDB: transaction. %lu row modifications to roll back.\n", + (ulong)ut_dulint_get_low(trx->undo_no)); + } + + innobase_rollback_trx(trx); + + trx_free_for_mysql(trx); + return(0); } @@ -2834,7 +2853,7 @@ ha_innobase::store_key_val_for_row( /* All indexes on BLOB and TEXT are column prefix indexes, and we may need to truncate the data to be - stored in the kay value: */ + stored in the key value: */ if (blob_len > key_part->length) { blob_len = key_part->length; @@ -7117,7 +7136,7 @@ int innobase_rollback_by_xid( /*=====================*/ /* out: 0 or error number */ - XID *xid) /* in: X/Open XA transaction idenfification */ + XID *xid) /* in: X/Open XA transaction identification */ { trx_t* trx; @@ -7131,9 +7150,10 @@ innobase_rollback_by_xid( } /*********************************************************************** -This function creates a consistent view for a cursor and start a transaction -if it has not been started. This consistent view is then used inside of MySQL -when accesing records using a cursor. */ +Create a consistent view for a cursor based on current transaction +which is created if the corresponding MySQL thread still lacks one. +This consistent view is then used inside of MySQL when accessing records +using a cursor. */ void* innobase_create_cursor_view(void) @@ -7145,9 +7165,9 @@ innobase_create_cursor_view(void) } /*********************************************************************** -This function closes the given consistent cursor view. Note that -global read view is restored to a transaction and a transaction is -started if it has not been started. */ +Close the given consistent cursor view of a transaction and restore +global read view to a transaction read view. Transaction is created if the +corresponding MySQL thread still lacks one. */ void innobase_close_cursor_view( @@ -7159,13 +7179,15 @@ innobase_close_cursor_view( } /*********************************************************************** -This function sets the given consistent cursor view to a transaction. -If a transaction does not exist, transaction is started. */ +Set the given consistent cursor view to a transaction which is created +if the corresponding MySQL thread still lacks one. If the given +consistent cursor view is NULL global read view of a transaction is +restored to a transaction read view. */ void innobase_set_cursor_view( /*=====================*/ - void* curview)/* in: Consistent cursor view to be closed */ + void* curview)/* in: Consistent cursor view to be set */ { read_cursor_set_for_mysql(check_trx_exists(current_thd), (cursor_view_t*) curview); diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 2cbc1c8d91b..3bc1fc5b2c8 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -302,7 +302,7 @@ which is in the prepared state */ int innobase_rollback_by_xid( /* out: 0 or error number */ - XID *xid); /* in : X/Open XA Transaction Idenfification */ + XID *xid); /* in : X/Open XA Transaction Identification */ int innobase_xa_end(THD *thd); @@ -312,9 +312,10 @@ int innobase_repl_report_sent_binlog(THD *thd, char *log_file_name, my_off_t end_offset); /*********************************************************************** -This function creates a consistent view for a cursor and start a transaction -if it has not been started. This consistent view is then used inside of MySQL -when accesing records using a cursor. */ +Create a consistent view for a cursor based on current transaction +which is created if the corresponding MySQL thread still lacks one. +This consistent view is then used inside of MySQL when accessing records +using a cursor. */ void* innobase_create_cursor_view(void); @@ -322,9 +323,9 @@ innobase_create_cursor_view(void); /* out: Pointer to cursor view or NULL */ /*********************************************************************** -This function closes the given consistent cursor view. Note that -global read view is restored to a transaction and a transaction is -started if it has not been started. */ +Close the given consistent cursor view of a transaction and restore +global read view to a transaction read view. Transaction is created if the +corresponding MySQL thread still lacks one. */ void innobase_close_cursor_view( @@ -332,8 +333,10 @@ innobase_close_cursor_view( void* curview); /* in: Consistent read view to be closed */ /*********************************************************************** -This function sets the given consistent cursor view to a transaction. -If a transaction does not exist, transaction is started. */ +Set the given consistent cursor view to a transaction which is created +if the corresponding MySQL thread still lacks one. If the given +consistent cursor view is NULL global read view of a transaction is +restored to a transaction read view. */ void innobase_set_cursor_view( From 43b1710c51b685bc52df43622529d1dcfb86bc1e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 18:11:55 +0300 Subject: [PATCH 118/144] ha_innodb.cc: Backport of Bug #9670 to 4.0: assertion failure in ut_a(cursor->old_stored == BTR_PCUR_OLD_STORED) sql/ha_innodb.cc: Backport of Bug #9670 to 4.0: assertion failure in ut_a(cursor->old_stored == BTR_PCUR_OLD_STORED) --- sql/ha_innodb.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 81a803e36b9..31c26f774a6 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4928,7 +4928,8 @@ ha_innobase::store_lock( (lock_type == TL_READ_HIGH_PRIORITY && thd->in_lock_tables) || lock_type == TL_READ_WITH_SHARED_LOCKS || lock_type == TL_READ_NO_INSERT || - thd->lex.sql_command != SQLCOM_SELECT) { + (thd->lex->sql_command != SQLCOM_SELECT + && lock_type != TL_IGNORE)) { /* The OR cases above are in this order: 1) MySQL is doing LOCK TABLES ... READ LOCAL, or From e1659c8154bca8965242fba8e90f33539decc95e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 18:21:38 +0300 Subject: [PATCH 119/144] buf0buf.c: Fix a bug: InnoDB could in a crash recovery print a big false corruption warning if the first page of an ibdata file was 'recreated' in the buffer pool; this could happen, for example, if a table was dropped, and the page used later innobase/buf/buf0buf.c: Fix a bug: InnoDB could in a crash recovery print a big false corruption warning if the first page of an ibdata file was 'recreated' in the buffer pool; this could happen, for example, if a table was dropped, and the page used later --- innobase/buf/buf0buf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index 699ad5fb42e..31a581d2ba8 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -1762,6 +1762,15 @@ buf_page_create( buf_flush_free_margin(); frame = block->frame; + + /* Reset to zero the file flush lsn field in the page; if the first + page of an ibdata file is 'created' in this function into the buffer + pool then we lose the original contents of the file flush lsn stamp. + Then InnoDB could in a crash recovery print a big, false, corruption + warning if the stamp contains an lsn bigger than the ib_logfile lsn. */ + + memset(frame + FIL_PAGE_FILE_FLUSH_LSN, 0, 8); + #ifdef UNIV_DEBUG buf_dbg_counter++; From 076c375ab5342979518585d17c731bc3ba874f15 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 18:47:50 +0300 Subject: [PATCH 120/144] ha_innodb.cc: Fix compilation error in previous commit sql/ha_innodb.cc: Fix compilation error in previous commit --- sql/ha_innodb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 31c26f774a6..bcd07198f5c 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4928,7 +4928,7 @@ ha_innobase::store_lock( (lock_type == TL_READ_HIGH_PRIORITY && thd->in_lock_tables) || lock_type == TL_READ_WITH_SHARED_LOCKS || lock_type == TL_READ_NO_INSERT || - (thd->lex->sql_command != SQLCOM_SELECT + (thd->lex.sql_command != SQLCOM_SELECT && lock_type != TL_IGNORE)) { /* The OR cases above are in this order: From 1bdc18b909b84f64c487e9643e079e95821acb3a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 18:53:22 +0300 Subject: [PATCH 121/144] ha_innodb.cc: Fix compilation error in the fix of Bug #12263 sql/ha_innodb.cc: Fix compilation error in the fix of Bug #12263 --- sql/ha_innodb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index a6edb2ea20f..8dd45c03350 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2153,7 +2153,7 @@ innobase_close_connection( " InnoDB: Warning: MySQL is closing a connection" "InnoDB: that has an active InnoDB transaction. We roll back that\n" "InnoDB: transaction. %lu row modifications to roll back.\n", - (ulong)ut_dulint_get_low(trx->undo_no)); + (ulong)trx->undo_no.low); } innobase_rollback_trx(trx); From e30364215aede94b4a291c0b8775f5dd1b5082cf Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 15:08:03 -0400 Subject: [PATCH 122/144] BUG#12330 Add --replace_column in order to make test deterministic. mysql-test/t/rpl_slave_status.test: Add --replace-column to make show slave status deterministic --- mysql-test/t/rpl_slave_status.test | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/rpl_slave_status.test b/mysql-test/t/rpl_slave_status.test index 4e0d7dae35c..7e16097edd0 100644 --- a/mysql-test/t/rpl_slave_status.test +++ b/mysql-test/t/rpl_slave_status.test @@ -23,6 +23,7 @@ connection slave; stop slave; start slave; --replace_result $MASTER_MYPORT MASTER_MYPORT +--replace_column 7 # 8 # 9 # 22 # 23 # --vertical_results show slave status; From 357ebcc284c9d5c5e18c6badc419001831a108db Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 16:12:06 -0400 Subject: [PATCH 123/144] BUG#12330 Adding updated result file which I missed in last changeset. Adds --replace_column to make test results deterministic. mysql-test/r/rpl_slave_status.result: BUG#12330 updated result file which I missed in last changeset This updates the test to use --replace_column to make the test deterministic. --- mysql-test/r/rpl_slave_status.result | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/rpl_slave_status.result b/mysql-test/r/rpl_slave_status.result index 5e9b6ab31ad..8badbab85ff 100644 --- a/mysql-test/r/rpl_slave_status.result +++ b/mysql-test/r/rpl_slave_status.result @@ -25,9 +25,9 @@ Master_User rpl Master_Port MASTER_MYPORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 357 -Relay_Log_File slave-relay-bin.000001 -Relay_Log_Pos 401 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 Slave_IO_Running No Slave_SQL_Running Yes @@ -40,8 +40,8 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 357 -Relay_Log_Space 401 +Exec_Master_Log_Pos # +Relay_Log_Space # Until_Condition None Until_Log_File Until_Log_Pos 0 From 55b4cb009e029a9ee626d229c5d8520b02773843 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 16:20:27 -0500 Subject: [PATCH 124/144] alot of formatting changes that came out of JimW's review server-tools/instance-manager/IMService.cpp: fixed tabs and spacing per JimW's review server-tools/instance-manager/WindowsService.cpp: fixed tabs and spacing per JimW's review server-tools/instance-manager/WindowsService.h: fixed tabs and spacing per JimW's review server-tools/instance-manager/commands.cc: fixed tabs and spacing per JimW's review server-tools/instance-manager/instance.cc: fixed tabs and spacing per JimW's review server-tools/instance-manager/instance_map.cc: fixed tabs and spacing per JimW's review server-tools/instance-manager/listener.cc: fixed tabs and spacing per JimW's review server-tools/instance-manager/manager.cc: fixed tabs and spacing per JimW's review server-tools/instance-manager/options.cc: fixed tabs and spacing per JimW's review server-tools/instance-manager/user_map.cc: fixed tabs and spacing per JimW's review --- server-tools/instance-manager/IMService.cpp | 19 +- .../instance-manager/WindowsService.cpp | 191 +++++++++--------- .../instance-manager/WindowsService.h | 18 +- server-tools/instance-manager/commands.cc | 2 +- server-tools/instance-manager/instance.cc | 88 ++++---- server-tools/instance-manager/instance_map.cc | 4 +- server-tools/instance-manager/listener.cc | 28 +-- server-tools/instance-manager/manager.cc | 4 +- server-tools/instance-manager/options.cc | 48 ++--- server-tools/instance-manager/user_map.cc | 4 +- 10 files changed, 208 insertions(+), 198 deletions(-) diff --git a/server-tools/instance-manager/IMService.cpp b/server-tools/instance-manager/IMService.cpp index 920a0f3db0c..1d678803264 100755 --- a/server-tools/instance-manager/IMService.cpp +++ b/server-tools/instance-manager/IMService.cpp @@ -25,8 +25,7 @@ void IMService::Run() ReportStatus((DWORD)SERVICE_START_PENDING); // init goes here - - ReportStatus((DWORD)SERVICE_RUNNING); + ReportStatus((DWORD)SERVICE_RUNNING); // wait for main loop to terminate } @@ -38,7 +37,7 @@ void IMService::Log(const char *msg) int HandleServiceOptions(Options options) { - int ret_val = 0; + int ret_val= 0; IMService winService; @@ -47,23 +46,23 @@ int HandleServiceOptions(Options options) if (winService.IsInstalled()) log_info("Service is already installed\n"); else if (winService.Install()) - log_info("Service installed successfully\n"); + log_info("Service installed successfully\n"); else { - log_info("Service failed to install\n"); - ret_val = -1; + log_info("Service failed to install\n"); + ret_val= -1; } } else if (options.remove_service) { if (! winService.IsInstalled()) log_info("Service is not installed\n"); - else if (winService.Remove()) - log_info("Service removed successfully\n"); + else if (winService.Remove()) + log_info("Service removed successfully\n"); else { - log_info("Service failed to remove\n"); - ret_val = -1; + log_info("Service failed to remove\n"); + ret_val= -1; } } else diff --git a/server-tools/instance-manager/WindowsService.cpp b/server-tools/instance-manager/WindowsService.cpp index 851ac9beac8..e4b9a3a8491 100755 --- a/server-tools/instance-manager/WindowsService.cpp +++ b/server-tools/instance-manager/WindowsService.cpp @@ -4,13 +4,15 @@ static WindowsService *gService; -WindowsService::WindowsService(void) -: statusCheckpoint(0), serviceName(NULL), inited(false), +WindowsService::WindowsService(void) : + statusCheckpoint(0), + serviceName(NULL), + inited(false), dwAcceptedControls(SERVICE_ACCEPT_STOP) { - gService = this; - status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; - status.dwServiceSpecificExitCode = 0; + gService= this; + status.dwServiceType= SERVICE_WIN32_OWN_PROCESS; + status.dwServiceSpecificExitCode= 0; } WindowsService::~WindowsService(void) @@ -19,83 +21,84 @@ WindowsService::~WindowsService(void) BOOL WindowsService::Install() { - bool ret_val=false; - SC_HANDLE newService; - SC_HANDLE scm; + bool ret_val= false; + SC_HANDLE newService; + SC_HANDLE scm; - if (IsInstalled()) return true; + if (IsInstalled()) return true; - // determine the name of the currently executing file - char szFilePath[_MAX_PATH]; - GetModuleFileName(NULL, szFilePath, sizeof(szFilePath)); + // determine the name of the currently executing file + char szFilePath[_MAX_PATH]; + GetModuleFileName(NULL, szFilePath, sizeof(szFilePath)); - // open a connection to the SCM - if (!(scm = OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE))) - return false; + // open a connection to the SCM + if (!(scm= OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE))) + return false; - newService = CreateService(scm, serviceName, displayName, - SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, - SERVICE_ERROR_NORMAL, szFilePath, - NULL, NULL, NULL, username, password); + newService= CreateService(scm, serviceName, displayName, + SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, + SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, + szFilePath, NULL, NULL, NULL, username, + password); - if (newService) - { - CloseServiceHandle(newService); - ret_val = true; - } + if (newService) + { + CloseServiceHandle(newService); + ret_val= true; + } - CloseServiceHandle(scm); - return ret_val; + CloseServiceHandle(scm); + return ret_val; } BOOL WindowsService::Init() { assert(serviceName != NULL); - if (inited) return true; + if (inited) return true; - SERVICE_TABLE_ENTRY stb[] = - { - { (LPSTR)serviceName, (LPSERVICE_MAIN_FUNCTION) ServiceMain}, - { NULL, NULL } - }; - inited = true; - return StartServiceCtrlDispatcher(stb); //register with the Service Manager + SERVICE_TABLE_ENTRY stb[] = + { + { (LPSTR)serviceName, (LPSERVICE_MAIN_FUNCTION) ServiceMain}, + { NULL, NULL } + }; + inited= true; + return StartServiceCtrlDispatcher(stb); //register with the Service Manager } BOOL WindowsService::Remove() { - bool ret_val = false; + bool ret_val= false; - if (! IsInstalled()) - return true; + if (! IsInstalled()) + return true; - // open a connection to the SCM - SC_HANDLE scm = OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE); - if (! scm) - return false; + // open a connection to the SCM + SC_HANDLE scm= OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE); + if (! scm) + return false; - SC_HANDLE service = OpenService(scm, serviceName, DELETE); - if (service) - { - if (DeleteService(service)) - ret_val = true; - DWORD dw = ::GetLastError(); - CloseServiceHandle(service); - } + SC_HANDLE service= OpenService(scm, serviceName, DELETE); + if (service) + { + if (DeleteService(service)) + ret_val= true; + DWORD dw= ::GetLastError(); + CloseServiceHandle(service); + } - CloseServiceHandle(scm); - return ret_val; + CloseServiceHandle(scm); + return ret_val; } BOOL WindowsService::IsInstalled() { - BOOL ret_val = FALSE; + BOOL ret_val= FALSE; - SC_HANDLE scm = ::OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); - SC_HANDLE serv_handle = ::OpenService(scm, serviceName, SERVICE_QUERY_STATUS); + SC_HANDLE scm= ::OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); + SC_HANDLE serv_handle= ::OpenService(scm, serviceName, SERVICE_QUERY_STATUS); - ret_val = serv_handle != NULL; + ret_val= serv_handle != NULL; ::CloseServiceHandle(serv_handle); ::CloseServiceHandle(scm); @@ -105,34 +108,36 @@ BOOL WindowsService::IsInstalled() void WindowsService::SetAcceptedControls(DWORD acceptedControls) { - dwAcceptedControls = acceptedControls; + dwAcceptedControls= acceptedControls; } -BOOL WindowsService::ReportStatus(DWORD currentState, DWORD waitHint, DWORD dwError) +BOOL WindowsService::ReportStatus(DWORD currentState, DWORD waitHint, + DWORD dwError) { - if(debugging) return TRUE; + if(debugging) return TRUE; if(currentState == SERVICE_START_PENDING) - status.dwControlsAccepted = 0; + status.dwControlsAccepted= 0; else - status.dwControlsAccepted = dwAcceptedControls; + status.dwControlsAccepted= dwAcceptedControls; - status.dwCurrentState = currentState; - status.dwWin32ExitCode = dwError != 0 ? ERROR_SERVICE_SPECIFIC_ERROR : NO_ERROR; - status.dwWaitHint = waitHint; - status.dwServiceSpecificExitCode = dwError; + status.dwCurrentState= currentState; + status.dwWin32ExitCode= dwError != 0 ? + ERROR_SERVICE_SPECIFIC_ERROR : NO_ERROR; + status.dwWaitHint= waitHint; + status.dwServiceSpecificExitCode= dwError; - if(currentState == SERVICE_RUNNING || currentState == SERVICE_STOPPED) - { - status.dwCheckPoint = 0; - statusCheckpoint = 0; - } - else - status.dwCheckPoint = ++statusCheckpoint; + if(currentState == SERVICE_RUNNING || currentState == SERVICE_STOPPED) + { + status.dwCheckPoint= 0; + statusCheckpoint= 0; + } + else + status.dwCheckPoint= ++statusCheckpoint; // Report the status of the service to the service control manager. - BOOL result = SetServiceStatus(statusHandle, &status); + BOOL result= SetServiceStatus(statusHandle, &status); if (!result) Log("ReportStatus failed"); @@ -141,7 +146,7 @@ BOOL WindowsService::ReportStatus(DWORD currentState, DWORD waitHint, DWORD dwEr void WindowsService::RegisterAndRun(DWORD argc, LPTSTR *argv) { - statusHandle = ::RegisterServiceCtrlHandler(serviceName, ControlHandler); + statusHandle= ::RegisterServiceCtrlHandler(serviceName, ControlHandler); if (statusHandle && ReportStatus(SERVICE_START_PENDING)) Run(); ReportStatus(SERVICE_STOPPED); @@ -152,41 +157,41 @@ void WindowsService::HandleControlCode(DWORD opcode) // Handle the requested control code. switch(opcode) { - case SERVICE_CONTROL_STOP: - // Stop the service. - status.dwCurrentState = SERVICE_STOP_PENDING; + case SERVICE_CONTROL_STOP: + // Stop the service. + status.dwCurrentState= SERVICE_STOP_PENDING; Stop(); - break; + break; - case SERVICE_CONTROL_PAUSE: - status.dwCurrentState = SERVICE_PAUSE_PENDING; + case SERVICE_CONTROL_PAUSE: + status.dwCurrentState= SERVICE_PAUSE_PENDING; Pause(); - break; + break; - case SERVICE_CONTROL_CONTINUE: - status.dwCurrentState = SERVICE_CONTINUE_PENDING; + case SERVICE_CONTROL_CONTINUE: + status.dwCurrentState= SERVICE_CONTINUE_PENDING; Continue(); - break; + break; - case SERVICE_CONTROL_SHUTDOWN: + case SERVICE_CONTROL_SHUTDOWN: Shutdown(); - break; + break; - case SERVICE_CONTROL_INTERROGATE: + case SERVICE_CONTROL_INTERROGATE: ReportStatus(status.dwCurrentState); - break; + break; - default: - // invalid control code - break; - } + default: + // invalid control code + break; + } } void WINAPI WindowsService::ServiceMain(DWORD argc, LPTSTR *argv) { - assert(gService != NULL); + assert(gService != NULL); - // register our service control handler: + // register our service control handler: gService->RegisterAndRun(argc, argv); } diff --git a/server-tools/instance-manager/WindowsService.h b/server-tools/instance-manager/WindowsService.h index b266bbca533..e4616278166 100755 --- a/server-tools/instance-manager/WindowsService.h +++ b/server-tools/instance-manager/WindowsService.h @@ -3,7 +3,7 @@ class WindowsService { protected: - bool inited; + bool inited; const char *serviceName; const char *displayName; const char *username; @@ -15,29 +15,29 @@ protected: bool debugging; public: - WindowsService(void); - ~WindowsService(void); + WindowsService(void); + ~WindowsService(void); - BOOL Install(); - BOOL Remove(); - BOOL Init(); + BOOL Install(); + BOOL Remove(); + BOOL Init(); BOOL IsInstalled(); void SetAcceptedControls(DWORD acceptedControls); void Debug(bool debugFlag) { debugging = debugFlag; } public: - static void WINAPI ServiceMain(DWORD argc, LPTSTR * argv); + static void WINAPI ServiceMain(DWORD argc, LPTSTR *argv); static void WINAPI ControlHandler(DWORD CtrlType); protected: - virtual void Run() = 0; + virtual void Run()= 0; virtual void Stop() {} virtual void Shutdown() {} virtual void Pause() {} virtual void Continue() {} virtual void Log(const char *msg) {} - BOOL ReportStatus(DWORD currentStatus, DWORD waitHint=3000, DWORD dwError=0); + BOOL ReportStatus(DWORD currentStatus, DWORD waitHint= 3000, DWORD dwError=0); void HandleControlCode(DWORD opcode); void RegisterAndRun(DWORD argc, LPTSTR *argv); }; diff --git a/server-tools/instance-manager/commands.cc b/server-tools/instance-manager/commands.cc index 3cc5039a59c..5fe3aa01ada 100644 --- a/server-tools/instance-manager/commands.cc +++ b/server-tools/instance-manager/commands.cc @@ -691,7 +691,7 @@ int Set_option::correct_file(int skip) int error; error= modify_defaults_file(Options::config_file, option, - option_value, instance_name, skip); + option_value, instance_name, skip); if (error > 0) return ER_OUT_OF_RESOURCES; else if (error < 0) diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc index 5e3c07b9b31..3fb953410cd 100644 --- a/server-tools/instance-manager/instance.cc +++ b/server-tools/instance-manager/instance.cc @@ -119,7 +119,7 @@ int Instance::start() #ifndef __WIN__ int Instance::launch_and_wait() { - pid_t pid = fork(); + pid_t pid= fork(); switch (pid) { @@ -160,21 +160,21 @@ int Instance::launch_and_wait() STARTUPINFO si; PROCESS_INFORMATION pi; - ZeroMemory( &si, sizeof(si) ); + ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); + ZeroMemory(&pi, sizeof(pi)); - int cmdlen = 0; - for (int i=1; options.argv[i] != 0; i++) - cmdlen += strlen(options.argv[i]) + 1; + int cmdlen= 0; + for (int i= 1; options.argv[i] != 0; i++) + cmdlen+= strlen(options.argv[i]) + 1; cmdlen++; // we have to add a single space for CreateProcess (read the docs) - char *cmdline = NULL; + char *cmdline= NULL; if (cmdlen > 0) { - cmdline = new char[cmdlen]; - cmdline[0] = 0; - for (int i=1; options.argv[i] != 0; i++) + cmdline= new char[cmdlen]; + cmdline[0]= 0; + for (int i= 1; options.argv[i] != 0; i++) { strcat(cmdline, " "); strcat(cmdline, options.argv[i]); @@ -182,16 +182,16 @@ int Instance::launch_and_wait() } // Start the child process. - BOOL result = CreateProcess(options.mysqld_path, // file to execute - cmdline, // Command line. - NULL, // Process handle not inheritable. - NULL, // Thread handle not inheritable. - FALSE, // Set handle inheritance to FALSE. - 0, // No creation flags. - NULL, // Use parent's environment block. - NULL, // Use parent's starting directory. - &si, // Pointer to STARTUPINFO structure. - &pi ); // Pointer to PROCESS_INFORMATION structure. + BOOL result= CreateProcess(options.mysqld_path, // file to execute + cmdline, // Command line. + NULL, // Process handle not inheritable. + NULL, // Thread handle not inheritable. + FALSE, // Set handle inheritance to FALSE. + 0, // No creation flags. + NULL, // Use parent's environment block. + NULL, // Use parent's starting directory. + &si, // Pointer to STARTUPINFO structure. + &pi ); // Pointer to PROCESS_INFORMATION structure. delete cmdline; if (! result) return -1; @@ -203,8 +203,8 @@ int Instance::launch_and_wait() ::GetExitCodeProcess(pi.hProcess, &exitcode); // Close process and thread handles. - CloseHandle( pi.hProcess ); - CloseHandle( pi.hThread ); + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); return exitcode; } @@ -215,7 +215,7 @@ void Instance::fork_and_monitor() { log_info("starting instance %s", options.instance_name); - int result = launch_and_wait(); + int result= launch_and_wait(); if (result == -1) return; /* set instance state to crashed */ @@ -371,48 +371,48 @@ err: BOOL SafeTerminateProcess(HANDLE hProcess, UINT uExitCode) { DWORD dwTID, dwCode, dwErr = 0; - HANDLE hProcessDup = INVALID_HANDLE_VALUE; - HANDLE hRT = NULL; - HINSTANCE hKernel = GetModuleHandle("Kernel32"); - BOOL bSuccess = FALSE; + HANDLE hProcessDup= INVALID_HANDLE_VALUE; + HANDLE hRT= NULL; + HINSTANCE hKernel= GetModuleHandle("Kernel32"); + BOOL bSuccess= FALSE; - BOOL bDup = DuplicateHandle(GetCurrentProcess(), - hProcess, GetCurrentProcess(), &hProcessDup, PROCESS_ALL_ACCESS, FALSE, 0); + BOOL bDup= DuplicateHandle(GetCurrentProcess(), + hProcess, GetCurrentProcess(), &hProcessDup, + PROCESS_ALL_ACCESS, FALSE, 0); // Detect the special case where the process is // already dead... - if ( GetExitCodeProcess((bDup) ? hProcessDup : hProcess, &dwCode) && - (dwCode == STILL_ACTIVE) ) + if (GetExitCodeProcess((bDup) ? hProcessDup : hProcess, &dwCode) && + (dwCode == STILL_ACTIVE)) { FARPROC pfnExitProc; - pfnExitProc = GetProcAddress(hKernel, "ExitProcess"); + pfnExitProc= GetProcAddress(hKernel, "ExitProcess"); - hRT = CreateRemoteThread((bDup) ? hProcessDup : hProcess, NULL, 0, - (LPTHREAD_START_ROUTINE)pfnExitProc, (PVOID)uExitCode, 0, &dwTID); + hRT= CreateRemoteThread((bDup) ? hProcessDup : hProcess, NULL, 0, + (LPTHREAD_START_ROUTINE)pfnExitProc, + (PVOID)uExitCode, 0, &dwTID); - if ( hRT == NULL ) - dwErr = GetLastError(); + if (hRT == NULL) + dwErr= GetLastError(); } else - { - dwErr = ERROR_PROCESS_ABORTED; - } + dwErr= ERROR_PROCESS_ABORTED; - if ( hRT ) + if (hRT) { // Must wait process to terminate to // guarantee that it has exited... WaitForSingleObject((bDup) ? hProcessDup : hProcess, INFINITE); CloseHandle(hRT); - bSuccess = TRUE; + bSuccess= TRUE; } - if ( bDup ) + if (bDup) CloseHandle(hProcessDup); - if ( !bSuccess ) + if (!bSuccess) SetLastError(dwErr); return bSuccess; @@ -420,7 +420,7 @@ BOOL SafeTerminateProcess(HANDLE hProcess, UINT uExitCode) int kill(pid_t pid, int signum) { - HANDLE processhandle = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid); + HANDLE processhandle= ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid); if (signum == SIGTERM) ::SafeTerminateProcess(processhandle, 0); else diff --git a/server-tools/instance-manager/instance_map.cc b/server-tools/instance-manager/instance_map.cc index 2c7166c59f5..7f7f752ea4c 100644 --- a/server-tools/instance-manager/instance_map.cc +++ b/server-tools/instance-manager/instance_map.cc @@ -256,8 +256,8 @@ int Instance_map::load() else argv_options[1]= '\0'; - if (my_search_option_files(Options::config_file, &argc, (char ***) &argv, &args_used, - process_option, (void*) this) || + if (my_search_option_files(Options::config_file, &argc, (char ***) &argv, + &args_used, process_option, (void*) this) || complete_initialization()) return 1; diff --git a/server-tools/instance-manager/listener.cc b/server-tools/instance-manager/listener.cc index a161fc9730b..d26324a6519 100644 --- a/server-tools/instance-manager/listener.cc +++ b/server-tools/instance-manager/listener.cc @@ -59,15 +59,15 @@ private: int create_unix_socket(struct sockaddr_un &unix_socket_address); }; -const int LISTEN_BACK_LOG_SIZE = 5; // standard backlog size +const int LISTEN_BACK_LOG_SIZE= 5; // standard backlog size Listener_thread::Listener_thread(const Listener_thread_args &args) : Listener_thread_args(args.thread_registry, args.options, args.user_map, args.instance_map) ,total_connection_count(0) ,thread_info(pthread_self()) + ,num_sockets(0) { - num_sockets= 0; } @@ -116,11 +116,11 @@ void Listener_thread::run() #endif /* II. Listen sockets and spawn childs */ - for (int i=0; i < num_sockets; i++) - n = max(n, sockets[i]); + for (int i= 0; i < num_sockets; i++) + n= max(n, sockets[i]); n++; - while (thread_registry.is_shutdown() == false) + while (!thread_registry.is_shutdown()) { fd_set read_fds_arg= read_fds; @@ -140,7 +140,7 @@ void Listener_thread::run() } - for (int socket_index=0; socket_index < num_sockets; socket_index++) + for (int socket_index= 0; socket_index < num_sockets; socket_index++) { /* Assuming that rc > 0 as we asked to wait forever */ if (FD_ISSET(sockets[socket_index], &read_fds_arg)) @@ -149,8 +149,8 @@ void Listener_thread::run() /* accept may return -1 (failure or spurious wakeup) */ if (client_fd >= 0) // connection established { - Vio *vio = vio_new(client_fd, socket_index==0?VIO_TYPE_SOCKET:VIO_TYPE_TCPIP, - socket_index==0?1:0); + Vio *vio = vio_new(client_fd, socket_index==0?VIO_TYPE_SOCKET: + VIO_TYPE_TCPIP, socket_index==0?1:0); if (vio != 0) handle_new_mysql_connection(vio); else @@ -167,7 +167,7 @@ void Listener_thread::run() log_info("Listener_thread::run(): shutdown requested, exiting..."); - for (int i=0; i < num_sockets; i++) + for (int i= 0; i < num_sockets; i++) close(sockets[i]); #ifndef __WIN__ @@ -179,6 +179,10 @@ void Listener_thread::run() return; err: + // we have to close the ip sockets in case of error + for (int i= 0; i < num_sockets; i++) + close(sockets[i]); + thread_registry.unregister_thread(&thread_info); thread_registry.request_shutdown(); my_thread_end(); @@ -191,7 +195,7 @@ void set_non_blocking(int socket) int flags= fcntl(socket, F_GETFL, 0); fcntl(socket, F_SETFL, flags | O_NONBLOCK); #else - u_long arg = 1; + u_long arg= 1; ioctlsocket(socket, FIONBIO, &arg); #endif } @@ -245,7 +249,7 @@ int Listener_thread::create_tcp_socket() log_error("Listener_thread::run(): bind(ip socket) failed, '%s'", strerror(errno)); close(ip_socket); - return -1; + return -1; } if (listen(ip_socket, LISTEN_BACK_LOG_SIZE)) @@ -263,7 +267,7 @@ int Listener_thread::create_tcp_socket() set_no_inherit(ip_socket); FD_SET(ip_socket, &read_fds); - sockets[num_sockets++] = ip_socket; + sockets[num_sockets++]= ip_socket; log_info("accepting connections on ip socket"); return 0; } diff --git a/server-tools/instance-manager/manager.cc b/server-tools/instance-manager/manager.cc index 5f2d9d0b493..80078666824 100644 --- a/server-tools/instance-manager/manager.cc +++ b/server-tools/instance-manager/manager.cc @@ -85,14 +85,14 @@ bool have_signal; void onsignal(int signo) { - have_signal = true; + have_signal= true; } void set_signals(sigset_t *set) { signal(SIGINT, onsignal); signal(SIGTERM, onsignal); - have_signal = false; + have_signal= false; } int my_sigwait(const sigset_t *set, int *sig) diff --git a/server-tools/instance-manager/options.cc b/server-tools/instance-manager/options.cc index f563fa783d2..6a9999d7dbd 100644 --- a/server-tools/instance-manager/options.cc +++ b/server-tools/instance-manager/options.cc @@ -30,9 +30,9 @@ #define QUOTE2(x) #x #define QUOTE(x) QUOTE2(x) -const char *default_password_file_name = QUOTE(DEFAULT_PASSWORD_FILE_NAME); -const char *default_log_file_name = QUOTE(DEFAULT_LOG_FILE_NAME); -char default_config_file[FN_REFLEN] = "/etc/my.cnf"; +const char *default_password_file_name= QUOTE(DEFAULT_PASSWORD_FILE_NAME); +const char *default_log_file_name= QUOTE(DEFAULT_LOG_FILE_NAME); +char default_config_file[FN_REFLEN]= "/etc/my.cnf"; #ifndef __WIN__ char Options::run_as_service; @@ -52,7 +52,7 @@ uint Options::monitoring_interval= DEFAULT_MONITORING_INTERVAL; uint Options::port_number= DEFAULT_PORT; /* just to declare */ char **Options::saved_argv; -const char *Options::config_file = NULL; +const char *Options::config_file= NULL; /* List of options, accepted by the instance manager. @@ -236,33 +236,34 @@ C_MODE_END int Options::load(int argc, char **argv) { int rc; - char** argv_ptr = argv; + char **argv_ptr= argv; #ifdef __WIN__ setup_windows_defaults(*argv); #endif - config_file=NULL; + config_file= NULL; if (argc >= 2) { - if (is_prefix(argv[1], "--defaults-file=")) - config_file=argv[1]; + if (is_prefix(argv[1], "--defaults-file=")) + config_file=argv[1]; if (is_prefix(argv[1],"--defaults-file=") || is_prefix(argv[1],"--defaults-extra-file=")) Options::first_option= argv[1]; } - // we were not given a config file on the command line so we - // set have to construct a new argv array - if (config_file == NULL) - { + /* + we were not given a config file on the command line so we + default to our compiled in default + */ + if (config_file == NULL) + { #ifdef __WIN__ - ::GetModuleFileName(NULL, default_config_file, sizeof(default_config_file)); - char *filename = strstr(default_config_file, "mysqlmanager.exe"); - strcpy(filename, "my.ini"); + ::GetModuleFileName(NULL, default_config_file, sizeof(default_config_file)); char *filename= strrchr(default_config_file, "\\"); + strcpy(filename, "\\my.ini"); #endif - config_file = default_config_file; - } + config_file= default_config_file; + } /* config-file options are prepended to command-line ones */ load_defaults(config_file, default_groups, &argc, &argv); @@ -281,7 +282,6 @@ void Options::cleanup() { /* free_defaults returns nothing */ free_defaults(Options::saved_argv); - #ifdef __WIN__ free((char*)default_password_file_name); #endif @@ -291,11 +291,11 @@ void Options::cleanup() char* change_extension(const char *src, const char *newext) { - char *dot = (char*)strrchr(src, '.'); + char *dot= (char*)strrchr(src, '.'); if (!dot) return (char*)src; - int newlen = dot-src+strlen(newext)+1; - char *temp = (char*)malloc(newlen); + int newlen= dot-src+strlen(newext)+1; + char *temp= (char*)malloc(newlen); bzero(temp, newlen); strncpy(temp, src, dot-src+1); strcat(temp, newext); @@ -304,8 +304,10 @@ char* change_extension(const char *src, const char *newext) void Options::setup_windows_defaults(const char *progname) { - Options::password_file_name = default_password_file_name = change_extension(progname, "passwd"); - Options::log_file_name = default_log_file_name = change_extension(progname, "log"); + Options::password_file_name= default_password_file_name = + change_extension(progname, "passwd"); + Options::log_file_name= default_log_file_name = + change_extension(progname, "log"); } #endif diff --git a/server-tools/instance-manager/user_map.cc b/server-tools/instance-manager/user_map.cc index a80cb7767d1..df86d6a6915 100644 --- a/server-tools/instance-manager/user_map.cc +++ b/server-tools/instance-manager/user_map.cc @@ -62,8 +62,8 @@ int User::init(const char *line) /* assume that newline characater is present */ if (password[strlen(password)-2] == '\r') { - password[strlen(password)-2] = '\n'; - password[strlen(password)-1] = 0; + password[strlen(password)-2]= '\n'; + password[strlen(password)-1]= 0; } if (strlen(password) != SCRAMBLED_PASSWORD_CHAR_LENGTH + 1) goto err; From 71bc6fef621b534ca7789178683578603132a5a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Aug 2005 02:06:21 +0200 Subject: [PATCH 125/144] Changed/fixed error message from last commit --- sql/sql_table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 1437c1d382c..8874a70327e 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2634,7 +2634,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, */ if (mysql_frm_type(src_path) != FRMTYPE_TABLE) { - my_error(ER_WRONG_OBJECT, MYF(0), src_db, src_table, "a table"); + my_error(ER_WRONG_OBJECT, MYF(0), src_db, src_table, "BASE TABLE"); goto err; } From 9942ad0108d8e94491a6e4b390b150951fecc81e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 17:38:55 -0700 Subject: [PATCH 126/144] Skip two tests that fail on Windows that just reflect limitations of that platform, not real failures. (Bug #12328, Bug #11569) mysql-test/t/packet.test: Skip this test on Windows mysql-test/t/rpl_flush_tables.test: Skip this test on Windows mysql-test/include/not_windows.inc: Add include for skipping tests on Windows --- mysql-test/include/not_windows.inc | 4 ++++ mysql-test/t/packet.test | 3 +++ mysql-test/t/rpl_flush_tables.test | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 mysql-test/include/not_windows.inc diff --git a/mysql-test/include/not_windows.inc b/mysql-test/include/not_windows.inc new file mode 100644 index 00000000000..54e9e0e817a --- /dev/null +++ b/mysql-test/include/not_windows.inc @@ -0,0 +1,4 @@ +--require r/true.require +disable_query_log; +select convert(@@version_compile_os using latin1) NOT IN ("Win32","Win64","Windows") as "TRUE"; +enable_query_log; diff --git a/mysql-test/t/packet.test b/mysql-test/t/packet.test index 04122b42b44..4de284b7824 100644 --- a/mysql-test/t/packet.test +++ b/mysql-test/t/packet.test @@ -1,5 +1,8 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc +# Windows fails because it disconnects on too-large packets instead of just +# swallowing them and returning an error +--source include/not_windows.inc # # Check protocol handling diff --git a/mysql-test/t/rpl_flush_tables.test b/mysql-test/t/rpl_flush_tables.test index 846e2cd56ee..04158aed9e0 100644 --- a/mysql-test/t/rpl_flush_tables.test +++ b/mysql-test/t/rpl_flush_tables.test @@ -3,7 +3,10 @@ # RENAME TABLE work with MERGE tables on the slave. # Test of FLUSH NO_WRITE_TO_BINLOG by the way. # -source include/master-slave.inc; +--source include/master-slave.inc +# Skipped on Windows because it can't handle a table underlying an open +# merge table getting renamed. +--source include/not_windows.inc create table t1 (a int); insert into t1 values (10); From 5107f1ab50a02c81eff36f59e8b492c9de88e9d6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Aug 2005 11:57:30 +0200 Subject: [PATCH 127/144] - fixed enabling the Archive storage engine for the mysqld-max RPM binary support-files/mysql.spec.sh: - fixed enabling the Archive storage engine for the mysqld-max binary --- support-files/mysql.spec.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 3c58e642a1d..81fed07079f 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -300,7 +300,7 @@ BuildMySQL "--enable-shared \ --with-innodb \ --with-ndbcluster \ --with-raid \ - --with-archive \ + --with-archive-storage-engine \ --with-csv-storage-engine \ --with-example-storage-engine \ --with-blackhole-storage-engine \ @@ -668,6 +668,10 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Thu Aug 04 2005 Lenz Grimmer + +- Fixed enabling the Archive storage engine in the Max binary + * Tue Aug 02 2005 Lenz Grimmer - Fixed the Requires: tag for the server RPM (BUG 12233) From 21fefc68cb5b9f48eea90053364d737ec022d70e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Aug 2005 12:22:51 +0200 Subject: [PATCH 128/144] - Fixed the creation of the mysql user group account in the postinstall section of the MySQL-server RPM spec file (BUG#12348) support-files/mysql.spec.sh: - Fixed the creation of the mysql user group account in the postinstall section (BUG#12348) --- support-files/mysql.spec.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index ade774fb4e3..325ebdf2c01 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -371,7 +371,7 @@ fi # Create a MySQL user and group. Do not report any problems if it already # exists. -groupadd -r -c "MySQL server" %{mysqld_user} 2> /dev/null || true +groupadd -r %{mysqld_user} 2> /dev/null || true useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_user} %{mysqld_user} 2> /dev/null || true # Change permissions so that the user that will run the MySQL daemon @@ -562,6 +562,11 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Thu Aug 04 2005 Lenz Grimmer + +- Fixed the creation of the mysql user group account in the postinstall + section (BUG 12348) + * Fri Jul 15 2005 Lenz Grimmer - create a "mysql" user group and assign the mysql user account to that group From 36a2a092ab7ab26d5e90f73003a48db8e313df2f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Aug 2005 15:23:21 +0500 Subject: [PATCH 129/144] Fix for bug #12177 (errorlog file isn't closed) 4.1 version of the patch libmysql/libmysql.c: here we close errorlog file sql/mysql_priv.h: stderror_file declared sql/mysqld.cc: stderror_file saved --- libmysql/libmysql.c | 7 +++++++ sql/mysql_priv.h | 1 + sql/mysqld.cc | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index e5681edd3d8..7c6d140d2ef 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -188,6 +188,13 @@ void STDCALL mysql_server_end() mysql_thread_end(); free_charsets(); mysql_client_init= org_my_init_done= 0; +#ifdef EMBEDDED_SERVER + if (stderror_file) + { + fclose(stderror_file); + stderror_file= 0; + } +#endif } static MYSQL_PARAMETERS mysql_internal_parameters= diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 6969433649f..c8a4c4740ef 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -941,6 +941,7 @@ extern char *default_tz_name; extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log; extern FILE *bootstrap_file; +extern FILE *stderror_file; extern pthread_key(MEM_ROOT**,THR_MALLOC); extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status, diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 6bbd6f79aa2..9177703599c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -382,6 +382,7 @@ Le_creator le_creator; FILE *bootstrap_file; +FILE *stderror_file=0; I_List replicate_rewrite_db; I_List replicate_do_db, replicate_ignore_db; @@ -2767,7 +2768,7 @@ server."); #ifndef EMBEDDED_LIBRARY if (freopen(log_error_file, "a+", stdout)) #endif - freopen(log_error_file, "a+", stderr); + stderror_file= freopen(log_error_file, "a+", stderr); } } From 5ba9aad278cbce67d1d1a11e84ad551e9c1f94e9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Aug 2005 13:47:02 +0200 Subject: [PATCH 130/144] mysqld.dsp: Added the blackhole storage engine to the Max builds VC++Files/sql/mysqld.dsp: Added the blackhole storage engine to the Max builds --- VC++Files/sql/mysqld.dsp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index 034c8350c67..6a33889da53 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -75,7 +75,7 @@ LINK32=xilink6.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "HAVE_BLACKHOLE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c # SUBTRACT CPP /Fr /YX # ADD BASE RSC /l 0x410 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" @@ -130,7 +130,7 @@ LINK32=xilink6.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-nt-max /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "HAVE_BLACKHOLE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-nt-max /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -159,7 +159,7 @@ LINK32=xilink6.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-max /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "HAVE_BLACKHOLE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-max /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -451,6 +451,10 @@ SOURCE=.\gstream.cpp # End Source File # Begin Source File +SOURCE=.\ha_blackhole.cpp +# End Source File +# Begin Source File + SOURCE=.\ha_berkeley.cpp # End Source File # Begin Source File From 2747666df80b872844baaee3e5caae41d0df77f4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Aug 2005 13:54:39 +0200 Subject: [PATCH 131/144] mysql-test-run.pl: Back ported ndbcluster_support() from 5.0 Corrected the server id handling mysql-test/mysql-test-run.pl: Back ported ndbcluster_support() from 5.0 Corrected the server id handling --- mysql-test/mysql-test-run.pl | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 4272c05f7dc..523f31f5a5f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -287,6 +287,7 @@ sub executable_setup (); sub environment_setup (); sub kill_running_server (); sub kill_and_cleanup (); +sub ndbcluster_support (); sub ndbcluster_install (); sub ndbcluster_start (); sub ndbcluster_stop (); @@ -319,6 +320,12 @@ sub main () { initial_setup(); command_line_setup(); executable_setup(); + + if (! $opt_skip_ndbcluster and ! $opt_with_ndbcluster) + { + $opt_with_ndbcluster= ndbcluster_support(); + } + environment_setup(); signal_setup(); @@ -1026,6 +1033,23 @@ sub kill_and_cleanup () { # ############################################################################## +sub ndbcluster_support () { + + # check ndbcluster support by testing using a switch + # that is only available in that case + if ( mtr_run($exe_mysqld, + ["--no-defaults", + "--ndb-use-exact-count", + "--help"], + "", "/dev/null", "/dev/null", "") != 0 ) + { + mtr_report("No ndbcluster support"); + return 0; + } + mtr_report("Has ndbcluster support"); + return 1; +} + # FIXME why is there a different start below?! sub ndbcluster_install () { @@ -1663,13 +1687,15 @@ sub mysqld_arguments ($$$$$) { if ( $type eq 'master' ) { + my $id= $idx > 0 ? $idx + 101 : 1; + mtr_add_arg($args, "%s--log-bin=%s/log/master-bin%s", $prefix, $opt_vardir, $sidx); mtr_add_arg($args, "%s--pid-file=%s", $prefix, $master->[$idx]->{'path_mypid'}); mtr_add_arg($args, "%s--port=%d", $prefix, $master->[$idx]->{'path_myport'}); - mtr_add_arg($args, "%s--server-id=1", $prefix); + mtr_add_arg($args, "%s--server-id=%d", $prefix, $id); mtr_add_arg($args, "%s--socket=%s", $prefix, $master->[$idx]->{'path_mysock'}); mtr_add_arg($args, "%s--innodb_data_file_path=ibdata1:50M", $prefix); @@ -1677,6 +1703,11 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--datadir=%s", $prefix, $master->[$idx]->{'path_myddir'}); + if ( $idx > 0 ) + { + mtr_add_arg($args, "%s--skip-innodb", $prefix); + } + if ( $opt_skip_ndbcluster ) { mtr_add_arg($args, "%s--skip-ndbcluster", $prefix); @@ -1686,7 +1717,7 @@ sub mysqld_arguments ($$$$$) { if ( $type eq 'slave' ) { my $slave_server_id= 2 + $idx; - my $slave_rpl_rank= $idx > 0 ? 2 : $slave_server_id; + my $slave_rpl_rank= $slave_server_id; mtr_add_arg($args, "%s--datadir=%s", $prefix, $slave->[$idx]->{'path_myddir'}); From d752732bb8c49d8db36e71d796942b4eb5aa7502 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Aug 2005 15:20:03 +0200 Subject: [PATCH 132/144] - Bumped up version number to 5.0.12-beta to indicate the 5.0.11 release build branchoff --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 8a5220dbf38..8c591bfddf8 100644 --- a/configure.in +++ b/configure.in @@ -6,7 +6,7 @@ AC_PREREQ(2.57)dnl Minimum Autoconf version required. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # Don't forget to also update the NDB lines below. -AM_INIT_AUTOMAKE(mysql, 5.0.11-beta) +AM_INIT_AUTOMAKE(mysql, 5.0.12-beta) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 @@ -17,7 +17,7 @@ SHARED_LIB_VERSION=15:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=11 +NDB_VERSION_BUILD=12 NDB_VERSION_STATUS="beta" # Set all version vars based on $VERSION. How do we do this more elegant ? From 2ee03416206449ee38de7e776666abf284329ec3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Aug 2005 10:08:55 -0500 Subject: [PATCH 133/144] add support for vcproj and sln files (Visual Studio 2003) --- scripts/make_win_src_distribution.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index c79433f97c1..8183370f220 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -202,7 +202,7 @@ copy_dir_files() for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp *.dsw \ README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ *.inc *.test *.result *.pem Moscow_leap des_key_file \ - *.dat *.000001 *.require *.opt + *.vcproj *.sln *.dat *.000001 *.require *.opt do if [ -f $i ] then @@ -343,7 +343,9 @@ mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp # Search the tree for plain text files and adapt the line end marker # find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.cnf" -o -name "*.ini" \ - -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \) -type f -print \ + -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT + -o -name "INSTALL*" -o -name LICENSE -o -name "README*" + -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ | while read v do unix_to_dos $v From 1beb95e3e43c7ae56a75e9206fa2b904480d0604 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Aug 2005 12:45:32 -0700 Subject: [PATCH 134/144] Update test to deal with more relaxed datetime parsing. mysql-test/r/query_cache.result: Updated results mysql-test/t/query_cache.test: Change test to use a truly invalid date, now that dates like '20050327 0:0:0' are handled as they are in 4.0. --- mysql-test/r/query_cache.result | 18 +++++++++--------- mysql-test/t/query_cache.test | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 13ba2f3b0ca..ed87e2be2b4 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -902,24 +902,24 @@ KEY `date` (`date`) ) ENGINE=MyISAM; INSERT INTO t1 VALUES ('20050326'); INSERT INTO t1 VALUES ('20050325'); -SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 0:0:0'; +SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid'; COUNT(*) 0 Warnings: -Warning 1292 Truncated incorrect datetime value: '20050327 0:0:0' -Warning 1292 Truncated incorrect datetime value: '20050327 0:0:0' -SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 0:0:0'; +Warning 1292 Truncated incorrect datetime value: '20050327 invalid' +Warning 1292 Truncated incorrect datetime value: '20050327 invalid' +SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 invalid'; COUNT(*) 0 Warnings: -Warning 1292 Truncated incorrect datetime value: '20050328 0:0:0' -Warning 1292 Truncated incorrect datetime value: '20050328 0:0:0' -SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 0:0:0'; +Warning 1292 Truncated incorrect datetime value: '20050328 invalid' +Warning 1292 Truncated incorrect datetime value: '20050328 invalid' +SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid'; COUNT(*) 0 Warnings: -Warning 1292 Truncated incorrect datetime value: '20050327 0:0:0' -Warning 1292 Truncated incorrect datetime value: '20050327 0:0:0' +Warning 1292 Truncated incorrect datetime value: '20050327 invalid' +Warning 1292 Truncated incorrect datetime value: '20050327 invalid' show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 4c2711ae833..d08dc5fb352 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -679,9 +679,9 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES ('20050326'); INSERT INTO t1 VALUES ('20050325'); -SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 0:0:0'; -SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 0:0:0'; -SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 0:0:0'; +SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid'; +SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 invalid'; +SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid'; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; show status like "Qcache_hits"; From 01f1a3ac124d31919e5fc7844ff00881bf410f33 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Aug 2005 14:38:48 -0700 Subject: [PATCH 135/144] Update test results mysql-test/r/create.result: Update error message text mysql-test/r/query_cache.result: Update warnings --- mysql-test/r/create.result | 2 +- mysql-test/r/query_cache.result | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 293be36e5ab..82a5ccc3e82 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -606,6 +606,6 @@ create database mysqltest; use mysqltest; create view v1 as select 'foo' from dual; create table t1 like v1; -ERROR HY000: 'mysqltest.v1' is not a table +ERROR HY000: 'mysqltest.v1' is not BASE TABLE drop view v1; drop database mysqltest; diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 0efd5ac1566..6ff49951d27 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -947,18 +947,24 @@ COUNT(*) Warnings: Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1 Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1 +Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid' +Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid' SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 invalid'; COUNT(*) 0 Warnings: Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1 Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1 +Warning 1292 Truncated incorrect INTEGER value: '20050328 invalid' +Warning 1292 Truncated incorrect INTEGER value: '20050328 invalid' SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid'; COUNT(*) 0 Warnings: Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1 Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1 +Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid' +Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid' show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 From b7ab93001d50bc2db7c1f06c8040ec79a35b170b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Aug 2005 16:33:29 -0700 Subject: [PATCH 136/144] Fix out-of-order results in view results file mysql-test/r/view.result: Update results file --- mysql-test/r/view.result | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 20c6b7782b7..f6b5018cf3a 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2007,17 +2007,6 @@ A B DROP VIEW v1; DROP TABLE t1; -create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime); -create view v1 as select * from t1; -desc v1; -Field Type Null Key Default Extra -f1 tinyint(1) YES NULL -f2 char(1) YES NULL -f3 varchar(1) YES NULL -f4 geometry YES NULL -f5 datetime YES NULL -drop view v1; -drop table t1; CREATE TABLE t1 ( bug_table_seq INTEGER NOT NULL); CREATE OR REPLACE VIEW v1 AS SELECT * from t1; DROP PROCEDURE IF EXISTS p1; @@ -2032,6 +2021,17 @@ CALL p1(); DROP PROCEDURE p1; DROP VIEW v1; DROP TABLE t1; +create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime); +create view v1 as select * from t1; +desc v1; +Field Type Null Key Default Extra +f1 tinyint(1) YES NULL +f2 char(1) YES NULL +f3 varchar(1) YES NULL +f4 geometry YES NULL +f5 datetime YES NULL +drop view v1; +drop table t1; create table t1(f1 datetime); insert into t1 values('2005.01.01 12:0:0'); create view v1 as select f1, subtime(f1, '1:1:1') as sb from t1; From 299a394d36cc9295096c37bd6c0c641047004058 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Aug 2005 11:10:51 +0400 Subject: [PATCH 137/144] Fix gcc -ansi -pedantic compilation failure. client/client_priv.h: Fix a compile failure. --- client/client_priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/client_priv.h b/client/client_priv.h index 997f9ffe552..74bc0b41006 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -50,5 +50,5 @@ enum options_client OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, #endif OPT_TRIGGERS, - OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE, + OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE }; From 7c3f55ec9cbe9b5de71440717a89b6259664d3cf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Aug 2005 11:01:29 +0200 Subject: [PATCH 138/144] fix for bug #12315 - SHOW TABLE STATUS FROM `information_schema`; does not sort tablenames mysql-test/r/information_schema.result: fix the test case for fix for bug #12315 - SHOW TABLE STATUS FROM `information_schema`; does not sort tablenames mysql-test/r/information_schema_db.result: fix the test case for fix for bug #12315 - SHOW TABLE STATUS FROM `information_schema`; does not sort tablenames sql/sql_show.cc: reorder the structure fix for bug #12315 - SHOW TABLE STATUS FROM `information_schema`; does not sort tablenames sql/table.h: reorder the enum fix for bug #12315 - SHOW TABLE STATUS FROM `information_schema`; does not sort tablenames --- mysql-test/r/information_schema.result | 50 +++++++++++------------ mysql-test/r/information_schema_db.result | 20 ++++----- sql/sql_show.cc | 44 ++++++++++---------- sql/table.h | 25 +++++++++--- 4 files changed, 77 insertions(+), 62 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index e6a929d7e3e..5688d8c2145 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -33,22 +33,22 @@ create table mysqltest.t4(a int); create view v1 (c) as select table_name from information_schema.TABLES; select * from v1; c -SCHEMATA -TABLES -COLUMNS CHARACTER_SETS COLLATIONS COLLATION_CHARACTER_SET_APPLICABILITY +COLUMNS +COLUMN_PRIVILEGES +KEY_COLUMN_USAGE ROUTINES +SCHEMATA +SCHEMA_PRIVILEGES STATISTICS +TABLES +TABLE_CONSTRAINTS +TABLE_PRIVILEGES +TRIGGERS VIEWS USER_PRIVILEGES -SCHEMA_PRIVILEGES -TABLE_PRIVILEGES -COLUMN_PRIVILEGES -TABLE_CONSTRAINTS -KEY_COLUMN_USAGE -TRIGGERS columns_priv db func @@ -76,8 +76,8 @@ inner join information_schema.TABLES v2 on (v1.c=v2.table_name) where v1.c like "t%"; c table_name TABLES TABLES -TABLE_PRIVILEGES TABLE_PRIVILEGES TABLE_CONSTRAINTS TABLE_CONSTRAINTS +TABLE_PRIVILEGES TABLE_PRIVILEGES TRIGGERS TRIGGERS tables_priv tables_priv time_zone time_zone @@ -94,8 +94,8 @@ left join information_schema.TABLES v2 on (v1.c=v2.table_name) where v1.c like "t%"; c table_name TABLES TABLES -TABLE_PRIVILEGES TABLE_PRIVILEGES TABLE_CONSTRAINTS TABLE_CONSTRAINTS +TABLE_PRIVILEGES TABLE_PRIVILEGES TRIGGERS TRIGGERS tables_priv tables_priv time_zone time_zone @@ -112,8 +112,8 @@ right join information_schema.TABLES v2 on (v1.c=v2.table_name) where v1.c like "t%"; c table_name TABLES TABLES -TABLE_PRIVILEGES TABLE_PRIVILEGES TABLE_CONSTRAINTS TABLE_CONSTRAINTS +TABLE_PRIVILEGES TABLE_PRIVILEGES TRIGGERS TRIGGERS tables_priv tables_priv time_zone time_zone @@ -577,13 +577,13 @@ select TABLE_NAME,TABLE_TYPE,ENGINE from information_schema.tables where table_schema='information_schema' limit 2; TABLE_NAME TABLE_TYPE ENGINE -SCHEMATA TEMPORARY MEMORY -TABLES TEMPORARY MEMORY +CHARACTER_SETS TEMPORARY MEMORY +COLLATIONS TEMPORARY MEMORY show tables from information_schema like "T%"; Tables_in_information_schema (T%) TABLES -TABLE_PRIVILEGES TABLE_CONSTRAINTS +TABLE_PRIVILEGES TRIGGERS create database information_schema; ERROR HY000: Can't create database 'information_schema'; database exists @@ -591,8 +591,8 @@ use information_schema; show full tables like "T%"; Tables_in_information_schema (T%) Table_type TABLES TEMPORARY -TABLE_PRIVILEGES TEMPORARY TABLE_CONSTRAINTS TEMPORARY +TABLE_PRIVILEGES TEMPORARY TRIGGERS TEMPORARY create table t1(a int); ERROR 42S02: Unknown table 't1' in information_schema @@ -603,8 +603,8 @@ use information_schema; show tables like "T%"; Tables_in_information_schema (T%) TABLES -TABLE_PRIVILEGES TABLE_CONSTRAINTS +TABLE_PRIVILEGES TRIGGERS select table_name from tables where table_name='user'; table_name @@ -710,18 +710,18 @@ table_schema table_name column_name information_schema COLUMNS COLUMN_TYPE information_schema ROUTINES ROUTINE_DEFINITION information_schema ROUTINES SQL_MODE -information_schema VIEWS VIEW_DEFINITION information_schema TRIGGERS ACTION_CONDITION information_schema TRIGGERS ACTION_STATEMENT information_schema TRIGGERS SQL_MODE +information_schema VIEWS VIEW_DEFINITION select table_name, column_name, data_type from information_schema.columns where data_type = 'datetime'; table_name column_name data_type +ROUTINES CREATED datetime +ROUTINES LAST_ALTERED datetime TABLES CREATE_TIME datetime TABLES UPDATE_TIME datetime TABLES CHECK_TIME datetime -ROUTINES CREATED datetime -ROUTINES LAST_ALTERED datetime TRIGGERS CREATED datetime SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES A WHERE NOT EXISTS @@ -756,14 +756,14 @@ grant select on test.* to mysqltest_4@localhost; SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME='TABLE_NAME'; TABLE_NAME COLUMN_NAME PRIVILEGES -TABLES TABLE_NAME select COLUMNS TABLE_NAME select -STATISTICS TABLE_NAME select -VIEWS TABLE_NAME select -TABLE_PRIVILEGES TABLE_NAME select COLUMN_PRIVILEGES TABLE_NAME select -TABLE_CONSTRAINTS TABLE_NAME select KEY_COLUMN_USAGE TABLE_NAME select +STATISTICS TABLE_NAME select +TABLES TABLE_NAME select +TABLE_CONSTRAINTS TABLE_NAME select +TABLE_PRIVILEGES TABLE_NAME select +VIEWS TABLE_NAME select delete from mysql.user where user='mysqltest_4'; delete from mysql.db where user='mysqltest_4'; flush privileges; diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result index ece30924055..d3ff310b812 100644 --- a/mysql-test/r/information_schema_db.result +++ b/mysql-test/r/information_schema_db.result @@ -1,27 +1,27 @@ use INFORMATION_SCHEMA; show tables; Tables_in_information_schema -SCHEMATA -TABLES -COLUMNS CHARACTER_SETS COLLATIONS COLLATION_CHARACTER_SET_APPLICABILITY +COLUMNS +COLUMN_PRIVILEGES +KEY_COLUMN_USAGE ROUTINES +SCHEMATA +SCHEMA_PRIVILEGES STATISTICS +TABLES +TABLE_CONSTRAINTS +TABLE_PRIVILEGES +TRIGGERS VIEWS USER_PRIVILEGES -SCHEMA_PRIVILEGES -TABLE_PRIVILEGES -COLUMN_PRIVILEGES -TABLE_CONSTRAINTS -KEY_COLUMN_USAGE -TRIGGERS show tables from INFORMATION_SCHEMA like 'T%'; Tables_in_information_schema (T%) TABLES -TABLE_PRIVILEGES TABLE_CONSTRAINTS +TABLE_PRIVILEGES TRIGGERS create database `inf%`; use `inf%`; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 56272b4fdaf..e3c6fa14522 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3981,46 +3981,46 @@ ST_FIELD_INFO variables_fields_info[]= ST_SCHEMA_TABLE schema_tables[]= { - {"SCHEMATA", schema_fields_info, create_schema_table, - fill_schema_shemata, make_schemata_old_format, 0, 1, -1, 0}, - {"TABLES", tables_fields_info, create_schema_table, - get_all_tables, make_old_format, get_schema_tables_record, 1, 2, 0}, - {"COLUMNS", columns_fields_info, create_schema_table, - get_all_tables, make_columns_old_format, get_schema_column_record, 1, 2, 0}, {"CHARACTER_SETS", charsets_fields_info, create_schema_table, fill_schema_charsets, make_character_sets_old_format, 0, -1, -1, 0}, {"COLLATIONS", collation_fields_info, create_schema_table, fill_schema_collation, make_old_format, 0, -1, -1, 0}, {"COLLATION_CHARACTER_SET_APPLICABILITY", coll_charset_app_fields_info, create_schema_table, fill_schema_coll_charset_app, 0, 0, -1, -1, 0}, - {"ROUTINES", proc_fields_info, create_schema_table, - fill_schema_proc, make_proc_old_format, 0, -1, -1, 0}, - {"STATISTICS", stat_fields_info, create_schema_table, - get_all_tables, make_old_format, get_schema_stat_record, 1, 2, 0}, - {"VIEWS", view_fields_info, create_schema_table, - get_all_tables, 0, get_schema_views_record, 1, 2, 0}, - {"USER_PRIVILEGES", user_privileges_fields_info, create_schema_table, - fill_schema_user_privileges, 0, 0, -1, -1, 0}, - {"SCHEMA_PRIVILEGES", schema_privileges_fields_info, create_schema_table, - fill_schema_schema_privileges, 0, 0, -1, -1, 0}, - {"TABLE_PRIVILEGES", table_privileges_fields_info, create_schema_table, - fill_schema_table_privileges, 0, 0, -1, -1, 0}, + {"COLUMNS", columns_fields_info, create_schema_table, + get_all_tables, make_columns_old_format, get_schema_column_record, 1, 2, 0}, {"COLUMN_PRIVILEGES", column_privileges_fields_info, create_schema_table, fill_schema_column_privileges, 0, 0, -1, -1, 0}, - {"TABLE_CONSTRAINTS", table_constraints_fields_info, create_schema_table, - get_all_tables, 0, get_schema_constraints_record, 3, 4, 0}, {"KEY_COLUMN_USAGE", key_column_usage_fields_info, create_schema_table, get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0}, - {"TABLE_NAMES", table_names_fields_info, create_schema_table, - get_all_tables, make_table_names_old_format, 0, 1, 2, 1}, {"OPEN_TABLES", open_tables_fields_info, create_schema_table, fill_open_tables, make_old_format, 0, -1, -1, 1}, + {"ROUTINES", proc_fields_info, create_schema_table, + fill_schema_proc, make_proc_old_format, 0, -1, -1, 0}, + {"SCHEMATA", schema_fields_info, create_schema_table, + fill_schema_shemata, make_schemata_old_format, 0, 1, -1, 0}, + {"SCHEMA_PRIVILEGES", schema_privileges_fields_info, create_schema_table, + fill_schema_schema_privileges, 0, 0, -1, -1, 0}, + {"STATISTICS", stat_fields_info, create_schema_table, + get_all_tables, make_old_format, get_schema_stat_record, 1, 2, 0}, {"STATUS", variables_fields_info, create_schema_table, fill_status, make_old_format, 0, -1, -1, 1}, + {"TABLES", tables_fields_info, create_schema_table, + get_all_tables, make_old_format, get_schema_tables_record, 1, 2, 0}, + {"TABLE_CONSTRAINTS", table_constraints_fields_info, create_schema_table, + get_all_tables, 0, get_schema_constraints_record, 3, 4, 0}, + {"TABLE_NAMES", table_names_fields_info, create_schema_table, + get_all_tables, make_table_names_old_format, 0, 1, 2, 1}, + {"TABLE_PRIVILEGES", table_privileges_fields_info, create_schema_table, + fill_schema_table_privileges, 0, 0, -1, -1, 0}, {"TRIGGERS", triggers_fields_info, create_schema_table, get_all_tables, make_old_format, get_schema_triggers_record, 5, 6, 0}, {"VARIABLES", variables_fields_info, create_schema_table, fill_variables, make_old_format, 0, -1, -1, 1}, + {"VIEWS", view_fields_info, create_schema_table, + get_all_tables, 0, get_schema_views_record, 1, 2, 0}, + {"USER_PRIVILEGES", user_privileges_fields_info, create_schema_table, + fill_schema_user_privileges, 0, 0, -1, -1, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0} }; diff --git a/sql/table.h b/sql/table.h index 13d44766804..22a35e29e87 100644 --- a/sql/table.h +++ b/sql/table.h @@ -278,11 +278,26 @@ typedef struct st_foreign_key_info enum enum_schema_tables { - SCH_SCHEMATA= 0, SCH_TABLES, SCH_COLUMNS, SCH_CHARSETS, SCH_COLLATIONS, - SCH_COLLATION_CHARACTER_SET_APPLICABILITY, SCH_PROCEDURES, SCH_STATISTICS, - SCH_VIEWS, SCH_USER_PRIVILEGES, SCH_SCHEMA_PRIVILEGES, SCH_TABLE_PRIVILEGES, - SCH_COLUMN_PRIVILEGES, SCH_TABLE_CONSTRAINTS, SCH_KEY_COLUMN_USAGE, - SCH_TABLE_NAMES, SCH_OPEN_TABLES, SCH_STATUS, SCH_TRIGGERS, SCH_VARIABLES + SCH_CHARSETS= 0, + SCH_COLLATIONS, + SCH_COLLATION_CHARACTER_SET_APPLICABILITY, + SCH_COLUMNS, + SCH_COLUMN_PRIVILEGES, + SCH_KEY_COLUMN_USAGE, + SCH_OPEN_TABLES, + SCH_PROCEDURES, + SCH_SCHEMATA, + SCH_SCHEMA_PRIVILEGES, + SCH_STATISTICS, + SCH_STATUS, + SCH_TABLES, + SCH_TABLE_CONSTRAINTS, + SCH_TABLE_NAMES, + SCH_TABLE_PRIVILEGES, + SCH_TRIGGERS, + SCH_VARIABLES, + SCH_VIEWS, + SCH_USER_PRIVILEGES }; From 85834c3b030e6680b02cf8b49ea71903d30a4ea2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Aug 2005 14:35:30 +0400 Subject: [PATCH 139/144] IM port fixes: fix crash on startup, add more error checking, get rid of unnecessary code. server-tools/instance-manager/commands.cc: fix memory leak server-tools/instance-manager/guardian.cc: don't check pthread_mutex_lock/unlock return value, as it never returns error if properly used (no self deadlocks) and initialized server-tools/instance-manager/guardian.h: prototype fixed server-tools/instance-manager/instance_map.cc: don't check pthread_mutex_lock/unlock status, as it never returns error if properly used (no self deadlocks) and initialized server-tools/instance-manager/instance_map.h: prototype fixed server-tools/instance-manager/listener.cc: initialize highest-numbered descriptor to 0 for select before setting it with max(n, sockets[i]), ifdef unix-specific code server-tools/instance-manager/manager.cc: remove commented stuff server-tools/instance-manager/options.cc: fix crash in load_defaults, which happened on all Unix systems due to const char *Options::config_file= NULL. Check return value for GetModuleFileName. Get rid of obscure default_config_file[FN_REFLEN]= "/etc/my.cnf"; which was never used --- server-tools/instance-manager/commands.cc | 10 +++++-- server-tools/instance-manager/guardian.cc | 14 ++------- server-tools/instance-manager/guardian.h | 4 +-- server-tools/instance-manager/instance_map.cc | 14 ++------- server-tools/instance-manager/instance_map.h | 4 +-- server-tools/instance-manager/listener.cc | 8 ++--- server-tools/instance-manager/manager.cc | 1 - server-tools/instance-manager/options.cc | 30 ++++++++++++------- 8 files changed, 39 insertions(+), 46 deletions(-) diff --git a/server-tools/instance-manager/commands.cc b/server-tools/instance-manager/commands.cc index 7589da859cf..0f801c8cc7e 100644 --- a/server-tools/instance-manager/commands.cc +++ b/server-tools/instance-manager/commands.cc @@ -471,6 +471,7 @@ int Show_instance_log::execute(struct st_net *net, ulong connection_id) int read_len; /* calculate buffer size */ MY_STAT file_stat; + Buffer read_buff; /* my_fstat doesn't use the flag parameter */ if (my_fstat(fd, &file_stat, MYF(0))) @@ -478,13 +479,16 @@ int Show_instance_log::execute(struct st_net *net, ulong connection_id) buff_size= (size - offset); + read_buff.reserve(0, buff_size); + /* read in one chunk */ read_len= my_seek(fd, file_stat.st_size - size, MY_SEEK_SET, MYF(0)); - char *bf= (char*) malloc(sizeof(char)*buff_size); - if ((read_len= my_read(fd, (byte*)bf, buff_size, MYF(0))) < 0) + if ((read_len= my_read(fd, (byte*) read_buff.buffer, + buff_size, MYF(0))) < 0) return ER_READ_FILE; - store_to_protocol_packet(&send_buff, (char*) bf, &position, read_len); + store_to_protocol_packet(&send_buff, read_buff.buffer, + &position, read_len); close(fd); } else diff --git a/server-tools/instance-manager/guardian.cc b/server-tools/instance-manager/guardian.cc index 0d6ebfa8d79..4c8f67bd64e 100644 --- a/server-tools/instance-manager/guardian.cc +++ b/server-tools/instance-manager/guardian.cc @@ -424,23 +424,13 @@ int Guardian_thread::stop_instances(bool stop_instances_arg) } -int Guardian_thread::lock() +void Guardian_thread::lock() { -#ifdef __WIN__ pthread_mutex_lock(&LOCK_guardian); - return 0; -#else - return pthread_mutex_lock(&LOCK_guardian); -#endif } -int Guardian_thread::unlock() +void Guardian_thread::unlock() { -#ifdef __WIN__ pthread_mutex_unlock(&LOCK_guardian); - return 0; -#else - return pthread_mutex_unlock(&LOCK_guardian); -#endif } diff --git a/server-tools/instance-manager/guardian.h b/server-tools/instance-manager/guardian.h index 502dc86b2ae..e8992722f3c 100644 --- a/server-tools/instance-manager/guardian.h +++ b/server-tools/instance-manager/guardian.h @@ -100,8 +100,8 @@ public: int stop_guard(Instance *instance); /* Returns true if guardian thread is stopped */ int is_stopped(); - int lock(); - int unlock(); + void lock(); + void unlock(); public: pthread_cond_t COND_guardian; diff --git a/server-tools/instance-manager/instance_map.cc b/server-tools/instance-manager/instance_map.cc index 802f085aaed..69eadd7e765 100644 --- a/server-tools/instance-manager/instance_map.cc +++ b/server-tools/instance-manager/instance_map.cc @@ -137,25 +137,15 @@ Instance_map::~Instance_map() } -int Instance_map::lock() +void Instance_map::lock() { -#ifdef __WIN__ pthread_mutex_lock(&LOCK_instance_map); - return 0; -#else - return pthread_mutex_lock(&LOCK_instance_map); -#endif } -int Instance_map::unlock() +void Instance_map::unlock() { -#ifdef __WIN__ pthread_mutex_unlock(&LOCK_instance_map); - return 0; -#else - return pthread_mutex_unlock(&LOCK_instance_map); -#endif } diff --git a/server-tools/instance-manager/instance_map.h b/server-tools/instance-manager/instance_map.h index 666a16c7040..47037e0d433 100644 --- a/server-tools/instance-manager/instance_map.h +++ b/server-tools/instance-manager/instance_map.h @@ -60,8 +60,8 @@ public: Instance *find(const char *name, uint name_len); int flush_instances(); - int lock(); - int unlock(); + void lock(); + void unlock(); int init(); Instance_map(const char *default_mysqld_path_arg); diff --git a/server-tools/instance-manager/listener.cc b/server-tools/instance-manager/listener.cc index d26324a6519..8fcf23a7397 100644 --- a/server-tools/instance-manager/listener.cc +++ b/server-tools/instance-manager/listener.cc @@ -47,6 +47,7 @@ public: ~Listener_thread(); void run(); private: + static const int LISTEN_BACK_LOG_SIZE= 5; /* standard backlog size */ ulong total_connection_count; Thread_info thread_info; @@ -59,7 +60,6 @@ private: int create_unix_socket(struct sockaddr_un &unix_socket_address); }; -const int LISTEN_BACK_LOG_SIZE= 5; // standard backlog size Listener_thread::Listener_thread(const Listener_thread_args &args) : Listener_thread_args(args.thread_registry, args.options, args.user_map, @@ -88,13 +88,14 @@ Listener_thread::~Listener_thread() void Listener_thread::run() { + int n= 0; + +#ifndef __WIN__ /* we use this var to check whether we are running on LinuxThreads */ pid_t thread_pid; - int n; thread_pid= getpid(); -#ifndef __WIN__ struct sockaddr_un unix_socket_address; /* set global variable */ linuxthreads= (thread_pid != manager_pid); @@ -205,7 +206,6 @@ void set_no_inherit(int socket) #ifndef __WIN__ int flags= fcntl(socket, F_GETFD, 0); fcntl(socket, F_SETFD, flags | FD_CLOEXEC); -#else #endif } diff --git a/server-tools/instance-manager/manager.cc b/server-tools/instance-manager/manager.cc index 3c809fdfce2..e3daca71898 100644 --- a/server-tools/instance-manager/manager.cc +++ b/server-tools/instance-manager/manager.cc @@ -97,7 +97,6 @@ void set_signals(sigset_t *set) int my_sigwait(const sigset_t *set, int *sig) { -// MSG msg; while (!have_signal) { Sleep(100); diff --git a/server-tools/instance-manager/options.cc b/server-tools/instance-manager/options.cc index a8e677db630..86e21ec8a11 100644 --- a/server-tools/instance-manager/options.cc +++ b/server-tools/instance-manager/options.cc @@ -32,17 +32,16 @@ const char *default_password_file_name= QUOTE(DEFAULT_PASSWORD_FILE_NAME); const char *default_log_file_name= QUOTE(DEFAULT_LOG_FILE_NAME); -char default_config_file[FN_REFLEN]= "/etc/my.cnf"; +#ifdef __WIN__ +char windows_config_file[FN_REFLEN]; -#ifndef __WIN__ -char Options::run_as_service; -const char *Options::user= 0; /* No default value */ -const char *Options::config_file= NULL; -#else char Options::install_as_service; char Options::remove_service; -const char *Options::config_file= QUOTE(DEFAULT_CONFIG_FILE); +#else +char Options::run_as_service; +const char *Options::user= 0; /* No default value */ #endif +const char *Options::config_file= QUOTE(DEFAULT_CONFIG_FILE); const char *Options::log_file_name= default_log_file_name; const char *Options::pid_file_name= QUOTE(DEFAULT_PID_FILE_NAME); const char *Options::socket_file_name= QUOTE(DEFAULT_SOCKET_FILE_NAME); @@ -271,9 +270,20 @@ int Options::load(int argc, char **argv) */ if (Options::config_file == NULL) { - ::GetModuleFileName(NULL, default_config_file, sizeof(default_config_file)); char *filename= strrchr(default_config_file, "\\"); - strcpy(filename, "\\my.ini"); - Options::config_file= default_config_file; + char *filename; + static const char default_win_config_file_name[]= "\\my.ini"; + + if (!GetModuleFileName(NULL, windows_config_file, + sizeof(windows_config_file))) + goto err; + + filename= strrchr(windows_config_file, "\\"); + /* + Don't check for the overflow as strlen("\\my.ini") is less + then strlen("mysqlmanager") (the binary name) + */ + strcpy(filename, default_win_config_file_name); + Options::config_file= windows_config_file; } #endif From cd3fa684cec86172ee3905675886f4efb05e407a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Aug 2005 17:02:06 +0400 Subject: [PATCH 140/144] IM port cleanup server-tools/instance-manager/IMService.cpp: coding style fixes: tabs, trailing spaces, offset e.t.c server-tools/instance-manager/WindowsService.cpp: coding style fixes: tabs, trailing spaces, offset e.t.c server-tools/instance-manager/WindowsService.h: coding style fixes: tabs, trailing spaces, offset e.t.c server-tools/instance-manager/instance.cc: cleanup & coding style fixes: tabs, trailing spaces, offset e.t.c server-tools/instance-manager/listener.cc: coding style fixes: tabs, trailing spaces, offset e.t.c server-tools/instance-manager/manager.cc: coding style fixes: tabs, trailing spaces, offset e.t.c server-tools/instance-manager/options.cc: coding style fixes: tabs, trailing spaces, offset e.t.c server-tools/instance-manager/user_map.cc: simplify password file processing --- server-tools/instance-manager/IMService.cpp | 11 +- .../instance-manager/WindowsService.cpp | 77 ++++---- .../instance-manager/WindowsService.h | 9 +- server-tools/instance-manager/instance.cc | 177 ++++++++---------- server-tools/instance-manager/listener.cc | 47 ++--- server-tools/instance-manager/manager.cc | 22 +-- server-tools/instance-manager/options.cc | 57 +++--- server-tools/instance-manager/user_map.cc | 24 +-- 8 files changed, 205 insertions(+), 219 deletions(-) diff --git a/server-tools/instance-manager/IMService.cpp b/server-tools/instance-manager/IMService.cpp index 1d678803264..b6195d15603 100755 --- a/server-tools/instance-manager/IMService.cpp +++ b/server-tools/instance-manager/IMService.cpp @@ -5,8 +5,8 @@ IMService::IMService(void) { - serviceName = "MySqlManager"; - displayName = "MySQL Manager"; + serviceName= "MySqlManager"; + displayName= "MySQL Manager"; } IMService::~IMService(void) @@ -35,13 +35,13 @@ void IMService::Log(const char *msg) log_info(msg); } -int HandleServiceOptions(Options options) +int HandleServiceOptions(Options options) { int ret_val= 0; IMService winService; - if (options.install_as_service) + if (options.install_as_service) { if (winService.IsInstalled()) log_info("Service is already installed\n"); @@ -59,7 +59,7 @@ int HandleServiceOptions(Options options) log_info("Service is not installed\n"); else if (winService.Remove()) log_info("Service removed successfully\n"); - else + else { log_info("Service failed to remove\n"); ret_val= -1; @@ -69,4 +69,3 @@ int HandleServiceOptions(Options options) return (int)winService.Init(); return ret_val; } - diff --git a/server-tools/instance-manager/WindowsService.cpp b/server-tools/instance-manager/WindowsService.cpp index e4b9a3a8491..fb7e00e0d9b 100755 --- a/server-tools/instance-manager/WindowsService.cpp +++ b/server-tools/instance-manager/WindowsService.cpp @@ -4,9 +4,9 @@ static WindowsService *gService; -WindowsService::WindowsService(void) : - statusCheckpoint(0), - serviceName(NULL), +WindowsService::WindowsService(void) : + statusCheckpoint(0), + serviceName(NULL), inited(false), dwAcceptedControls(SERVICE_ACCEPT_STOP) { @@ -32,14 +32,14 @@ BOOL WindowsService::Install() GetModuleFileName(NULL, szFilePath, sizeof(szFilePath)); // open a connection to the SCM - if (!(scm= OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE))) + if (!(scm= OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE))) return false; newService= CreateService(scm, serviceName, displayName, - SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, - SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, - szFilePath, NULL, NULL, NULL, username, - password); + SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, + SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, + szFilePath, NULL, NULL, NULL, username, + password); if (newService) { @@ -68,7 +68,7 @@ BOOL WindowsService::Init() BOOL WindowsService::Remove() { - bool ret_val= false; + bool ret_val= false; if (! IsInstalled()) return true; @@ -81,7 +81,7 @@ BOOL WindowsService::Remove() SC_HANDLE service= OpenService(scm, serviceName, DELETE); if (service) { - if (DeleteService(service)) + if (DeleteService(service)) ret_val= true; DWORD dw= ::GetLastError(); CloseServiceHandle(service); @@ -112,18 +112,18 @@ void WindowsService::SetAcceptedControls(DWORD acceptedControls) } -BOOL WindowsService::ReportStatus(DWORD currentState, DWORD waitHint, +BOOL WindowsService::ReportStatus(DWORD currentState, DWORD waitHint, DWORD dwError) { if(debugging) return TRUE; if(currentState == SERVICE_START_PENDING) - status.dwControlsAccepted= 0; + status.dwControlsAccepted= 0; else - status.dwControlsAccepted= dwAcceptedControls; + status.dwControlsAccepted= dwAcceptedControls; status.dwCurrentState= currentState; - status.dwWin32ExitCode= dwError != 0 ? + status.dwWin32ExitCode= dwError != 0 ? ERROR_SERVICE_SPECIFIC_ERROR : NO_ERROR; status.dwWaitHint= waitHint; status.dwServiceSpecificExitCode= dwError; @@ -155,35 +155,34 @@ void WindowsService::RegisterAndRun(DWORD argc, LPTSTR *argv) void WindowsService::HandleControlCode(DWORD opcode) { // Handle the requested control code. - switch(opcode) - { - case SERVICE_CONTROL_STOP: - // Stop the service. - status.dwCurrentState= SERVICE_STOP_PENDING; - Stop(); - break; + switch(opcode) { + case SERVICE_CONTROL_STOP: + // Stop the service. + status.dwCurrentState= SERVICE_STOP_PENDING; + Stop(); + break; - case SERVICE_CONTROL_PAUSE: - status.dwCurrentState= SERVICE_PAUSE_PENDING; - Pause(); - break; + case SERVICE_CONTROL_PAUSE: + status.dwCurrentState= SERVICE_PAUSE_PENDING; + Pause(); + break; - case SERVICE_CONTROL_CONTINUE: - status.dwCurrentState= SERVICE_CONTINUE_PENDING; - Continue(); - break; + case SERVICE_CONTROL_CONTINUE: + status.dwCurrentState= SERVICE_CONTINUE_PENDING; + Continue(); + break; - case SERVICE_CONTROL_SHUTDOWN: - Shutdown(); - break; + case SERVICE_CONTROL_SHUTDOWN: + Shutdown(); + break; - case SERVICE_CONTROL_INTERROGATE: - ReportStatus(status.dwCurrentState); - break; + case SERVICE_CONTROL_INTERROGATE: + ReportStatus(status.dwCurrentState); + break; - default: - // invalid control code - break; + default: + // invalid control code + break; } } @@ -201,5 +200,3 @@ void WINAPI WindowsService::ControlHandler(DWORD opcode) return gService->HandleControlCode(opcode); } - - diff --git a/server-tools/instance-manager/WindowsService.h b/server-tools/instance-manager/WindowsService.h index e4616278166..612eeda21e9 100755 --- a/server-tools/instance-manager/WindowsService.h +++ b/server-tools/instance-manager/WindowsService.h @@ -3,7 +3,7 @@ class WindowsService { protected: - bool inited; + bool inited; const char *serviceName; const char *displayName; const char *username; @@ -23,11 +23,11 @@ public: BOOL Init(); BOOL IsInstalled(); void SetAcceptedControls(DWORD acceptedControls); - void Debug(bool debugFlag) { debugging = debugFlag; } + void Debug(bool debugFlag) { debugging= debugFlag; } public: - static void WINAPI ServiceMain(DWORD argc, LPTSTR *argv); - static void WINAPI ControlHandler(DWORD CtrlType); + static void WINAPI ServiceMain(DWORD argc, LPTSTR *argv); + static void WINAPI ControlHandler(DWORD CtrlType); protected: virtual void Run()= 0; @@ -41,4 +41,3 @@ protected: void HandleControlCode(DWORD opcode); void RegisterAndRun(DWORD argc, LPTSTR *argv); }; - diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc index 3fb953410cd..0ebd5802af9 100644 --- a/server-tools/instance-manager/instance.cc +++ b/server-tools/instance-manager/instance.cc @@ -57,12 +57,12 @@ C_MODE_END void Instance::remove_pid() { - int pid; - if ((pid= options.get_pid()) != 0) /* check the pidfile */ - if (options.unlink_pidfile()) /* remove stalled pidfile */ - log_error("cannot remove pidfile for instance %i, this might be \ - since IM lacks permmissions or hasn't found the pidifle", - options.instance_name); + int pid; + if ((pid= options.get_pid()) != 0) /* check the pidfile */ + if (options.unlink_pidfile()) /* remove stalled pidfile */ + log_error("cannot remove pidfile for instance %i, this might be \ + since IM lacks permmissions or hasn't found the pidifle", + options.instance_name); } /* @@ -121,16 +121,15 @@ int Instance::launch_and_wait() { pid_t pid= fork(); - switch (pid) - { - case 0: - execv(options.mysqld_path, options.argv); - /* exec never returns */ - exit(1); - case -1: - log_info("cannot fork() to start instance %s", options.instance_name); - return -1; - default: + switch (pid) { + case 0: + execv(options.mysqld_path, options.argv); + /* exec never returns */ + exit(1); + case -1: + log_info("cannot fork() to start instance %s", options.instance_name); + return -1; + default: /* Here we wait for the child created. This process differs for systems running LinuxThreads and POSIX Threads compliant systems. This is because @@ -157,56 +156,56 @@ int Instance::launch_and_wait() #else int Instance::launch_and_wait() { - STARTUPINFO si; - PROCESS_INFORMATION pi; + STARTUPINFO si; + PROCESS_INFORMATION pi; - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - ZeroMemory(&pi, sizeof(pi)); + ZeroMemory(&si, sizeof(si)); + si.cb= sizeof(si); + ZeroMemory(&pi, sizeof(pi)); - int cmdlen= 0; + int cmdlen= 0; + for (int i= 1; options.argv[i] != 0; i++) + cmdlen+= strlen(options.argv[i]) + 1; + cmdlen++; // we have to add a single space for CreateProcess (read the docs) + + char *cmdline= NULL; + if (cmdlen > 0) + { + cmdline= new char[cmdlen]; + cmdline[0]= 0; for (int i= 1; options.argv[i] != 0; i++) - cmdlen+= strlen(options.argv[i]) + 1; - cmdlen++; // we have to add a single space for CreateProcess (read the docs) - - char *cmdline= NULL; - if (cmdlen > 0) { - cmdline= new char[cmdlen]; - cmdline[0]= 0; - for (int i= 1; options.argv[i] != 0; i++) - { - strcat(cmdline, " "); - strcat(cmdline, options.argv[i]); - } + strcat(cmdline, " "); + strcat(cmdline, options.argv[i]); } + } - // Start the child process. - BOOL result= CreateProcess(options.mysqld_path, // file to execute - cmdline, // Command line. - NULL, // Process handle not inheritable. - NULL, // Thread handle not inheritable. - FALSE, // Set handle inheritance to FALSE. - 0, // No creation flags. - NULL, // Use parent's environment block. - NULL, // Use parent's starting directory. - &si, // Pointer to STARTUPINFO structure. - &pi ); // Pointer to PROCESS_INFORMATION structure. - delete cmdline; - if (! result) - return -1; - - // Wait until child process exits. - WaitForSingleObject(pi.hProcess, INFINITE); + // Start the child process. + BOOL result= CreateProcess(options.mysqld_path, // file to execute + cmdline, // Command line. + NULL, // Process handle not inheritable. + NULL, // Thread handle not inheritable. + FALSE, // Set handle inheritance to FALSE. + 0, // No creation flags. + NULL, // Use parent's environment block. + NULL, // Use parent's starting directory. + &si, // Pointer to STARTUPINFO structure. + &pi ); // Pointer to PROCESS_INFORMATION structure. + delete cmdline; + if (! result) + return -1; - DWORD exitcode; - ::GetExitCodeProcess(pi.hProcess, &exitcode); + // Wait until child process exits. + WaitForSingleObject(pi.hProcess, INFINITE); - // Close process and thread handles. - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); + DWORD exitcode; + ::GetExitCodeProcess(pi.hProcess, &exitcode); - return exitcode; + // Close process and thread handles. + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + + return exitcode; } #endif @@ -214,9 +213,9 @@ int Instance::launch_and_wait() void Instance::fork_and_monitor() { log_info("starting instance %s", options.instance_name); - - int result= launch_and_wait(); - if (result == -1) return; + + if (launch_and_wait()) + return; /* error is logged */ /* set instance state to crashed */ pthread_mutex_lock(&LOCK_instance); @@ -233,9 +232,6 @@ void Instance::fork_and_monitor() pthread_cond_signal(&instance_map->guardian->COND_guardian); /* thread exits */ return; - - /* we should never end up here */ - DBUG_ASSERT(0); } @@ -268,9 +264,9 @@ bool Instance::is_running() MYSQL mysql; uint port= 0; const char *socket= NULL; - const char *password= "check_connection"; - const char *username= "MySQL_Instance_Manager"; - const char *access_denied_message= "Access denied for user"; + static const char *password= "check_connection"; + static const char *username= "MySQL_Instance_Manager"; + static const char *access_denied_message= "Access denied for user"; bool return_val; if (options.mysqld_port) @@ -299,15 +295,8 @@ bool Instance::is_running() return_val= TRUE; /* server is alive */ } else - { - if (!strncmp(access_denied_message, mysql_error(&mysql), - sizeof(access_denied_message)-1)) - { - return_val= TRUE; - } - else - return_val= FALSE; - } + return_val= test(!strncmp(access_denied_message, mysql_error(&mysql), + sizeof(access_denied_message) - 1)); mysql_close(&mysql); pthread_mutex_unlock(&LOCK_instance); @@ -370,53 +359,53 @@ err: BOOL SafeTerminateProcess(HANDLE hProcess, UINT uExitCode) { - DWORD dwTID, dwCode, dwErr = 0; + DWORD dwTID, dwCode, dwErr= 0; HANDLE hProcessDup= INVALID_HANDLE_VALUE; HANDLE hRT= NULL; HINSTANCE hKernel= GetModuleHandle("Kernel32"); BOOL bSuccess= FALSE; BOOL bDup= DuplicateHandle(GetCurrentProcess(), - hProcess, GetCurrentProcess(), &hProcessDup, + hProcess, GetCurrentProcess(), &hProcessDup, PROCESS_ALL_ACCESS, FALSE, 0); // Detect the special case where the process is // already dead... if (GetExitCodeProcess((bDup) ? hProcessDup : hProcess, &dwCode) && - (dwCode == STILL_ACTIVE)) + (dwCode == STILL_ACTIVE)) { - FARPROC pfnExitProc; + FARPROC pfnExitProc; - pfnExitProc= GetProcAddress(hKernel, "ExitProcess"); + pfnExitProc= GetProcAddress(hKernel, "ExitProcess"); - hRT= CreateRemoteThread((bDup) ? hProcessDup : hProcess, NULL, 0, - (LPTHREAD_START_ROUTINE)pfnExitProc, - (PVOID)uExitCode, 0, &dwTID); + hRT= CreateRemoteThread((bDup) ? hProcessDup : hProcess, NULL, 0, + (LPTHREAD_START_ROUTINE)pfnExitProc, + (PVOID)uExitCode, 0, &dwTID); - if (hRT == NULL) - dwErr= GetLastError(); + if (hRT == NULL) + dwErr= GetLastError(); } else - dwErr= ERROR_PROCESS_ABORTED; + dwErr= ERROR_PROCESS_ABORTED; if (hRT) { - // Must wait process to terminate to - // guarantee that it has exited... - WaitForSingleObject((bDup) ? hProcessDup : hProcess, INFINITE); + // Must wait process to terminate to + // guarantee that it has exited... + WaitForSingleObject((bDup) ? hProcessDup : hProcess, INFINITE); - CloseHandle(hRT); - bSuccess= TRUE; + CloseHandle(hRT); + bSuccess= TRUE; } if (bDup) - CloseHandle(hProcessDup); + CloseHandle(hProcessDup); if (!bSuccess) - SetLastError(dwErr); + SetLastError(dwErr); return bSuccess; -} +} int kill(pid_t pid, int signum) { diff --git a/server-tools/instance-manager/listener.cc b/server-tools/instance-manager/listener.cc index 8fcf23a7397..54b58536f0f 100644 --- a/server-tools/instance-manager/listener.cc +++ b/server-tools/instance-manager/listener.cc @@ -108,11 +108,11 @@ void Listener_thread::run() FD_ZERO(&read_fds); /* I. prepare 'listen' sockets */ - if (create_tcp_socket()) + if (create_tcp_socket()) goto err; #ifndef __WIN__ - if (create_unix_socket(unix_socket_address)) + if (create_unix_socket(unix_socket_address)) goto err; #endif @@ -133,12 +133,12 @@ void Listener_thread::run() int rc= select(n, &read_fds_arg, 0, 0, 0); - if (rc == -1 && errno != EINTR) - { - log_error("Listener_thread::run(): select() failed, %s", - strerror(errno)); - continue; - } + if (rc == -1 && errno != EINTR) + { + log_error("Listener_thread::run(): select() failed, %s", + strerror(errno)); + continue; + } for (int socket_index= 0; socket_index < num_sockets; socket_index++) @@ -150,8 +150,8 @@ void Listener_thread::run() /* accept may return -1 (failure or spurious wakeup) */ if (client_fd >= 0) // connection established { - Vio *vio = vio_new(client_fd, socket_index==0?VIO_TYPE_SOCKET: - VIO_TYPE_TCPIP, socket_index==0?1:0); + Vio *vio= vio_new(client_fd, socket_index==0?VIO_TYPE_SOCKET: + VIO_TYPE_TCPIP, socket_index==0?1:0); if (vio != 0) handle_new_mysql_connection(vio); else @@ -212,7 +212,7 @@ void set_no_inherit(int socket) int Listener_thread::create_tcp_socket() { /* value to be set by setsockopt */ - int arg= 1; + int arg= 1; int ip_socket= socket(AF_INET, SOCK_STREAM, 0); if (ip_socket == INVALID_SOCKET) @@ -236,11 +236,11 @@ int Listener_thread::create_tcp_socket() uint im_port= options.port_number; ip_socket_address.sin_family= AF_INET; - ip_socket_address.sin_addr.s_addr = im_bind_addr; + ip_socket_address.sin_addr.s_addr= im_bind_addr; ip_socket_address.sin_port= (unsigned short) - htons((unsigned short) im_port); + htons((unsigned short) im_port); setsockopt(ip_socket, SOL_SOCKET, SO_REUSEADDR, (char*) &arg, sizeof(arg)); if (bind(ip_socket, (struct sockaddr *) &ip_socket_address, @@ -273,8 +273,8 @@ int Listener_thread::create_tcp_socket() } #ifndef __WIN__ -int Listener_thread::create_unix_socket( - struct sockaddr_un &unix_socket_address) +int Listener_thread::create_unix_socket(struct sockaddr_un + &unix_socket_address) { int unix_socket= socket(AF_UNIX, SOCK_STREAM, 0); if (unix_socket == INVALID_SOCKET) @@ -297,20 +297,20 @@ int Listener_thread::create_unix_socket( */ mode_t old_mask= umask(0); if (bind(unix_socket, (struct sockaddr *) &unix_socket_address, - sizeof(unix_socket_address))) + sizeof(unix_socket_address))) { log_error("Listener_thread::run(): bind(unix socket) failed, " - "socket file name is '%s', error '%s'", - unix_socket_address.sun_path, strerror(errno)); + "socket file name is '%s', error '%s'", + unix_socket_address.sun_path, strerror(errno)); close(unix_socket); return -1; } - + umask(old_mask); - + if (listen(unix_socket, LISTEN_BACK_LOG_SIZE)) { - log_error("Listener_thread::run(): listen(unix socket) failed, %s", + log_error("Listener_thread::run(): listen(unix socket) failed, %s", strerror(errno)); close(unix_socket); return -1; @@ -322,8 +322,9 @@ int Listener_thread::create_unix_socket( /* make sure that instances won't be listening our sockets */ set_no_inherit(unix_socket); - log_info("accepting connections on unix socket %s", unix_socket_address.sun_path); - sockets[num_sockets++] = unix_socket; + log_info("accepting connections on unix socket %s", + unix_socket_address.sun_path); + sockets[num_sockets++]= unix_socket; FD_SET(unix_socket, &read_fds); return 0; } diff --git a/server-tools/instance-manager/manager.cc b/server-tools/instance-manager/manager.cc index e3daca71898..09d30e1312f 100644 --- a/server-tools/instance-manager/manager.cc +++ b/server-tools/instance-manager/manager.cc @@ -238,20 +238,20 @@ void manager(const Options &options) process_alarm(signo); else #endif + { + if (!guardian_thread.is_stopped()) { - if (!guardian_thread.is_stopped()) - { - bool stop_instances= true; - guardian_thread.request_shutdown(stop_instances); - pthread_cond_signal(&guardian_thread.COND_guardian); - } - else - { - thread_registry.deliver_shutdown(); - shutdown_complete= TRUE; - } + bool stop_instances= true; + guardian_thread.request_shutdown(stop_instances); + pthread_cond_signal(&guardian_thread.COND_guardian); + } + else + { + thread_registry.deliver_shutdown(); + shutdown_complete= TRUE; } } + } err: /* delete the pid file */ diff --git a/server-tools/instance-manager/options.cc b/server-tools/instance-manager/options.cc index 86e21ec8a11..5d8483d3b0b 100644 --- a/server-tools/instance-manager/options.cc +++ b/server-tools/instance-manager/options.cc @@ -111,22 +111,23 @@ static struct my_option my_long_options[] = 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "default-mysqld-path", OPT_MYSQLD_PATH, "Where to look for MySQL" - " Server binary.", - (gptr *) &Options::default_mysqld_path, (gptr *) &Options::default_mysqld_path, + " Server binary.", + (gptr *) &Options::default_mysqld_path, + (gptr *) &Options::default_mysqld_path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - { "monitoring-interval", OPT_MONITORING_INTERVAL, "Interval to monitor instances" - " in seconds.", - (gptr *) &Options::monitoring_interval, - (gptr *) &Options::monitoring_interval, - 0, GET_UINT, REQUIRED_ARG, DEFAULT_MONITORING_INTERVAL, - 0, 0, 0, 0, 0 }, + { "monitoring-interval", OPT_MONITORING_INTERVAL, "Interval to monitor" + " instances in seconds.", + (gptr *) &Options::monitoring_interval, + (gptr *) &Options::monitoring_interval, + 0, GET_UINT, REQUIRED_ARG, DEFAULT_MONITORING_INTERVAL, + 0, 0, 0, 0, 0 }, #ifdef __WIN__ - { "install", OPT_INSTALL_SERVICE, "Install as system service.", - (gptr *) &Options::install_as_service, (gptr*) &Options::install_as_service, + { "install", OPT_INSTALL_SERVICE, "Install as system service.", + (gptr *) &Options::install_as_service, (gptr*) &Options::install_as_service, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 }, - { "remove", OPT_REMOVE_SERVICE, "Remove system service.", - (gptr *)&Options::remove_service, (gptr*) &Options::remove_service, + { "remove", OPT_REMOVE_SERVICE, "Remove system service.", + (gptr *)&Options::remove_service, (gptr*) &Options::remove_service, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0}, #else { "run-as-service", OPT_RUN_AS_SERVICE, @@ -134,12 +135,12 @@ static struct my_option my_long_options[] = 0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 }, { "user", OPT_USER, "Username to start mysqlmanager", - (gptr *) &Options::user, - (gptr *) &Options::user, - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + (gptr *) &Options::user, + (gptr *) &Options::user, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, #endif { "version", 'V', "Output version information and exit.", 0, 0, 0, - GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, + GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 } }; @@ -242,7 +243,7 @@ C_MODE_END int Options::load(int argc, char **argv) { saved_argv= argv; - + if (argc >= 2) { if (is_prefix(argv[1], "--defaults-file=")) @@ -254,19 +255,19 @@ int Options::load(int argc, char **argv) { /* the log is not enabled yet */ fprintf(stderr, "The --defaults-extra-file and --no-defaults options" - " are not supported by\n" - "Instance Manager. Program aborted.\n"); + " are not supported by\n" + "Instance Manager. Program aborted.\n"); goto err; } } #ifdef __WIN__ setup_windows_defaults(*argv); - - /* - On Windows, there are two possibilities. Either we are given - a defaults file on the command line or we use the my.ini file - that is in our app dir + + /* + On Windows, there are two possibilities. Either we are given + a defaults file on the command line or we use the my.ini file + that is in our app dir */ if (Options::config_file == NULL) { @@ -274,7 +275,7 @@ int Options::load(int argc, char **argv) static const char default_win_config_file_name[]= "\\my.ini"; if (!GetModuleFileName(NULL, windows_config_file, - sizeof(windows_config_file))) + sizeof(windows_config_file))) goto err; filename= strrchr(windows_config_file, "\\"); @@ -316,7 +317,7 @@ char* change_extension(const char *src, const char *newext) { char *dot= (char*)strrchr(src, '.'); if (!dot) return (char*)src; - + int newlen= dot-src+strlen(newext)+1; char *temp= (char*)malloc(newlen); bzero(temp, newlen); @@ -327,9 +328,9 @@ char* change_extension(const char *src, const char *newext) void Options::setup_windows_defaults(const char *progname) { - Options::password_file_name= default_password_file_name = + Options::password_file_name= default_password_file_name= change_extension(progname, "passwd"); - Options::log_file_name= default_log_file_name = + Options::log_file_name= default_log_file_name= change_extension(progname, "log"); } diff --git a/server-tools/instance-manager/user_map.cc b/server-tools/instance-manager/user_map.cc index df86d6a6915..1498f2fa947 100644 --- a/server-tools/instance-manager/user_map.cc +++ b/server-tools/instance-manager/user_map.cc @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef __GNUC__ -#pragma interface +#pragma interface #endif #include "user_map.h" @@ -25,6 +25,12 @@ #include "log.h" +#ifdef __WIN__ +#define NEWLINE_LEN 2 +#else +#define NEWLINE_LEN 1 +#endif + struct User { char user[USERNAME_LENGTH + 1]; @@ -36,8 +42,7 @@ struct User int User::init(const char *line) { - const char *name_begin, *name_end; - char *password; + const char *name_begin, *name_end, *password; if (line[0] == '\'' || line[0] == '"') { @@ -45,7 +50,7 @@ int User::init(const char *line) name_end= strchr(name_begin, line[0]); if (name_end == 0 || name_end[1] != ':') goto err; - password= (char*)(name_end + 2); + password= name_end + 2; } else { @@ -53,19 +58,14 @@ int User::init(const char *line) name_end= strchr(name_begin, ':'); if (name_end == 0) goto err; - password= (char*)(name_end + 1); + password= name_end + 1; } user_length= name_end - name_begin; if (user_length > USERNAME_LENGTH) goto err; /* assume that newline characater is present */ - if (password[strlen(password)-2] == '\r') - { - password[strlen(password)-2]= '\n'; - password[strlen(password)-1]= 0; - } - if (strlen(password) != SCRAMBLED_PASSWORD_CHAR_LENGTH + 1) + if (strlen(password) != SCRAMBLED_PASSWORD_CHAR_LENGTH + NEWLINE_LEN) goto err; memcpy(user, name_begin, user_length); @@ -101,7 +101,7 @@ C_MODE_END int User_map::init() { - enum { START_HASH_SIZE = 16 }; + enum { START_HASH_SIZE= 16 }; if (hash_init(&hash, default_charset_info, START_HASH_SIZE, 0, 0, get_user_key, delete_user, 0)) return 1; From 69220b00bda64dcf196d4a25cdcb9a768201c201 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Aug 2005 17:09:02 +0400 Subject: [PATCH 141/144] chmod -x new IM files server-tools/instance-manager/WindowsService.cpp: Change mode to -rw-rw-r-- server-tools/instance-manager/WindowsService.h: Change mode to -rw-rw-r-- server-tools/instance-manager/port.h: Change mode to -rw-rw-r-- server-tools/instance-manager/mysqlmanager.vcproj: Change mode to -rw-rw-r-- server-tools/instance-manager/IMService.cpp: Change mode to -rw-rw-r-- server-tools/instance-manager/IMService.h: Change mode to -rw-rw-r-- --- server-tools/instance-manager/IMService.cpp | 0 server-tools/instance-manager/IMService.h | 0 server-tools/instance-manager/WindowsService.cpp | 0 server-tools/instance-manager/WindowsService.h | 0 server-tools/instance-manager/mysqlmanager.vcproj | 0 server-tools/instance-manager/port.h | 0 6 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 server-tools/instance-manager/IMService.cpp mode change 100755 => 100644 server-tools/instance-manager/IMService.h mode change 100755 => 100644 server-tools/instance-manager/WindowsService.cpp mode change 100755 => 100644 server-tools/instance-manager/WindowsService.h mode change 100755 => 100644 server-tools/instance-manager/mysqlmanager.vcproj mode change 100755 => 100644 server-tools/instance-manager/port.h diff --git a/server-tools/instance-manager/IMService.cpp b/server-tools/instance-manager/IMService.cpp old mode 100755 new mode 100644 diff --git a/server-tools/instance-manager/IMService.h b/server-tools/instance-manager/IMService.h old mode 100755 new mode 100644 diff --git a/server-tools/instance-manager/WindowsService.cpp b/server-tools/instance-manager/WindowsService.cpp old mode 100755 new mode 100644 diff --git a/server-tools/instance-manager/WindowsService.h b/server-tools/instance-manager/WindowsService.h old mode 100755 new mode 100644 diff --git a/server-tools/instance-manager/mysqlmanager.vcproj b/server-tools/instance-manager/mysqlmanager.vcproj old mode 100755 new mode 100644 diff --git a/server-tools/instance-manager/port.h b/server-tools/instance-manager/port.h old mode 100755 new mode 100644 From 719117b3611c4e5dc7edeaab039305b29cd8779b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Aug 2005 17:48:37 +0400 Subject: [PATCH 142/144] post-review fix server-tools/instance-manager/listener.cc: some more cleanup --- server-tools/instance-manager/listener.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server-tools/instance-manager/listener.cc b/server-tools/instance-manager/listener.cc index 54b58536f0f..0c928e76c8c 100644 --- a/server-tools/instance-manager/listener.cc +++ b/server-tools/instance-manager/listener.cc @@ -150,8 +150,9 @@ void Listener_thread::run() /* accept may return -1 (failure or spurious wakeup) */ if (client_fd >= 0) // connection established { - Vio *vio= vio_new(client_fd, socket_index==0?VIO_TYPE_SOCKET: - VIO_TYPE_TCPIP, socket_index==0?1:0); + Vio *vio= vio_new(client_fd, socket_index == 0 ? + VIO_TYPE_SOCKET : VIO_TYPE_TCPIP, + socket_index == 0 ? 1 : 0); if (vio != 0) handle_new_mysql_connection(vio); else @@ -273,8 +274,8 @@ int Listener_thread::create_tcp_socket() } #ifndef __WIN__ -int Listener_thread::create_unix_socket(struct sockaddr_un - &unix_socket_address) +int Listener_thread:: +create_unix_socket(struct sockaddr_un &unix_socket_address) { int unix_socket= socket(AF_UNIX, SOCK_STREAM, 0); if (unix_socket == INVALID_SOCKET) From be1640e2da85b14fe0317556ff1efb29873f0a2f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Aug 2005 20:19:51 +0500 Subject: [PATCH 143/144] Fix for bug #12281 (Geometry: crash in trigger) Field_geom lack size_of method sql/field.h: size_of implemented --- sql/field.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/field.h b/sql/field.h index 523cf444c30..2b67ed3f599 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1204,6 +1204,7 @@ public: int store(longlong nr); int store_decimal(const my_decimal *); void get_key_image(char *buff,uint length,imagetype type); + uint size_of() const { return sizeof(*this); } }; #endif /*HAVE_SPATIAL*/ From e13fa8ebbb095970b9a5a206001eeb06273567de Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Aug 2005 20:26:55 +0500 Subject: [PATCH 144/144] testcase added to fix for bug #12281 (Geometry & trigger crash) mysql-test/r/gis.result: test result fixed mysql-test/t/gis.test: testcase added --- mysql-test/r/gis.result | 5 +++++ mysql-test/t/gis.test | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 93216fe2003..dfe375fd694 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -665,3 +665,8 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field insert into t1 values (pointfromtext('point(1,1)')); ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1; +create table t1 (s1 geometry not null,s2 char(100)); +create trigger t1_bu before update on t1 for each row set new.s1 = null; +insert into t1 values (null,null); +ERROR 23000: Column 's1' cannot be null +drop table t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 661616c0a6c..202042d0257 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -373,3 +373,13 @@ insert into t1 values (pointfromtext('point(1,1)')); drop table t1; # End of 4.1 tests + +# +# Bug #12281 (Geometry: crash in trigger) +# + +create table t1 (s1 geometry not null,s2 char(100)); +create trigger t1_bu before update on t1 for each row set new.s1 = null; +--error 1048 +insert into t1 values (null,null); +drop table t1;