diff --git a/BUILD/compile-darwin-mwcc b/BUILD/compile-darwin-mwcc new file mode 100755 index 00000000000..6fd0eab7e26 --- /dev/null +++ b/BUILD/compile-darwin-mwcc @@ -0,0 +1,54 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +c_warnings="" +cxx_warnings="" +fast_cflags="-O3" +base_cxxflags="-fno-handle-exceptions" + +# FIXME do we need to link static, not to depend on CodeWarrior libs? + +if [ x$MODE = x ] ; then + echo "You need to give an argument, 'standard', 'max', 'debug' or 'debug-max'" + echo "Like: MODE=standard BUILD/compile-darwin-codewarrior" + exit 1 +else + case $MODE in + standard|pro-gpl) + # FIXME pro/pro-gpl different libedit/readline + extra_flags="$ppc_cflags $fast_cflags" + ;; + pro) + # FIXME pro/pro-gpl different libedit/readline + extra_flags="$ppc_cflags $fast_cflags" + extra_configs="--with-libedit" + ;; + max) + extra_flags="$ppc_cflags $fast_cflags" + extra_configs="$max_configs" + ;; + debug) + extra_flags="$ppc_cflags $debug_cflags" + c_warnings="$c_warnings $debug_extra_warnings" + cxx_warnings="$cxx_warnings $debug_extra_warnings" + extra_configs="$debug_configs" + ;; + debug-max) + extra_flags="$ppc_cflags $debug_cflags $max_cflags" + c_warnings="$c_warnings $debug_extra_warnings" + cxx_warnings="$cxx_warnings $debug_extra_warnings" + extra_configs="$debug_configs $max_configs" + ;; + *) + echo "You need to give an argument, 'standard', 'max', 'debug' or 'debug-max'" + echo "Like: MODE=standard BUILD/compile-darwin-codewarrior" + exit 1 + ;; + esac +fi + +extra_configs="$extra_configs --with-darwin-mwcc" + +. "$path/FINISH.sh" diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 75ccef73ee3..d73f511031d 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -82,6 +82,7 @@ hf@bisonxp.(none) hf@deer.(none) hf@deer.mysql.r18.ru hf@genie.(none) +holyfoot@mysql.com igor@hundin.mysql.fi igor@linux.local igor@rurik.mysql.com @@ -96,6 +97,7 @@ jani@dsl-jkl1657.dial.inet.fi jani@dsl-kpogw4gb5.dial.inet.fi jani@hynda.(none) jani@hynda.mysql.fi +jani@ibmlab.site jani@janikt.pp.saunalahti.fi jani@linux.local jani@rhols221.adsl.netsonic.fi @@ -186,6 +188,7 @@ mysqldev@build.mysql2.com mysqldev@melody.local mysqldev@mysql.com mysqldev@o2k.irixworld.net +ndbdev@dl145b.mysql.com ndbdev@eel.hemma.oreland.se ndbdev@ndbmaster.mysql.com ndbdev@shark. @@ -219,6 +222,7 @@ ram@deer.(none) ram@gw.mysql.r18.ru ram@gw.udmsearch.izhnet.ru ram@mysql.r18.ru +ram@ram-book.(none) ram@ram.(none) ramil@mysql.com ranger@regul.home.lan @@ -242,6 +246,7 @@ serg@serg.mysql.com serg@sergbook.mylan serg@sergbook.mysql.com sergefp@mysql.com +shuichi@mysql.com sinisa@rhols221.adsl.netsonic.fi stewart@mysql.com svoj@mysql.com diff --git a/cmd-line-utils/libedit/config.h b/cmd-line-utils/libedit/config.h index b6f002d5b9e..642123d1ddc 100644 --- a/cmd-line-utils/libedit/config.h +++ b/cmd-line-utils/libedit/config.h @@ -2,8 +2,10 @@ #include "my_config.h" #include "sys.h" +#if defined(LIBC_SCCS) && !defined(lint) #define __RCSID(x) #define __COPYRIGHT(x) +#endif #define __RENAME(x) #define _DIAGASSERT(x) diff --git a/cmd-line-utils/readline/terminal.c b/cmd-line-utils/readline/terminal.c index a506fa6de09..b2bcf5f146c 100644 --- a/cmd-line-utils/readline/terminal.c +++ b/cmd-line-utils/readline/terminal.c @@ -346,7 +346,7 @@ get_term_capabilities (bp) register unsigned int i; for (i = 0; i < NUM_TC_STRINGS; i++) -# ifdef __LCC__ +# if defined(__LCC__) || defined(__MWERKS__) *(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp); # else *(tc_strings[i].tc_value) = tgetstr (tc_strings[i].tc_var, bp); diff --git a/config/ac-macros/misc.m4 b/config/ac-macros/misc.m4 index d75dedafa2a..8c961ef84e0 100644 --- a/config/ac-macros/misc.m4 +++ b/config/ac-macros/misc.m4 @@ -693,3 +693,20 @@ dnl --------------------------------------------------------------------------- dnl END OF MYSQL_CHECK_BIG_TABLES SECTION dnl --------------------------------------------------------------------------- +dnl MYSQL_NEEDS_MYSYS_NEW +AC_DEFUN([MYSQL_NEEDS_MYSYS_NEW], +[AC_CACHE_CHECK([needs mysys_new helpers], mysql_use_mysys_new, +[ +AC_LANG_PUSH(C++) +AC_TRY_LINK([], [ +class A { public: int b; }; A *a=new A; a->b=10; delete a; +], mysql_use_mysys_new=no, mysql_use_mysys_new=yes) +AC_LANG_POP(C++) +]) +if test "$mysql_use_mysys_new" = "yes" +then + AC_DEFINE([USE_MYSYS_NEW], [1], [Needs to use mysys_new helpers]) +fi +]) + + diff --git a/configure.in b/configure.in index 202b58939c6..3d96471727b 100644 --- a/configure.in +++ b/configure.in @@ -123,8 +123,25 @@ AM_SANITY_CHECK # This is needed is SUBDIRS is set AC_PROG_MAKE_SET -# This is need before AC_PROG_CC -# +############################################################################## +# The below section needs to be done before AC_PROG_CC +############################################################################## + +# Hack for OS X/Darwin and Metrowerks CodeWarrior +AC_ARG_WITH(darwin-mwcc, +[ --with-darwin-mwcc Use Metrowerks CodeWarrior wrappers on OS X/Darwin],[ + builddir=`pwd` + ccwrapper="$builddir/support-files/MacOSX/mwcc-wrapper" + arwrapper="$builddir/support-files/MacOSX/mwar-wrapper" + CC="$ccwrapper" + CXX="$ccwrapper" + LD="$ccwrapper" + AR="$arwrapper" + RANLIB=: + export CC CXX LD AR RANLIB + AC_SUBST(AR) + AC_SUBST(RANLIB) +]) if test "x${CFLAGS-}" = x ; then cflags_is_set=no @@ -144,6 +161,8 @@ else ldflags_is_set=yes fi +################ End of section to be done before AC_PROG_CC ################# + # The following hack should ensure that configure doesn't add optimizing # or debugging flags to CFLAGS or CXXFLAGS # C_EXTRA_FLAGS are flags that are automaticly added to both @@ -336,32 +355,6 @@ AC_SUBST(LD) AC_SUBST(INSTALL_SCRIPT) export CC CXX CFLAGS LD LDFLAGS AR -if test "$GXX" = "yes" -then - # mysqld requires -fno-implicit-templates. - # Disable exceptions as they seams to create problems with gcc and threads. - # mysqld doesn't use run-time-type-checking, so we disable it. - CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti" - - CXX_VERNO=`echo $CXX_VERSION | sed -e 's/[[^0-9. ]]//g; s/^ *//g; s/ .*//g'` - case "$CXX_VERNO" in - 3.*) - USE_MYSYS_NEW="-DUSE_MYSYS_NEW" # yassl needs it - if echo $CXX | grep gcc > /dev/null 2>&1 - then - # If you are using 'gcc' 3.0 (not g++) to compile C++ programs on Linux, - # we will gets some problems when linking static programs. - # The following code is used to fix this problem. - CXXFLAGS="$CXXFLAGS $USE_MYSYS_NEW" - AC_MSG_WARN([Using MYSYS_NEW for static linking with gcc]) - fi - ;; - *) - USE_MYSYS_NEW="" - ;; - esac - AC_SUBST(USE_MYSYS_NEW) -fi # Avoid bug in fcntl on some versions of linux AC_MSG_CHECKING("if we should use 'skip-locking' as default for $target_os") @@ -1730,6 +1723,7 @@ AC_TYPE_OFF_T AC_STRUCT_ST_RDEV AC_HEADER_TIME AC_STRUCT_TM +MYSQL_NEEDS_MYSYS_NEW # AC_CHECK_SIZEOF return 0 when it does not find the size of a # type. We want a error instead. AC_CHECK_SIZEOF(char, 1) diff --git a/extra/yassl/src/Makefile.am b/extra/yassl/src/Makefile.am index 9dd8a09b00b..3dbd7bac03a 100644 --- a/extra/yassl/src/Makefile.am +++ b/extra/yassl/src/Makefile.am @@ -5,4 +5,3 @@ libyassl_a_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \ handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \ timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp EXTRA_DIST = ../include/*.hpp ../include/openssl/*.h -AM_CXXFLAGS=@USE_MYSYS_NEW@ diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp index ba2fbd8cc07..c1485cce986 100644 --- a/extra/yassl/src/yassl_imp.cpp +++ b/extra/yassl/src/yassl_imp.cpp @@ -2092,6 +2092,7 @@ void InitClientKeyFactory(ClientKeyFactory& ckf) } // namespace #ifdef __GNUC__ +namespace mySTL { template class mySTL::list; template yaSSL::del_ptr_zero mySTL::for_each(mySTL::list::iterator, mySTL::list::iterator, yaSSL::del_ptr_zero); template mySTL::pair* mySTL::uninit_copy*, mySTL::pair*>(mySTL::pair*, mySTL::pair*, mySTL::pair*); @@ -2112,5 +2113,6 @@ template yaSSL::del_ptr_zero mySTL::for_each::i template yaSSL::del_ptr_zero mySTL::for_each::iterator, yaSSL::del_ptr_zero>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::del_ptr_zero); template yaSSL::del_ptr_zero mySTL::for_each::iterator, yaSSL::del_ptr_zero>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::del_ptr_zero); template yaSSL::del_ptr_zero mySTL::for_each::iterator, yaSSL::del_ptr_zero>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::del_ptr_zero); +} #endif diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp index 5f918b0a356..4cc2b85fccc 100644 --- a/extra/yassl/src/yassl_int.cpp +++ b/extra/yassl/src/yassl_int.cpp @@ -1951,7 +1951,7 @@ char* X509_NAME::GetName() X509::X509(const char* i, size_t iSz, const char* s, size_t sSz) : issuer_(i, iSz), subject_(s, sSz) {} - + X509_NAME* X509::GetIssuer() { @@ -1967,7 +1967,9 @@ X509_NAME* X509::GetSubject() } // namespace #ifdef __GNUC__ +namespace mySTL { template yaSSL::yassl_int_cpp_local1::SumData mySTL::for_each::iterator, yaSSL::yassl_int_cpp_local1::SumData>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::yassl_int_cpp_local1::SumData); template yaSSL::yassl_int_cpp_local1::SumBuffer mySTL::for_each::iterator, yaSSL::yassl_int_cpp_local1::SumBuffer>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::yassl_int_cpp_local1::SumBuffer); template mySTL::list::iterator mySTL::find_if::iterator, yaSSL::yassl_int_cpp_local2::sess_match>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::yassl_int_cpp_local2::sess_match); +} #endif diff --git a/extra/yassl/taocrypt/include/runtime.hpp b/extra/yassl/taocrypt/include/runtime.hpp index 5b9e13df644..e2c04af44f4 100644 --- a/extra/yassl/taocrypt/include/runtime.hpp +++ b/extra/yassl/taocrypt/include/runtime.hpp @@ -25,10 +25,11 @@ -#if !defined(yaSSL_NEW_HPP) && defined(USE_MYSYS_NEW) +#if !defined(yaSSL_NEW_HPP) && defined(__GNUC__) #define yaSSL_NEW_HPP +#if __GNUC__ > 2 #include @@ -66,4 +67,6 @@ static int __cxa_pure_virtual() } // extern "C" -#endif // yaSSL_NEW_HPP +#endif // __GNUC__ > 2 +#endif // yaSSL_NEW_HPP && __GNUC__ + diff --git a/extra/yassl/taocrypt/src/Makefile.am b/extra/yassl/taocrypt/src/Makefile.am index 4bf901b76ea..b00e6081c23 100644 --- a/extra/yassl/taocrypt/src/Makefile.am +++ b/extra/yassl/taocrypt/src/Makefile.am @@ -5,4 +5,3 @@ libtaocrypt_a_SOURCES = aes.cpp aestables.cpp algebra.cpp arc4.cpp asn.cpp \ coding.cpp dh.cpp des.cpp dsa.cpp file.cpp hash.cpp integer.cpp \ md2.cpp md5.cpp misc.cpp random.cpp ripemd.cpp rsa.cpp sha.cpp EXTRA_DIST = ../include/*.hpp -AM_CXXFLAGS=@USE_MYSYS_NEW@ diff --git a/extra/yassl/taocrypt/src/integer.cpp b/extra/yassl/taocrypt/src/integer.cpp index 20a968d78e3..c95170722ae 100644 --- a/extra/yassl/taocrypt/src/integer.cpp +++ b/extra/yassl/taocrypt/src/integer.cpp @@ -4168,16 +4168,13 @@ Integer CRT(const Integer &xp, const Integer &p, const Integer &xq, return p * (u * (xq-xp) % q) + xp; } - +#ifdef __GNUC__ +template Integer StringToInteger(char const*); +template Integer StringToInteger(wchar_t const*); +template class EuclideanDomainOf; +template class AbstractEuclideanDomain; +template unsigned int DivideThreeWordsByTwo(unsigned int*, unsigned int, unsigned int, DWord*); +#endif } // namespace -#ifdef __GNUC__ -template TaoCrypt::Integer TaoCrypt::StringToInteger(char const*); -template TaoCrypt::Integer TaoCrypt::StringToInteger(wchar_t const*); -template class TaoCrypt::EuclideanDomainOf; -template class TaoCrypt::AbstractEuclideanDomain; -template unsigned int TaoCrypt::DivideThreeWordsByTwo(unsigned int*, unsigned int, unsigned int, TaoCrypt::DWord*); -#endif - - diff --git a/extra/yassl/taocrypt/src/rsa.cpp b/extra/yassl/taocrypt/src/rsa.cpp index da8cd697a7c..ecb2288f1c2 100644 --- a/extra/yassl/taocrypt/src/rsa.cpp +++ b/extra/yassl/taocrypt/src/rsa.cpp @@ -211,24 +211,28 @@ word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain) lengths.PaddedBlockBitLength(), plain); } +#ifdef __GNUC__ +template AllocatorWithCleanup::pointer StdReallocate >(AllocatorWithCleanup&, unsigned char*, AllocatorWithCleanup::size_type, AllocatorWithCleanup::size_type, bool); +template AllocatorWithCleanup::pointer StdReallocate >(AllocatorWithCleanup&, unsigned int*, AllocatorWithCleanup::size_type, AllocatorWithCleanup::size_type, bool); +template class AbstractGroup; +template class AbstractRing; +template class RSA_Decryptor; +template class RSA_Encryptor; +template class RSA_Encryptor; +#endif } // namespace #ifdef __GNUC__ -template TaoCrypt::AllocatorWithCleanup::pointer TaoCrypt::StdReallocate >(TaoCrypt::AllocatorWithCleanup&, unsigned char*, TaoCrypt::AllocatorWithCleanup::size_type, TaoCrypt::AllocatorWithCleanup::size_type, bool); -template TaoCrypt::AllocatorWithCleanup::pointer TaoCrypt::StdReallocate >(TaoCrypt::AllocatorWithCleanup&, unsigned int*, TaoCrypt::AllocatorWithCleanup::size_type, TaoCrypt::AllocatorWithCleanup::size_type, bool); -template TaoCrypt::Integer* mySTL::uninit_copy(TaoCrypt::Integer*, TaoCrypt::Integer*, TaoCrypt::Integer*); -template TaoCrypt::Integer* mySTL::uninit_fill_n(TaoCrypt::Integer*, unsigned int, TaoCrypt::Integer const&); -template TaoCrypt::WindowSlider* mySTL::uninit_copy(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*); -template class TaoCrypt::AbstractGroup; -template class TaoCrypt::AbstractRing; -template class TaoCrypt::RSA_Decryptor; -template class TaoCrypt::RSA_Encryptor; -template class TaoCrypt::RSA_Encryptor; -template mySTL::vector* mySTL::uninit_fill_n*, unsigned int, mySTL::vector >(mySTL::vector*, unsigned int, mySTL::vector const&); -template void mySTL::destroy(TaoCrypt::Integer*, TaoCrypt::Integer*); -template void mySTL::destroy(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*); -template void mySTL::destroy*>(mySTL::vector*, mySTL::vector*); +namespace mySTL { +template TaoCrypt::Integer* uninit_copy(TaoCrypt::Integer*, TaoCrypt::Integer*, TaoCrypt::Integer*); +template TaoCrypt::Integer* uninit_fill_n(TaoCrypt::Integer*, unsigned int, TaoCrypt::Integer const&); +template TaoCrypt::WindowSlider* uninit_copy(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*); +template vector* uninit_fill_n*, unsigned int, vector >(vector*, unsigned int, vector const&); +template void destroy(TaoCrypt::Integer*, TaoCrypt::Integer*); +template void destroy(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*); +template void destroy*>(vector*, vector*); +} #endif diff --git a/include/decimal.h b/include/decimal.h index 7b49841ca88..2648e04c1cf 100644 --- a/include/decimal.h +++ b/include/decimal.h @@ -39,7 +39,7 @@ int decimal2longlong(decimal_t *from, longlong *to); int longlong2decimal(longlong from, decimal_t *to); int decimal2double(decimal_t *from, double *to); int double2decimal(double from, decimal_t *to); -void decimal_optimize_fraction(decimal_t *from); +int decimal_actual_fraction(decimal_t *from); int decimal2bin(decimal_t *from, char *to, int precision, int scale); int bin2decimal(char *from, decimal_t *to, int precision, int scale); diff --git a/include/m_ctype.h b/include/m_ctype.h index 61524dc4ddd..6f304f4ba43 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -132,6 +132,7 @@ typedef struct my_collation_handler_st /* Hash calculation */ void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len, ulong *nr1, ulong *nr2); + my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, uint len); } MY_COLLATION_HANDLER; extern MY_COLLATION_HANDLER my_collation_mb_bin_handler; @@ -385,6 +386,10 @@ int my_wildcmp_unicode(CHARSET_INFO *cs, extern my_bool my_parse_charset_xml(const char *bug, uint len, int (*add)(CHARSET_INFO *cs)); +my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, uint len); +my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len); + + #define _MY_U 01 /* Upper case */ #define _MY_L 02 /* Lower case */ #define _MY_NMR 04 /* Numeral (digit) */ diff --git a/include/my_handler.h b/include/my_handler.h index cad15d5471f..c076ba0c2c9 100644 --- a/include/my_handler.h +++ b/include/my_handler.h @@ -72,10 +72,11 @@ typedef struct st_HA_KEYSEG /* Key-portion */ #define set_rec_bits(bits, bit_ptr, bit_ofs, bit_len) \ { \ - (bit_ptr)[0]= ((bit_ptr)[0] & ((1 << (bit_ofs)) - 1)) | \ + (bit_ptr)[0]= ((bit_ptr)[0] & ~(((1 << (bit_len)) - 1) << (bit_ofs))) | \ ((bits) << (bit_ofs)); \ if ((bit_ofs) + (bit_len) > 8) \ - (bit_ptr)[1]= ((bits) & ((1 << (bit_len)) - 1)) >> (8 - (bit_ofs)); \ + (bit_ptr)[1]= ((bit_ptr)[1] & ~((1 << ((bit_len) - 8 + (bit_ofs))) - 1)) | \ + ((bits) >> (8 - (bit_ofs))); \ } #define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \ diff --git a/include/my_sys.h b/include/my_sys.h index 8f595bfdbf0..f235b5a072e 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -179,6 +179,10 @@ extern void my_large_free(gptr ptr, myf my_flags); #if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43) #pragma alloca #endif /* _AIX */ +#if defined(__MWERKS__) +#undef alloca +#define alloca __alloca +#endif /* __MWERKS__ */ #if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca) #define alloca __builtin_alloca #endif /* GNUC */ diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 5fc8def844b..b6d92aa913a 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -1187,6 +1187,7 @@ start_master() --language=$LANGUAGE \ --innodb_data_file_path=ibdata1:128M:autoextend \ --open-files-limit=1024 \ + --log-bin-trust-routine-creators \ $MASTER_40_ARGS \ $SMALL_SERVER \ $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \ @@ -1207,6 +1208,7 @@ start_master() --tmpdir=$MYSQL_TMP_DIR \ --language=$LANGUAGE \ --innodb_data_file_path=ibdata1:128M:autoextend \ + --log-bin-trust-routine-creators \ $MASTER_40_ARGS \ $SMALL_SERVER \ $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \ @@ -1339,6 +1341,7 @@ start_slave() --report-port=$slave_port \ --master-retry-count=10 \ -O slave_net_timeout=10 \ + --log-bin-trust-routine-creators \ $SMALL_SERVER \ $EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT" CUR_MYERR=$slave_err diff --git a/mysql-test/r/blackhole.result b/mysql-test/r/blackhole.result index 66752b11655..38e548490fe 100644 --- a/mysql-test/r/blackhole.result +++ b/mysql-test/r/blackhole.result @@ -105,8 +105,8 @@ a select * from t3; a show binlog events; -Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 # Start 1 # Server ver: VERSION, Binlog ver: 3 +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query 1 # use `test`; drop table t1,t2 master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=blackhole master-bin.000001 # Query 1 # use `test`; delete from t1 where a=10 @@ -115,8 +115,8 @@ master-bin.000001 # Query 1 # use `test`; insert into t1 values(1) master-bin.000001 # Query 1 # use `test`; insert ignore into t1 values(1) master-bin.000001 # Query 1 # use `test`; replace into t1 values(100) master-bin.000001 # Query 1 # use `test`; create table t2 (a varchar(200)) engine=blackhole -master-bin.000001 # Create_file 1 # db=test;table=t2;file_id=1;block_len=581 -master-bin.000001 # Exec_load 1 # ;file_id=1 +master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581 +master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../../std_data/words.dat' into table t2 ;file_id=1 master-bin.000001 # Query 1 # use `test`; alter table t1 add b int master-bin.000001 # Query 1 # use `test`; alter table t1 drop b master-bin.000001 # Query 1 # use `test`; create table t3 like t1 diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 1ca913e1259..5fb21004469 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -105,9 +105,9 @@ t1 CREATE TABLE `t1` ( `c4` varbinary(1) NOT NULL default '', `c5` varbinary(4) NOT NULL default '', `c6` varbinary(4) NOT NULL default '', - `c7` decimal(5,1) NOT NULL default '0.0', - `c8` decimal(5,1) NOT NULL default '0.0', - `c9` decimal(5,1) default NULL, + `c7` decimal(2,1) NOT NULL default '0.0', + `c8` decimal(2,1) NOT NULL default '0.0', + `c9` decimal(2,1) default NULL, `c10` double NOT NULL default '0', `c11` double NOT NULL default '0', `c12` varbinary(5) NOT NULL default '' @@ -152,9 +152,9 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `COALESCE(1)` int(1) NOT NULL default '0', - `COALESCE(1.0)` decimal(5,1) NOT NULL default '0.0', + `COALESCE(1.0)` decimal(2,1) NOT NULL default '0.0', `COALESCE('a')` varchar(1) NOT NULL default '', - `COALESCE(1,1.0)` decimal(5,1) NOT NULL default '0.0', + `COALESCE(1,1.0)` decimal(2,1) NOT NULL default '0.0', `COALESCE(1,'1')` varbinary(1) NOT NULL default '', `COALESCE(1.1,'1')` varbinary(4) NOT NULL default '', `COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) character set latin1 collate latin1_bin NOT NULL default '' diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 4f4400b4a9b..82c0f4c1ce5 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -115,9 +115,9 @@ Field Type Null Key Default Extra a datetime NO 0000-00-00 00:00:00 b time NO 00:00:00 c date NO 0000-00-00 -d int(2) NO 0 -e decimal(6,1) NO 0.0 -f bigint(18) NO 0 +d int(3) NO 0 +e decimal(3,1) NO 0.0 +f bigint(19) NO 0 drop table t2; create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt; describe t2; @@ -453,7 +453,7 @@ t2 CREATE TABLE `t2` ( `ifnull(e,e)` bigint(20) default NULL, `ifnull(f,f)` float(3,2) default NULL, `ifnull(g,g)` double(4,3) default NULL, - `ifnull(h,h)` decimal(6,4) default NULL, + `ifnull(h,h)` decimal(5,4) default NULL, `ifnull(i,i)` year(4) default NULL, `ifnull(j,j)` date default NULL, `ifnull(k,k)` datetime NOT NULL default '0000-00-00 00:00:00', diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result index 43947edbd48..f60dc175cd6 100644 --- a/mysql-test/r/ctype_latin1_de.result +++ b/mysql-test/r/ctype_latin1_de.result @@ -338,3 +338,9 @@ ss ss ß DROP TABLE t1; +create table t1 (s1 char(5) character set latin1 collate latin1_german2_ci); +insert into t1 values (0xf6) /* this is o-umlaut */; +select * from t1 where length(s1)=1 and s1='oe'; +s1 +ö +drop table t1; diff --git a/mysql-test/r/ctype_latin2.result b/mysql-test/r/ctype_latin2.result new file mode 100644 index 00000000000..2876accaf72 Binary files /dev/null and b/mysql-test/r/ctype_latin2.result differ diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 177994b488d..955ea5b8673 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -462,5 +462,5 @@ rout int(11) default '0' INSERT INTO t1 VALUES ('1',1,0); SELECT DISTINCT html,SUM(rout)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin; html prod -1 0.00000 +1 0.0000 drop table t1; diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 1cf1a19056b..0db2ceb0e6b 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1,4 +1,9 @@ drop table if exists t1,t2; +set @sav_dpi= @@div_precision_increment; +set div_precision_increment= 5; +show variables like 'div_precision_increment'; +Variable_name Value +div_precision_increment 5 create table t1 (grp int, a bigint unsigned, c char(10) not null); insert into t1 values (1,1,"a"); insert into t1 values (2,2,"b"); @@ -44,13 +49,13 @@ count(distinct a) count(distinct grp) 6 3 select sum(all a),count(all a),avg(all a),std(all a),variance(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1; sum(all a) count(all a) avg(all a) std(all a) variance(all a) bit_or(all a) bit_and(all a) min(all a) max(all a) min(all c) max(all c) -21 6 3.5000 1.7078 2.9167 7 0 1 6 E +21 6 3.50000 1.70783 2.91667 7 0 1 6 E select grp, sum(a),count(a),avg(a),std(a),variance(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp; grp sum(a) count(a) avg(a) std(a) variance(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c) NULL NULL 0 NULL NULL NULL 0 18446744073709551615 NULL NULL -1 1 1 1.0000 0.0000 0.0000 1 1 1 1 a a -2 5 2 2.5000 0.5000 0.2500 3 2 2 3 b c -3 15 3 5.0000 0.8165 0.6667 7 4 4 6 C E +1 1 1 1.00000 0.00000 0.00000 1 1 1 1 a a +2 5 2 2.50000 0.50000 0.25000 3 2 2 3 b c +3 15 3 5.00000 0.81650 0.66667 7 4 4 6 C E select grp, sum(a)+count(a)+avg(a)+std(a)+variance(a)+bit_or(a)+bit_and(a)+min(a)+max(a)+min(c)+max(c) as sum from t1 group by grp; grp sum NULL NULL @@ -74,12 +79,12 @@ CREATE TABLE t2 (id int(11),name char(20)); INSERT INTO t2 VALUES (1,'Set One'),(2,'Set Two'); select id, avg(value1), std(value1), variance(value1) from t1 group by id; id avg(value1) std(value1) variance(value1) -1 1.000000 0.816497 0.666667 -2 11.000000 0.816497 0.666667 +1 1.0000000 0.816497 0.666667 +2 11.0000000 0.816497 0.666667 select name, avg(value1), std(value1), variance(value1) from t1, t2 where t1.id = t2.id group by t1.id; name avg(value1) std(value1) variance(value1) -Set One 1.000000 0.816497 0.666667 -Set Two 11.000000 0.816497 0.666667 +Set One 1.0000000 0.816497 0.666667 +Set Two 11.0000000 0.816497 0.666667 drop table t1,t2; create table t1 (id int not null); create table t2 (id int not null,rating int null); @@ -87,19 +92,19 @@ insert into t1 values(1),(2),(3); insert into t2 values(1, 3),(2, NULL),(2, NULL),(3, 2),(3, NULL); select t1.id, avg(rating) from t1 left join t2 on ( t1.id = t2.id ) group by t1.id; id avg(rating) -1 3.0000 +1 3.00000 2 NULL -3 2.0000 +3 2.00000 select sql_small_result t2.id, avg(rating) from t2 group by t2.id; id avg(rating) -1 3.0000 +1 3.00000 2 NULL -3 2.0000 +3 2.00000 select sql_big_result t2.id, avg(rating) from t2 group by t2.id; id avg(rating) -1 3.0000 +1 3.00000 2 NULL -3 2.0000 +3 2.00000 select sql_small_result t2.id, avg(rating+0.0e0) from t2 group by t2.id; id avg(rating+0.0e0) 1 3 @@ -265,22 +270,22 @@ insert into t1 values (2,1); select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) 1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 -2 1 1 1.0000 0.0000 1 1 1 1 +2 1 1 1.00000 0.00000 1 1 1 1 select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) 1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 -2 1 1 1.0000 0.0000 1 1 1 1 +2 1 1 1.00000 0.00000 1 1 1 1 insert into t1 values (3,1); select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) 1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 -2 1 1 1.0000 0.0000 1 1 1 1 -3 1 1 1.0000 0.0000 1 1 1 1 +2 1 1 1.00000 0.00000 1 1 1 1 +3 1 1 1.00000 0.00000 1 1 1 1 select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b), bit_xor(b) from t1 group by a; a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) bit_xor(b) 1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 0 -2 1 1 1.0000 0.0000 1 1 1 1 1 -3 1 1 1.0000 0.0000 1 1 1 1 1 +2 1 1 1.00000 0.00000 1 1 1 1 1 +3 1 1 1.00000 0.00000 1 1 1 1 1 explain extended select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b), bit_xor(b) from t1 group by a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort @@ -837,10 +842,10 @@ INSERT INTO t1 VALUES (-5.00000000001),(-5.00000000002),(-5.00000000003),(-5.000 insert into t1 select * from t1; select col1,count(col1),sum(col1),avg(col1) from t1 group by col1; col1 count(col1) sum(col1) avg(col1) --5.000000000030 2 -10.000000000060 -5.0000000000300000 --5.000000000020 4 -20.000000000080 -5.0000000000200000 --5.000000000010 4 -20.000000000040 -5.0000000000100000 --5.000000000000 2 -10.000000000000 -5.0000000000000000 +-5.000000000030 2 -10.000000000060 -5.00000000003000000 +-5.000000000020 4 -20.000000000080 -5.00000000002000000 +-5.000000000010 4 -20.000000000040 -5.00000000001000000 +-5.000000000000 2 -10.000000000000 -5.00000000000000000 DROP TABLE t1; create table t1 (col1 decimal(16,12)); insert into t1 values (-5.00000000001); @@ -947,3 +952,4 @@ SUM(a) 6 6 DROP TABLE t1; +set div_precision_increment= @sav_dpi; diff --git a/mysql-test/r/func_op.result b/mysql-test/r/func_op.result index 5f89fe7b727..61b29e9380d 100644 --- a/mysql-test/r/func_op.result +++ b/mysql-test/r/func_op.result @@ -1,6 +1,6 @@ select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2; 1+1 1-1 1+1*2 8/5 8%5 mod(8,5) mod(8,5)|0 -(1+1)*-2 -2 0 3 1.60000 3 3 3 4 +2 0 3 1.6000 3 3 3 4 explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 5cee9b15dcd..88b43c7ce35 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -440,12 +440,12 @@ create table t2 (user_id integer not null, date date); insert into t2 values (1, '2002-06-09'),(2, '2002-06-09'),(1, '2002-06-09'),(3, '2002-06-09'),(4, '2002-06-09'),(4, '2002-06-09'); select u.gender as gender, count(distinct u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender; gender dist_count percentage -F 3 60.00000 -M 1 20.00000 +F 3 60.0000 +M 1 20.0000 select u.gender as gender, count(distinct u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender order by percentage; gender dist_count percentage -M 1 20.00000 -F 3 60.00000 +M 1 20.0000 +F 3 60.0000 drop table t1,t2; CREATE TABLE t1 (ID1 int, ID2 int, ID int NOT NULL AUTO_INCREMENT,PRIMARY KEY(ID )); diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index b5d5785f0f1..dcd32bf477b 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -2,7 +2,7 @@ drop table if exists t1,t2; select 1, 1.0, -1, "hello", NULL; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def 1 8 1 1 N 32897 0 63 -def 1.0 246 4 3 N 161 1 63 +def 1.0 246 4 3 N 129 1 63 def -1 8 2 2 N 32897 0 63 def hello 253 5 5 N 1 31 8 def NULL 6 0 0 Y 32896 0 63 @@ -18,7 +18,7 @@ def test t1 t1 d d 3 11 0 Y 32768 0 63 def test t1 t1 e e 8 20 0 Y 32768 0 63 def test t1 t1 f f 4 3 0 Y 32768 2 63 def test t1 t1 g g 5 4 0 Y 32768 3 63 -def test t1 t1 h h 246 5 0 Y 0 4 63 +def test t1 t1 h h 246 7 0 Y 0 4 63 def test t1 t1 i i 13 4 0 Y 32864 0 63 def test t1 t1 j j 10 10 0 Y 128 0 63 def test t1 t1 k k 7 19 0 N 1249 0 63 diff --git a/mysql-test/r/ndb_restore.result b/mysql-test/r/ndb_restore.result index 8e4449b1996..c78a4137468 100644 --- a/mysql-test/r/ndb_restore.result +++ b/mysql-test/r/ndb_restore.result @@ -247,3 +247,4 @@ count(*) 3 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +520093696,1 diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index 06f474923eb..1d8830b7d5f 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -1,4 +1,9 @@ drop table if exists t1,t2; +set @sav_dpi= @@div_precision_increment; +set div_precision_increment= 5; +show variables like 'div_precision_increment'; +Variable_name Value +div_precision_increment 5 create table t1 (product varchar(32), country_id int not null, year int, profit int); insert into t1 values ( 'Computer', 2,2000, 1200), ( 'TV', 1, 1999, 150), @@ -40,11 +45,11 @@ TV 600 NULL 7785 select product, sum(profit),avg(profit) from t1 group by product with rollup; product sum(profit) avg(profit) -Calculator 275 68.7500 -Computer 6900 1380.0000 -Phone 10 10.0000 -TV 600 120.0000 -NULL 7785 519.0000 +Calculator 275 68.75000 +Computer 6900 1380.00000 +Phone 10 10.00000 +TV 600 120.00000 +NULL 7785 519.00000 select product, country_id , year, sum(profit) from t1 group by product, country_id, year; product country_id year sum(profit) Calculator 1 1999 50 @@ -244,11 +249,11 @@ select product, country_id , year, sum(profit) from t1 group by product, country product country_id year sum(profit) select concat(':',product,':'), sum(profit),avg(profit) from t1 group by product with rollup; concat(':',product,':') sum(profit) avg(profit) -:Calculator: 275 68.7500 -:Computer: 6900 1380.0000 -:Phone: 10 10.0000 -:TV: 600 120.0000 -:TV: 7785 519.0000 +:Calculator: 275 68.75000 +:Computer: 6900 1380.00000 +:Phone: 10 10.00000 +:TV: 600 120.00000 +:TV: 7785 519.00000 select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube; ERROR 42000: This version of MySQL doesn't yet support 'CUBE' explain select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube; @@ -450,3 +455,4 @@ a m 2 2 NULL 3 DROP TABLE t1; +set div_precision_increment= @sav_dpi; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index bbd95da2f82..c84c62442ef 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -570,3 +570,66 @@ id deallocate prepare stmt| drop procedure p1| drop table t1| +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +create table t1 (c1 int(11) not null, c2 int(11) not null, +primary key (c1,c2), key c2 (c2), key c1 (c1)); +insert into t1 values (200887, 860); +insert into t1 values (200887, 200887); +select * from t1 where (c1=200887 and c2=200887) or c2=860; +c1 c2 +200887 860 +200887 200887 +prepare stmt from +"select * from t1 where (c1=200887 and c2=200887) or c2=860"; +execute stmt; +c1 c2 +200887 860 +200887 200887 +prepare stmt from +"select * from t1 where (c1=200887 and c2=?) or c2=?"; +set @a=200887, @b=860; +execute stmt using @a, @b; +c1 c2 +200887 860 +200887 200887 +deallocate prepare stmt; +drop table t1; +create table t1 ( +id bigint(20) not null auto_increment, +code varchar(20) character set utf8 collate utf8_bin not null default '', +company_name varchar(250) character set utf8 collate utf8_bin default null, +setup_mode tinyint(4) default null, +start_date datetime default null, +primary key (id), unique key code (code) +); +create table t2 ( +id bigint(20) not null auto_increment, +email varchar(250) character set utf8 collate utf8_bin default null, +name varchar(250) character set utf8 collate utf8_bin default null, +t1_id bigint(20) default null, +password varchar(250) character set utf8 collate utf8_bin default null, +primary_contact tinyint(4) not null default '0', +email_opt_in tinyint(4) not null default '1', +primary key (id), unique key email (email), key t1_id (t1_id), +constraint t2_fk1 foreign key (t1_id) references t1 (id) +); +insert into t1 values +(1, 'demo', 'demo s', 0, current_date()), +(2, 'code2', 'name 2', 0, current_date()), +(3, 'code3', 'name 3', 0, current_date()); +insert into t2 values +(2, 'email1', 'name1', 3, 'password1', 0, 0), +(3, 'email2', 'name1', 1, 'password2', 1, 0), +(5, 'email3', 'name3', 2, 'password3', 0, 0); +prepare stmt from 'select t2.id from t2, t1 where (t1.id=? and t2.t1_id=t1.id)'; +set @a=1; +execute stmt using @a; +id +3 +select t2.id from t2, t1 where (t1.id=1 and t2.t1_id=t1.id); +id +3 +deallocate prepare stmt; +drop table t1, t2; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 37c3682cacd..d6c3d0e78d5 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 246 7 6 Y 0 4 63 -def test t9 t9 c12 c12 246 8 6 Y 0 4 63 +def test t9 t9 c11 c11 246 9 6 Y 0 4 63 +def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -1776,8 +1776,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(3,1) NOT NULL default '0.0', - `param02` decimal(64,30) default NULL, + `const02` decimal(2,1) NOT NULL default '0.0', + `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -1798,7 +1798,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` decimal(64,30) default NULL, + `param13` decimal(65,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -1806,10 +1806,10 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 3 3 N 1 1 63 -def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 def test t5 t5 const05 const05 253 3 3 N 129 0 63 @@ -1828,7 +1828,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 64 0 Y 0 30 63 +def test t5 t5 param13 param13 246 67 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 @@ -1916,25 +1916,25 @@ from t9 where c1= 1 ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -1963,25 +1963,25 @@ from t9 where c1= 0 ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2013,25 +2013,25 @@ execute stmt1 using @my_key ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2053,25 +2053,25 @@ execute stmt1 using @my_key ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2101,25 +2101,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 1 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2145,25 +2145,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 0 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2191,25 +2191,25 @@ set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2229,25 +2229,25 @@ set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index d56fcb96726..1bbc1091393 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 246 7 6 Y 0 4 63 -def test t9 t9 c12 c12 246 8 6 Y 0 4 63 +def test t9 t9 c11 c11 246 9 6 Y 0 4 63 +def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -1759,8 +1759,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(3,1) NOT NULL default '0.0', - `param02` decimal(64,30) default NULL, + `const02` decimal(2,1) NOT NULL default '0.0', + `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -1781,7 +1781,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` decimal(64,30) default NULL, + `param13` decimal(65,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -1789,10 +1789,10 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 3 3 N 1 1 63 -def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 def test t5 t5 const05 const05 253 3 3 N 129 0 63 @@ -1811,7 +1811,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 64 0 Y 0 30 63 +def test t5 t5 param13 param13 246 67 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 @@ -1899,25 +1899,25 @@ from t9 where c1= 1 ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -1946,25 +1946,25 @@ from t9 where c1= 0 ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -1996,25 +1996,25 @@ execute stmt1 using @my_key ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2036,25 +2036,25 @@ execute stmt1 using @my_key ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2084,25 +2084,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 1 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2128,25 +2128,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 0 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2174,25 +2174,25 @@ set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2212,25 +2212,25 @@ set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 899299fa36c..009b642d7e7 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -60,8 +60,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 246 7 6 Y 0 4 63 -def test t9 t9 c12 c12 246 8 6 Y 0 4 63 +def test t9 t9 c11 c11 246 9 6 Y 0 4 63 +def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -1760,8 +1760,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(3,1) NOT NULL default '0.0', - `param02` decimal(64,30) default NULL, + `const02` decimal(2,1) NOT NULL default '0.0', + `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -1782,7 +1782,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` decimal(64,30) default NULL, + `param13` decimal(65,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -1790,10 +1790,10 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 3 3 N 1 1 63 -def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 def test t5 t5 const05 const05 253 3 3 N 129 0 63 @@ -1812,7 +1812,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 64 0 Y 0 30 63 +def test t5 t5 param13 param13 246 67 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 @@ -1900,25 +1900,25 @@ from t9 where c1= 1 ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -1947,25 +1947,25 @@ from t9 where c1= 0 ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -1997,25 +1997,25 @@ execute stmt1 using @my_key ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2037,25 +2037,25 @@ execute stmt1 using @my_key ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2085,25 +2085,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 1 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2129,25 +2129,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 0 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2175,25 +2175,25 @@ set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2213,25 +2213,25 @@ set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 4a53fe47f3f..5bd18078213 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -102,8 +102,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 246 7 6 Y 0 4 63 -def test t9 t9 c12 c12 246 8 6 Y 0 4 63 +def test t9 t9 c11 c11 246 9 6 Y 0 4 63 +def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -1696,8 +1696,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(3,1) NOT NULL default '0.0', - `param02` decimal(64,30) default NULL, + `const02` decimal(2,1) NOT NULL default '0.0', + `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -1718,7 +1718,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` decimal(64,30) default NULL, + `param13` decimal(65,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -1726,10 +1726,10 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 3 3 N 1 1 63 -def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 def test t5 t5 const05 const05 253 3 3 N 129 0 63 @@ -1748,7 +1748,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 64 0 Y 0 30 63 +def test t5 t5 param13 param13 246 67 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 @@ -1836,25 +1836,25 @@ from t9 where c1= 1 ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -1883,25 +1883,25 @@ from t9 where c1= 0 ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -1933,25 +1933,25 @@ execute stmt1 using @my_key ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -1973,25 +1973,25 @@ execute stmt1 using @my_key ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2021,25 +2021,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 1 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2065,25 +2065,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 0 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2111,25 +2111,25 @@ set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2149,25 +2149,25 @@ set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -3115,8 +3115,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 246 7 6 Y 0 4 63 -def test t9 t9 c12 c12 246 8 6 Y 0 4 63 +def test t9 t9 c11 c11 246 9 6 Y 0 4 63 +def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -4709,8 +4709,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(3,1) NOT NULL default '0.0', - `param02` decimal(64,30) default NULL, + `const02` decimal(2,1) NOT NULL default '0.0', + `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -4731,7 +4731,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` decimal(64,30) default NULL, + `param13` decimal(65,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -4739,10 +4739,10 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 3 3 N 1 1 63 -def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 def test t5 t5 const05 const05 253 3 3 N 129 0 63 @@ -4761,7 +4761,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 64 0 Y 0 30 63 +def test t5 t5 param13 param13 246 67 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 @@ -4849,25 +4849,25 @@ from t9 where c1= 1 ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -4896,25 +4896,25 @@ from t9 where c1= 0 ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -4946,25 +4946,25 @@ execute stmt1 using @my_key ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -4986,25 +4986,25 @@ execute stmt1 using @my_key ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -5034,25 +5034,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 1 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -5078,25 +5078,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 0 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -5124,25 +5124,25 @@ set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -5162,25 +5162,25 @@ set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 8ea5b092b5e..753def70dc0 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 246 7 6 Y 0 4 63 -def test t9 t9 c12 c12 246 8 6 Y 0 4 63 +def test t9 t9 c11 c11 246 9 6 Y 0 4 63 +def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -1759,8 +1759,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(3,1) NOT NULL default '0.0', - `param02` decimal(64,30) default NULL, + `const02` decimal(2,1) NOT NULL default '0.0', + `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -1781,7 +1781,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` decimal(64,30) default NULL, + `param13` decimal(65,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -1789,10 +1789,10 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 3 3 N 1 1 63 -def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 def test t5 t5 const05 const05 253 3 3 N 129 0 63 @@ -1811,7 +1811,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 64 0 Y 0 30 63 +def test t5 t5 param13 param13 246 67 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 @@ -1899,25 +1899,25 @@ from t9 where c1= 1 ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -1946,25 +1946,25 @@ from t9 where c1= 0 ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -1996,25 +1996,25 @@ execute stmt1 using @my_key ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2036,25 +2036,25 @@ execute stmt1 using @my_key ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2084,25 +2084,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 1 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2128,25 +2128,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 0 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2174,25 +2174,25 @@ set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2212,25 +2212,25 @@ set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index ec8c47031c1..a6da6e169db 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 246 7 6 Y 0 4 63 -def test t9 t9 c12 c12 246 8 6 Y 0 4 63 +def test t9 t9 c11 c11 246 9 6 Y 0 4 63 +def test t9 t9 c12 c12 246 10 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -1759,8 +1759,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` decimal(3,1) NOT NULL default '0.0', - `param02` decimal(64,30) default NULL, + `const02` decimal(2,1) NOT NULL default '0.0', + `param02` decimal(65,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -1781,7 +1781,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` decimal(64,30) default NULL, + `param13` decimal(65,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -1789,10 +1789,10 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 246 3 3 N 1 1 63 -def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const02 const02 246 4 3 N 1 1 63 +def test t5 t5 param02 param02 246 67 32 Y 0 30 63 def test t5 t5 const03 const03 5 17 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 def test t5 t5 const05 const05 253 3 3 N 129 0 63 @@ -1811,7 +1811,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 246 64 0 Y 0 30 63 +def test t5 t5 param13 param13 246 67 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 @@ -1899,25 +1899,25 @@ from t9 where c1= 1 ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -1946,25 +1946,25 @@ from t9 where c1= 0 ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -1996,25 +1996,25 @@ execute stmt1 using @my_key ; 1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2036,25 +2036,25 @@ execute stmt1 using @my_key ; 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2084,25 +2084,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 1 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2128,25 +2128,25 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, from t9 where c1= 0 ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 @@ -2174,25 +2174,25 @@ set @my_key= 1 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 1 Y 128 31 63 -def @arg03 253 20 1 Y 128 31 63 -def @arg04 253 20 1 Y 128 31 63 -def @arg05 253 20 1 Y 128 31 63 -def @arg06 253 20 1 Y 128 31 63 -def @arg07 253 20 1 Y 128 31 63 -def @arg08 253 20 1 Y 128 31 63 -def @arg09 253 20 1 Y 128 31 63 -def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 64 6 Y 128 30 63 -def @arg12 253 64 6 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 1 Y 128 0 63 +def @arg03 253 20 1 Y 128 0 63 +def @arg04 253 20 1 Y 128 0 63 +def @arg05 253 20 1 Y 128 0 63 +def @arg06 253 20 1 Y 128 0 63 +def @arg07 253 23 1 Y 128 31 63 +def @arg08 253 23 1 Y 128 31 63 +def @arg09 253 23 1 Y 128 31 63 +def @arg10 253 23 1 Y 128 31 63 +def @arg11 253 67 6 Y 128 30 63 +def @arg12 253 67 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 8 Y 128 31 63 -def @arg17 253 20 4 Y 128 31 63 -def @arg18 253 20 1 Y 128 31 63 -def @arg19 253 20 1 Y 128 31 63 +def @arg17 253 20 4 Y 128 0 63 +def @arg18 253 20 1 Y 128 0 63 +def @arg19 253 20 1 Y 128 0 63 def @arg20 253 8192 1 Y 0 31 8 def @arg21 253 8192 10 Y 0 31 8 def @arg22 253 8192 30 Y 0 31 8 @@ -2212,25 +2212,25 @@ set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 253 20 1 Y 128 31 63 -def @arg02 253 20 0 Y 128 31 63 -def @arg03 253 20 0 Y 128 31 63 -def @arg04 253 20 0 Y 128 31 63 -def @arg05 253 20 0 Y 128 31 63 -def @arg06 253 20 0 Y 128 31 63 -def @arg07 253 20 0 Y 128 31 63 -def @arg08 253 20 0 Y 128 31 63 -def @arg09 253 20 0 Y 128 31 63 -def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 64 0 Y 128 30 63 -def @arg12 253 64 0 Y 128 30 63 +def @arg01 253 20 1 Y 128 0 63 +def @arg02 253 20 0 Y 128 0 63 +def @arg03 253 20 0 Y 128 0 63 +def @arg04 253 20 0 Y 128 0 63 +def @arg05 253 20 0 Y 128 0 63 +def @arg06 253 20 0 Y 128 0 63 +def @arg07 253 23 0 Y 128 31 63 +def @arg08 253 23 0 Y 128 31 63 +def @arg09 253 23 0 Y 128 31 63 +def @arg10 253 23 0 Y 128 31 63 +def @arg11 253 67 0 Y 128 30 63 +def @arg12 253 67 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 def @arg16 253 8192 0 Y 128 31 63 -def @arg17 253 20 0 Y 128 31 63 -def @arg18 253 20 0 Y 128 31 63 -def @arg19 253 20 0 Y 128 31 63 +def @arg17 253 20 0 Y 128 0 63 +def @arg18 253 20 0 Y 128 0 63 +def @arg19 253 20 0 Y 128 0 63 def @arg20 253 8192 0 Y 0 31 8 def @arg21 253 8192 0 Y 0 31 8 def @arg22 253 8192 0 Y 0 31 8 diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result new file mode 100644 index 00000000000..6e5fccfe4e2 --- /dev/null +++ b/mysql-test/r/rpl_sp.result @@ -0,0 +1,235 @@ +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; +create database if not exists mysqltest1; +use mysqltest1; +create table t1 (a varchar(100)); +use mysqltest1; +drop procedure if exists foo; +drop procedure if exists foo2; +drop procedure if exists foo3; +drop procedure if exists foo4; +drop procedure if exists bar; +drop function if exists fn1; +create procedure foo() +begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end| +ERROR HY000: This routine is declared to be non-deterministic and to modify data and binary logging is enabled (you *might* want to use the less safe log_bin_trust_routine_creators variable) +show binlog events from 98| +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # create database if not exists mysqltest1 +master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a varchar(100)) +create procedure foo() deterministic +begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end| +select * from mysql.proc where name='foo' and db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL YES DEFINER begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end root@localhost # # +select * from mysql.proc where name='foo' and db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL YES DEFINER begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end @ # # +set timestamp=1000000000; +call foo(); +show binlog events from 308; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo() deterministic +begin +declare b int; +set b = 8; +insert into t1 values (b); +insert into t1 values (unix_timestamp()); +end +master-bin.000001 # Query 1 # use `mysqltest1`; call foo() +select * from t1; +a +8 +1000000000 +select * from t1; +a +8 +1000000000 +delete from t1; +create procedure foo2() +not deterministic +reads sql data +select * from mysqltest1.t1; +call foo2(); +a +show binlog events from 605; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1 +master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo2() +not deterministic +reads sql data +select * from mysqltest1.t1 +alter procedure foo2 contains sql; +ERROR HY000: This routine is declared to be non-deterministic and to modify data and binary logging is enabled (you *might* want to use the less safe log_bin_trust_routine_creators variable) +drop table t1; +create table t1 (a int); +create table t2 like t1; +create procedure foo3() +deterministic +insert into t1 values (15); +grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1; +grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1; +grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1; +create procedure foo4() +deterministic +insert into t1 values (10); +ERROR HY000: You do not have SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_routine_creators variable) +set global log_bin_trust_routine_creators=1; +create procedure foo4() +deterministic +begin +insert into t2 values(3); +insert into t1 values (5); +end| +call foo4(); +Got one of the listed errors +show warnings; +Level Code Message +Warning 1417 A routine failed and is declared to modify data and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes +call foo3(); +show warnings; +Level Code Message +call foo4(); +Got one of the listed errors +show warnings; +Level Code Message +Warning 1417 A routine failed and is declared to modify data and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes +alter procedure foo4 sql security invoker; +call foo4(); +show warnings; +Level Code Message +show binlog events from 841; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1 +master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int) +master-bin.000001 # Query 1 # use `mysqltest1`; create table t2 like t1 +master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo3() +deterministic +insert into t1 values (15) +master-bin.000001 # Query 1 # use `mysqltest1`; grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Query 1 # use `mysqltest1`; grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Query 1 # use `mysqltest1`; grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1 +master-bin.000001 # Query 1 # use `mysqltest1`; create procedure foo4() +deterministic +begin +insert into t2 values(3); +insert into t1 values (5); +end +master-bin.000001 # Query 1 # use `mysqltest1`; call foo3() +master-bin.000001 # Query 1 # use `mysqltest1`; alter procedure foo4 sql security invoker +master-bin.000001 # Query 1 # use `mysqltest1`; call foo4() +select * from t1; +a +15 +5 +select * from t2; +a +3 +3 +3 +select * from t1; +a +15 +5 +select * from t2; +a +3 +select if(compte<>3,"this is broken but documented","this unexpectedly works?") from (select count(*) as compte from t2) as aggreg; +if(compte<>3,"this is broken but documented","this unexpectedly works?") +this is broken but documented +select * from mysql.proc where name="foo4" and db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES INVOKER begin +insert into t2 values(3); +insert into t1 values (5); +end @ # # +drop procedure foo4; +select * from mysql.proc where name="foo4" and db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +select * from mysql.proc where name="foo4" and db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +drop procedure foo; +drop procedure foo2; +drop procedure foo3; +create function fn1(x int) +returns int +deterministic +begin +insert into t1 values (x); +return x+2; +end| +delete t1,t2 from t1,t2; +select fn1(20); +fn1(20) +22 +insert into t2 values(fn1(21)); +select * from t1; +a +21 +20 +select * from t2; +a +23 +select * from t1; +a +21 +select if(compte<>1,"this is broken but documented","this unexpectedly works?") from (select count(*) as compte from t1 where a=20) as aggreg; +if(compte<>1,"this is broken but documented","this unexpectedly works?") +this is broken but documented +select * from t2; +a +23 +drop function fn1; +create function fn1() +returns int +deterministic +begin +return unix_timestamp(); +end| +delete from t1; +set timestamp=1000000000; +insert into t1 values(fn1()); +select * from mysql.proc where db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +mysqltest1 fn1 FUNCTION fn1 SQL CONTAINS_SQL YES DEFINER int(11) begin +return unix_timestamp(); +end root@localhost # # +select * from t1; +a +1000000000 +use mysqltest1; +select * from t1; +a +1000000000 +select * from mysql.proc where db='mysqltest1'; +db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment +mysqltest1 fn1 FUNCTION fn1 SQL CONTAINS_SQL YES DEFINER int(11) begin +return unix_timestamp(); +end @ # # +drop function fn1; +drop database mysqltest1; +drop user "zedjzlcsjhd"@127.0.0.1; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 7f131c63421..ff45eff68da 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -1672,7 +1672,7 @@ fld1 count(*) 158402 4181 select sum(Period)/count(*) from t1; sum(Period)/count(*) -9410.00000 +9410.0000 select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; companynr count sum diff func 37 12543 309394878010 0.0000 464091 @@ -1684,7 +1684,7 @@ companynr count sum diff func 512 4181 3288532102 0.0000 2140672 select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; companynr avg -154 983543950.00 +154 983543950.0000 select companynr,count(*) from t2 group by companynr order by 2 desc; companynr count(*) 37 588 diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index a5cdee4b1bf..815683172f6 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -2913,10 +2913,10 @@ select @sptmp| 10 call bug9674_2()| v/10 -10.00000 +10.0000 call bug9674_2()| v/10 -10.00000 +10.0000 drop procedure bug9674_1| drop procedure bug9674_2| drop procedure if exists bug9598_1| @@ -3057,4 +3057,12 @@ yes yes drop procedure bug7293| delete from t1| +drop procedure if exists bug9841| +drop view if exists v1| +create view v1 as select * from t1, t2 where id = s| +create procedure bug9841 () +update v1 set data = 10| +call bug9841()| +drop view v1| +drop procedure bug9841| drop table t1,t2; diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result index b0cd4150c9d..64c9a11b3cd 100644 --- a/mysql-test/r/type_bit.result +++ b/mysql-test/r/type_bit.result @@ -437,3 +437,24 @@ a+0 b+0 2303 2 12345 4 drop table t1, t2; +create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1), +g bit(1) NOT NULL default 1, h char(1) default 'a'); +insert into t1 set a=1; +select hex(g), h from t1; +hex(g) h +1 a +drop table t1; +create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1), +g bit(1) NOT NULL default 1); +insert into t1 set a=1; +select hex(g) from t1; +hex(g) +1 +drop table t1; +create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1), +h char(1) default 'a') engine=myisam; +insert into t1 set a=1; +select h from t1; +h +a +drop table t1; diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 920c82c3e67..98f7829ca1c 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -88,7 +88,7 @@ date numfacture expedition 0000-00-00 00:00:00 1212 0001-00-00 00:00:00 EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref expedition expedition 8 const 1 Using where +1 SIMPLE t1 ref expedition expedition 8 const 1 drop table t1; create table t1 (a datetime not null, b datetime not null); insert into t1 values (now(), now()); diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index a7b6fa1b376..ab57caacc0f 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -731,7 +731,7 @@ t1 CREATE TABLE `t1` ( `d` decimal(10,0) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; -create table t1 (d decimal(65,0)); +create table t1 (d decimal(66,0)); ERROR 42000: Incorrect column specifier for column 'd' CREATE TABLE t1 (i INT, d1 DECIMAL(9,2), d2 DECIMAL(9,2)); INSERT INTO t1 VALUES (1, 101.40, 21.40), (1, -80.00, 0.00), diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 330caf68293..6702676fa35 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -52,13 +52,13 @@ if(1, 1.1, 1.2) if(0, 1.1, 1.2) if(0.1, 1.1, 1.2) if(0, 1, 1.1) if(0, NULL, 1.2) show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `if(1, 1.1, 1.2)` decimal(5,1) NOT NULL default '0.0', - `if(0, 1.1, 1.2)` decimal(5,1) NOT NULL default '0.0', - `if(0.1, 1.1, 1.2)` decimal(5,1) NOT NULL default '0.0', - `if(0, 1, 1.1)` decimal(5,1) NOT NULL default '0.0', - `if(0, NULL, 1.2)` decimal(5,1) default NULL, + `if(1, 1.1, 1.2)` decimal(2,1) NOT NULL default '0.0', + `if(0, 1.1, 1.2)` decimal(2,1) NOT NULL default '0.0', + `if(0.1, 1.1, 1.2)` decimal(2,1) NOT NULL default '0.0', + `if(0, 1, 1.1)` decimal(2,1) NOT NULL default '0.0', + `if(0, NULL, 1.2)` decimal(2,1) default NULL, `if(1, 0.22e1, 1.1)` double NOT NULL default '0', - `if(1E0, 1.1, 1.2)` decimal(5,1) NOT NULL default '0.0' + `if(1E0, 1.1, 1.2)` decimal(2,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 select nullif(1.1, 1.1), nullif(1.1, 1.2), nullif(1.1, 0.11e1), nullif(1.0, 1), nullif(1, 1.0), nullif(1, 1.1); @@ -68,12 +68,12 @@ NULL 1.1 NULL NULL NULL 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `nullif(1.1, 1.1)` decimal(5,1) default NULL, - `nullif(1.1, 1.2)` decimal(5,1) default NULL, - `nullif(1.1, 0.11e1)` double(4,1) default NULL, - `nullif(1.0, 1)` decimal(5,1) default NULL, - `nullif(1, 1.0)` decimal(1,0) default NULL, - `nullif(1, 1.1)` decimal(1,0) default NULL + `nullif(1.1, 1.1)` decimal(2,1) default NULL, + `nullif(1.1, 1.2)` decimal(2,1) default NULL, + `nullif(1.1, 0.11e1)` decimal(2,1) default NULL, + `nullif(1.0, 1)` decimal(2,1) default NULL, + `nullif(1, 1.0)` int(1) default NULL, + `nullif(1, 1.1)` int(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a decimal(4,2)); @@ -174,10 +174,10 @@ create table t1 select round(15.4,-1), truncate(-5678.123451,-3), abs(-1.1), -(- show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `round(15.4,-1)` decimal(5,0) NOT NULL default '0', - `truncate(-5678.123451,-3)` decimal(13,0) NOT NULL default '0', - `abs(-1.1)` decimal(6,1) NOT NULL default '0.0', - `-(-1.1)` decimal(7,1) NOT NULL default '0.0' + `round(15.4,-1)` decimal(3,0) NOT NULL default '0', + `truncate(-5678.123451,-3)` decimal(4,0) NOT NULL default '0', + `abs(-1.1)` decimal(3,1) NOT NULL default '0.0', + `-(-1.1)` decimal(2,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; set session sql_mode='traditional'; @@ -375,7 +375,7 @@ col1 drop table wl1612; select 1/3; 1/3 -0.33333 +0.3333 select 0.8=0.7+0.1; 0.8=0.7+0.1 1 @@ -398,7 +398,7 @@ select 0.07*0.07 from wl1612_1; 0.0049 select 0.07/0.07 from wl1612_1; 0.07/0.07 -1.000000000 +1.000000 drop table wl1612_1; create table wl1612_2 (col1 decimal(10,2), col2 numeric(10,2)); insert into wl1612_2 values(1,1); @@ -626,16 +626,16 @@ create table wl1612_4 (col1 int, col2 decimal(30,25), col3 numeric(30,25)); insert into wl1612_4 values(1,0.0123456789012345678912345,0.0123456789012345678912345); select col2/9999999999 from wl1612_4 where col1=1; col2/9999999999 -0.0000000000012345678902469135781481410000000000000000000 +0.00000000000123456789024691358 select col3/9999999999 from wl1612_4 where col1=1; col3/9999999999 -0.0000000000012345678902469135781481410000000000000000000 +0.00000000000123456789024691358 select 9999999999/col2 from wl1612_4 where col1=1; 9999999999/col2 -810000007209.00007 +810000007209.0001 select 9999999999/col3 from wl1612_4 where col1=1; 9999999999/col3 -810000007209.00007 +810000007209.0001 select col2*9999999999 from wl1612_4 where col1=1; col2*9999999999 123456789.0000000000111104321087655 @@ -645,16 +645,16 @@ col3*9999999999 insert into wl1612_4 values(2,55555.0123456789012345678912345,55555.0123456789012345678912345); select col2/9999999999 from wl1612_4 where col1=2; col2/9999999999 -0.0000055555012351234402469691331481460000000000000000000 +0.00000555550123512344024696913 select col3/9999999999 from wl1612_4 where col1=2; col3/9999999999 -0.0000055555012351234402469691331481460000000000000000000 +0.00000555550123512344024696913 select 9999999999/col2 from wl1612_4 where col1=2; 9999999999/col2 -180001.76000 +180001.7600 select 9999999999/col3 from wl1612_4 where col1=2; 9999999999/col3 -180001.76000 +180001.7600 select col2*9999999999 from wl1612_4 where col1=2; col2*9999999999 555550123401234.0000000000111104321087655 @@ -712,7 +712,7 @@ select .7777777777777777777777777777777777777 * 1000000000000000000; .7777777777777777777777777777777777777 * 1000000000000000000 -777777777777777777.7777777777777777777000000000000000000 +777777777777777777.777777777777777777700000000000 select .7777777777777777777777777777777777777 - 0.1; .7777777777777777777777777777777777777 - 0.1 0.6777777777777777777777777777777777777 @@ -772,10 +772,10 @@ round(-99999999999999999.999,3) -99999999999999999.999 select truncate(99999999999999999999999999999999999999,31); truncate(99999999999999999999999999999999999999,31) -99999999999999999999999999999999999999.000000000000000000000000000 +99999999999999999999999999999999999999.000000000000000000000000000000 select truncate(99.999999999999999999999999999999999999,31); truncate(99.999999999999999999999999999999999999,31) -99.9999999999999999999999999999999 +100.000000000000000000000000000000 select truncate(99999999999999999999999999999999999999,-31); truncate(99999999999999999999999999999999999999,-31) 99999990000000000000000000000000000000 @@ -783,7 +783,7 @@ create table t1 as select 0.5; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `0.5` decimal(3,1) NOT NULL default '0.0' + `0.5` decimal(2,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select round(1.5),round(2.5); @@ -841,4 +841,8 @@ ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1 drop table Sow6_2f; select 10.3330000000000/12.34500000; 10.3330000000000/12.34500000 -0.8370190360469825840421223160000 +0.83701903604698258 +set sql_mode=''; +select 0/0; +0/0 +NULL diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index dcd364f1422..aae3c414c5c 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -565,7 +565,7 @@ a show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` decimal(19,1) NOT NULL default '0.0' + `a` decimal(3,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t2 (it1 tinyint, it2 tinyint not null, i int not null, ib bigint, f float, d double, y year, da date, dt datetime, sc char(10), sv varchar(10), b blob, tx text); @@ -792,7 +792,7 @@ d show create table t3; Table Create Table t3 CREATE TABLE `t3` ( - `d` decimal(19,9) default NULL + `d` decimal(18,9) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2,t3; create table t1 select 1 union select -1; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index b3850bcc72c..3479d209019 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -504,7 +504,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) default NULL, - `c2` decimal(64,30) default NULL, + `c2` decimal(65,30) default NULL, `c3` longtext, `c4` double default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test index e17806a54aa..88eb840a787 100644 --- a/mysql-test/t/ctype_latin1_de.test +++ b/mysql-test/t/ctype_latin1_de.test @@ -132,3 +132,11 @@ INSERT INTO t1 VALUES (' ALTER TABLE t1 ADD KEY ifword(col1); SELECT * FROM t1 WHERE col1='ß' ORDER BY col1, BINARY col1; DROP TABLE t1; + +# +# Bug#9509 +# +create table t1 (s1 char(5) character set latin1 collate latin1_german2_ci); +insert into t1 values (0xf6) /* this is o-umlaut */; +select * from t1 where length(s1)=1 and s1='oe'; +drop table t1; diff --git a/mysql-test/t/ctype_latin2.test b/mysql-test/t/ctype_latin2.test new file mode 100644 index 00000000000..445223f534c --- /dev/null +++ b/mysql-test/t/ctype_latin2.test @@ -0,0 +1,47 @@ + +# Tests with the latin1 character set +# +--disable_warnings +drop table if exists t1; +--enable_warnings + +SET NAMES latin2; +CREATE TABLE t1 (a char(1) character set latin2); +INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07); +INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17); +INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27); +INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37); +INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47); +INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57); +INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67); +INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77); +INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87); +INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F); +INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97); +INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F); +INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7); +INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF); +INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7); +INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF); +INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7); +INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF); +INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7); +INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF); +INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7); +INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF); +INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7); +INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF); + +# +# Bug#6504 upper/lower conversion bug +# +SELECT hex(a) ha, hex(lower(a)) hl, hex(upper(a)) hu, +a, lower(a) l, upper(a) u from t1 order by ha; diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 9b6f91067d4..459a40cfe87 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -6,6 +6,9 @@ drop table if exists t1,t2; --enable_warnings +set @sav_dpi= @@div_precision_increment; +set div_precision_increment= 5; +show variables like 'div_precision_increment'; create table t1 (grp int, a bigint unsigned, c char(10) not null); insert into t1 values (1,1,"a"); insert into t1 values (2,2,"b"); @@ -623,4 +626,5 @@ SELECT b/c as v, SUM(a) FROM t1 GROUP BY v; SELECT SUM(a) FROM t1 GROUP BY b/c; DROP TABLE t1; +set div_precision_increment= @sav_dpi; diff --git a/mysql-test/t/ndb_restore.test b/mysql-test/t/ndb_restore.test index e3191538a22..3c7b99da25a 100644 --- a/mysql-test/t/ndb_restore.test +++ b/mysql-test/t/ndb_restore.test @@ -209,3 +209,9 @@ select count(*) drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; --enable_warnings + +# +# Test BUG#10287 +# + +--exec $NDB_TOOLS_DIR/ndb_select_all -d sys -D , SYSTAB_0 | grep 520093696 diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index 03b26e0b6c6..378f195406b 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -2,6 +2,10 @@ drop table if exists t1,t2; --enable_warnings +set @sav_dpi= @@div_precision_increment; +set div_precision_increment= 5; +show variables like 'div_precision_increment'; + create table t1 (product varchar(32), country_id int not null, year int, profit int); insert into t1 values ( 'Computer', 2,2000, 1200), ( 'TV', 1, 1999, 150), @@ -191,3 +195,4 @@ SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP; SELECT * FROM ( SELECT a, SUM(a) m FROM t1 GROUP BY a WITH ROLLUP ) t2; DROP TABLE t1; +set div_precision_increment= @sav_dpi; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 820fae12db0..b06d3c4caf0 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -587,3 +587,77 @@ deallocate prepare stmt| drop procedure p1| drop table t1| delimiter ;| + +# +# Bug#9096 "select doesn't return all matched records if prepared statements +# is used" +# The bug was is bad co-operation of the optimizer's algorithm which determines +# which keys can be used to execute a query, constants propagation +# part of the optimizer and parameter markers used by prepared statements. + +drop table if exists t1; +create table t1 (c1 int(11) not null, c2 int(11) not null, + primary key (c1,c2), key c2 (c2), key c1 (c1)); + +insert into t1 values (200887, 860); +insert into t1 values (200887, 200887); + +select * from t1 where (c1=200887 and c2=200887) or c2=860; + +prepare stmt from +"select * from t1 where (c1=200887 and c2=200887) or c2=860"; +execute stmt; +prepare stmt from +"select * from t1 where (c1=200887 and c2=?) or c2=?"; +set @a=200887, @b=860; +# this query did not return all matching rows +execute stmt using @a, @b; +deallocate prepare stmt; + +drop table t1; + +# +# Bug#9777 - another occurrence of the problem stated in Bug#9096: +# we can not compare basic constants by their names, because a placeholder +# is a basic constant while his name is always '?' +# + +create table t1 ( + id bigint(20) not null auto_increment, + code varchar(20) character set utf8 collate utf8_bin not null default '', + company_name varchar(250) character set utf8 collate utf8_bin default null, + setup_mode tinyint(4) default null, + start_date datetime default null, + primary key (id), unique key code (code) +); + +create table t2 ( + id bigint(20) not null auto_increment, + email varchar(250) character set utf8 collate utf8_bin default null, + name varchar(250) character set utf8 collate utf8_bin default null, + t1_id bigint(20) default null, + password varchar(250) character set utf8 collate utf8_bin default null, + primary_contact tinyint(4) not null default '0', + email_opt_in tinyint(4) not null default '1', + primary key (id), unique key email (email), key t1_id (t1_id), + constraint t2_fk1 foreign key (t1_id) references t1 (id) +); + +insert into t1 values +(1, 'demo', 'demo s', 0, current_date()), +(2, 'code2', 'name 2', 0, current_date()), +(3, 'code3', 'name 3', 0, current_date()); + +insert into t2 values +(2, 'email1', 'name1', 3, 'password1', 0, 0), +(3, 'email2', 'name1', 1, 'password2', 1, 0), +(5, 'email3', 'name3', 2, 'password3', 0, 0); + +prepare stmt from 'select t2.id from t2, t1 where (t1.id=? and t2.t1_id=t1.id)'; +set @a=1; +execute stmt using @a; + +select t2.id from t2, t1 where (t1.id=1 and t2.t1_id=t1.id); + +deallocate prepare stmt; +drop table t1, t2; diff --git a/mysql-test/t/rpl_sp-master.opt b/mysql-test/t/rpl_sp-master.opt new file mode 100644 index 00000000000..709a224fd92 --- /dev/null +++ b/mysql-test/t/rpl_sp-master.opt @@ -0,0 +1 @@ +--log_bin_trust_routine_creators=0 diff --git a/mysql-test/t/rpl_sp-slave.opt b/mysql-test/t/rpl_sp-slave.opt new file mode 100644 index 00000000000..709a224fd92 --- /dev/null +++ b/mysql-test/t/rpl_sp-slave.opt @@ -0,0 +1 @@ +--log_bin_trust_routine_creators=0 diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test new file mode 100644 index 00000000000..b8dc381630b --- /dev/null +++ b/mysql-test/t/rpl_sp.test @@ -0,0 +1,234 @@ +# Test of replication of stored procedures (WL#2146 for MySQL 5.0) + +source include/master-slave.inc; + +# First let's test replication of current_user() (that's a related thing) +# we need a db != test, where we don't have automatic grants +create database if not exists mysqltest1; +use mysqltest1; +create table t1 (a varchar(100)); +sync_slave_with_master; +use mysqltest1; + +# ********************** PART 1 : STORED PROCEDURES *************** + +# Does the same proc as on master get inserted into mysql.proc ? +# (same definer, same properties...) + +connection master; +# cleanup +--disable_warnings +drop procedure if exists foo; +drop procedure if exists foo2; +drop procedure if exists foo3; +drop procedure if exists foo4; +drop procedure if exists bar; +drop function if exists fn1; +--enable_warnings + +delimiter |; +--error 1418; # not deterministic +create procedure foo() +begin + declare b int; + set b = 8; + insert into t1 values (b); + insert into t1 values (unix_timestamp()); +end| + +--replace_column 2 # 5 # +show binlog events from 98| # check that not there + +create procedure foo() deterministic +begin + declare b int; + set b = 8; + insert into t1 values (b); + insert into t1 values (unix_timestamp()); +end| +delimiter ;| + +# we replace columns having times +# (even with fixed timestamp displayed time may changed based on TZ) +--replace_result localhost.localdomain localhost 127.0.0.1 localhost +--replace_column 13 # 14 # +select * from mysql.proc where name='foo' and db='mysqltest1'; +sync_slave_with_master; +--replace_result localhost.localdomain localhost 127.0.0.1 localhost +--replace_column 13 # 14 # +select * from mysql.proc where name='foo' and db='mysqltest1'; + +# Now when we call it, does the CALL() get into binlog, +# or the substatements? +connection master; +# see if timestamp used in SP on slave is same as on master +set timestamp=1000000000; +call foo(); +--replace_column 2 # 5 # +show binlog events from 308; +select * from t1; +sync_slave_with_master; +select * from t1; + +# Now a SP which is supposed to not update tables (CALL should not be +# binlogged) as it's "read sql data", so should not give error even if +# non-deterministic. + +connection master; +delete from t1; +create procedure foo2() + not deterministic + reads sql data + select * from mysqltest1.t1; +call foo2(); +# verify CALL is not in binlog +--replace_column 2 # 5 # +show binlog events from 605; + +--error 1418; +alter procedure foo2 contains sql; + +# SP with definer's right + +drop table t1; +create table t1 (a int); +create table t2 like t1; + +create procedure foo3() + deterministic + insert into t1 values (15); + +# let's create a non-privileged user +grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1; +grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1; +grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1; + +connect (con1,127.0.0.1,zedjzlcsjhd,,mysqltest1,$MASTER_MYPORT,); +connection con1; + +--error 1419; # only full-global-privs user can create a routine +create procedure foo4() + deterministic + insert into t1 values (10); + +connection master; +set global log_bin_trust_routine_creators=1; +connection con1; + +delimiter |; +create procedure foo4() + deterministic + begin + insert into t2 values(3); + insert into t1 values (5); + end| + +delimiter ;| + +# I add ,0 so that it does not print the error in the test output, +# because this error is hostname-dependent +--error 1142,0; +call foo4(); # invoker has no INSERT grant on table => failure +show warnings; + +connection master; +call foo3(); # success (definer == root) +show warnings; + +--replace_result localhost.localdomain localhost 127.0.0.1 localhost +--error 1142,0; +call foo4(); # definer's rights => failure +show warnings; + +# we test replication of ALTER PROCEDURE +alter procedure foo4 sql security invoker; +call foo4(); # invoker's rights => success +show warnings; + +# Check that only successful CALLs are in binlog +--replace_column 2 # 5 # +show binlog events from 841; + +# Note that half-failed CALLs are not in binlog, which is a known +# bug. If we compare t2 on master and slave we see they differ: + +select * from t1; +select * from t2; +sync_slave_with_master; +select * from t1; +select * from t2; +select if(compte<>3,"this is broken but documented","this unexpectedly works?") from (select count(*) as compte from t2) as aggreg; + +# Test of DROP PROCEDURE + +--replace_result localhost.localdomain localhost 127.0.0.1 localhost +--replace_column 13 # 14 # +select * from mysql.proc where name="foo4" and db='mysqltest1'; +connection master; +drop procedure foo4; +select * from mysql.proc where name="foo4" and db='mysqltest1'; +sync_slave_with_master; +select * from mysql.proc where name="foo4" and db='mysqltest1'; + +# ********************** PART 2 : FUNCTIONS *************** + +connection master; +drop procedure foo; +drop procedure foo2; +drop procedure foo3; + +delimiter |; +create function fn1(x int) + returns int + deterministic +begin + insert into t1 values (x); + return x+2; +end| + +delimiter ;| +delete t1,t2 from t1,t2; +select fn1(20); +insert into t2 values(fn1(21)); +select * from t1; +select * from t2; +sync_slave_with_master; +select * from t1; +select if(compte<>1,"this is broken but documented","this unexpectedly works?") from (select count(*) as compte from t1 where a=20) as aggreg; +select * from t2; + +connection master; +delimiter |; + +drop function fn1; + +create function fn1() + returns int + deterministic +begin + return unix_timestamp(); +end| +delimiter ;| +delete from t1; +set timestamp=1000000000; +insert into t1 values(fn1()); + +--replace_result localhost.localdomain localhost 127.0.0.1 localhost +--replace_column 13 # 14 # +select * from mysql.proc where db='mysqltest1'; +select * from t1; + +sync_slave_with_master; +use mysqltest1; +select * from t1; +--replace_result localhost.localdomain localhost 127.0.0.1 localhost +--replace_column 13 # 14 # +select * from mysql.proc where db='mysqltest1'; + + +# Clean up +connection master; +drop function fn1; +drop database mysqltest1; +drop user "zedjzlcsjhd"@127.0.0.1; +sync_slave_with_master; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 2e45d1c6cd1..77fe5ab7601 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -3741,6 +3741,25 @@ call bug7293 ('secrete')| drop procedure bug7293| delete from t1| + +# +# BUG#9841: Unexpected read lock when trying to update a view in a +# stored procedure +# +--disable_warnings +drop procedure if exists bug9841| +drop view if exists v1| +--enable_warnings + +create view v1 as select * from t1, t2 where id = s| +create procedure bug9841 () + update v1 set data = 10| +call bug9841()| + +drop view v1| +drop procedure bug9841| + + # # BUG#NNNN: New bug synopsis # diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test index 1fbcf01d5a6..19d16f95990 100644 --- a/mysql-test/t/type_bit.test +++ b/mysql-test/t/type_bit.test @@ -140,3 +140,25 @@ drop table t1; create table t1 select * from t2; select a+0, b+0 from t1; drop table t1, t2; + +# +# Bug #10179: problem with NULLs and default values +# + +create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1), + g bit(1) NOT NULL default 1, h char(1) default 'a'); +insert into t1 set a=1; +select hex(g), h from t1; +drop table t1; + +create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1), + g bit(1) NOT NULL default 1); +insert into t1 set a=1; +select hex(g) from t1; +drop table t1; + +create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1), + h char(1) default 'a') engine=myisam; +insert into t1 set a=1; +select h from t1; +drop table t1; diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index f86113ac66b..7ce54847506 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -308,7 +308,7 @@ create table t1 (d decimal); show create table t1; drop table t1; --error 1063 -create table t1 (d decimal(65,0)); +create table t1 (d decimal(66,0)); # # Test example from manual diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index e85cc3d55c6..19230c02743 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -869,3 +869,10 @@ drop table Sow6_2f; # bug#9501 # select 10.3330000000000/12.34500000; + +# +# Bug #10404 +# + +set sql_mode=''; +select 0/0; diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index d8a13ca9dfd..26f3477140b 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -24,6 +24,24 @@ fun:pthread_create } +{ + pthread allocate_dtv memory loss second + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls + fun:pthread_create* +} + +{ + pthread allocate_dtv memory loss second + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls + fun:pthread_create* +} + { pthread memalign memory loss Memcheck:Leak @@ -33,6 +51,28 @@ fun:pthread_create } +{ + pthread strstr uninit + Memcheck:Cond + fun:strstr + obj:/lib/tls/libpthread.so.* + obj:/lib/tls/libpthread.so.* + fun:call_init + fun:_dl_init + obj:/lib/ld-*.so +} + +{ + pthread strstr uninit + Memcheck:Cond + fun:strstr + obj:/lib/tls/libpthread.so.* + obj:/lib/tls/libpthread.so.* + fun:call_init + fun:_dl_init + obj:/lib/ld-*.so +} + { pthread errno Memcheck:Leak diff --git a/mysys/default.c b/mysys/default.c index a4ab6eb1939..e3a0b8a20ad 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -121,7 +121,8 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv, if (forced_extra_defaults) defaults_extra_file= strchr(forced_extra_defaults,'=')+1; - args_used+= (forced_default_file ? 1 : 0) + (forced_extra_defaults ? 1 : 0); + (*args_used)+= (forced_default_file ? 1 : 0) + + (forced_extra_defaults ? 1 : 0); if (forced_default_file) { diff --git a/sql/field.cc b/sql/field.cc index c59d9b63fca..78266441bda 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2229,12 +2229,6 @@ void Field_decimal::sql_type(String &res) const ** Field_new_decimal ****************************************************************************/ -/* - Constructors of new decimal field. In case of using NOT_FIXED_DEC it try - to use maximally allowed length (DECIMAL_MAX_LENGTH) and number of digits - after decimal point maximally close to half of this range - (min(DECIMAL_MAX_LENGTH/2, NOT_FIXED_DEC-1)) -*/ Field_new_decimal::Field_new_decimal(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, @@ -2243,17 +2237,15 @@ Field_new_decimal::Field_new_decimal(char *ptr_arg, struct st_table *table_arg, uint8 dec_arg,bool zero_arg, bool unsigned_arg) - :Field_num(ptr_arg, - (dec_arg == NOT_FIXED_DEC || len_arg > DECIMAL_MAX_LENGTH ? - DECIMAL_MAX_LENGTH : len_arg), + :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg, table_arg, - (dec_arg == NOT_FIXED_DEC ? - min(DECIMAL_MAX_LENGTH / 2, NOT_FIXED_DEC - 1) : - dec_arg), - zero_arg, unsigned_arg) + dec_arg, zero_arg, unsigned_arg) { - bin_size= my_decimal_get_binary_size(field_length, dec); + precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg); + DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION) && + (dec <= DECIMAL_MAX_SCALE)); + bin_size= my_decimal_get_binary_size(precision, dec); } @@ -2261,18 +2253,18 @@ Field_new_decimal::Field_new_decimal(uint32 len_arg, bool maybe_null, const char *name, struct st_table *t_arg, - uint8 dec_arg) - :Field_num((char*) 0, - (dec_arg == NOT_FIXED_DEC|| len_arg > DECIMAL_MAX_LENGTH ? - DECIMAL_MAX_LENGTH : len_arg), + uint8 dec_arg, + bool unsigned_arg) + :Field_num((char*) 0, len_arg, maybe_null ? (uchar*) "": 0, 0, NONE, name, t_arg, - (dec_arg == NOT_FIXED_DEC ? - min(DECIMAL_MAX_LENGTH / 2, NOT_FIXED_DEC - 1) : - dec_arg), - 0, 0) + dec_arg, + 0, unsigned_arg) { - bin_size= my_decimal_get_binary_size(field_length, dec); + precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg); + DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION) && + (dec <= DECIMAL_MAX_SCALE)); + bin_size= my_decimal_get_binary_size(precision, dec); } @@ -2295,7 +2287,7 @@ void Field_new_decimal::set_value_on_overflow(my_decimal *decimal_value, bool sign) { DBUG_ENTER("Field_new_decimal::set_value_on_overflow"); - max_my_decimal(decimal_value, field_length, decimals()); + max_my_decimal(decimal_value, precision, decimals()); if (sign) { if (unsigned_flag) @@ -2326,10 +2318,14 @@ void Field_new_decimal::set_value_on_overflow(my_decimal *decimal_value, bool Field_new_decimal::store_value(const my_decimal *decimal_value) { - my_decimal *dec= (my_decimal*)decimal_value; int error= 0; DBUG_ENTER("Field_new_decimal::store_value"); - dbug_print_decimal("enter", "value: %s", dec); +#ifndef DBUG_OFF + { + char dbug_buff[DECIMAL_MAX_STR_LENGTH+1]; + DBUG_PRINT("enter", ("value: %s", dbug_decimal_as_string(dbug_buff, decimal_value))); + } +#endif /* check that we do not try to write negative value in unsigned field */ if (unsigned_flag && decimal_value->sign()) @@ -2337,25 +2333,27 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value) DBUG_PRINT("info", ("unsigned overflow")); set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; - dec= &decimal_zero; + decimal_value= &decimal_zero; } - DBUG_PRINT("info", ("saving with precision %d, scale: %d", - (int)field_length, (int)decimals())); - dbug_print_decimal("info", "value: %s", dec); +#ifndef DBUG_OFF + { + char dbug_buff[DECIMAL_MAX_STR_LENGTH+1]; + DBUG_PRINT("info", ("saving with precision %d, scale: %d, value %s", + (int)precision, (int)dec, + dbug_decimal_as_string(dbug_buff, decimal_value))); + } +#endif - if (warn_if_overflow(my_decimal2binary(E_DEC_FATAL_ERROR & - ~E_DEC_OVERFLOW, - dec, ptr, - field_length, - decimals()))) + if (warn_if_overflow(my_decimal2binary(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW, + decimal_value, ptr, precision, dec))) { my_decimal buff; DBUG_PRINT("info", ("overflow")); - set_value_on_overflow(&buff, dec->sign()); - my_decimal2binary(E_DEC_FATAL_ERROR, &buff, ptr, field_length, decimals()); + set_value_on_overflow(&buff, decimal_value->sign()); + my_decimal2binary(E_DEC_FATAL_ERROR, &buff, ptr, precision, dec); error= 1; } - DBUG_EXECUTE("info", print_decimal_buff(dec, (byte *) ptr, bin_size);); + DBUG_EXECUTE("info", print_decimal_buff(decimal_value, (byte *) ptr, bin_size);); DBUG_RETURN(error); } @@ -2387,7 +2385,11 @@ int Field_new_decimal::store(const char *from, uint length, break; } - dbug_print_decimal("enter", "value: %s", &decimal_value); +#ifndef DBUG_OFF + char dbug_buff[DECIMAL_MAX_STR_LENGTH+1]; + DBUG_PRINT("enter", ("value: %s", + dbug_decimal_as_string(dbug_buff, &decimal_value))); +#endif store_value(&decimal_value); DBUG_RETURN(err); } @@ -2477,8 +2479,7 @@ my_decimal* Field_new_decimal::val_decimal(my_decimal *decimal_value) { DBUG_ENTER("Field_new_decimal::val_decimal"); binary2my_decimal(E_DEC_FATAL_ERROR, ptr, decimal_value, - field_length, - decimals()); + precision, dec); DBUG_EXECUTE("info", print_decimal_buff(decimal_value, (byte *) ptr, bin_size);); DBUG_RETURN(decimal_value); @@ -2489,12 +2490,9 @@ String *Field_new_decimal::val_str(String *val_buffer, String *val_ptr __attribute__((unused))) { my_decimal decimal_value; - int fixed_precision= (zerofill ? - (field_length + (decimals() ? 1 : 0)) : - 0); + uint fixed_precision= zerofill ? precision : 0; my_decimal2string(E_DEC_FATAL_ERROR, val_decimal(&decimal_value), - fixed_precision, decimals(), '0', - val_buffer); + fixed_precision, dec, '0', val_buffer); return val_buffer; } @@ -2516,7 +2514,7 @@ void Field_new_decimal::sql_type(String &str) const { CHARSET_INFO *cs= str.charset(); str.length(cs->cset->snprintf(cs, (char*) str.ptr(), str.alloced_length(), - "decimal(%d,%d)", field_length, (int)dec)); + "decimal(%d,%d)", precision, (int)dec)); add_zerofill_and_unsigned(str); } diff --git a/sql/field.h b/sql/field.h index ac9c2f351b3..853b5dd13ff 100644 --- a/sql/field.h +++ b/sql/field.h @@ -300,8 +300,6 @@ public: int warn_if_overflow(int op_result); /* maximum possible display length */ virtual uint32 max_length()= 0; - /* length of field value symbolic representation (in bytes) */ - virtual uint32 representation_length() { return field_length; } /* convert decimal to longlong with overflow check */ longlong convert_decimal2longlong(const my_decimal *val, bool unsigned_flag, int *err); @@ -438,7 +436,13 @@ public: /* New decimal/numeric field which use fixed point arithmetic */ class Field_new_decimal :public Field_num { public: + /* The maximum number of decimal digits can be stored */ + uint precision; uint bin_size; + /* Constructors take max_length of the field as a parameter - not the */ + /* precision as the number of decimal digits allowed */ + /* So for example we need to count length from precision handling */ + /* CREATE TABLE ( DECIMAL(x,y)) */ Field_new_decimal(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const char *field_name_arg, @@ -446,7 +450,8 @@ public: uint8 dec_arg, bool zero_arg, bool unsigned_arg); Field_new_decimal(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg, - struct st_table *table_arg, uint8 dec_arg); + struct st_table *table_arg, uint8 dec_arg, + bool unsigned_arg); enum_field_types type() const { return FIELD_TYPE_NEWDECIMAL;} enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; } Item_result result_type () const { return DECIMAL_RESULT; } @@ -465,10 +470,7 @@ public: void sort_string(char *buff, uint length); bool zero_pack() const { return 0; } void sql_type(String &str) const; - uint32 max_length() - { return field_length + 1 + (dec ? 1 : 0) + (field_length == dec ? 1 : 0); } - uint32 representation_length() - { return field_length + 1 + (dec ? 1 : 0) + (field_length == dec ? 1 : 0); }; + uint32 max_length() { return field_length; } uint size_of() const { return sizeof(*this); } uint32 pack_length() const { return (uint32) bin_size; } }; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index c7d3bc9e247..bfaa2015ea3 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -6146,10 +6146,12 @@ innodb_show_status( /*===============*/ THD* thd) /* in: the MySQL query thread of the caller */ { - Protocol *protocol= thd->protocol; - trx_t* trx; - long flen; - char* str; + Protocol* protocol = thd->protocol; + trx_t* trx; + static const char truncated_msg[] = "... truncated...\n"; + const long MAX_STATUS_SIZE = 64000; + ulint trx_list_start = ULINT_UNDEFINED; + ulint trx_list_end = ULINT_UNDEFINED; DBUG_ENTER("innodb_show_status"); @@ -6164,32 +6166,58 @@ innodb_show_status( innobase_release_stat_resources(trx); - /* We let the InnoDB Monitor to output at most 64000 bytes of text. */ + /* We let the InnoDB Monitor to output at most MAX_STATUS_SIZE + bytes of text. */ + + long flen, usable_len; + char* str; mutex_enter_noninline(&srv_monitor_file_mutex); rewind(srv_monitor_file); - - srv_printf_innodb_monitor(srv_monitor_file); + srv_printf_innodb_monitor(srv_monitor_file, + &trx_list_start, &trx_list_end); flen = ftell(srv_monitor_file); os_file_set_eof(srv_monitor_file); if (flen < 0) { flen = 0; - } else if (flen > 64000 - 1) { - flen = 64000 - 1; + } + + if (flen > MAX_STATUS_SIZE) { + usable_len = MAX_STATUS_SIZE; + } else { + usable_len = flen; } /* allocate buffer for the string, and read the contents of the temporary file */ - if (!(str = my_malloc(flen + 1, MYF(0)))) { - mutex_exit_noninline(&srv_monitor_file_mutex); - - DBUG_RETURN(TRUE); + if (!(str = my_malloc(usable_len + 1, MYF(0)))) + { + mutex_exit_noninline(&srv_monitor_file_mutex); + DBUG_RETURN(TRUE); } rewind(srv_monitor_file); - flen = fread(str, 1, flen, srv_monitor_file); + if (flen < MAX_STATUS_SIZE) { + /* Display the entire output. */ + flen = fread(str, 1, flen, srv_monitor_file); + } else if (trx_list_end < (ulint) flen + && trx_list_start < trx_list_end + && trx_list_start + (flen - trx_list_end) + < MAX_STATUS_SIZE - sizeof truncated_msg - 1) { + /* Omit the beginning of the list of active transactions. */ + long len = fread(str, 1, trx_list_start, srv_monitor_file); + memcpy(str + len, truncated_msg, sizeof truncated_msg - 1); + len += sizeof truncated_msg - 1; + usable_len = (MAX_STATUS_SIZE - 1) - len; + fseek(srv_monitor_file, flen - usable_len, SEEK_SET); + len += fread(str + len, 1, usable_len, srv_monitor_file); + flen = len; + } else { + /* Omit the end of the output. */ + flen = fread(str, 1, MAX_STATUS_SIZE - 1, srv_monitor_file); + } mutex_exit_noninline(&srv_monitor_file_mutex); @@ -6429,15 +6457,15 @@ ha_innobase::store_lock( (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT) && thd->lex->sql_command != SQLCOM_SELECT && thd->lex->sql_command != SQLCOM_UPDATE_MULTI && - thd->lex->sql_command != SQLCOM_DELETE_MULTI ) { + thd->lex->sql_command != SQLCOM_DELETE_MULTI && + thd->lex->sql_command != SQLCOM_LOCK_TABLES) { /* In case we have innobase_locks_unsafe_for_binlog option set and isolation level of the transaction is not set to serializable and MySQL is doing - INSERT INTO...SELECT without FOR UPDATE or IN - SHARE MODE we use consistent read for select. - Similarly, in case of DELETE...SELECT and - UPDATE...SELECT when these are not multi table.*/ + INSERT INTO...SELECT or UPDATE ... = (SELECT ...) + without FOR UPDATE or IN SHARE MODE in select, then + we use consistent read for select. */ prebuilt->select_lock_type = LOCK_NONE; prebuilt->stored_select_lock_type = LOCK_NONE; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index b61dbd1792c..99fb05b24d3 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3621,7 +3621,7 @@ static int create_ndb_column(NDBCOL &col, case MYSQL_TYPE_NEWDECIMAL: { Field_new_decimal *f= (Field_new_decimal*)field; - uint precision= f->field_length; + uint precision= f->precision; uint scale= f->decimals(); if (field->flags & UNSIGNED_FLAG) { diff --git a/sql/hostname.cc b/sql/hostname.cc index fe2fad6f3b2..ec5c6f29a27 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -183,7 +183,7 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) that attempted to connect during the outage) unable to connect indefinitely. */ - if (tmp_errno == HOST_NOT_FOUND || tmp_error == NO_DATA) + if (tmp_errno == HOST_NOT_FOUND || tmp_errno == NO_DATA) add_wrong_ip(in); my_gethostbyname_r_free(); DBUG_RETURN(0); @@ -207,13 +207,17 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) { VOID(pthread_mutex_unlock(&LOCK_hostname)); DBUG_PRINT("error",("gethostbyaddr returned %d",errno)); - goto err; + + if (errno == HOST_NOT_FOUND || errno == NO_DATA) + add_wrong_ip(in); /* only cache negative responses, not failures */ + + DBUG_RETURN(0); } if (!hp->h_name[0]) // Don't allow empty hostnames { VOID(pthread_mutex_unlock(&LOCK_hostname)); DBUG_PRINT("error",("Got an empty hostname")); - goto err; + goto add_wrong_ip_and_return; } if (!(name=my_strdup(hp->h_name,MYF(0)))) { @@ -240,7 +244,7 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) { DBUG_PRINT("error",("mysqld doesn't accept hostnames that starts with a number followed by a '.'")); my_free(name,MYF(0)); - goto err; + goto add_wrong_ip_and_return; } } @@ -256,7 +260,7 @@ my_string ip_to_hostname(struct in_addr *in, uint *errors) DBUG_PRINT("error",("Couldn't verify hostname with gethostbyname")); my_free(name,MYF(0)); -err: +add_wrong_ip_and_return: add_wrong_ip(in); DBUG_RETURN(0); } diff --git a/sql/item.cc b/sql/item.cc index a2649d7506f..f5c7f2d7c05 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -80,7 +80,7 @@ Hybrid_type_traits_decimal::fix_length_and_dec(Item *item, Item *arg) const { item->decimals= arg->decimals; item->max_length= min(arg->max_length + DECIMAL_LONGLONG_DIGITS, - DECIMAL_MAX_LENGTH); + DECIMAL_MAX_STR_LENGTH); } @@ -348,6 +348,17 @@ Item::Item(THD *thd, Item *item): } +uint Item::decimal_precision() const +{ + Item_result restype= result_type(); + + if ((restype == DECIMAL_RESULT) || (restype == INT_RESULT)) + return min(my_decimal_length_to_precision(max_length, decimals, unsigned_flag), + DECIMAL_MAX_PRECISION); + return min(max_length, DECIMAL_MAX_PRECISION); +} + + void Item::print_item_w_name(String *str) { print(str); @@ -558,6 +569,11 @@ void Item::set_name(const char *str, uint length, CHARSET_INFO *cs) bool Item::eq(const Item *item, bool binary_cmp) const { + /* + Note, that this is never TRUE if item is a Item_param: + for all basic constants we have special checks, and Item_param's + type() can be only among basic constant types. + */ return type() == item->type() && name && item->name && !my_strcasecmp(system_charset_info,name,item->name); } @@ -602,7 +618,7 @@ Item *Item_string::safe_charset_converter(CHARSET_INFO *tocs) bool Item_string::eq(const Item *item, bool binary_cmp) const { - if (type() == item->type()) + if (type() == item->type() && item->basic_const_item()) { if (binary_cmp) return !stringcmp(&str_value, &item->str_value); @@ -938,10 +954,8 @@ bool DTCollation::aggregate(DTCollation &dt, uint flags) return 1; } if (collation->state & MY_CS_BINSORT) - { return 0; - } - else if (dt.collation->state & MY_CS_BINSORT) + if (dt.collation->state & MY_CS_BINSORT) { set(dt); return 0; @@ -1021,7 +1035,7 @@ void Item_field::set_field(Field *field_par) field=result_field=field_par; // for easy coding with fields maybe_null=field->maybe_null(); decimals= field->decimals(); - max_length= field_par->representation_length(); + max_length= field_par->field_length; table_name= *field_par->table_name; field_name= field_par->field_name; db_name= field_par->table->s->db; @@ -1336,6 +1350,13 @@ Item_uint::Item_uint(const char *str_arg, uint length): } +Item_uint::Item_uint(const char *str_arg, longlong i, uint length): + Item_int(str_arg, i, length) +{ + unsigned_flag= 1; +} + + String *Item_uint::val_str(String *str) { // following assert is redundant, because fixed=1 assigned in constructor @@ -1359,18 +1380,18 @@ Item_decimal::Item_decimal(const char *str_arg, uint length, str2my_decimal(E_DEC_FATAL_ERROR, str_arg, length, charset, &decimal_value); name= (char*) str_arg; decimals= (uint8) decimal_value.frac; - max_length= my_decimal_max_length(&decimal_value); fixed= 1; - unsigned_flag= !decimal_value.sign(); + max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, + decimals, unsigned_flag); } Item_decimal::Item_decimal(longlong val, bool unsig) { int2my_decimal(E_DEC_FATAL_ERROR, val, unsig, &decimal_value); decimals= (uint8) decimal_value.frac; - max_length= my_decimal_max_length(&decimal_value); fixed= 1; - unsigned_flag= !decimal_value.sign(); + max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, + decimals, unsigned_flag); } @@ -1378,9 +1399,9 @@ Item_decimal::Item_decimal(double val, int precision, int scale) { double2my_decimal(E_DEC_FATAL_ERROR, val, &decimal_value); decimals= (uint8) decimal_value.frac; - max_length= my_decimal_max_length(&decimal_value); fixed= 1; - unsigned_flag= !decimal_value.sign(); + max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, + decimals, unsigned_flag); } @@ -1392,7 +1413,6 @@ Item_decimal::Item_decimal(const char *str, const my_decimal *val_arg, decimals= (uint8) decimal_par; max_length= length; fixed= 1; - unsigned_flag= !decimal_value.sign(); } @@ -1400,19 +1420,20 @@ Item_decimal::Item_decimal(my_decimal *value_par) { my_decimal2decimal(value_par, &decimal_value); decimals= (uint8) decimal_value.frac; - max_length= my_decimal_max_length(value_par); fixed= 1; - unsigned_flag= !decimal_value.sign(); + max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, + decimals, !decimal_value.sign()); } Item_decimal::Item_decimal(const char *bin, int precision, int scale) { - binary2my_decimal(E_DEC_FATAL_ERROR, bin, &decimal_value, precision, scale); + binary2my_decimal(E_DEC_FATAL_ERROR, bin, + &decimal_value, precision, scale); decimals= (uint8) decimal_value.frac; - max_length= my_decimal_max_length(&decimal_value); fixed= 1; - unsigned_flag= !decimal_value.sign(); + max_length= my_decimal_precision_to_length(precision, decimals, + !decimal_value.sign()); } @@ -1444,6 +1465,24 @@ void Item_decimal::print(String *str) } +bool Item_decimal::eq(const Item *item, bool binary_cmp) const +{ + if (type() == item->type() && item->basic_const_item()) + { + /* + We need to cast off const to call val_decimal(). This should + be OK for a basic constant. Additionally, we can pass 0 as + a true decimal constant will return its internal decimal + storage and ignore the argument. + */ + Item *arg= (Item*) item; + my_decimal *value= arg->val_decimal(0); + return !my_decimal_cmp(&decimal_value, value); + } + return 0; +} + + String *Item_float::val_str(String *str) { // following assert is redundant, because fixed=1 assigned in constructor @@ -1672,7 +1711,8 @@ void Item_param::set_decimal(const char *str, ulong length) str2my_decimal(E_DEC_FATAL_ERROR, str, &decimal_value, &end); state= DECIMAL_VALUE; decimals= decimal_value.frac; - max_length= decimal_value.intg + decimals + 2; + max_length= my_decimal_precision_to_length(decimal_value.precision(), + decimals, unsigned_flag); maybe_null= 0; DBUG_VOID_RETURN; } @@ -1823,7 +1863,8 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) my_decimal2decimal(ent_value, &decimal_value); state= DECIMAL_VALUE; decimals= ent_value->frac; - max_length= ent_value->intg + decimals + 2; + max_length= my_decimal_precision_to_length(ent_value->precision(), + decimals, unsigned_flag); break; } default: @@ -2195,6 +2236,74 @@ bool Item_param::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) } +bool Item_param::basic_const_item() const +{ + if (state == NO_VALUE || state == TIME_VALUE) + return FALSE; + return TRUE; +} + + +Item * +Item_param::new_item() +{ + /* see comments in the header file */ + switch (state) { + case NULL_VALUE: + return new Item_null(name); + case INT_VALUE: + return (unsigned_flag ? + new Item_uint(name, value.integer, max_length) : + new Item_int(name, value.integer, max_length)); + case REAL_VALUE: + return new Item_float(name, value.real, decimals, max_length); + case STRING_VALUE: + case LONG_DATA_VALUE: + return new Item_string(name, str_value.c_ptr_quick(), str_value.length(), + str_value.charset()); + case TIME_VALUE: + break; + case NO_VALUE: + default: + DBUG_ASSERT(0); + }; + return 0; +} + + +bool +Item_param::eq(const Item *arg, bool binary_cmp) const +{ + Item *item; + if (!basic_const_item() || !arg->basic_const_item() || arg->type() != type()) + return FALSE; + /* + We need to cast off const to call val_int(). This should be OK for + a basic constant. + */ + item= (Item*) arg; + + switch (state) { + case NULL_VALUE: + return TRUE; + case INT_VALUE: + return value.integer == item->val_int() && + unsigned_flag == item->unsigned_flag; + case REAL_VALUE: + return value.real == item->val_real(); + case STRING_VALUE: + case LONG_DATA_VALUE: + if (binary_cmp) + return !stringcmp(&str_value, &item->str_value); + return !sortcmp(&str_value, &item->str_value, collation.collation); + default: + break; + } + return FALSE; +} + +/* End of Item_param related */ + void Item_param::print(String *str) { if (state == NO_VALUE) @@ -3173,11 +3282,8 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table) switch (field_type()) { case MYSQL_TYPE_DECIMAL: - return new Field_decimal((char*) 0, max_length, null_ptr, 0, Field::NONE, - name, table, decimals, 0, unsigned_flag); case MYSQL_TYPE_NEWDECIMAL: - return new Field_new_decimal((char*) 0, max_length - (decimals?1:0), - null_ptr, 0, + return new Field_new_decimal((char*) 0, max_length, null_ptr, 0, Field::NONE, name, table, decimals, 0, unsigned_flag); case MYSQL_TYPE_TINY: @@ -3412,6 +3518,35 @@ int Item_decimal::save_in_field(Field *field, bool no_conversions) } +bool Item_int::eq(const Item *arg, bool binary_cmp) const +{ + /* No need to check for null value as basic constant can't be NULL */ + if (arg->basic_const_item() && arg->type() == type()) + { + /* + We need to cast off const to call val_int(). This should be OK for + a basic constant. + */ + Item *item= (Item*) arg; + return item->val_int() == value && item->unsigned_flag == unsigned_flag; + } + return FALSE; +} + + +Item *Item_int_with_ref::new_item() +{ + DBUG_ASSERT(ref->basic_const_item()); + /* + We need to evaluate the constant to make sure it works with + parameter markers. + */ + return (ref->unsigned_flag ? + new Item_uint(ref->name, ref->val_int(), ref->max_length) : + new Item_int(ref->name, ref->val_int(), ref->max_length)); +} + + Item_num *Item_uint::neg() { Item_decimal *item= new Item_decimal(value, 0); @@ -3499,6 +3634,21 @@ void Item_float::print(String *str) In number context this is a longlong value. */ +bool Item_float::eq(const Item *arg, bool binary_cmp) const +{ + if (arg->basic_const_item() && arg->type() == type()) + { + /* + We need to cast off const to call val_int(). This should be OK for + a basic constant. + */ + Item *item= (Item*) arg; + return item->val_real() == value; + } + return FALSE; +} + + inline uint char_val(char X) { return (uint) (X >= '0' && X <= '9' ? X-'0' : @@ -3569,6 +3719,17 @@ int Item_hex_string::save_in_field(Field *field, bool no_conversions) } +bool Item_hex_string::eq(const Item *arg, bool binary_cmp) const +{ + if (arg->basic_const_item() && arg->type() == type()) + { + if (binary_cmp) + return !stringcmp(&str_value, &arg->str_value); + return !sortcmp(&str_value, &arg->str_value, collation.collation); + } + return FALSE; +} + /* bin item. In string context this is a binary string. @@ -4878,6 +5039,7 @@ Item_type_holder::Item_type_holder(THD *thd, Item *item) /* fix variable decimals which always is NOT_FIXED_DEC */ if (Field::result_merge_type(fld_type) == INT_RESULT) decimals= 0; + prev_decimal_int_part= item->decimal_int_part(); } @@ -5000,18 +5162,12 @@ bool Item_type_holder::join_types(THD *thd, Item *item) } if (Field::result_merge_type(fld_type) == DECIMAL_RESULT) { - int item_length= display_length(item); - int intp1= item_length - min(item->decimals, NOT_FIXED_DEC - 1); - int intp2= max_length - min(decimals, NOT_FIXED_DEC - 1); - /* can't be overflow because it work only for decimals (no strings) */ - int dec_length= max(intp1, intp2) + decimals; - max_length= max(max_length, (uint) max(item_length, dec_length)); - /* - we can't allow decimals to be NOT_FIXED_DEC, to prevent creation - decimal with max precision (see Field_new_decimal constcuctor) - */ - if (decimals >= NOT_FIXED_DEC) - decimals= NOT_FIXED_DEC - 1; + decimals= min(max(decimals, item->decimals), DECIMAL_MAX_SCALE); + int precision= min(max(prev_decimal_int_part, item->decimal_int_part()) + + decimals, DECIMAL_MAX_PRECISION); + unsigned_flag&= item->unsigned_flag; + max_length= my_decimal_precision_to_length(precision, decimals, + unsigned_flag); } else max_length= max(max_length, display_length(item)); @@ -5032,6 +5188,9 @@ bool Item_type_holder::join_types(THD *thd, Item *item) } maybe_null|= item->maybe_null; get_full_info(item); + + /* Remember decimal integer part to be used in DECIMAL_RESULT handleng */ + prev_decimal_int_part= decimal_int_part(); DBUG_PRINT("info", ("become type: %d len: %u dec: %u", (int) fld_type, max_length, (uint) decimals)); DBUG_RETURN(FALSE); diff --git a/sql/item.h b/sql/item.h index f762896ba34..697194e2878 100644 --- a/sql/item.h +++ b/sql/item.h @@ -258,7 +258,7 @@ public: Item *next; uint32 max_length; uint name_length; /* Length of name */ - uint8 marker,decimals; + uint8 marker, decimals; my_bool maybe_null; /* If item may be null */ my_bool null_value; /* if item is null */ my_bool unsigned_flag; @@ -434,7 +434,7 @@ public: virtual table_map not_null_tables() const { return used_tables(); } /* Returns true if this is a simple constant item like an integer, not - a constant expression + a constant expression. Used in the optimizer to propagate basic constants. */ virtual bool basic_const_item() const { return 0; } /* cloning of constant items (0 if it is not const) */ @@ -442,6 +442,9 @@ public: virtual cond_result eq_cmp_result() const { return COND_OK; } inline uint float_length(uint decimals_par) const { return decimals != NOT_FIXED_DEC ? (DBL_DIG+2+decimals_par) : DBL_DIG+8;} + virtual uint decimal_precision() const; + inline int decimal_int_part() const + { return my_decimal_int_part(decimal_precision(), decimals); } /* Returns true if this is constant (during query execution, i.e. its value will not change until next fix_fields) and its value is known. @@ -914,7 +917,6 @@ public: bool convert_str_value(THD *thd); - Item *new_item() { return new Item_param(pos_in_query); } /* If value for parameter was not set we treat it as non-const so noone will use parameters value in fix_fields still @@ -923,12 +925,29 @@ public: virtual table_map used_tables() const { return state != NO_VALUE ? (table_map)0 : PARAM_TABLE_BIT; } void print(String *str); - /* parameter never equal to other parameter of other item */ - bool eq(const Item *item, bool binary_cmp) const { return 0; } bool is_null() { DBUG_ASSERT(state != NO_VALUE); return state == NULL_VALUE; } + bool basic_const_item() const; + /* + This method is used to make a copy of a basic constant item when + propagating constants in the optimizer. The reason to create a new + item and not use the existing one is not precisely known (2005/04/16). + Probably we are trying to preserve tree structure of items, in other + words, avoid pointing at one item from two different nodes of the tree. + Return a new basic constant item if parameter value is a basic + constant, assert otherwise. This method is called only if + basic_const_item returned TRUE. + */ + Item *new_item(); + /* + Implement by-value equality evaluation if parameter value + is set and is a basic constant (integer, real or string). + Otherwise return FALSE. + */ + bool eq(const Item *item, bool binary_cmp) const; }; + class Item_int :public Item_num { public: @@ -937,7 +956,7 @@ public: { max_length=length; fixed= 1; } #ifdef HAVE_LONG_LONG Item_int(longlong i,uint length=21) :value(i) - { max_length=length; fixed= 1;} + { max_length=length; fixed= 1; } #endif Item_int(const char *str_arg,longlong i,uint length) :value(i) { max_length=length; name=(char*) str_arg; fixed= 1; } @@ -956,6 +975,8 @@ public: void cleanup() {} void print(String *str); Item_num *neg() { value= -value; return this; } + uint decimal_precision() const { return (uint)(max_length - test(value < 0)); } + bool eq(const Item *, bool binary_cmp) const; }; @@ -974,6 +995,7 @@ class Item_uint :public Item_int { public: Item_uint(const char *str_arg, uint length); + Item_uint(const char *str_arg, longlong i, uint length); Item_uint(uint32 i) :Item_int((longlong) i, 10) { unsigned_flag= 1; } double val_real() @@ -983,6 +1005,7 @@ public: int save_in_field(Field *field, bool no_conversions); void print(String *str); Item_num *neg (); + uint decimal_precision() const { return max_length; } }; @@ -1022,8 +1045,11 @@ public: unsigned_flag= !decimal_value.sign(); return this; } + uint decimal_precision() const { return decimal_value.precision(); } + bool eq(const Item *, bool binary_cmp) const; }; + class Item_float :public Item_num { char *presentation; @@ -1059,6 +1085,7 @@ public: { return new Item_float(name, value, decimals, max_length); } Item_num *neg() { value= -value; return this; } void print(String *str); + bool eq(const Item *, bool binary_cmp) const; }; @@ -1198,6 +1225,7 @@ public: enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } // to prevent drop fixed flag (no need parent cleanup call) void cleanup() {} + bool eq(const Item *item, bool binary_cmp) const; }; @@ -1376,11 +1404,7 @@ public: { return ref->save_in_field(field, no_conversions); } - Item *new_item() - { - return (ref->unsigned_flag)? new Item_uint(ref->name, ref->max_length) : - new Item_int(ref->name, ref->max_length); - } + Item *new_item(); }; @@ -1784,6 +1808,9 @@ protected: enum_field_types fld_type; void get_full_info(Item *item); + + /* It is used to count decimal precision in join_types */ + int prev_decimal_int_part; public: Item_type_holder(THD*, Item*); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 66354560756..8c44972e469 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1134,6 +1134,14 @@ Item_func_ifnull::fix_length_and_dec() cached_field_type= Item_func::field_type(); } + +uint Item_func_ifnull::decimal_precision() const +{ + int max_int_part=max(args[0]->decimal_int_part(),args[1]->decimal_int_part()); + return min(max_int_part + decimals, DECIMAL_MAX_PRECISION); +} + + enum_field_types Item_func_ifnull::field_type() const { return cached_field_type; @@ -1251,6 +1259,14 @@ Item_func_if::fix_length_and_dec() } +uint Item_func_if::decimal_precision() const +{ + int precision=(max(args[1]->decimal_int_part(),args[2]->decimal_int_part())+ + decimals); + return min(precision, DECIMAL_MAX_PRECISION); +} + + double Item_func_if::val_real() { @@ -1304,7 +1320,8 @@ Item_func_nullif::fix_length_and_dec() { max_length=args[0]->max_length; decimals=args[0]->decimals; - agg_result_type(&cached_result_type, args, 2); + unsigned_flag= args[0]->unsigned_flag; + cached_result_type= args[0]->result_type(); if (cached_result_type == STRING_RESULT && agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV)) return; @@ -1616,6 +1633,18 @@ void Item_func_case::fix_length_and_dec() } +uint Item_func_case::decimal_precision() const +{ + int max_int_part=0; + for (uint i=0 ; i < ncases ; i+=2) + set_if_bigger(max_int_part, args[i+1]->decimal_int_part()); + + if (else_expr_num != -1) + set_if_bigger(max_int_part, args[else_expr_num]->decimal_int_part()); + return min(max_int_part + decimals, DECIMAL_MAX_PRECISION); +} + + /* TODO: Fix this so that it prints the whole CASE expression */ void Item_func_case::print(String *str) diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index e917e13c5aa..78357c457cb 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -95,6 +95,7 @@ public: Item_bool_func(THD *thd, Item_bool_func *item) :Item_int_func(thd, item) {} bool is_bool_func() { return 1; } void fix_length_and_dec() { decimals=0; max_length=1; } + uint decimal_precision() const { return 1; } }; class Item_cache; @@ -208,6 +209,7 @@ public: bool is_null() { return test(args[0]->is_null() || args[1]->is_null()); } bool is_bool_func() { return 1; } CHARSET_INFO *compare_collation() { return cmp.cmp_collation.collation; } + uint decimal_precision() const { return 1; } friend class Arg_comparator; }; @@ -411,6 +413,7 @@ public: void fix_length_and_dec(); void print(String *str); CHARSET_INFO *compare_collation() { return cmp_collation.collation; } + uint decimal_precision() const { return 1; } }; @@ -445,6 +448,7 @@ public: longlong val_int(); void fix_length_and_dec(); const char *func_name() const { return "interval"; } + uint decimal_precision() const { return 2; } }; @@ -485,6 +489,7 @@ public: void fix_length_and_dec(); const char *func_name() const { return "ifnull"; } Field *tmp_table_field(TABLE *table); + uint decimal_precision() const; }; @@ -507,6 +512,7 @@ public: return Item_func::fix_fields(thd, tlist, ref); } void fix_length_and_dec(); + uint decimal_precision() const; const char *func_name() const { return "if"; } table_map not_null_tables() const { return 0; } }; @@ -525,6 +531,7 @@ public: my_decimal *val_decimal(my_decimal *); enum Item_result result_type () const { return cached_result_type; } void fix_length_and_dec(); + uint decimal_precision() const { return args[0]->decimal_precision(); } const char *func_name() const { return "nullif"; } void print(String *str) { Item_func::print(str); } table_map not_null_tables() const { return 0; } @@ -563,6 +570,7 @@ public: String *val_str(String *); my_decimal *val_decimal(my_decimal *); void fix_length_and_dec(); + uint decimal_precision() const; table_map not_null_tables() const { return 0; } enum Item_result result_type () const { return cached_result_type; } const char *func_name() const { return "case"; } @@ -825,6 +833,7 @@ class Item_func_in :public Item_int_func } longlong val_int(); void fix_length_and_dec(); + uint decimal_precision() const { return 1; } void cleanup() { DBUG_ENTER("Item_func_in::cleanup"); diff --git a/sql/item_func.cc b/sql/item_func.cc index 4e3011ac4bb..edb4513b2d7 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -534,8 +534,10 @@ Field *Item_func::tmp_table_field(TABLE *t_arg) res= make_string_field(t_arg); break; case DECIMAL_RESULT: - res= new Field_new_decimal(max_length + (decimals?1:0), maybe_null, - name, t_arg, decimals); + res= new Field_new_decimal(my_decimal_precision_to_length(decimal_precision(), + decimals, + unsigned_flag), + maybe_null, name, t_arg, decimals, unsigned_flag); break; case ROW_RESULT: default: @@ -590,19 +592,18 @@ void Item_func_numhybrid::fix_num_length_and_dec() void Item_func::count_decimal_length() { - uint32 length= 0; + int max_int_part= 0; decimals= 0; + unsigned_flag= 1; for (uint i=0 ; i < arg_count ; i++) { set_if_bigger(decimals, args[i]->decimals); - set_if_bigger(length, (args[i]->max_length - args[i]->decimals)); + set_if_bigger(max_int_part, args[i]->decimal_int_part()); + set_if_smaller(unsigned_flag, args[i]->unsigned_flag); } - max_length= length; - length+= decimals; - if (length < max_length) // If previous operation gave overflow - max_length= UINT_MAX32; - else - max_length= length; + int precision= min(max_int_part + decimals, DECIMAL_MAX_PRECISION); + max_length= my_decimal_precision_to_length(precision, decimals, + unsigned_flag); } @@ -616,8 +617,12 @@ void Item_func::count_decimal_length() void Item_func::count_only_length() { max_length= 0; + unsigned_flag= 0; for (uint i=0 ; i < arg_count ; i++) + { set_if_bigger(max_length, args[i]->max_length); + set_if_bigger(unsigned_flag, args[i]->unsigned_flag); + } } @@ -719,7 +724,6 @@ void Item_num_op::find_num_type(void) { decimals= 0; hybrid_type=INT_RESULT; - unsigned_flag=args[0]->unsigned_flag | args[1]->unsigned_flag; result_precision(); } DBUG_PRINT("info", ("Type: %s", @@ -1075,9 +1079,17 @@ my_decimal *Item_func_plus::decimal_op(my_decimal *decimal_value) void Item_func_additive_op::result_precision() { decimals= max(args[0]->decimals, args[1]->decimals); - max_length= (max(args[0]->max_length - args[0]->decimals, - args[1]->max_length - args[1]->decimals) + - decimals + 1); + int max_int_part= max(args[0]->decimal_precision() - args[0]->decimals, + args[1]->decimal_precision() - args[1]->decimals); + int precision= min(max_int_part + 1 + decimals, DECIMAL_MAX_PRECISION); + + /* Integer operations keep unsigned_flag if one of arguments is unsigned */ + if (result_type() == INT_RESULT) + unsigned_flag= args[0]->unsigned_flag | args[1]->unsigned_flag; + else + unsigned_flag= args[0]->unsigned_flag & args[1]->unsigned_flag; + max_length= my_decimal_precision_to_length(precision, decimals, + unsigned_flag); } @@ -1172,10 +1184,15 @@ my_decimal *Item_func_mul::decimal_op(my_decimal *decimal_value) void Item_func_mul::result_precision() { - decimals= args[0]->decimals + args[1]->decimals; - max_length= ((args[0]->max_length - args[0]->decimals) + - (args[1]->max_length - args[1]->decimals) + - decimals); + /* Integer operations keep unsigned_flag if one of arguments is unsigned */ + if (result_type() == INT_RESULT) + unsigned_flag= args[0]->unsigned_flag | args[1]->unsigned_flag; + else + unsigned_flag= args[0]->unsigned_flag & args[1]->unsigned_flag; + decimals= min(args[0]->decimals + args[1]->decimals, DECIMAL_MAX_SCALE); + int precision= min(args[0]->decimal_precision() + args[1]->decimal_precision(), + DECIMAL_MAX_PRECISION); + max_length= my_decimal_precision_to_length(precision, decimals,unsigned_flag); } @@ -1207,7 +1224,7 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value) if ((null_value= args[1]->null_value)) return 0; switch (my_decimal_div(E_DEC_FATAL_ERROR & ~E_DEC_DIV_ZERO, decimal_value, - val1, val2, DECIMAL_DIV_SCALE_INCREASE)) { + val1, val2, prec_increment)) { case E_DEC_TRUNCATED: case E_DEC_OK: return decimal_value; @@ -1222,11 +1239,16 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value) void Item_func_div::result_precision() { - decimals= (args[0]->decimals + args[0]->decimals + - DECIMAL_DIV_SCALE_INCREASE); - max_length= ((args[0]->max_length - args[0]->decimals) + - (args[1]->max_length - args[1]->decimals) + - decimals); + uint precision=min(args[0]->decimal_precision() + prec_increment, + DECIMAL_MAX_PRECISION); + /* Integer operations keep unsigned_flag if one of arguments is unsigned */ + if (result_type() == INT_RESULT) + unsigned_flag= args[0]->unsigned_flag | args[1]->unsigned_flag; + else + unsigned_flag= args[0]->unsigned_flag & args[1]->unsigned_flag; + decimals= min(args[0]->decimals + prec_increment, DECIMAL_MAX_SCALE); + max_length= my_decimal_precision_to_length(precision, decimals, + unsigned_flag); } @@ -1234,10 +1256,11 @@ void Item_func_div::fix_length_and_dec() { DBUG_ENTER("Item_func_div::fix_length_and_dec"); Item_num_op::fix_length_and_dec(); + prec_increment= current_thd->variables.div_precincrement; switch(hybrid_type) { case REAL_RESULT: { - decimals=max(args[0]->decimals,args[1]->decimals)+2; + decimals=max(args[0]->decimals,args[1]->decimals)+prec_increment; set_if_smaller(decimals, NOT_FIXED_DEC); max_length=args[0]->max_length - args[0]->decimals + decimals; uint tmp=float_length(decimals); @@ -1383,7 +1406,6 @@ void Item_func_neg::fix_num_length_and_dec() decimals= args[0]->decimals; /* 1 add because sign can appear */ max_length= args[0]->max_length + 1; - unsigned_flag= 0; } @@ -1395,11 +1417,12 @@ void Item_func_neg::fix_length_and_dec() /* If this is in integer context keep the context as integer if possible (This is how multiplication and other integer functions works) + Use val() to get value as arg_type doesn't mean that item is + Item_int or Item_real due to existence of Item_param. */ if (hybrid_type == INT_RESULT && args[0]->type() == INT_ITEM && - ((ulonglong) ((Item_uint*) args[0])->value >= - (ulonglong) LONGLONG_MIN)) + ((ulonglong) args[0]->val_int() >= (ulonglong) LONGLONG_MIN)) { /* Ensure that result is converted to DECIMAL, as longlong can't hold @@ -1408,6 +1431,7 @@ void Item_func_neg::fix_length_and_dec() hybrid_type= DECIMAL_RESULT; DBUG_PRINT("info", ("Type changed: DECIMAL_RESULT")); } + unsigned_flag= 0; DBUG_VOID_RETURN; } @@ -1792,17 +1816,65 @@ my_decimal *Item_func_floor::decimal_op(my_decimal *decimal_value) } -void Item_func_round::fix_num_length_and_dec() +void Item_func_round::fix_length_and_dec() { - max_length= args[0]->max_length; - decimals= NOT_FIXED_DEC; - if (args[1]->const_item()) + unsigned_flag= args[0]->unsigned_flag; + if (!args[1]->const_item()) { - int tmp=(int) args[1]->val_int(); - if (tmp < 0) - decimals=0; + max_length= args[0]->max_length; + decimals= args[0]->decimals; + hybrid_type= REAL_RESULT; + return; + } + + int decimals_to_set= max(args[1]->val_int(), 0); + if (args[0]->decimals == NOT_FIXED_DEC) + { + max_length= args[0]->max_length; + decimals= min(decimals_to_set, NOT_FIXED_DEC); + hybrid_type= REAL_RESULT; + return; + } + + switch (args[0]->result_type()) + { + case REAL_RESULT: + case STRING_RESULT: + hybrid_type= REAL_RESULT; + decimals= min(decimals_to_set, NOT_FIXED_DEC); + max_length= float_length(decimals); + break; + case INT_RESULT: + if (truncate || (args[0]->decimal_precision() < DECIMAL_LONGLONG_DIGITS)) + { + /* Here we can keep INT_RESULT */ + hybrid_type= INT_RESULT; + int length_can_increase= !truncate && (args[1]->val_int() < 0); + max_length= args[0]->max_length + length_can_increase; + decimals= 0; + break; + } + case DECIMAL_RESULT: + { + hybrid_type= DECIMAL_RESULT; + int decimals_delta= args[0]->decimals - decimals_to_set; + int precision= args[0]->decimal_precision(); + if (decimals_delta > 0) + { + int length_increase= truncate ? 0:1; + precision-= decimals_delta - length_increase; + decimals= decimals_to_set; + } else - decimals=min(tmp, NOT_FIXED_DEC); + /* Decimals to set is bigger that the original scale */ + /* we keep original decimals value */ + decimals= args[0]->decimals; + max_length= my_decimal_precision_to_length(precision, decimals, + unsigned_flag); + break; + } + default: + DBUG_ASSERT(0); /* This result type isn't handled */ } } @@ -1880,7 +1952,9 @@ my_decimal *Item_func_round::decimal_op(my_decimal *decimal_value) my_decimal val, *value= args[0]->val_decimal(&val); int dec=(int) args[1]->val_int(); if (dec > 0) - decimals= dec; // to get correct output + { + decimals= min(dec, DECIMAL_MAX_SCALE); // to get correct output + } if ((null_value= (args[0]->null_value || args[1]->null_value || my_decimal_round(E_DEC_FATAL_ERROR, value, dec, truncate, decimal_value) > 1))) @@ -1972,6 +2046,7 @@ double Item_func_units::val_real() void Item_func_min_max::fix_length_and_dec() { + int max_int_part=0; decimals=0; max_length=0; maybe_null=1; @@ -1981,12 +2056,16 @@ void Item_func_min_max::fix_length_and_dec() { set_if_bigger(max_length, args[i]->max_length); set_if_bigger(decimals, args[i]->decimals); + set_if_bigger(max_int_part, args[i]->decimal_int_part()); if (!args[i]->maybe_null) maybe_null=0; cmp_type=item_cmp_type(cmp_type,args[i]->result_type()); } if (cmp_type == STRING_RESULT) agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV); + else if ((cmp_type == DECIMAL_RESULT) || (cmp_type == INT_RESULT)) + max_length= my_decimal_precision_to_length(max_int_part+decimals, decimals, + unsigned_flag); } @@ -3913,15 +3992,17 @@ void Item_func_get_user_var::fix_length_and_dec() switch (var_entry->type) { case REAL_RESULT: max_length= DBL_DIG + 8; + break; case INT_RESULT: max_length= MAX_BIGINT_WIDTH; + decimals=0; break; case STRING_RESULT: max_length= MAX_BLOB_WIDTH; break; case DECIMAL_RESULT: - max_length= DECIMAL_MAX_LENGTH; - decimals= min(DECIMAL_MAX_LENGTH / 2, NOT_FIXED_DEC - 1); + max_length= DECIMAL_MAX_STR_LENGTH; + decimals= DECIMAL_MAX_SCALE; break; case ROW_RESULT: // Keep compiler happy default: @@ -4670,9 +4751,24 @@ Item_func_sp::execute(Item **itp) DBUG_RETURN(-1); } #endif + /* + Like for SPs, we don't binlog the substatements. If the statement which + called this function is an update statement, it will be binlogged; but if + it's not (e.g. SELECT myfunc()) it won't be binlogged (documented known + problem). + */ + tmp_disable_binlog(thd); /* don't binlog the substatements */ res= m_sp->execute_function(thd, args, arg_count, itp); + reenable_binlog(thd); + if (res && mysql_bin_log.is_open() && + (m_sp->m_chistics->daccess == SP_CONTAINS_SQL || + m_sp->m_chistics->daccess == SP_MODIFIES_SQL_DATA)) + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_FAILED_ROUTINE_BREAK_BINLOG, + ER(ER_FAILED_ROUTINE_BREAK_BINLOG)); + #ifndef NO_EMBEDDED_ACCESS_CHECKS sp_restore_security_context(thd, m_sp, &save_ctx); #endif @@ -4757,7 +4853,7 @@ Item_func_sp::fix_length_and_dec() if (result_field) { decimals= result_field->decimals(); - max_length= result_field->representation_length(); + max_length= result_field->field_length; DBUG_VOID_RETURN; } @@ -4769,29 +4865,12 @@ Item_func_sp::fix_length_and_dec() } else { - if (!field) - field= sp_result_field(); - + field= sp_result_field(); decimals= field->decimals(); - max_length= field->representation_length(); - - switch (field->result_type()) { - case STRING_RESULT: - maybe_null= 1; - case REAL_RESULT: - case INT_RESULT: - case DECIMAL_RESULT: - break; - case ROW_RESULT: - default: - // This case should never be chosen - DBUG_ASSERT(0); - break; - } - - if (field != result_field) - delete field; + max_length= field->field_length; + maybe_null= 1; } + delete field; DBUG_VOID_RETURN; } diff --git a/sql/item_func.h b/sql/item_func.h index 76d1151f3bf..57faa05ce23 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -267,6 +267,8 @@ public: void fix_length_and_dec() { max_length=args[0]->max_length; unsigned_flag=0; } void print(String *str); + uint decimal_precision() const { return args[0]->decimal_precision(); } + }; @@ -296,7 +298,7 @@ public: longlong val_int(); my_decimal *val_decimal(my_decimal*); enum Item_result result_type () const { return DECIMAL_RESULT; } - enum_field_types field_type() const { return MYSQL_TYPE_DECIMAL; } + enum_field_types field_type() const { return MYSQL_TYPE_NEWDECIMAL; } void fix_length_and_dec() {}; }; @@ -346,6 +348,7 @@ public: class Item_func_div :public Item_num_op { public: + uint prec_increment; Item_func_div(Item *a,Item *b) :Item_num_op(a,b) {} longlong int_op() { DBUG_ASSERT(0); return 0; } double real_op(); @@ -390,6 +393,7 @@ public: const char *func_name() const { return "-"; } void fix_length_and_dec(); void fix_num_length_and_dec(); + uint decimal_precision() const { return args[0]->decimal_precision(); } }; @@ -593,7 +597,7 @@ public: double real_op(); longlong int_op(); my_decimal *decimal_op(my_decimal *); - void fix_num_length_and_dec(); + void fix_length_and_dec(); }; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 3dd4b6618a2..a7bc08ea170 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -156,8 +156,8 @@ Field *Item_sum::create_tmp_field(bool group, TABLE *table, collation.collation); return make_string_field(table); case DECIMAL_RESULT: - return new Field_new_decimal(max_length - (decimals?1:0), - maybe_null, name, table, decimals); + return new Field_new_decimal(max_length, maybe_null, name, table, + decimals, unsigned_flag); case ROW_RESULT: default: // This case should never be choosen @@ -372,13 +372,16 @@ void Item_sum_sum::fix_length_and_dec() break; case INT_RESULT: case DECIMAL_RESULT: + { /* SUM result can't be longer than length(arg) + length(MAX_ROWS) */ - max_length= min(args[0]->max_length + DECIMAL_LONGLONG_DIGITS, - DECIMAL_MAX_LENGTH); + int precision= args[0]->decimal_precision() + DECIMAL_LONGLONG_DIGITS; + max_length= my_decimal_precision_to_length(precision, decimals, + unsigned_flag); curr_dec_buff= 0; hybrid_type= DECIMAL_RESULT; my_decimal_set_zero(dec_buffs); break; + } case ROW_RESULT: default: DBUG_ASSERT(0); @@ -725,11 +728,12 @@ void Item_sum_avg_distinct::fix_length_and_dec() { Item_sum_distinct::fix_length_and_dec(); + prec_increment= current_thd->variables.div_precincrement; /* AVG() will divide val by count. We need to reserve digits after decimal point as the result can be fractional. */ - decimals= min(decimals + 4, NOT_FIXED_DEC); + decimals= min(decimals + prec_increment, NOT_FIXED_DEC); } @@ -790,14 +794,19 @@ void Item_sum_avg::fix_length_and_dec() { Item_sum_sum::fix_length_and_dec(); maybe_null=null_value=1; - decimals= min(args[0]->decimals + 4, NOT_FIXED_DEC); + prec_increment= current_thd->variables.div_precincrement; if (hybrid_type == DECIMAL_RESULT) { - f_scale= args[0]->decimals; - max_length= DECIMAL_MAX_LENGTH + (f_scale ? 1 : 0); - f_precision= DECIMAL_MAX_LENGTH; + int precision= args[0]->decimal_precision() + prec_increment; + decimals= min(args[0]->decimals + prec_increment, DECIMAL_MAX_SCALE); + max_length= my_decimal_precision_to_length(precision, decimals, + unsigned_flag); + f_precision= min(precision+DECIMAL_LONGLONG_DIGITS, DECIMAL_MAX_PRECISION); + f_scale= args[0]->decimals; dec_bin_size= my_decimal_get_binary_size(f_precision, f_scale); } + else + decimals= min(args[0]->decimals + prec_increment, NOT_FIXED_DEC); } @@ -822,8 +831,8 @@ Field *Item_sum_avg::create_tmp_field(bool group, TABLE *table, 0, name, table, &my_charset_bin); } if (hybrid_type == DECIMAL_RESULT) - return new Field_new_decimal(f_precision, - maybe_null, name, table, f_scale); + return new Field_new_decimal(max_length, maybe_null, name, table, + decimals, unsigned_flag); return new Field_double(max_length, maybe_null, name, table, decimals); } @@ -868,7 +877,7 @@ my_decimal *Item_sum_avg::val_decimal(my_decimal *val) } sum_dec= Item_sum_sum::val_decimal(&sum); int2my_decimal(E_DEC_FATAL_ERROR, count, 0, &cnt); - my_decimal_div(E_DEC_FATAL_ERROR, val, sum_dec, &cnt, 4); + my_decimal_div(E_DEC_FATAL_ERROR, val, sum_dec, &cnt, prec_increment); return val; } @@ -905,7 +914,8 @@ Item *Item_sum_std::copy_or_same(THD* thd) Item_sum_variance::Item_sum_variance(THD *thd, Item_sum_variance *item): Item_sum_num(thd, item), hybrid_type(item->hybrid_type), - cur_dec(item->cur_dec), count(item->count), sample(item->sample) + cur_dec(item->cur_dec), count(item->count), sample(item->sample), + prec_increment(item->prec_increment) { if (hybrid_type == DECIMAL_RESULT) { @@ -929,20 +939,21 @@ void Item_sum_variance::fix_length_and_dec() { DBUG_ENTER("Item_sum_variance::fix_length_and_dec"); maybe_null= null_value= 1; - decimals= min(args[0]->decimals + 4, NOT_FIXED_DEC); + prec_increment= current_thd->variables.div_precincrement; switch (args[0]->result_type()) { case REAL_RESULT: case STRING_RESULT: + decimals= min(args[0]->decimals + 4, NOT_FIXED_DEC); hybrid_type= REAL_RESULT; sum= 0.0; break; case INT_RESULT: case DECIMAL_RESULT: - /* - SUM result can't be longer than length(arg)*2 + - digits_after_the_point_to_add - */ - max_length= args[0]->max_length*2 + 4; + { + int precision= args[0]->decimal_precision()*2 + prec_increment; + decimals= min(args[0]->decimals + prec_increment, DECIMAL_MAX_SCALE); + max_length= my_decimal_precision_to_length(precision, decimals, + unsigned_flag); cur_dec= 0; hybrid_type= DECIMAL_RESULT; my_decimal_set_zero(dec_sum); @@ -954,12 +965,15 @@ void Item_sum_variance::fix_length_and_dec() column_value * column_value */ f_scale0= args[0]->decimals; - f_precision0= DECIMAL_MAX_LENGTH / 2; - f_scale1= min(f_scale0 * 2, NOT_FIXED_DEC - 1); - f_precision1= DECIMAL_MAX_LENGTH; + f_precision0= min(args[0]->decimal_precision() + DECIMAL_LONGLONG_DIGITS, + DECIMAL_MAX_PRECISION); + f_scale1= min(args[0]->decimals * 2, DECIMAL_MAX_SCALE); + f_precision1= min(args[0]->decimal_precision()*2 + DECIMAL_LONGLONG_DIGITS, + DECIMAL_MAX_PRECISION); dec_bin_size0= my_decimal_get_binary_size(f_precision0, f_scale0); dec_bin_size1= my_decimal_get_binary_size(f_precision1, f_scale1); break; + } case ROW_RESULT: default: DBUG_ASSERT(0); @@ -997,8 +1011,8 @@ Field *Item_sum_variance::create_tmp_field(bool group, TABLE *table, 0, name, table, &my_charset_bin); } if (hybrid_type == DECIMAL_RESULT) - return new Field_new_decimal(DECIMAL_MAX_LENGTH, - maybe_null, name, table, f_scale1 + 4); + return new Field_new_decimal(max_length, maybe_null, name, table, + decimals, unsigned_flag); return new Field_double(max_length, maybe_null,name,table,decimals); } @@ -1083,9 +1097,11 @@ my_decimal *Item_sum_variance::val_decimal(my_decimal *dec_buf) int2my_decimal(E_DEC_FATAL_ERROR, count-sample, 0, &count1_buf); my_decimal_mul(E_DEC_FATAL_ERROR, &sum_sqr_buf, dec_sum+cur_dec, dec_sum+cur_dec); - my_decimal_div(E_DEC_FATAL_ERROR, dec_buf, &sum_sqr_buf, &count_buf, 2); + my_decimal_div(E_DEC_FATAL_ERROR, dec_buf, + &sum_sqr_buf, &count_buf, prec_increment); my_decimal_sub(E_DEC_FATAL_ERROR, &sum_sqr_buf, dec_sqr+cur_dec, dec_buf); - my_decimal_div(E_DEC_FATAL_ERROR, dec_buf, &sum_sqr_buf, &count1_buf, 2); + my_decimal_div(E_DEC_FATAL_ERROR, dec_buf, + &sum_sqr_buf, &count1_buf, prec_increment); return dec_buf; } @@ -1929,10 +1945,12 @@ Item_avg_field::Item_avg_field(Item_result res_type, Item_sum_avg *item) { name=item->name; decimals=item->decimals; - max_length=item->max_length; + max_length= item->max_length; + unsigned_flag= item->unsigned_flag; field=item->result_field; maybe_null=1; hybrid_type= res_type; + prec_increment= item->prec_increment; if (hybrid_type == DECIMAL_RESULT) { f_scale= item->f_scale; @@ -1941,7 +1959,6 @@ Item_avg_field::Item_avg_field(Item_result res_type, Item_sum_avg *item) } } - double Item_avg_field::val_real() { // fix_fields() never calls for this Item @@ -1982,7 +1999,8 @@ my_decimal *Item_avg_field::val_decimal(my_decimal *dec_buf) binary2my_decimal(E_DEC_FATAL_ERROR, field->ptr, &dec_field, f_precision, f_scale); int2my_decimal(E_DEC_FATAL_ERROR, count, 0, &dec_count); - my_decimal_div(E_DEC_FATAL_ERROR, dec_buf, &dec_field, &dec_count, 4); + my_decimal_div(E_DEC_FATAL_ERROR, dec_buf, + &dec_field, &dec_count, prec_increment); return dec_buf; } @@ -2054,9 +2072,11 @@ Item_variance_field::Item_variance_field(Item_sum_variance *item) name=item->name; decimals=item->decimals; max_length=item->max_length; + unsigned_flag= item->unsigned_flag; field=item->result_field; maybe_null=1; sample= item->sample; + prec_increment= item->prec_increment; if ((hybrid_type= item->hybrid_type) == DECIMAL_RESULT) { f_scale0= item->f_scale0; @@ -2116,9 +2136,10 @@ my_decimal *Item_variance_field::val_decimal(my_decimal *dec_buf) binary2my_decimal(E_DEC_FATAL_ERROR, field->ptr+dec_bin_size0, &dec_sqr, f_precision1, f_scale1); my_decimal_mul(E_DEC_FATAL_ERROR, &tmp, &dec_sum, &dec_sum); - my_decimal_div(E_DEC_FATAL_ERROR, dec_buf, &tmp, &dec_count, 2); + my_decimal_div(E_DEC_FATAL_ERROR, dec_buf, &tmp, &dec_count, prec_increment); my_decimal_sub(E_DEC_FATAL_ERROR, &dec_sum, &dec_sqr, dec_buf); - my_decimal_div(E_DEC_FATAL_ERROR, dec_buf, &dec_sum, &dec1_count, 2); + my_decimal_div(E_DEC_FATAL_ERROR, dec_buf, + &dec_sum, &dec1_count, prec_increment); return dec_buf; } diff --git a/sql/item_sum.h b/sql/item_sum.h index 8c8360b0726..fb72fed1c5e 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -237,6 +237,7 @@ private: Item_sum_avg_distinct(THD *thd, Item_sum_avg_distinct *original) :Item_sum_distinct(thd, original) {} public: + uint prec_increment; Item_sum_avg_distinct(Item *item_arg) : Item_sum_distinct(item_arg) {} void fix_length_and_dec(); @@ -343,8 +344,8 @@ class Item_avg_field :public Item_result_field public: Field *field; Item_result hybrid_type; - uint f_precision, f_scale; - uint dec_bin_size; + uint f_precision, f_scale, dec_bin_size; + uint prec_increment; Item_avg_field(Item_result res_type, Item_sum_avg *item); enum Type type() const { return FIELD_AVG_ITEM; } double val_real(); @@ -366,12 +367,14 @@ class Item_sum_avg :public Item_sum_sum { public: ulonglong count; - uint f_precision, f_scale; - uint dec_bin_size; + uint prec_increment; + uint f_precision, f_scale, dec_bin_size; Item_sum_avg(Item *item_par) :Item_sum_sum(item_par), count(0) {} Item_sum_avg(THD *thd, Item_sum_avg *item) - :Item_sum_sum(thd, item), count(item->count) {} + :Item_sum_sum(thd, item), count(item->count), + prec_increment(item->prec_increment) {} + void fix_length_and_dec(); enum Sumfunctype sum_func () const {return AVG_FUNC;} void clear(); @@ -402,6 +405,7 @@ public: uint f_precision1, f_scale1; uint dec_bin_size0, dec_bin_size1; uint sample; + uint prec_increment; Item_variance_field(Item_sum_variance *item); enum Type type() const {return FIELD_VARIANCE_ITEM; } double val_real(); @@ -446,6 +450,7 @@ public: uint f_precision1, f_scale1; uint dec_bin_size0, dec_bin_size1; uint sample; + uint prec_increment; Item_sum_variance(Item *item_par, uint sample_arg) :Item_sum_num(item_par), hybrid_type(REAL_RESULT), cur_dec(0), count(0), sample(sample_arg) diff --git a/sql/key.cc b/sql/key.cc index 3299c3db8f8..4bd71d2fa47 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -197,12 +197,6 @@ void key_restore(byte *to_record, byte *from_key, KEY *key_info, (key_part->null_bit == 128), field->bit_ofs, field->bit_len); } - else - { - clr_rec_bits(to_record + key_part->null_offset + - (key_part->null_bit == 128), - field->bit_ofs, field->bit_len); - } } if (key_part->key_part_flag & HA_BLOB_PART) { diff --git a/sql/log_event.cc b/sql/log_event.cc index 4189bf2a787..5186d5b1a9a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -956,6 +956,18 @@ void Query_log_event::pack_info(Protocol *protocol) #ifndef MYSQL_CLIENT +/* Utility function for the next method */ +static void write_str_with_code_and_len(char **dst, const char *src, + int len, uint code) +{ + DBUG_ASSERT(src); + *((*dst)++)= code; + *((*dst)++)= (uchar) len; + bmove(*dst, src, len); + (*dst)+= len; +} + + /* Query_log_event::write() @@ -1040,12 +1052,10 @@ bool Query_log_event::write(IO_CACHE* file) int8store(start, (ulonglong)sql_mode); start+= 8; } - if (catalog_len) // i.e. "catalog inited" (false for 4.0 events) + if (catalog_len) // i.e. this var is inited (false for 4.0 events) { - *start++= Q_CATALOG_NZ_CODE; - *start++= (uchar) catalog_len; - bmove(start, catalog, catalog_len); - start+= catalog_len; + write_str_with_code_and_len((char **)(&start), + catalog, catalog_len, Q_CATALOG_NZ_CODE); /* In 5.0.x where x<4 masters we used to store the end zero here. This was a waste of one byte so we don't do it in x>=4 masters. We change code to @@ -1177,6 +1187,25 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, #endif /* MYSQL_CLIENT */ +/* 2 utility functions for the next method */ + +static void get_str_len_and_pointer(const char **dst, const char **src, uint *len) +{ + if ((*len= **src)) + *dst= *src + 1; // Will be copied later + (*src)+= *len+1; +} + + +static void copy_str_and_move(char **dst, const char **src, uint len) +{ + memcpy(*dst, *src, len); + *src= *dst; + (*dst)+= len; + *(*dst)++= 0; +} + + /* Query_log_event::Query_log_event() This is used by the SQL slave thread to prepare the event before execution. @@ -1265,9 +1294,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, break; } case Q_CATALOG_NZ_CODE: - if ((catalog_len= *pos)) - catalog= (char*) pos+1; // Will be copied later - pos+= catalog_len+1; + get_str_len_and_pointer(&catalog, (const char **)(&pos), &catalog_len); break; case Q_AUTO_INCREMENT: auto_increment_increment= uint2korr(pos); @@ -1283,9 +1310,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, } case Q_TIME_ZONE_CODE: { - if ((time_zone_len= *pos)) - time_zone_str= (char *)(pos+1); - pos+= time_zone_len+1; + get_str_len_and_pointer(&time_zone_str, (const char **)(&pos), &time_zone_len); break; } case Q_CATALOG_CODE: /* for 5.0.x where 0<=x<=3 masters */ @@ -1309,12 +1334,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, if (catalog_len) // If catalog is given { if (likely(catalog_nz)) // true except if event comes from 5.0.0|1|2|3. - { - memcpy(start, catalog, catalog_len); - catalog= start; - start+= catalog_len; - *start++= 0; - } + copy_str_and_move(&start, &catalog, catalog_len); else { memcpy(start, catalog, catalog_len+1); // copy end 0 @@ -1323,12 +1343,8 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, } } if (time_zone_len) - { - memcpy(start, time_zone_str, time_zone_len); - time_zone_str= start; - start+= time_zone_len; - *start++= 0; - } + copy_str_and_move(&start, &time_zone_str, time_zone_len); + /* A 2nd variable part; this is common to all versions */ memcpy((char*) start, end, data_len); // Copy db and query start[data_len]= '\0'; // End query with \0 (For safetly) diff --git a/sql/log_event.h b/sql/log_event.h index 2985fcabb50..f8989c4994a 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -234,13 +234,12 @@ struct sql_ex_info /* these are codes, not offsets; not more than 256 values (1 byte). */ #define Q_FLAGS2_CODE 0 #define Q_SQL_MODE_CODE 1 -#ifndef TO_BE_DELETED /* Q_CATALOG_CODE is catalog with end zero stored; it is used only by MySQL - 5.0.x where 0<=x<=3. + 5.0.x where 0<=x<=3. We have to keep it to be able to replicate these + old masters. */ #define Q_CATALOG_CODE 2 -#endif #define Q_AUTO_INCREMENT 3 #define Q_CHARSET_CODE 4 #define Q_TIME_ZONE_CODE 5 diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc index b4bbef4a637..14c15cdc4ef 100644 --- a/sql/my_decimal.cc +++ b/sql/my_decimal.cc @@ -81,7 +81,7 @@ int decimal_operation_results(int result) */ int my_decimal2string(uint mask, const my_decimal *d, - int fixed_prec, int fixed_dec, + uint fixed_prec, uint fixed_dec, char filler, String *str) { int length= (fixed_prec ? (fixed_prec + 1) : my_decimal_string_length(d)); @@ -89,7 +89,7 @@ int my_decimal2string(uint mask, const my_decimal *d, if (str->alloc(length)) return check_result(mask, E_DEC_OOM); result= decimal2string((decimal_t*) d, (char*) str->ptr(), - &length, fixed_prec, fixed_dec, + &length, (int)fixed_prec, fixed_dec, filler); str->length(length); return check_result(mask, result); @@ -123,7 +123,7 @@ int my_decimal2binary(uint mask, const my_decimal *d, char *bin, int prec, int err1= E_DEC_OK, err2; my_decimal rounded; my_decimal2decimal(d, &rounded); - decimal_optimize_fraction(&rounded); + rounded.frac= decimal_actual_fraction(&rounded); if (scale < rounded.frac) { err1= E_DEC_TRUNCATED; @@ -220,18 +220,16 @@ print_decimal_buff(const my_decimal *dec, const byte* ptr, int length) } -void dbug_print_decimal(const char *tag, const char *format, my_decimal *val) +const char *dbug_decimal_as_string(char *buff, const my_decimal *val) { - char buff[DECIMAL_MAX_STR_LENGTH]; - String str(buff, sizeof(buff), &my_charset_bin); + int length= DECIMAL_MAX_STR_LENGTH; if (!val) - str.set("NULL", 4, &my_charset_bin); - else - my_decimal2string(0, val, 0, 0, 0, &str); - DBUG_PRINT(tag, (format, (char*) str.ptr())); + return "NULL"; + (void)decimal2string((decimal_t*) val, buff, &length, 0,0,0); + return buff; } -#endif +#endif /*DBUG_OFF*/ #endif /*MYSQL_CLIENT*/ diff --git a/sql/my_decimal.h b/sql/my_decimal.h index 03801390d82..27fd33cffbe 100644 --- a/sql/my_decimal.h +++ b/sql/my_decimal.h @@ -35,27 +35,27 @@ C_MODE_END #define DECIMAL_LONG_DIGITS 10 #define DECIMAL_LONG3_DIGITS 8 -/* number of digits on which we increase scale of devision result */ -#define DECIMAL_DIV_SCALE_INCREASE 5 - /* maximum length of buffer in our big digits (uint32) */ -#define DECIMAL_BUFF_LENGTH 8 +#define DECIMAL_BUFF_LENGTH 9 /* - maximum guaranteed length of number in decimal digits (number of our + maximum guaranteed precision of number in decimal digits (number of our digits * number of decimal digits in one our big digit - number of decimal digits in one our big digit decreased on 1 (because we always put decimal point on the border of our big digits)) */ -#define DECIMAL_MAX_LENGTH ((8 * 9) - 8) +#define DECIMAL_MAX_PRECISION ((DECIMAL_BUFF_LENGTH * 9) - 8*2) +#define DECIMAL_MAX_SCALE 30 +#define DECIMAL_NOT_SPECIFIED 31 + /* maximum length of string representation (number of maximum decimal digits + 1 position for sign + 1 position for decimal point) */ -#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_LENGTH + 2) +#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_PRECISION + 2) /* maximum size of packet length */ -#define DECIMAL_MAX_FIELD_SIZE DECIMAL_MAX_LENGTH +#define DECIMAL_MAX_FIELD_SIZE DECIMAL_MAX_PRECISION inline uint my_decimal_size(uint precision, uint scale) @@ -68,6 +68,12 @@ inline uint my_decimal_size(uint precision, uint scale) } +inline int my_decimal_int_part(uint precision, uint decimals) +{ + return precision - ((decimals == DECIMAL_NOT_SPECIFIED) ? 0 : decimals); +} + + /* my_decimal class limits 'decimal_t' type to what we need in MySQL It contains internally all necessary space needed by the instance so @@ -99,15 +105,16 @@ public: bool sign() const { return decimal_t::sign; } void sign(bool s) { decimal_t::sign= s; } + uint precision() const { return intg + frac; } }; #ifndef DBUG_OFF void print_decimal(const my_decimal *dec); void print_decimal_buff(const my_decimal *dec, const byte* ptr, int length); -void dbug_print_decimal(const char *tag, const char *format, my_decimal *val); +const char *dbug_decimal_as_string(char *buff, const my_decimal *val); #else -#define dbug_print_decimal(A,B,C) +#define dbug_decimal_as_string(A) NULL #endif #ifndef MYSQL_CLIENT @@ -126,6 +133,18 @@ inline int check_result(uint mask, int result) return result; } +inline uint my_decimal_length_to_precision(uint length, uint scale, + bool unsigned_flag) +{ + return (uint) (length - (scale>0 ? 1:0) - (unsigned_flag ? 0:1)); +} + +inline uint32 my_decimal_precision_to_length(uint precision, uint8 scale, + bool unsigned_flag) +{ + set_if_smaller(precision, DECIMAL_MAX_PRECISION); + return (uint32)(precision + (scale>0 ? 1:0) + (unsigned_flag ? 0:1)); +} inline int my_decimal_string_length(const my_decimal *d) @@ -209,8 +228,8 @@ int my_decimal_ceiling(uint mask, const my_decimal *from, my_decimal *to) #ifndef MYSQL_CLIENT -int my_decimal2string(uint mask, const my_decimal *d, int fixed_prec, - int fixed_dec, char filler, String *str); +int my_decimal2string(uint mask, const my_decimal *d, uint fixed_prec, + uint fixed_dec, char filler, String *str); #endif inline @@ -326,7 +345,8 @@ int my_decimal_cmp(const my_decimal *a, const my_decimal *b) inline void max_my_decimal(my_decimal *to, int precision, int frac) { - DBUG_ASSERT(precision <= DECIMAL_MAX_LENGTH); + DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&& + (frac <= DECIMAL_MAX_SCALE)); max_decimal(precision, frac, (decimal_t*) to); } diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 0f1fbe8d83c..a7ef88e7de1 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1088,7 +1088,7 @@ extern my_bool opt_readonly, lower_case_file_system; extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs; extern my_bool opt_secure_auth; extern my_bool sp_automatic_privileges; -extern my_bool opt_old_style_user_limits; +extern my_bool opt_old_style_user_limits, trust_routine_creators; extern uint opt_crash_binlog_innodb; extern char *shared_memory_base_name, *mysqld_unix_port; extern bool opt_enable_shared_memory; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e27dbca77bb..c76331820d9 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -304,7 +304,7 @@ my_bool opt_log_queries_not_using_indexes= 0; my_bool lower_case_file_system= 0; my_bool opt_large_pages= 0; uint opt_large_page_size= 0; -my_bool opt_old_style_user_limits= 0; +my_bool opt_old_style_user_limits= 0, trust_routine_creators= 0; /* True if there is at least one per-hour limit for some user, so we should check them before each query (and possibly reset counters when hour is @@ -4172,6 +4172,7 @@ enum options_mysqld OPT_INNODB_FAST_SHUTDOWN, OPT_INNODB_FILE_PER_TABLE, OPT_CRASH_BINLOG_INNODB, OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG, + OPT_LOG_BIN_TRUST_ROUTINE_CREATORS, OPT_SAFE_SHOW_DB, OPT_INNODB_SAFE_BINLOG, OPT_INNODB, OPT_ISAM, OPT_ENGINE_CONDITION_PUSHDOWN, @@ -4220,7 +4221,8 @@ enum options_mysqld OPT_PRELOAD_BUFFER_SIZE, OPT_QUERY_CACHE_LIMIT, OPT_QUERY_CACHE_MIN_RES_UNIT, OPT_QUERY_CACHE_SIZE, OPT_QUERY_CACHE_TYPE, OPT_QUERY_CACHE_WLOCK_INVALIDATE, OPT_RECORD_BUFFER, - OPT_RECORD_RND_BUFFER, OPT_RELAY_LOG_SPACE_LIMIT, OPT_RELAY_LOG_PURGE, + OPT_RECORD_RND_BUFFER, OPT_DIV_PRECINCREMENT, OPT_RELAY_LOG_SPACE_LIMIT, + OPT_RELAY_LOG_PURGE, OPT_SLAVE_NET_TIMEOUT, OPT_SLAVE_COMPRESSED_PROTOCOL, OPT_SLOW_LAUNCH_TIME, OPT_SLAVE_TRANS_RETRIES, OPT_READONLY, OPT_DEBUGGING, OPT_SORT_BUFFER, OPT_TABLE_CACHE, @@ -4592,6 +4594,17 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, "File that holds the names for last binary log files.", (gptr*) &opt_binlog_index_name, (gptr*) &opt_binlog_index_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + /* + This option starts with "log-bin" to emphasize that it is specific of + binary logging. Hopefully in 5.1 nobody will need it anymore, when we have + row-level binlog. + */ + {"log-bin-trust-routine-creators", OPT_LOG_BIN_TRUST_ROUTINE_CREATORS, + "If equal to 0 (the default), then when --log-bin is used, creation of " + "a routine is allowed only to users having the SUPER privilege and only" + "if this routine may not break binary logging", + (gptr*) &trust_routine_creators, (gptr*) &trust_routine_creators, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"log-error", OPT_ERROR_LOG_FILE, "Error log file.", (gptr*) &log_error_file_ptr, (gptr*) &log_error_file_ptr, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, @@ -5441,6 +5454,11 @@ The minimum value for this variable is 4096.", (gptr*) &max_system_variables.read_rnd_buff_size, 0, GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE, 0}, + {"div_precision_increment", OPT_DIV_PRECINCREMENT, + "Precision of the result of '/' operator will be increased on that value.", + (gptr*) &global_system_variables.div_precincrement, + (gptr*) &max_system_variables.div_precincrement, 0, GET_ULONG, + REQUIRED_ARG, 4, 0, DECIMAL_MAX_SCALE, 0, 0, 0}, {"record_buffer", OPT_RECORD_BUFFER, "Alias for read_buffer_size", (gptr*) &global_system_variables.read_buff_size, @@ -6948,9 +6966,15 @@ static void create_pid_file() char buff[21], *end; end= int10_to_str((long) getpid(), buff, 10); *end++= '\n'; - (void) my_write(file, (byte*) buff, (uint) (end-buff),MYF(MY_WME)); + if (!my_write(file, (byte*) buff, (uint) (end-buff), MYF(MY_WME | MY_NABP))) + { + (void) my_close(file, MYF(0)); + return; + } (void) my_close(file, MYF(0)); } + sql_perror("Can't start server: can't create PID file"); + exit(1); } diff --git a/sql/set_var.cc b/sql/set_var.cc index 0e6e36f63a2..4add5d6b39b 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -203,6 +203,9 @@ sys_var_key_cache_long sys_key_cache_age_threshold("key_cache_age_threshold", param_age_threshold)); sys_var_bool_ptr sys_local_infile("local_infile", &opt_local_infile); +sys_var_bool_ptr +sys_trust_routine_creators("log_bin_trust_routine_creators", + &trust_routine_creators); sys_var_thd_ulong sys_log_warnings("log_warnings", &SV::log_warnings); sys_var_thd_ulong sys_long_query_time("long_query_time", &SV::long_query_time); @@ -295,6 +298,8 @@ sys_var_thd_ulong sys_read_buff_size("read_buffer_size", sys_var_bool_ptr sys_readonly("read_only", &opt_readonly); sys_var_thd_ulong sys_read_rnd_buff_size("read_rnd_buffer_size", &SV::read_rnd_buff_size); +sys_var_thd_ulong sys_div_precincrement("div_precision_increment", + &SV::div_precincrement); #ifdef HAVE_REPLICATION sys_var_bool_ptr sys_relay_log_purge("relay_log_purge", &relay_log_purge); @@ -567,6 +572,7 @@ sys_var *sys_variables[]= &sys_connect_timeout, &sys_date_format, &sys_datetime_format, + &sys_div_precincrement, &sys_default_week_format, &sys_delay_key_write, &sys_delayed_insert_limit, @@ -703,6 +709,7 @@ sys_var *sys_variables[]= &sys_innodb_thread_sleep_delay, &sys_innodb_thread_concurrency, #endif + &sys_trust_routine_creators, &sys_engine_condition_pushdown, #ifdef HAVE_NDBCLUSTER_DB &sys_ndb_autoincrement_prefetch_sz, @@ -754,6 +761,7 @@ struct show_var_st init_vars[]= { {"datadir", mysql_real_data_home, SHOW_CHAR}, {sys_date_format.name, (char*) &sys_date_format, SHOW_SYS}, {sys_datetime_format.name, (char*) &sys_datetime_format, SHOW_SYS}, + {sys_div_precincrement.name,(char*) &sys_div_precincrement,SHOW_SYS}, {sys_default_week_format.name, (char*) &sys_default_week_format, SHOW_SYS}, {sys_delay_key_write.name, (char*) &sys_delay_key_write, SHOW_SYS}, {sys_delayed_insert_limit.name, (char*) &sys_delayed_insert_limit,SHOW_SYS}, @@ -842,6 +850,7 @@ struct show_var_st init_vars[]= { #endif {"log", (char*) &opt_log, SHOW_BOOL}, {"log_bin", (char*) &opt_bin_log, SHOW_BOOL}, + {sys_trust_routine_creators.name,(char*) &sys_trust_routine_creators, SHOW_SYS}, {"log_error", (char*) log_error_file, SHOW_CHAR}, #ifdef HAVE_REPLICATION {"log_slave_updates", (char*) &opt_log_slave_updates, SHOW_MY_BOOL}, diff --git a/sql/share/charsets/latin2.xml b/sql/share/charsets/latin2.xml index 702f052604b..3ae239cb8fd 100644 --- a/sql/share/charsets/latin2.xml +++ b/sql/share/charsets/latin2.xml @@ -60,7 +60,7 @@ A0 B1 A2 B3 A4 B5 B6 A7 A8 B9 BA BB BC AD BE BF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF - D0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF + F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF @@ -84,7 +84,7 @@ C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF - F0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF + D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 050bbe86948..388f47bf96f 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5346,3 +5346,9 @@ ER_SP_NO_RETSET_IN_FUNC 0A000 eng "Not allowed to return a result set from a function" ER_CANT_CREATE_GEOMETRY_OBJECT 22003 eng "Cannot get geometry object from data you send to the GEOMETRY field" +ER_FAILED_ROUTINE_BREAK_BINLOG + eng "A routine failed and is declared to modify data and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes" +ER_BINLOG_UNSAFE_ROUTINE + eng "This routine is declared to be non-deterministic and to modify data and binary logging is enabled (you *might* want to use the less safe log_bin_trust_routine_creators variable)" +ER_BINLOG_CREATE_ROUTINE_NEED_SUPER + eng "You do not have SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_routine_creators variable)" diff --git a/sql/slave.cc b/sql/slave.cc index 28801d8ea6e..1d5281ce55a 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2425,12 +2425,17 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) DBUG_ENTER("init_slave_thread"); thd->system_thread = (thd_type == SLAVE_THD_SQL) ? SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO; + /* + The two next lines are needed for replication of SP (CREATE PROCEDURE + needs a valid user to store in mysql.proc). + */ + thd->priv_user= (char *) ""; + thd->priv_host[0]= '\0'; thd->host_or_ip= ""; thd->client_capabilities = 0; my_net_init(&thd->net, 0); thd->net.read_timeout = slave_net_timeout; thd->master_access= ~0; - thd->priv_user = 0; thd->slave_thread = 1; set_slave_thread_options(thd); /* diff --git a/sql/sp.cc b/sql/sp.cc index 1956f32f2c6..81513cb3198 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -58,6 +58,9 @@ enum bool mysql_proc_table_exists= 1; +/* Tells what SP_DEFAULT_ACCESS should be mapped to */ +#define SP_DEFAULT_ACCESS_MAPPING SP_CONTAINS_SQL + /* *opened=true means we opened ourselves */ static int db_find_routine_aux(THD *thd, int type, sp_name *name, @@ -189,7 +192,7 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp) chistics.daccess= SP_MODIFIES_SQL_DATA; break; default: - chistics.daccess= SP_CONTAINS_SQL; + chistics.daccess= SP_DEFAULT_ACCESS_MAPPING; } if ((ptr= get_field(thd->mem_root, @@ -425,9 +428,46 @@ db_create_routine(THD *thd, int type, sp_head *sp) store(sp->m_chistics->comment.str, sp->m_chistics->comment.length, system_charset_info); + if (!trust_routine_creators && mysql_bin_log.is_open()) + { + if (!sp->m_chistics->detistic) + { + /* + Note that for a _function_ this test is not enough; one could use + a non-deterministic read-only function in an update statement. + */ + enum enum_sp_data_access access= + (sp->m_chistics->daccess == SP_DEFAULT_ACCESS) ? + SP_DEFAULT_ACCESS_MAPPING : sp->m_chistics->daccess; + if (access == SP_CONTAINS_SQL || + access == SP_MODIFIES_SQL_DATA) + { + my_message(ER_BINLOG_UNSAFE_ROUTINE, + ER(ER_BINLOG_UNSAFE_ROUTINE), MYF(0)); + ret= SP_INTERNAL_ERROR; + goto done; + } + } + if (!(thd->master_access & SUPER_ACL)) + { + my_message(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER, + ER(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER), MYF(0)); + ret= SP_INTERNAL_ERROR; + goto done; + } + } + ret= SP_OK; if (table->file->write_row(table->record[0])) ret= SP_WRITE_ROW_FAILED; + else if (mysql_bin_log.is_open()) + { + thd->clear_error(); + /* Such a statement can always go directly to binlog, no trans cache */ + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); + mysql_bin_log.write(&qinfo); + } + } done: diff --git a/sql/sp_head.cc b/sql/sp_head.cc index ad14116a4c7..9fb4b1c7fac 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -164,7 +164,10 @@ sp_eval_func_item(THD *thd, Item *it, enum enum_field_types type) it= new Item_null(); else it= new Item_decimal(val); - dbug_print_decimal("info", "DECIMAL_RESULT: %s", val); +#ifndef DBUG_OFF + char dbug_buff[DECIMAL_MAX_STR_LENGTH+1]; + DBUG_PRINT("info", ("DECIMAL_RESULT: %s", dbug_decimal_as_string(dbug_buff, val))); +#endif break; } case STRING_RESULT: diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index e72d78a6ac8..b2761ea7ce3 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2692,6 +2692,7 @@ bool mysql_table_grant(THD *thd, TABLE_LIST *table_list, some kind of updates to the mysql.% tables. */ if (thd->slave_thread && rpl_filter->is_on()) + if (thd->slave_thread && rpl_filter->is_on()) { /* The tables must be marked "updating" so that tables_ok() takes them into diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h index 5c51f3ecb67..2fd603d9381 100644 --- a/sql/sql_bitmap.h +++ b/sql/sql_bitmap.h @@ -91,7 +91,7 @@ template <> class Bitmap<64> ulonglong map; public: Bitmap<64>() { } -#if defined(__NETWARE__) +#if defined(__NETWARE__) || defined(__MWERKS__) /* Metwork compiler gives error on Bitmap<64> Changed to Bitmap, since in this case also it will proper construct diff --git a/sql/sql_class.h b/sql/sql_class.h index a97f2566a3e..f3e7a0d34b5 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -524,6 +524,7 @@ struct system_variables ulong query_cache_type; ulong read_buff_size; ulong read_rnd_buff_size; + ulong div_precincrement; ulong sortbuff_size; ulong table_type; ulong tmp_table_size; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 458058c86cc..065080517ba 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4100,7 +4100,43 @@ unsent_create_error: thd->variables.select_limit= HA_POS_ERROR; 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); + + /* + We write CALL to binlog; on the opposite we didn't write the + substatements. That choice is necessary because the substatements + may use local vars. + Binlogging should happen when all tables are locked. They are locked + just above, and unlocked by close_thread_tables(). All tables which + are to be updated are locked like with a table-level write lock, and + this also applies to InnoDB (I tested - note that it reduces + InnoDB's concurrency as we don't use row-level locks). So binlogging + below is safe. + Note the limitation: if the SP returned an error, but still did some + updates, we do NOT binlog it. This is because otherwise "permission + denied", "table does not exist" etc would stop the slave quite + often. There is no easy way to know if the SP updated something + (even no_trans_update is not suitable, as it may be a transactional + autocommit update which happened, and no_trans_update covers only + INSERT/UPDATE/LOAD). + */ + if (mysql_bin_log.is_open() && + (sp->m_chistics->daccess == SP_CONTAINS_SQL || + sp->m_chistics->daccess == SP_MODIFIES_SQL_DATA)) + { + if (res) + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_FAILED_ROUTINE_BREAK_BINLOG, + ER(ER_FAILED_ROUTINE_BREAK_BINLOG)); + else + { + thd->clear_error(); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); + mysql_bin_log.write(&qinfo); + } + } /* If warnings have been cleared, we have to clear total_warn_count @@ -4156,14 +4192,32 @@ unsent_create_error: sp->m_name.str, 0)) goto error; memcpy(&lex->sp_chistics, &chistics, sizeof(lex->sp_chistics)); - if (lex->sql_command == SQLCOM_ALTER_PROCEDURE) - result= sp_update_procedure(thd, lex->spname, &lex->sp_chistics); - else - result= sp_update_function(thd, lex->spname, &lex->sp_chistics); + if (!trust_routine_creators && mysql_bin_log.is_open() && + !sp->m_chistics->detistic && + (chistics.daccess == SP_CONTAINS_SQL || + chistics.daccess == SP_MODIFIES_SQL_DATA)) + { + my_message(ER_BINLOG_UNSAFE_ROUTINE, + ER(ER_BINLOG_UNSAFE_ROUTINE), MYF(0)); + result= SP_INTERNAL_ERROR; + } + else + { + if (lex->sql_command == SQLCOM_ALTER_PROCEDURE) + result= sp_update_procedure(thd, lex->spname, &lex->sp_chistics); + else + result= sp_update_function(thd, lex->spname, &lex->sp_chistics); + } } switch (result) { case SP_OK: + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); + mysql_bin_log.write(&qinfo); + } send_ok(thd); break; case SP_KEY_NOT_FOUND: @@ -4240,6 +4294,12 @@ unsent_create_error: switch (result) { case SP_OK: + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); + mysql_bin_log.write(&qinfo); + } send_ok(thd); break; case SP_KEY_NOT_FOUND: @@ -4498,6 +4558,7 @@ unsent_create_error: break; } thd->proc_info="query end"; + /* Two binlog-related cleanups: */ if (thd->one_shot_set) { /* @@ -5413,9 +5474,14 @@ new_create_field(THD *thd, char *field_name, enum_field_types type, } new_field->pack_length= my_decimal_get_binary_size(new_field->length, new_field->decimals); - if (new_field->length <= DECIMAL_MAX_LENGTH && + if (new_field->length <= DECIMAL_MAX_PRECISION && new_field->length >= new_field->decimals) + { + new_field->length= + my_decimal_precision_to_length(new_field->length, new_field->decimals, + type_modifier & UNSIGNED_FLAG); break; + } my_error(ER_WRONG_FIELD_SPEC, MYF(0), field_name); DBUG_RETURN(NULL); case MYSQL_TYPE_VARCHAR: diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 32624bb3305..6e28e50b217 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6435,10 +6435,13 @@ static bool check_equality(Item *item, COND_EQUAL *cond_equal) { bool copyfl; - if (field_item->result_type() == STRING_RESULT && - ((Field_str *) field_item->field)->charset() != - ((Item_cond *) item)->compare_collation()) - return FALSE; + if (field_item->result_type() == STRING_RESULT) + { + CHARSET_INFO *cs= ((Field_str*) field_item->field)->charset(); + if ((cs != ((Item_cond *) item)->compare_collation()) || + !cs->coll->propagate(cs, 0, 0)) + return FALSE; + } Item_equal *item_equal = find_item_equal(cond_equal, field_item->field, ©fl); @@ -7781,9 +7784,8 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table, new_field= item->make_string_field(table); break; case DECIMAL_RESULT: - new_field= new Field_new_decimal(item->max_length - (item->decimals?1:0), - maybe_null, - item->name, table, item->decimals); + new_field= new Field_new_decimal(item->max_length, maybe_null, item->name, + table, item->decimals, item->unsigned_flag); break; case ROW_RESULT: default: diff --git a/sql/sql_show.cc b/sql/sql_show.cc index d6027699257..cf0050a774b 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2362,10 +2362,10 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables, strlen((const char*) pos), cs); if (field->has_charset()) { - table->field[8]->store((longlong) field->representation_length()/ + table->field[8]->store((longlong) field->field_length/ field->charset()->mbmaxlen); table->field[8]->set_notnull(); - table->field[9]->store((longlong) field->representation_length()); + table->field[9]->store((longlong) field->field_length); table->field[9]->set_notnull(); } @@ -2373,7 +2373,8 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables, uint dec =field->decimals(); switch (field->type()) { case FIELD_TYPE_NEWDECIMAL: - table->field[10]->store((longlong) field->field_length); + table->field[10]->store((longlong) + ((Field_new_decimal*)field)->precision); table->field[10]->set_notnull(); table->field[11]->store((longlong) field->decimals()); table->field[11]->set_notnull(); diff --git a/sql/sql_view.cc b/sql/sql_view.cc index ce08763015f..15a8f52af20 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -716,6 +716,16 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) table->next_global= view_tables; } + /* + Let us set proper lock type for tables of the view's main select + since we may want to perform update or insert on view. This won't + work for view containing union. But this is ok since we don't + allow insert and update on such views anyway. + */ + if (!lex->select_lex.next_select()) + for (tbl= lex->select_lex.get_table_list(); tbl; tbl= tbl->next_local) + tbl->lock_type= table->lock_type; + /* If we are opening this view as part of implicit LOCK TABLES, then this view serves as simple placeholder and we should not continue @@ -756,23 +766,14 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) table->ancestor= view_tables; /* - Process upper level tables of view. As far as we do noy suport union - here we can go through local tables of view most upper SELECT + Tables of the main select of the view should be marked as belonging + to the same select as original view (again we can use LEX::select_lex + for this purprose because we don't support MERGE algorithm for views + with unions). */ - for(tbl= view_tables; - tbl; - tbl= tbl->next_local) - { - /* next table should include SELECT_LEX under this table SELECT_LEX */ + for (tbl= lex->select_lex.get_table_list(); tbl; tbl= tbl->next_local) tbl->select_lex= table->select_lex; - /* - move lock type (TODO: should we issue error in case of TMPTABLE - algorithm and non-read locking)? - */ - tbl->lock_type= table->lock_type; - } - /* multi table view */ if (view_tables->next_local) { diff --git a/sql/unireg.cc b/sql/unireg.cc index 95a383e0f01..e29b97a3f03 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -647,7 +647,7 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type, { int error; Field::utype type; - uint firstpos,null_count,null_length; + uint null_count; uchar *buff,*null_pos; TABLE table; create_field *field; @@ -671,15 +671,14 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type, table.s->db_low_byte_first= handler->low_byte_first(); table.s->blob_ptr_size= portable_sizeof_char_ptr; - firstpos=reclength; null_count=0; if (!(table_options & HA_OPTION_PACK_RECORD)) { null_fields++; // Need one bit for delete mark null_count++; + *buff|= 1; } - bfill(buff,(null_length=(null_fields+7)/8),255); - null_pos= buff + null_count / 8; + null_pos= buff; List_iterator it(create_fields); thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong default values @@ -689,7 +688,7 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type, regfield don't have to be deleted as it's allocated with sql_alloc() */ Field *regfield=make_field((char*) buff+field->offset,field->length, - null_pos, + null_pos + null_count / 8, null_count & 7, field->pack_flag, field->sql_type, @@ -703,11 +702,13 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type, goto err; // End of memory if (!(field->flags & NOT_NULL_FLAG)) + { + *regfield->null_ptr|= regfield->null_bit; null_count++; + } - if ((uint) field->offset < firstpos && - regfield->type() != FIELD_TYPE_NULL) - firstpos= field->offset; + if (field->sql_type == FIELD_TYPE_BIT && !f_bit_as_char(field->pack_flag)) + null_count+= field->length & 7; type= (Field::utype) MTYP_TYPENR(field->unireg_check); @@ -737,7 +738,9 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type, } /* Fill not used startpos */ - bfill((byte*) buff+null_length,firstpos-null_length,255); + if (null_count) + *(null_pos + null_count / 8)|= ~(((uchar) 1 << (null_count & 7)) - 1); + error=(int) my_write(file,(byte*) buff,(uint) reclength,MYF_RW); err: diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h index 710c945375c..45a81a4ac77 100644 --- a/storage/innobase/include/lock0lock.h +++ b/storage/innobase/include/lock0lock.h @@ -565,8 +565,15 @@ lock_rec_print( Prints info of locks for all transactions. */ void -lock_print_info( -/*============*/ +lock_print_info_summary( +/*====================*/ + FILE* file); /* in: file where to print */ +/************************************************************************* +Prints info of locks for each transaction. */ + +void +lock_print_info_all_transactions( +/*=============================*/ FILE* file); /* in: file where to print */ /************************************************************************* Validates the lock queue on a table. */ diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 4a1833a1a21..6e4241965c1 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -466,8 +466,13 @@ Outputs to a file the output of the InnoDB Monitor. */ void srv_printf_innodb_monitor( /*======================*/ - FILE* file); /* in: output stream */ -/************************************************************************ + FILE* file, /* in: output stream */ + ulint* trx_start, /* out: file position of the start of + the list of active transactions */ + ulint* trx_end); /* out: file position of the end of + the list of active transactions */ + +/********************************************************************** Function to pass InnoDB status variables to MySQL */ void diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c index 512f487b3f5..73ecc717e0e 100644 --- a/storage/innobase/lock/lock0lock.c +++ b/storage/innobase/lock/lock0lock.c @@ -4226,21 +4226,10 @@ lock_get_n_rec_locks(void) Prints info of locks for all transactions. */ void -lock_print_info( -/*============*/ +lock_print_info_summary( +/*====================*/ FILE* file) /* in: file where to print */ { - lock_t* lock; - trx_t* trx; - ulint space; - ulint page_no; - page_t* page; - ibool load_page_first = TRUE; - ulint nth_trx = 0; - ulint nth_lock = 0; - ulint i; - mtr_t mtr; - /* We must protect the MySQL thd->query field with a MySQL mutex, and because the MySQL mutex must be reserved before the kernel_mutex of InnoDB, we call innobase_mysql_prepare_print_arbitrary_thd() here. */ @@ -4279,6 +4268,26 @@ lock_print_info( fprintf(file, "Total number of lock structs in row lock hash table %lu\n", (ulong) lock_get_n_rec_locks()); +} + +/************************************************************************* +Prints info of locks for each transaction. */ + +void +lock_print_info_all_transactions( +/*=============================*/ + FILE* file) /* in: file where to print */ +{ + lock_t* lock; + ulint space; + ulint page_no; + page_t* page; + ibool load_page_first = TRUE; + ulint nth_trx = 0; + ulint nth_lock = 0; + ulint i; + mtr_t mtr; + trx_t* trx; fprintf(file, "LIST OF TRANSACTIONS FOR EACH SESSION:\n"); diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index a4bfdb6162d..f901425a5f9 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -1602,7 +1602,11 @@ Outputs to a file the output of the InnoDB Monitor. */ void srv_printf_innodb_monitor( /*======================*/ - FILE* file) /* in: output stream */ + FILE* file, /* in: output stream */ + ulint* trx_start, /* out: file position of the start of + the list of active transactions */ + ulint* trx_end) /* out: file position of the end of + the list of active transactions */ { double time_elapsed; time_t current_time; @@ -1651,7 +1655,24 @@ srv_printf_innodb_monitor( mutex_exit(&dict_foreign_err_mutex); - lock_print_info(file); + lock_print_info_summary(file); + if (trx_start) { + long t = ftell(file); + if (t < 0) { + *trx_start = ULINT_UNDEFINED; + } else { + *trx_start = (ulint) t; + } + } + lock_print_info_all_transactions(file); + if (trx_end) { + long t = ftell(file); + if (t < 0) { + *trx_end = ULINT_UNDEFINED; + } else { + *trx_end = (ulint) t; + } + } fputs("--------\n" "FILE I/O\n" "--------\n", file); @@ -1865,13 +1886,13 @@ loop: last_monitor_time = time(NULL); if (srv_print_innodb_monitor) { - srv_printf_innodb_monitor(stderr); + srv_printf_innodb_monitor(stderr, NULL, NULL); } if (srv_innodb_status) { mutex_enter(&srv_monitor_file_mutex); rewind(srv_monitor_file); - srv_printf_innodb_monitor(srv_monitor_file); + srv_printf_innodb_monitor(srv_monitor_file, NULL, NULL); os_file_set_eof(srv_monitor_file); mutex_exit(&srv_monitor_file_mutex); } diff --git a/storage/ndb/test/src/NDBT_ResultRow.cpp b/storage/ndb/test/src/NDBT_ResultRow.cpp index 8e92a57d2e4..ab8d7b07ea1 100644 --- a/storage/ndb/test/src/NDBT_ResultRow.cpp +++ b/storage/ndb/test/src/NDBT_ResultRow.cpp @@ -116,8 +116,12 @@ BaseString NDBT_ResultRow::c_str() const { NdbOut & operator << (NdbOut& ndbout, const NDBT_ResultRow & res) { - for(int i = 0; ifrac, i; dec1 *buf0= from->buf + ROUND_UP(from->intg) + ROUND_UP(frac) - 1; if (frac == 0) - return; + return 0; i= ((frac - 1) % DIG_PER_DEC1 + 1); while (frac > 0 && *buf0 == 0) @@ -302,7 +302,7 @@ void decimal_optimize_fraction(decimal_t *from) *buf0 % powers10[i++] == 0; frac--); } - from->frac= frac; + return frac; } @@ -332,23 +332,15 @@ int decimal2string(decimal_t *from, char *to, int *to_len, int fixed_precision, int fixed_decimals, char filler) { - int len, intg, frac=from->frac, i, intg_len, frac_len, fill; + int len, intg, frac= from->frac, i, intg_len, frac_len, fill; /* number digits before decimal point */ int fixed_intg= (fixed_precision ? - (fixed_precision - - (from->sign ? 1 : 0) - - (fixed_decimals ? 1 : 0) - - fixed_decimals) : - 0); + (fixed_precision - fixed_decimals) : 0); int error=E_DEC_OK; char *s=to; dec1 *buf, *buf0=from->buf, tmp; DBUG_ASSERT(*to_len >= 2+from->sign); - DBUG_ASSERT(fixed_precision == 0 || - (fixed_precision < *to_len && - fixed_precision > ((from->sign ? 1 : 0) + - (fixed_decimals ? 1 : 0)))); /* removing leading zeroes */ buf0= remove_leading_zeroes(from, &intg); @@ -1953,6 +1945,18 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2, sanity(to); /* removing all the leading zeroes */ + i= ((prec2 - 1) % DIG_PER_DEC1) + 1; + while (prec2 > 0 && *buf2 == 0) + { + prec2-= i; + i= DIG_PER_DEC1; + buf2++; + } + if (prec2 <= 0) /* short-circuit everything: from2 == 0 */ + return E_DEC_DIV_ZERO; + for (i= (prec2 - 1) % DIG_PER_DEC1; *buf2 < powers10[i--]; prec2--) ; + DBUG_ASSERT(prec2 > 0); + i=((prec1-1) % DIG_PER_DEC1)+1; while (prec1 > 0 && *buf1 == 0) { @@ -1968,19 +1972,6 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2, for (i=(prec1-1) % DIG_PER_DEC1; *buf1 < powers10[i--]; prec1--) ; DBUG_ASSERT(prec1 > 0); - i=((prec2-1) % DIG_PER_DEC1)+1; - while (prec2 > 0 && *buf2 == 0) - { - prec2-=i; - i=DIG_PER_DEC1; - buf2++; - } - if (prec2 <= 0) /* short-circuit everything: from2 == 0 */ - return E_DEC_DIV_ZERO; - - for (i=(prec2-1) % DIG_PER_DEC1; *buf2 < powers10[i--]; prec2--) ; - DBUG_ASSERT(prec2 > 0); - /* let's fix scale_incr, taking into account frac1,frac2 increase */ if ((scale_incr-= frac1 - from1->frac + frac2 - from2->frac) < 0) scale_incr=0; @@ -2609,7 +2600,7 @@ void test_fr(const char *s1, const char *orig) printf("%-40s => ", s); end= strend(s1); string2decimal(s1, &a, &end); - decimal_optimize_fraction(&a); + a.frac= decimal_actual_fraction(&a); print_decimal(&a, orig, 0, 0); printf("\n"); } @@ -2731,6 +2722,7 @@ int main() test_dv("123", "0.01","12300.000000000", 0); test_dv("120", "100000000000.00000","0.000000001200000000", 0); test_dv("123", "0","", 4); + test_dv("0", "0", "", 4); test_dv("-12193185.1853376", "98765.4321","-123.456000000000000000", 0); test_dv("121931851853376", "987654321","123456.000000000", 0); test_dv("0", "987","0", 0); @@ -2947,7 +2939,7 @@ int main() test_sh("123456789.987654321", 0, "123456789.987654321", 0); a.len= sizeof(buf1)/sizeof(dec1); - printf("==== decimal_optimize_fraction ====\n"); + printf("==== decimal_actual_fraction ====\n"); test_fr("1.123456789000000000", "1.123456789"); test_fr("1.12345678000000000", "1.12345678"); test_fr("1.1234567000000000", "1.1234567"); diff --git a/support-files/MacOSX/mwar-wrapper b/support-files/MacOSX/mwar-wrapper new file mode 100755 index 00000000000..4bc5153e7ef --- /dev/null +++ b/support-files/MacOSX/mwar-wrapper @@ -0,0 +1,16 @@ +#!/bin/sh + +# This script can only create a library, not take it apart +# again to AR files + +case $1 in + -d*|-m*|-t*|-p*|-r*|-x*|x) + echo "$0: can't handle arguments $*" + exit 1; + ;; + -c|c|cr|cru|cu) + shift; + ;; +esac + +exec mwld -lib -o $* diff --git a/support-files/MacOSX/mwcc-wrapper b/support-files/MacOSX/mwcc-wrapper new file mode 100755 index 00000000000..914578aca1d --- /dev/null +++ b/support-files/MacOSX/mwcc-wrapper @@ -0,0 +1,48 @@ +#!/bin/sh + +if [ -z "$CWINSTALL" ] ; then + echo "ERROR: You need to source 'mwvars' to set CWINSTALL and other variables" + exit 1 +fi + +if [ `expr "$MWMacOSXPPCLibraryFiles" : ".*BSD.*"` = 0 ] ; then + echo "ERROR: You need to source 'mwvars' with the 'bsd' argument" + exit 1 +fi + +# ============================================================================== + +# Extra options that don't change + +PREOPTS="-D__SCHAR_MAX__=127 -D__CHAR_BIT__=8 -ext o -gccinc" +PREOPTS="$PREOPTS -wchar_t on -bool on -relax_pointers -align power_gcc" +PREOPTS="$PREOPTS -stabs all -fno-handle-exceptions -Cpp_exceptions off" + +# ============================================================================== + +# We want the "PPC Specific" directory to be last, before the source +# file. It is to work around a CodeWarrior/Apple bug, that we need a +# Metrowersk header even though we have configured CodeWarrior to use +# the BSD headers. But not to conflict, the directory has to be last. + +# FIXME this will probably break if one path contains space characters + +PREARGS="" +for i in $* ; do + case "$i" in + -bind_at_load) + # This is a flag some version of libtool adds, when the host + # is "*darwin*". It doesn't check that it is gcc. + # FIXME add some flag?! + ;; + *.c|*.cc|*.cpp) + break + ;; + *) + PREARGS="$PREARGS $1" + ;; + esac + shift +done +#echo "mwcc $PREOPTS $PREARGS -I\"$CWINSTALL/MacOS X Support/Headers/PPC Specific\" $*" +exec mwcc $PREOPTS $PREARGS -I"$CWINSTALL/MacOS X Support/Headers/PPC Specific" $* diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh index 071b7696908..6757a1052a8 100644 --- a/support-files/mysql.server.sh +++ b/support-files/mysql.server.sh @@ -10,7 +10,7 @@ # started and shut down when the systems goes down. # Comments to support chkconfig on RedHat Linux -# chkconfig: 2345 90 20 +# chkconfig: 2345 64 36 # description: A very fast and reliable SQL database engine. # Comments to support LSB init script conventions