diff --git a/.bzrignore b/.bzrignore index 095c04b36ee..57fcbdd8f73 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1770,3 +1770,4 @@ vio/viotest-sslconnect.cpp vio/viotest.cpp zlib/*.ds? zlib/*.vcproj +libmysqld/event_scheduler.cc diff --git a/client/get_password.c b/client/get_password.c index 1b7b4e65a9f..b643b760718 100644 --- a/client/get_password.c +++ b/client/get_password.c @@ -64,7 +64,7 @@ /* were just going to fake it here and get input from the keyboard */ -char *get_tty_password(char *opt_message) +char *get_tty_password(const char *opt_message) { char to[80]; char *pos=to,*end=to+sizeof(to)-1; @@ -150,7 +150,7 @@ static void get_password(char *to,uint length,int fd,bool echo) #endif /* ! HAVE_GETPASS */ -char *get_tty_password(char *opt_message) +char *get_tty_password(const char *opt_message) { #ifdef HAVE_GETPASS char *passbuff; diff --git a/configure.in b/configure.in index 64886892e2e..0f0649fd3bc 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.1.11-beta) +AM_INIT_AUTOMAKE(mysql, 5.1.12-beta) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 diff --git a/extra/yassl/examples/echoserver/echoserver.cpp b/extra/yassl/examples/echoserver/echoserver.cpp index 3243cc21a7c..8e23ead20ab 100644 --- a/extra/yassl/examples/echoserver/echoserver.cpp +++ b/extra/yassl/examples/echoserver/echoserver.cpp @@ -65,7 +65,8 @@ THREAD_RETURN YASSL_API echoserver_test(void* args) while (!shutdown) { sockaddr_in client; socklen_t client_len = sizeof(client); - int clientfd = accept(sockfd, (sockaddr*)&client, &client_len); + int clientfd = accept(sockfd, (sockaddr*)&client, + (ACCEPT_THIRD_T)&client_len); if (clientfd == -1) err_sys("tcp accept failed"); SSL* ssl = SSL_new(ctx); diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index a7eca9138a2..23e48d2011f 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -273,6 +273,7 @@ int SSL_pending(SSL*); enum { /* ssl Constants */ + SSL_WOULD_BLOCK = -8, SSL_BAD_STAT = -7, SSL_BAD_PATH = -6, SSL_BAD_FILETYPE = -5, @@ -494,7 +495,7 @@ ASN1_TIME* X509_get_notAfter(X509* x); typedef struct MD4_CTX { - void* ptr; + int buffer[32]; /* big enough to hold, check size in Init */ } MD4_CTX; void MD4_Init(MD4_CTX*); diff --git a/extra/yassl/include/socket_wrapper.hpp b/extra/yassl/include/socket_wrapper.hpp index d2258a93723..16db142b3a2 100644 --- a/extra/yassl/include/socket_wrapper.hpp +++ b/extra/yassl/include/socket_wrapper.hpp @@ -66,6 +66,7 @@ typedef unsigned char byte; // Wraps Windows Sockets and BSD Sockets class Socket { socket_t socket_; // underlying socket descriptor + bool wouldBlock_; // for non-blocking data public: explicit Socket(socket_t s = INVALID_SOCKET); ~Socket(); @@ -75,9 +76,10 @@ public: socket_t get_fd() const; uint send(const byte* buf, unsigned int len, int flags = 0) const; - uint receive(byte* buf, unsigned int len, int flags = 0) const; + uint receive(byte* buf, unsigned int len, int flags = 0); - bool wait() const; + bool wait(); + bool WouldBlock() const; void closeSocket(); void shutDown(int how = SD_SEND); diff --git a/extra/yassl/mySTL/stdexcept.hpp b/extra/yassl/mySTL/stdexcept.hpp index 33ea43bf0e0..b50dd35edae 100644 --- a/extra/yassl/mySTL/stdexcept.hpp +++ b/extra/yassl/mySTL/stdexcept.hpp @@ -46,8 +46,10 @@ public: // for compiler generated call, never used static void operator delete(void*) { assert(0); } private: +#if defined(__hpux) // don't allow dynamic creation of exceptions static void* operator new(size_t); +#endif }; diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp index 2603365e41a..2b099af930c 100644 --- a/extra/yassl/src/handshake.cpp +++ b/extra/yassl/src/handshake.cpp @@ -656,7 +656,7 @@ mySTL::auto_ptr DoProcessReply(SSL& ssl, mySTL::auto_ptr buffered) { // wait for input if blocking - if (!ssl.getSocket().wait()) { + if (!ssl.useSocket().wait()) { ssl.SetError(receive_error); buffered.reset(0); return buffered; @@ -673,7 +673,7 @@ DoProcessReply(SSL& ssl, mySTL::auto_ptr buffered) } // add new data - uint read = ssl.getSocket().receive(buffer.get_buffer() + buffSz, ready); + uint read = ssl.useSocket().receive(buffer.get_buffer() + buffSz, ready); buffer.add_size(read); uint offset = 0; const MessageFactory& mf = ssl.getFactory().getMessage(); @@ -858,6 +858,9 @@ void sendFinished(SSL& ssl, ConnectionEnd side, BufferOutput buffer) // send data int sendData(SSL& ssl, const void* buffer, int sz) { + if (ssl.GetError() == YasslError(SSL_ERROR_WANT_READ)) + ssl.SetError(no_error); + ssl.verfiyHandShakeComplete(); if (ssl.GetError()) return 0; int sent = 0; @@ -893,6 +896,9 @@ int sendAlert(SSL& ssl, const Alert& alert) // process input data int receiveData(SSL& ssl, Data& data) { + if (ssl.GetError() == YasslError(SSL_ERROR_WANT_READ)) + ssl.SetError(no_error); + ssl.verfiyHandShakeComplete(); if (ssl.GetError()) return 0; @@ -902,6 +908,11 @@ int receiveData(SSL& ssl, Data& data) ssl.useLog().ShowData(data.get_length()); if (ssl.GetError()) return 0; + + if (data.get_length() == 0 && ssl.getSocket().WouldBlock()) { + ssl.SetError(YasslError(SSL_ERROR_WANT_READ)); + return SSL_WOULD_BLOCK; + } return data.get_length(); } diff --git a/extra/yassl/src/socket_wrapper.cpp b/extra/yassl/src/socket_wrapper.cpp index c6611803421..803f4b01249 100644 --- a/extra/yassl/src/socket_wrapper.cpp +++ b/extra/yassl/src/socket_wrapper.cpp @@ -58,7 +58,7 @@ namespace yaSSL { Socket::Socket(socket_t s) - : socket_(s) + : socket_(s), wouldBlock_(false) {} @@ -123,17 +123,21 @@ uint Socket::send(const byte* buf, unsigned int sz, int flags) const } -uint Socket::receive(byte* buf, unsigned int sz, int flags) const +uint Socket::receive(byte* buf, unsigned int sz, int flags) { assert(socket_ != INVALID_SOCKET); + wouldBlock_ = false; + int recvd = ::recv(socket_, reinterpret_cast(buf), sz, flags); // idea to seperate error from would block by arnetheduck@gmail.com if (recvd == -1) { if (get_lastError() == SOCKET_EWOULDBLOCK || - get_lastError() == SOCKET_EAGAIN) + get_lastError() == SOCKET_EAGAIN) { + wouldBlock_ = true; return 0; } + } else if (recvd == 0) return static_cast(-1); @@ -142,7 +146,7 @@ uint Socket::receive(byte* buf, unsigned int sz, int flags) const // wait if blocking for input, return false for error -bool Socket::wait() const +bool Socket::wait() { byte b; return receive(&b, 1, MSG_PEEK) != static_cast(-1); @@ -166,6 +170,12 @@ int Socket::get_lastError() } +bool Socket::WouldBlock() const +{ + return wouldBlock_; +} + + void Socket::set_lastError(int errorCode) { #ifdef _WIN32 diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index 66196514a87..747305730df 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -37,6 +37,7 @@ #include "handshake.hpp" #include "yassl_int.hpp" #include "md5.hpp" // for TaoCrypt MD5 size assert +#include "md4.hpp" // for TaoCrypt MD4 size assert #include #ifdef _WIN32 @@ -1131,17 +1132,26 @@ void* X509_get_ext_d2i(X509* x, int nid, int* crit, int* idx) void MD4_Init(MD4_CTX* md4) { - assert(0); // not yet supported, build compat. only + // make sure we have a big enough buffer + typedef char ok[sizeof(md4->buffer) >= sizeof(TaoCrypt::MD4) ? 1 : -1]; + (void) sizeof(ok); + + // using TaoCrypt since no dynamic memory allocated + // and no destructor will be called + new (reinterpret_cast(md4->buffer)) TaoCrypt::MD4(); } void MD4_Update(MD4_CTX* md4, const void* data, unsigned long sz) { + reinterpret_cast(md4->buffer)->Update( + static_cast(data), static_cast(sz)); } void MD4_Final(unsigned char* hash, MD4_CTX* md4) { + reinterpret_cast(md4->buffer)->Final(hash); } diff --git a/extra/yassl/src/template_instnt.cpp b/extra/yassl/src/template_instnt.cpp index 43b80d59a4d..134deb00c75 100644 --- a/extra/yassl/src/template_instnt.cpp +++ b/extra/yassl/src/template_instnt.cpp @@ -31,6 +31,7 @@ #include "hmac.hpp" #include "md5.hpp" #include "sha.hpp" +#include "ripemd.hpp" #include "openssl/ssl.h" #ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION diff --git a/extra/yassl/src/timer.cpp b/extra/yassl/src/timer.cpp index 4fe0d3aa4f9..8b7d2d17a84 100644 --- a/extra/yassl/src/timer.cpp +++ b/extra/yassl/src/timer.cpp @@ -26,13 +26,17 @@ #include "runtime.hpp" #include "timer.hpp" +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#else +#include +#endif + namespace yaSSL { #ifdef _WIN32 - #define WIN32_LEAN_AND_MEAN - #include - timer_d timer() { static bool init(false); @@ -57,8 +61,6 @@ namespace yaSSL { #else // _WIN32 - #include - timer_d timer() { struct timeval tv; diff --git a/extra/yassl/src/yassl_error.cpp b/extra/yassl/src/yassl_error.cpp index 59113d7438c..1973c54d781 100644 --- a/extra/yassl/src/yassl_error.cpp +++ b/extra/yassl/src/yassl_error.cpp @@ -26,6 +26,7 @@ #include "runtime.hpp" #include "yassl_error.hpp" #include "error.hpp" // TaoCrypt error numbers +#include "openssl/ssl.h" // SSL_ERROR_WANT_READ namespace yaSSL { @@ -117,6 +118,11 @@ void SetErrorString(YasslError error, char* buffer) strncpy(buffer, "unable to proccess cerificate", max); break; + // openssl errors + case SSL_ERROR_WANT_READ : + strncpy(buffer, "the read operation would block", max); + break; + // TaoCrypt errors case NO_ERROR : strncpy(buffer, "not in error state", max); diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp index f7fb1abfa3f..a715d32f282 100644 --- a/extra/yassl/src/yassl_int.cpp +++ b/extra/yassl/src/yassl_int.cpp @@ -1415,15 +1415,6 @@ BulkCipher* CryptProvider::NewDesEde() } -extern "C" void yaSSL_CleanUp() -{ - TaoCrypt::CleanUp(); - ysDelete(cryptProviderInstance); - ysDelete(sslFactoryInstance); - ysDelete(sessionsInstance); -} - - typedef Mutex::Lock Lock; @@ -2109,9 +2100,18 @@ ASN1_STRING* StringHolder::GetString() } - } // namespace + +extern "C" void yaSSL_CleanUp() +{ + TaoCrypt::CleanUp(); + ysDelete(yaSSL::cryptProviderInstance); + ysDelete(yaSSL::sslFactoryInstance); + ysDelete(yaSSL::sessionsInstance); +} + + #ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION namespace mySTL { template yaSSL::yassl_int_cpp_local1::SumData for_each::iterator, yaSSL::yassl_int_cpp_local1::SumData>(mySTL::list::iterator, mySTL::list::iterator, yaSSL::yassl_int_cpp_local1::SumData); diff --git a/extra/yassl/taocrypt/CMakeLists.txt b/extra/yassl/taocrypt/CMakeLists.txt index 3ad9195b372..0af0a242e5d 100644 --- a/extra/yassl/taocrypt/CMakeLists.txt +++ b/extra/yassl/taocrypt/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES(../mySTL include) ADD_LIBRARY(taocrypt src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp src/asn.cpp src/coding.cpp src/des.cpp src/dh.cpp src/dsa.cpp src/file.cpp src/hash.cpp src/integer.cpp src/md2.cpp - src/md5.cpp src/misc.cpp src/random.cpp src/ripemd.cpp src/rsa.cpp src/sha.cpp + src/md4.cpp src/md5.cpp src/misc.cpp src/random.cpp src/ripemd.cpp src/rsa.cpp src/sha.cpp include/aes.hpp include/algebra.hpp include/arc4.hpp include/asn.hpp include/block.hpp include/coding.hpp include/des.hpp include/dh.hpp include/dsa.hpp include/dsa.hpp include/error.hpp include/file.hpp include/hash.hpp include/hmac.hpp include/integer.hpp diff --git a/extra/yassl/taocrypt/include/block.hpp b/extra/yassl/taocrypt/include/block.hpp index 4c262e1a540..76836615ce6 100644 --- a/extra/yassl/taocrypt/include/block.hpp +++ b/extra/yassl/taocrypt/include/block.hpp @@ -96,7 +96,7 @@ public: pointer allocate(size_type n, const void* = 0) { - CheckSize(n); + this->CheckSize(n); if (n == 0) return 0; return NEW_TC T[n]; diff --git a/extra/yassl/taocrypt/include/md4.hpp b/extra/yassl/taocrypt/include/md4.hpp new file mode 100644 index 00000000000..aac930d7498 --- /dev/null +++ b/extra/yassl/taocrypt/include/md4.hpp @@ -0,0 +1,65 @@ +/* md4.hpp + * + * Copyright (C) 2003 Sawtooth Consulting Ltd. + * + * This file is part of yaSSL. + * + * yaSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * yaSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +/* md4.hpp provides MD4 digest support + * WANRING: MD4 is considered insecure, only use if you have to, e.g., yaSSL + * libcurl supports needs this for NTLM authentication +*/ + +#ifndef TAO_CRYPT_MD4_HPP +#define TAO_CRYPT_MD4_HPP + +#include "hash.hpp" + +namespace TaoCrypt { + + +// MD4 digest +class MD4 : public HASHwithTransform { +public: + enum { BLOCK_SIZE = 64, DIGEST_SIZE = 16, PAD_SIZE = 56, + TAO_BYTE_ORDER = LittleEndianOrder }; // in Bytes + MD4() : HASHwithTransform(DIGEST_SIZE / sizeof(word32), BLOCK_SIZE) + { Init(); } + ByteOrder getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER); } + word32 getBlockSize() const { return BLOCK_SIZE; } + word32 getDigestSize() const { return DIGEST_SIZE; } + word32 getPadSize() const { return PAD_SIZE; } + + MD4(const MD4&); + MD4& operator= (const MD4&); + + void Init(); + void Swap(MD4&); +private: + void Transform(); +}; + +inline void swap(MD4& a, MD4& b) +{ + a.Swap(b); +} + + +} // namespace + +#endif // TAO_CRYPT_MD4_HPP + diff --git a/extra/yassl/taocrypt/include/runtime.hpp b/extra/yassl/taocrypt/include/runtime.hpp index 09ca7524ef3..3a5cf62865a 100644 --- a/extra/yassl/taocrypt/include/runtime.hpp +++ b/extra/yassl/taocrypt/include/runtime.hpp @@ -28,10 +28,6 @@ #ifndef yaSSL_NEW_HPP #define yaSSL_NEW_HPP -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifdef __sun diff --git a/extra/yassl/taocrypt/src/Makefile.am b/extra/yassl/taocrypt/src/Makefile.am index d3e72346110..1110ed335b8 100644 --- a/extra/yassl/taocrypt/src/Makefile.am +++ b/extra/yassl/taocrypt/src/Makefile.am @@ -4,7 +4,7 @@ noinst_LTLIBRARIES = libtaocrypt.la libtaocrypt_la_SOURCES = aes.cpp aestables.cpp algebra.cpp arc4.cpp \ asn.cpp bftables.cpp blowfish.cpp coding.cpp des.cpp dh.cpp \ - dsa.cpp file.cpp hash.cpp integer.cpp md2.cpp md5.cpp misc.cpp \ + dsa.cpp file.cpp hash.cpp integer.cpp md2.cpp md4.cpp md5.cpp misc.cpp \ random.cpp ripemd.cpp rsa.cpp sha.cpp template_instnt.cpp \ tftables.cpp twofish.cpp diff --git a/extra/yassl/taocrypt/src/md4.cpp b/extra/yassl/taocrypt/src/md4.cpp new file mode 100644 index 00000000000..dfc2b079141 --- /dev/null +++ b/extra/yassl/taocrypt/src/md4.cpp @@ -0,0 +1,154 @@ +/* md4.cpp + * + * Copyright (C) 2003 Sawtooth Consulting Ltd. + * + * This file is part of yaSSL. + * + * yaSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * yaSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +/* based on Wei Dai's md4.cpp from CryptoPP */ + +#include "runtime.hpp" +#include "md4.hpp" +#include "algorithm.hpp" // mySTL::swap + + + +namespace TaoCrypt { + +void MD4::Init() +{ + digest_[0] = 0x67452301L; + digest_[1] = 0xefcdab89L; + digest_[2] = 0x98badcfeL; + digest_[3] = 0x10325476L; + + buffLen_ = 0; + loLen_ = 0; + hiLen_ = 0; +} + + +MD4::MD4(const MD4& that) : HASHwithTransform(DIGEST_SIZE / sizeof(word32), + BLOCK_SIZE) +{ + buffLen_ = that.buffLen_; + loLen_ = that.loLen_; + hiLen_ = that.hiLen_; + + memcpy(digest_, that.digest_, DIGEST_SIZE); + memcpy(buffer_, that.buffer_, BLOCK_SIZE); +} + +MD4& MD4::operator= (const MD4& that) +{ + MD4 tmp(that); + Swap(tmp); + + return *this; +} + + +void MD4::Swap(MD4& other) +{ + mySTL::swap(loLen_, other.loLen_); + mySTL::swap(hiLen_, other.hiLen_); + mySTL::swap(buffLen_, other.buffLen_); + + memcpy(digest_, other.digest_, DIGEST_SIZE); + memcpy(buffer_, other.buffer_, BLOCK_SIZE); +} + + +void MD4::Transform() +{ +#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) +#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) + + word32 A, B, C, D; + + A = digest_[0]; + B = digest_[1]; + C = digest_[2]; + D = digest_[3]; + +#define function(a,b,c,d,k,s) a=rotlFixed(a+F(b,c,d)+buffer_[k],s); + function(A,B,C,D, 0, 3); + function(D,A,B,C, 1, 7); + function(C,D,A,B, 2,11); + function(B,C,D,A, 3,19); + function(A,B,C,D, 4, 3); + function(D,A,B,C, 5, 7); + function(C,D,A,B, 6,11); + function(B,C,D,A, 7,19); + function(A,B,C,D, 8, 3); + function(D,A,B,C, 9, 7); + function(C,D,A,B,10,11); + function(B,C,D,A,11,19); + function(A,B,C,D,12, 3); + function(D,A,B,C,13, 7); + function(C,D,A,B,14,11); + function(B,C,D,A,15,19); + +#undef function +#define function(a,b,c,d,k,s) a=rotlFixed(a+G(b,c,d)+buffer_[k]+0x5a827999,s); + function(A,B,C,D, 0, 3); + function(D,A,B,C, 4, 5); + function(C,D,A,B, 8, 9); + function(B,C,D,A,12,13); + function(A,B,C,D, 1, 3); + function(D,A,B,C, 5, 5); + function(C,D,A,B, 9, 9); + function(B,C,D,A,13,13); + function(A,B,C,D, 2, 3); + function(D,A,B,C, 6, 5); + function(C,D,A,B,10, 9); + function(B,C,D,A,14,13); + function(A,B,C,D, 3, 3); + function(D,A,B,C, 7, 5); + function(C,D,A,B,11, 9); + function(B,C,D,A,15,13); + +#undef function +#define function(a,b,c,d,k,s) a=rotlFixed(a+H(b,c,d)+buffer_[k]+0x6ed9eba1,s); + function(A,B,C,D, 0, 3); + function(D,A,B,C, 8, 9); + function(C,D,A,B, 4,11); + function(B,C,D,A,12,15); + function(A,B,C,D, 2, 3); + function(D,A,B,C,10, 9); + function(C,D,A,B, 6,11); + function(B,C,D,A,14,15); + function(A,B,C,D, 1, 3); + function(D,A,B,C, 9, 9); + function(C,D,A,B, 5,11); + function(B,C,D,A,13,15); + function(A,B,C,D, 3, 3); + function(D,A,B,C,11, 9); + function(C,D,A,B, 7,11); + function(B,C,D,A,15,15); + + digest_[0] += A; + digest_[1] += B; + digest_[2] += C; + digest_[3] += D; +} + + +} // namespace + diff --git a/extra/yassl/taocrypt/src/template_instnt.cpp b/extra/yassl/taocrypt/src/template_instnt.cpp index 5efd2d32a10..12bcd8238f2 100644 --- a/extra/yassl/taocrypt/src/template_instnt.cpp +++ b/extra/yassl/taocrypt/src/template_instnt.cpp @@ -30,11 +30,11 @@ #include "sha.hpp" #include "md5.hpp" #include "hmac.hpp" +#include "ripemd.hpp" #include "pwdbased.hpp" #include "algebra.hpp" #include "vector.hpp" #include "hash.hpp" -#include "ripemd.hpp" #ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION namespace TaoCrypt { diff --git a/extra/yassl/taocrypt/taocrypt.dsp b/extra/yassl/taocrypt/taocrypt.dsp index b741cef0096..19edf7b2f22 100644 --- a/extra/yassl/taocrypt/taocrypt.dsp +++ b/extra/yassl/taocrypt/taocrypt.dsp @@ -146,6 +146,10 @@ SOURCE=.\src\md2.cpp # End Source File # Begin Source File +SOURCE=.\src\md4.cpp +# End Source File +# Begin Source File + SOURCE=.\src\md5.cpp # End Source File # Begin Source File @@ -246,6 +250,10 @@ SOURCE=.\include\md2.hpp # End Source File # Begin Source File +SOURCE=.\include\md4.hpp +# End Source File +# Begin Source File + SOURCE=.\include\md5.hpp # End Source File # Begin Source File diff --git a/extra/yassl/taocrypt/test/test.cpp b/extra/yassl/taocrypt/test/test.cpp index b8618b18d47..28ef73dfac8 100644 --- a/extra/yassl/taocrypt/test/test.cpp +++ b/extra/yassl/taocrypt/test/test.cpp @@ -8,6 +8,7 @@ #include "sha.hpp" #include "md5.hpp" #include "md2.hpp" +#include "md4.hpp" #include "ripemd.hpp" #include "hmac.hpp" #include "arc4.hpp" @@ -30,6 +31,7 @@ using TaoCrypt::word32; using TaoCrypt::SHA; using TaoCrypt::MD5; using TaoCrypt::MD2; +using TaoCrypt::MD4; using TaoCrypt::RIPEMD160; using TaoCrypt::HMAC; using TaoCrypt::ARC4; @@ -89,6 +91,7 @@ void file_test(int, char**); int sha_test(); int md5_test(); int md2_test(); +int md4_test(); int ripemd_test(); int hmac_test(); int arc4_test(); @@ -165,6 +168,11 @@ void taocrypt_test(void* args) else printf( "MD2 test passed!\n"); + if ( (ret = md4_test()) ) + err_sys("MD4 test failed!\n", ret); + else + printf( "MD4 test passed!\n"); + if ( (ret = ripemd_test()) ) err_sys("RIPEMD test failed!\n", ret); else @@ -348,6 +356,51 @@ int md5_test() } +int md4_test() +{ + MD4 md4; + byte hash[MD4::DIGEST_SIZE]; + + testVector test_md4[] = + { + testVector("", + "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31\xb7\x3c\x59\xd7\xe0\xc0\x89" + "\xc0"), + testVector("a", + "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46\x24\x5e\x05\xfb\xdb\xd6\xfb" + "\x24"), + testVector("abc", + "\xa4\x48\x01\x7a\xaf\x21\xd8\x52\x5f\xc1\x0a\xe8\x7a\xa6\x72" + "\x9d"), + testVector("message digest", + "\xd9\x13\x0a\x81\x64\x54\x9f\xe8\x18\x87\x48\x06\xe1\xc7\x01" + "\x4b"), + testVector("abcdefghijklmnopqrstuvwxyz", + "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd\xee\xa8\xed\x63\xdf\x41\x2d" + "\xa9"), + testVector("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345" + "6789", + "\x04\x3f\x85\x82\xf2\x41\xdb\x35\x1c\xe6\x27\xe1\x53\xe7\xf0" + "\xe4"), + testVector("1234567890123456789012345678901234567890123456789012345678" + "9012345678901234567890", + "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19\x9c\x3e\x7b\x16\x4f\xcc\x05" + "\x36") + }; + + int times( sizeof(test_md4) / sizeof(testVector) ); + for (int i = 0; i < times; ++i) { + md4.Update(test_md4[i].input_, test_md4[i].inLen_); + md4.Final(hash); + + if (memcmp(hash, test_md4[i].output_, MD4::DIGEST_SIZE) != 0) + return -5 - i; + } + + return 0; +} + + int md2_test() { MD2 md5; diff --git a/extra/yassl/testsuite/test.hpp b/extra/yassl/testsuite/test.hpp index 259975fba0b..c80e3ad23da 100644 --- a/extra/yassl/testsuite/test.hpp +++ b/extra/yassl/testsuite/test.hpp @@ -33,10 +33,16 @@ // HPUX doesn't use socklent_t for third parameter to accept -#if !defined(__hpux__) +#if !defined(__hpux) typedef socklen_t* ACCEPT_THIRD_T; #else typedef int* ACCEPT_THIRD_T; + +// HPUX does not define _POSIX_THREADS as it's not _fully_ implemented +#ifndef _POSIX_THREADS +#define _POSIX_THREADS +#endif + #endif diff --git a/include/m_string.h b/include/m_string.h index ce34c303c22..9f7ec220f2c 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -240,4 +240,22 @@ extern int my_snprintf(char* to, size_t n, const char* fmt, ...); #if defined(__cplusplus) } #endif + +/* + LEX_STRING -- a pair of a C-string and its length. + + NOTE: this exactly form of declaration is required for some C-compilers + (for one, Sun C 5.7 2005/01/07). Unfortunatelt with such declaration + LEX_STRING can not be forward declared. +*/ + +typedef struct +{ + char *str; + uint length; +} LEX_STRING; + +#define STRING_WITH_LEN(X) (X), ((uint) (sizeof(X) - 1)) +#define C_STRING_WITH_SIZE(X) ((char *) (X)), ((uint) (sizeof(X) - 1)) + #endif diff --git a/include/my_sys.h b/include/my_sys.h index 3a4895f5dc5..5024505a821 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -77,6 +77,10 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MY_GIVE_INFO 2 /* Give time info about process*/ #define MY_DONT_FREE_DBUG 4 /* Do not call DBUG_END() in my_end() */ +#define MY_REMOVE_NONE 0 /* Params for modify_defaults_file */ +#define MY_REMOVE_OPTION 1 +#define MY_REMOVE_SECTION 2 + #define ME_HIGHBYTE 8 /* Shift for colours */ #define ME_NOCUR 1 /* Don't use curses message */ #define ME_OLDWIN 2 /* Use old window */ diff --git a/include/mysql_com.h b/include/mysql_com.h index 2af0fb86906..bff5fcc47d2 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -423,17 +423,11 @@ char *octet2hex(char *to, const char *str, unsigned int len); /* end of password.c */ -char *get_tty_password(char *opt_message); +char *get_tty_password(const char *opt_message); const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); /* Some other useful functions */ -my_bool my_init(void); -extern int modify_defaults_file(const char *file_location, const char *option, - const char *option_value, - const char *section_name, int remove_option); -int load_defaults(const char *conf_file, const char **groups, - int *argc, char ***argv); my_bool my_thread_init(void); void my_thread_end(void); diff --git a/libmysql/get_password.c b/libmysql/get_password.c index a48cb6d7a6e..4c251677a66 100644 --- a/libmysql/get_password.c +++ b/libmysql/get_password.c @@ -75,7 +75,7 @@ #define _cputs(A) putstring(A) #endif -char *get_tty_password(char *opt_message) +char *get_tty_password(const char *opt_message) { char to[80]; char *pos=to,*end=to+sizeof(to)-1; @@ -159,7 +159,7 @@ static void get_password(char *to,uint length,int fd,bool echo) #endif /* ! HAVE_GETPASS */ -char *get_tty_password(char *opt_message) +char *get_tty_password(const char *opt_message) { #ifdef HAVE_GETPASS char *passbuff; diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 8d1591282db..a3af2d43bd5 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -68,7 +68,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \ sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \ parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \ - event_executor.cc event.cc event_timed.cc \ + event_scheduler.cc event.cc event_timed.cc \ rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \ sql_tablespace.cc \ rpl_injector.cc my_user.c partition_info.cc diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 0591c24e914..8923c032dff 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1220,9 +1220,12 @@ sub environment_setup () { $ENV{'NDBCLUSTER_PORT_SLAVE'}=$opt_ndbcluster_port_slave; $ENV{'NDB_STATUS_OK'}= "YES"; + $ENV{'IM_EXE'}= $exe_im; $ENV{'IM_PATH_PID'}= $instance_manager->{path_pid}; $ENV{'IM_PATH_ANGEL_PID'}= $instance_manager->{path_angel_pid}; $ENV{'IM_PORT'}= $instance_manager->{port}; + $ENV{'IM_DEFAULTS_PATH'}= $instance_manager->{defaults_file}; + $ENV{'IM_PASSWORD_PATH'}= $instance_manager->{password_file}; $ENV{'IM_MYSQLD1_SOCK'}= $instance_manager->{instances}->[0]->{path_sock}; $ENV{'IM_MYSQLD1_PORT'}= $instance_manager->{instances}->[0]->{port}; diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index 01d206be7cb..d02a2af3c9f 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -17,13 +17,13 @@ db_x SHOW TABLES FROM db_x; Tables_in_db_x x_table -SET GLOBAL event_scheduler=0; +SET GLOBAL event_scheduler=2; DROP EVENT e_x1; DROP EVENT e_x2; DROP DATABASE db_x; DROP USER pauline@localhost; USE events_test; -SET GLOBAL event_scheduler=0; +SET GLOBAL event_scheduler=2; drop event if exists event1; Warnings: Note 1305 Event event1 does not exist @@ -100,7 +100,7 @@ a 800219 drop event non_qualif_ev; drop table non_qualif; -set global event_scheduler = 0; +set global event_scheduler = 2; create table t_event3 (a int, b float); drop event if exists event3; Warnings: @@ -324,18 +324,18 @@ events_test one_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED events_test three_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED events_test two_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED "This should show us only 3 events:"; -SHOW FULL EVENTS; +SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test one_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED events_test three_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED events_test two_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED "This should show us only 2 events:"; -SHOW FULL EVENTS LIKE 't%event'; +SHOW EVENTS LIKE 't%event'; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test three_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED events_test two_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED "This should show us no events:"; -SHOW FULL EVENTS FROM test LIKE '%'; +SHOW EVENTS FROM test LIKE '%'; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status DROP DATABASE events_test2; "should see 1 event:"; @@ -343,11 +343,8 @@ SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status events_test one_event root@localhost RECURRING NULL 10 SECOND # # ENABLED "we should see 4 events now:"; -SHOW FULL EVENTS; +SHOW EVENTS; Db Name Definer Type Execute at Interval value Interval field Starts Ends Status -events_test one_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED -events_test three_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED -events_test two_event ev_test@localhost RECURRING NULL 20 SECOND # # ENABLED events_test one_event root@localhost RECURRING NULL 10 SECOND # # ENABLED SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT from information_schema.events; EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT @@ -373,12 +370,12 @@ ERROR HY000: Incorrect AT value: 'definitely not a datetime' set names utf8; create event задачка on schedule every 123 minute starts now() ends now() + interval 1 month do select 1; drop event задачка; -set event_scheduler=0; +set event_scheduler=2; ERROR HY000: Variable 'event_scheduler' is a GLOBAL variable and should be set with SET GLOBAL -set global event_scheduler=2; -ERROR 42000: Variable 'event_scheduler' can't be set to the value of '2' +set global event_scheduler=3; +ERROR 42000: Variable 'event_scheduler' can't be set to the value of '3' "DISABLE the scheduler. Testing that it does not work when the variable is 0" -set global event_scheduler=0; +set global event_scheduler=2; select definer, name, db from mysql.event; definer name db select get_lock("test_lock1", 20); @@ -389,9 +386,10 @@ create event закачка on schedule every 10 hour do select get_lock("test_l select definer, name, db from mysql.event; definer name db root@localhost закачка events_test -"Should be 0 processes" +"Should be only 1 process" select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info; user host db command state info +event_scheduler localhost NULL Connect Suspended NULL select release_lock("test_lock1"); release_lock("test_lock1") 1 @@ -409,11 +407,12 @@ get_lock("test_lock2", 20) create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20); "Let some time pass to the event starts" "Should have only 2 processes: the scheduler and the locked event" -select /*1*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info; +select /*2*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info; user host db command state info event_scheduler localhost NULL Connect Sleeping NULL root localhost events_test Connect User lock select get_lock("test_lock2", 20) "Release the mutex, the event worker should finish." +"Release the mutex, the event worker should finish." select release_lock("test_lock2"); release_lock("test_lock2") 1 @@ -423,21 +422,17 @@ select get_lock("test_lock2_1", 20); get_lock("test_lock2_1", 20) 1 create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20); -"Should see 1 process, locked on get_lock(" -"Shutting down the scheduler, it should wait for the running event" -set global event_scheduler=0; -"Should have only 2 processes: the scheduler and the locked event" -select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info; +"Should have only 3 processes: the scheduler, our conn and the locked event" +select /*3*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info; user host db command state info event_scheduler localhost NULL Connect Sleeping NULL root localhost events_test Connect User lock select get_lock("test_lock2_1", 20) -"Release the lock so the child process should finish. Hence the scheduler also" -select release_lock("test_lock2_1"); -release_lock("test_lock2_1") -1 -"Should see 0 processes now:" -select /*5*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info; +set global event_scheduler=2; +"Should have only our process now:" +select /*4*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info; user host db command state info +event_scheduler localhost NULL Connect Suspended NULL +root localhost events_test Connect User lock select get_lock("test_lock2_1", 20) drop event закачка21; create table t_16 (s1 int); create trigger t_16_bi before insert on t_16 for each row create event e_16 on schedule every 1 second do set @a=5; @@ -457,6 +452,9 @@ select 2; select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space'; event_schema event_name definer event_body events_test white_space root@localhost select 2 +select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space'; +event_schema event_name definer event_body +events_test white_space root@localhost select 2 drop event white_space; create event white_space on schedule every 10 hour disable do select 3; select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space'; diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index ef1ccfadecb..bc89c692f9a 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -35,7 +35,7 @@ create event e_55 on schedule every 10 hour starts 99990101000000 do drop table ERROR HY000: Incorrect STARTS value: '99990101000000' create event e_55 on schedule every 10 minute ends 99990101000000 do drop table t; ERROR HY000: ENDS is either invalid or before STARTS -set global event_scheduler=0; +set global event_scheduler=2; "Wait a bit to settle down" delete from mysql.event; set global event_scheduler= 1; @@ -57,7 +57,7 @@ root localhost events_test Connect User lock select get_lock('test_bug16407', 60 select release_lock('test_bug16407'); release_lock('test_bug16407') 1 -set global event_scheduler= 0; +set global event_scheduler= 2; select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name; event_schema event_name sql_mode events_test e_16407 REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI @@ -115,7 +115,7 @@ release_lock('ee_16407_2') select /*3*/ user, host, db, command, state, info from information_schema.processlist where info is null or info not like '%processlist%' order by info; user host db command state info event_scheduler localhost NULL Connect Sleeping NULL -set global event_scheduler= 0; +set global event_scheduler= 2; select * from events_smode_test order by ev_name, a; ev_name a ee_16407_3 1980-02-19 @@ -175,7 +175,7 @@ drop event ee_16407_5; drop event ee_16407_6; drop procedure ee_16407_5_pendant; drop procedure ee_16407_6_pendant; -set global event_scheduler= 0; +set global event_scheduler= 2; drop table events_smode_test; set sql_mode=@old_sql_mode; drop database events_test; diff --git a/mysql-test/r/events_logs_tests.result b/mysql-test/r/events_logs_tests.result index ab1666fefb9..911bc8b2d60 100644 --- a/mysql-test/r/events_logs_tests.result +++ b/mysql-test/r/events_logs_tests.result @@ -8,7 +8,7 @@ BEGIN SELECT user_host, argument FROM mysql.general_log WHERE argument LIKE '%alabala%'; END| "Check General Query Log" -SET GLOBAL event_scheduler=0; +SET GLOBAL event_scheduler=2; create event log_general on schedule every 1 minute do SELect 'alabala', sleep(3) from dual; TRUNCATE mysql.general_log; "1 row, the current statement!" @@ -22,7 +22,7 @@ user_host argument root[root] @ localhost [localhost] SELect 'alabala', sleep(3) from dual DROP PROCEDURE select_general_log; DROP EVENT log_general; -SET GLOBAL event_scheduler=0; +SET GLOBAL event_scheduler=2; "Check slow query log" "Save the values" SET @old_global_long_query_time:=(select get_value()); @@ -36,14 +36,14 @@ SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; user_host query_time db sql_text "Set new values" SET GLOBAL long_query_time=4; -SET SESSION long_query_time=2; +SET SESSION long_query_time=1; "Check that logging is working" -SELECT SLEEP(3); -SLEEP(3) +SELECT SLEEP(2); +SLEEP(2) 0 SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; user_host query_time db sql_text -root[root] @ localhost [] SLEEPVAL events_test SELECT SLEEP(3) +root[root] @ localhost [] SLEEPVAL events_test SELECT SLEEP(2) TRUNCATE mysql.slow_log; CREATE TABLE slow_event_test (slo_val tinyint, val tinyint); "This won't go to the slow log" @@ -54,7 +54,7 @@ SET GLOBAL event_scheduler=1; "Sleep some more time than the actual event run will take" SHOW VARIABLES LIKE 'event_scheduler'; Variable_name Value -event_scheduler ON +event_scheduler 1 "Check our table. Should see 1 row" SELECT * FROM slow_event_test; slo_val val @@ -64,18 +64,19 @@ SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; user_host query_time db sql_text "This should go to the slow log" SET SESSION long_query_time=10; +SET GLOBAL long_query_time=1; DROP EVENT long_event; -CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(5); +CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2); "Sleep some more time than the actual event run will take" "Check our table. Should see 2 rows" SELECT * FROM slow_event_test; slo_val val 4 0 -4 0 -"Check slow log. Should see 1 row because 5 is over the threshold of 4 for GLOBAL, though under SESSION which is 10" +1 0 +"Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10" SELECT user_host, query_time, db, sql_text FROM mysql.slow_log; user_host query_time db sql_text -root[root] @ localhost [localhost] SLEEPVAL events_test INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(5) +root[root] @ localhost [localhost] SLEEPVAL events_test INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2) DROP EVENT long_event2; SET GLOBAL long_query_time =@old_global_long_query_time; SET SESSION long_query_time =@old_session_long_query_time; diff --git a/mysql-test/r/events_microsec.result b/mysql-test/r/events_microsec.result index ed15b066b93..b96bd551511 100644 --- a/mysql-test/r/events_microsec.result +++ b/mysql-test/r/events_microsec.result @@ -10,50 +10,4 @@ CREATE EVENT micro_test ON SCHEDULE EVERY 100 MINUTE_MICROSECOND DO SELECT 1; ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND' CREATE EVENT micro_test ON SCHEDULE EVERY 100 SECOND_MICROSECOND DO SELECT 1; ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND' -"Now create normal event and change it on SQL level" -CREATE EVENT micro_test2 ON SCHEDULE EVERY 1 MONTH DO SELECT 1; -UPDATE mysql.event SET interval_field='MICROSECOND' WHERE db=database() AND definer=user() AND name='micro_test2'; -SHOW CREATE EVENT micro_test2; -ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND' -SET GLOBAL event_scheduler=0; -"Should not be running:" -SHOW VARIABLES like 'event_scheduler'; -Variable_name Value -event_scheduler OFF -UPDATE mysql.event SET interval_field='DAY_MICROSECOND' WHERE db=database() AND definer=user() AND name='micro_test2'; -SHOW CREATE EVENT micro_test2; -ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND' -SET GLOBAL event_scheduler=0; -"Should not be running:" -SHOW VARIABLES like 'event_scheduler'; -Variable_name Value -event_scheduler OFF -UPDATE mysql.event SET interval_field='SECOND_MICROSECOND' WHERE db=database() AND definer=user() AND name='micro_test2'; -SHOW CREATE EVENT micro_test2; -ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND' -SET GLOBAL event_scheduler=0; -"Should not be running:" -SHOW VARIABLES like 'event_scheduler'; -Variable_name Value -event_scheduler OFF -UPDATE mysql.event SET interval_field='HOUR_MICROSECOND' WHERE db=database() AND definer=user() AND name='micro_test2'; -SHOW CREATE EVENT micro_test2; -ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND' -SET GLOBAL event_scheduler=0; -"Should not be running:" -SHOW VARIABLES like 'event_scheduler'; -Variable_name Value -event_scheduler OFF -UPDATE mysql.event SET interval_field='MINUTE_MICROSECOND' WHERE db=database() AND definer=user() AND name='micro_test2'; -SHOW CREATE EVENT micro_test2; -ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND' -SET GLOBAL event_scheduler=0; -"Should not be running:" -SHOW VARIABLES like 'event_scheduler'; -Variable_name Value -event_scheduler OFF -SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER='event_scheduler'; -COUNT(*) -0 -DROP EVENT micro_test2; drop database events_test; diff --git a/mysql-test/r/events_scheduling.result b/mysql-test/r/events_scheduling.result index 8b1f29d320f..aec2053f0e7 100644 --- a/mysql-test/r/events_scheduling.result +++ b/mysql-test/r/events_scheduling.result @@ -14,7 +14,7 @@ ENDS NOW() + INTERVAL 6 SECOND ON COMPLETION PRESERVE DO INSERT INTO table_2 VALUES(1); CREATE EVENT only_one_time ON SCHEDULE EVERY 2 SECOND ENDS NOW() + INTERVAL 1 SECOND DO INSERT INTO table_3 VALUES(1); -CREATE EVENT two_time ON SCHEDULE EVERY 1 SECOND ENDS NOW() + INTERVAL 1 SECOND DO INSERT INTO table_4 VALUES(1); +CREATE EVENT two_time ON SCHEDULE EVERY 1 SECOND ENDS NOW() + INTERVAL 1 SECOND ON COMPLETION PRESERVE DO INSERT INTO table_4 VALUES(1); SELECT IF(SUM(a) >= 4, 'OK', 'ERROR') FROM table_1; IF(SUM(a) >= 4, 'OK', 'ERROR') OK @@ -38,9 +38,12 @@ DROP EVENT start_n_end; "Already dropped because ended. Therefore an error." DROP EVENT only_one_time; ERROR HY000: Unknown event 'only_one_time' -"Already dropped because ended. Therefore an error." +"Should be preserved" +SELECT EVENT_NAME, STATUS FROM INFORMATION_SCHEMA.EVENTS; +EVENT_NAME STATUS +E19170 ENABLED +two_time DISABLED DROP EVENT two_time; -ERROR HY000: Unknown event 'two_time' DROP TABLE table_1; DROP TABLE table_2; DROP TABLE table_3; diff --git a/mysql-test/r/events_stress.result b/mysql-test/r/events_stress.result index 9f95cfad75d..ead618e8136 100644 --- a/mysql-test/r/events_stress.result +++ b/mysql-test/r/events_stress.result @@ -1,46 +1,61 @@ CREATE DATABASE IF NOT EXISTS events_test; -CREATE DATABASE events_test2; -USE events_test2; +CREATE DATABASE events_conn1_test2; +CREATE TABLE events_test.fill_it(test_name varchar(20), occur datetime); +CREATE USER event_user2@localhost; +CREATE DATABASE events_conn2_db; +GRANT ALL ON *.* TO event_user2@localhost; +CREATE USER event_user3@localhost; +CREATE DATABASE events_conn3_db; +GRANT ALL ON *.* TO event_user3@localhost; +"In the second connection we create some events which won't be dropped till the end" +"In the second connection we create some events which won't be dropped till the end" +USE events_conn1_test2; CREATE EVENT ev_drop1 ON SCHEDULE EVERY 10 MINUTE DISABLE DO SELECT 1; CREATE EVENT ev_drop2 ON SCHEDULE EVERY 10 MINUTE DISABLE DO SELECT 1; CREATE EVENT ev_drop3 ON SCHEDULE EVERY 10 MINUTE DISABLE DO SELECT 1; USE events_test; -SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_test2'; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS; +COUNT(*) +103 +SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2'; COUNT(*) 3 -DROP DATABASE events_test2; -SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_test2'; +DROP DATABASE events_conn1_test2; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2'; COUNT(*) 0 "Now testing stability - dropping db -> events while they are running" -CREATE DATABASE events_test2; -USE events_test2; -SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_test2'; +CREATE DATABASE events_conn1_test2; +USE events_conn1_test2; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2'; COUNT(*) -1000 +50 SET GLOBAL event_scheduler=1; -DROP DATABASE events_test2; -SET GLOBAL event_scheduler=0; -SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_test2'; +DROP DATABASE events_conn1_test2; +SET GLOBAL event_scheduler=2; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2'; COUNT(*) 0 -CREATE DATABASE events_test3; -USE events_test3; -SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_test3'; -COUNT(*) -950 -CREATE DATABASE events_test4; -USE events_test4; -CREATE DATABASE events_test2; -USE events_test2; -SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_test2'; -COUNT(*) -1050 -DROP DATABASE events_test2; -SET GLOBAL event_scheduler=0; -DROP DATABASE events_test3; +CREATE DATABASE events_conn1_test3; +USE events_conn1_test3; SET GLOBAL event_scheduler=1; -DROP DATABASE events_test4; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test3'; +COUNT(*) +50 +CREATE DATABASE events_conn1_test4; +USE events_conn1_test4; +CREATE DATABASE events_conn1_test2; +USE events_conn1_test2; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2'; +COUNT(*) +50 +DROP DATABASE events_conn2_db; +DROP DATABASE events_conn3_db; +DROP DATABASE events_conn1_test2; +DROP DATABASE events_conn1_test3; +SET GLOBAL event_scheduler=2; +DROP DATABASE events_conn1_test4; SET GLOBAL event_scheduler=1; USE events_test; +DROP TABLE fill_it; DROP DATABASE events_test; diff --git a/mysql-test/r/im_cmd_line.result b/mysql-test/r/im_cmd_line.result new file mode 100644 index 00000000000..5b289549a3f --- /dev/null +++ b/mysql-test/r/im_cmd_line.result @@ -0,0 +1,40 @@ +--> Listing users... +im_admin + +==> Adding user 'testuser'... + +--> IM password file: +testuser:*0D3CED9BEC10A777AEC23CCC353A8C08A633045E +im_admin:*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295 +--> EOF + +--> Printing out line for 'testuser'... +testuser:*0D3CED9BEC10A777AEC23CCC353A8C08A633045E + +--> Listing users... +im_admin +testuser + +==> Changing the password of 'testuser'... + +--> IM password file: +im_admin:*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295 +testuser:*39C549BDECFBA8AFC3CE6B948C9359A0ECE08DE2 +--> EOF + +--> Printing out line for 'testuser'... +testuser:*39C549BDECFBA8AFC3CE6B948C9359A0ECE08DE2 + +--> Listing users... +testuser +im_admin + +==> Dropping user 'testuser'... + +--> IM password file: +im_admin:*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295 +--> EOF + +--> Listing users... +im_admin + diff --git a/mysql-test/r/im_daemon_life_cycle.result b/mysql-test/r/im_daemon_life_cycle.result index d0a76b450fe..29c9ea2047d 100644 --- a/mysql-test/r/im_daemon_life_cycle.result +++ b/mysql-test/r/im_daemon_life_cycle.result @@ -1,5 +1,5 @@ SHOW INSTANCES; -instance_name status +instance_name state mysqld1 online mysqld2 offline Killing the process... diff --git a/mysql-test/r/im_instance_conf.result b/mysql-test/r/im_instance_conf.result new file mode 100644 index 00000000000..efda9439f38 --- /dev/null +++ b/mysql-test/r/im_instance_conf.result @@ -0,0 +1,196 @@ +-------------------------------------------------------------------- +server_id = 1 +server_id = 2 +-------------------------------------------------------------------- +SHOW INSTANCES; +instance_name state +mysqld1 online +mysqld2 offline + +---> connection: mysql1_con +SHOW VARIABLES LIKE 'server_id'; +Variable_name Value +server_id 1 + +---> connection: default +CREATE INSTANCE mysqld3; +SHOW INSTANCES; +instance_name state +mysqld3 offline +mysqld2 offline +mysqld1 online +-------------------------------------------------------------------- +server_id = 1 +server_id = 2 +-------------------------------------------------------------------- +CREATE INSTANCE mysqld1; +ERROR HY000: Instance already exists +CREATE INSTANCE mysqld2; +ERROR HY000: Instance already exists +CREATE INSTANCE mysqld3; +ERROR HY000: Instance already exists +-------------------------------------------------------------------- +nonguarded +-------------------------------------------------------------------- +CREATE INSTANCE mysqld4 nonguarded; +SHOW INSTANCES; +instance_name state +mysqld3 offline +mysqld4 offline +mysqld1 online +mysqld2 offline +-------------------------------------------------------------------- +nonguarded +nonguarded +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +CREATE INSTANCE mysqld5 test-A = 000, test-B = test; +SHOW INSTANCES; +instance_name state +mysqld1 online +mysqld4 offline +mysqld5 offline +mysqld2 offline +mysqld3 offline +-------------------------------------------------------------------- +test-A=000 +-------------------------------------------------------------------- +test-B=test +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +CREATE INSTANCE mysqld6 test-C1 = 10 , test-C2 = 02 ; +SHOW INSTANCES; +instance_name state +mysqld1 online +mysqld2 offline +mysqld5 offline +mysqld6 offline +mysqld3 offline +mysqld4 offline +-------------------------------------------------------------------- +test-C1=10 +-------------------------------------------------------------------- +test-C2=02 +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +CREATE INSTANCE mysqld7 test-D = test-D-value ; +ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use +SHOW INSTANCES; +instance_name state +mysqld1 online +mysqld2 offline +mysqld5 offline +mysqld6 offline +mysqld3 offline +mysqld4 offline +CREATE INSTANCE mysqld8 test-E 0 ; +ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use +SHOW INSTANCES; +instance_name state +mysqld1 online +mysqld2 offline +mysqld5 offline +mysqld6 offline +mysqld3 offline +mysqld4 offline +CREATE INSTANCE mysqld8 test-F = ; +ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use +SHOW INSTANCES; +instance_name state +mysqld1 online +mysqld2 offline +mysqld5 offline +mysqld6 offline +mysqld3 offline +mysqld4 offline +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +CREATE INSTANCE mysqld9 test-1=" hello world ", test-2=' '; +SHOW INSTANCES; +instance_name state +mysqld1 online +mysqld2 offline +mysqld5 offline +mysqld6 offline +mysqld3 offline +mysqld4 offline +mysqld9 offline +CREATE INSTANCE mysqld9a test-3='\b\babc\sdef'; +SHOW INSTANCES; +instance_name state +mysqld1 online +mysqld9a offline +mysqld5 offline +mysqld6 offline +mysqld3 offline +mysqld4 offline +mysqld9 offline +mysqld2 offline +CREATE INSTANCE mysqld9b test-4='abc\tdef', test-5='abc\ndef'; +SHOW INSTANCES; +instance_name state +mysqld9b offline +mysqld9a offline +mysqld5 offline +mysqld6 offline +mysqld3 offline +mysqld4 offline +mysqld9 offline +mysqld2 offline +mysqld1 online +CREATE INSTANCE mysqld9c test-6="abc\rdef", test-7="abc\\def"; +SHOW INSTANCES; +instance_name state +mysqld9b offline +mysqld6 offline +mysqld5 offline +mysqld9c offline +mysqld3 offline +mysqld4 offline +mysqld9 offline +mysqld2 offline +mysqld1 online +mysqld9a offline +CREATE INSTANCE mysqld10 test-bad=' \ '; +ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use +SHOW INSTANCES; +instance_name state +mysqld9b offline +mysqld6 offline +mysqld5 offline +mysqld9c offline +mysqld3 offline +mysqld4 offline +mysqld9 offline +mysqld2 offline +mysqld1 online +mysqld9a offline +-------------------------------------------------------------------- +test-1= hello world +-------------------------------------------------------------------- +test-2= +-------------------------------------------------------------------- +test-3=abc def +-------------------------------------------------------------------- +test-4=abc def +-------------------------------------------------------------------- +test-5=abc +-------------------------------------------------------------------- +test-6=abc def +-------------------------------------------------------------------- +test-7=abc\def +-------------------------------------------------------------------- +-------------------------------------------------------------------- +CREATE INSTANCE qqq1; +ERROR HY000: Malformed instance name. diff --git a/mysql-test/r/im_life_cycle.result b/mysql-test/r/im_life_cycle.result index e208ccb9f00..876fbb38eee 100644 --- a/mysql-test/r/im_life_cycle.result +++ b/mysql-test/r/im_life_cycle.result @@ -1,69 +1,93 @@ + +-------------------------------------------------------------------- +-- 1.1.1. +-------------------------------------------------------------------- SHOW INSTANCES; -instance_name status +instance_name state mysqld1 online mysqld2 offline -SHOW INSTANCE STATUS mysqld1; -instance_name status version_number version -mysqld1 online VERSION_NUMBER VERSION -SHOW INSTANCE STATUS mysqld2; -instance_name status version_number version -mysqld2 offline VERSION_NUMBER VERSION + +-------------------------------------------------------------------- +-- 1.1.2. +-------------------------------------------------------------------- START INSTANCE mysqld2; SHOW INSTANCES; -instance_name status +instance_name state mysqld1 online mysqld2 online -SHOW INSTANCE STATUS mysqld1; -instance_name status version_number version -mysqld1 online VERSION_NUMBER VERSION -SHOW INSTANCE STATUS mysqld2; -instance_name status version_number version -mysqld2 online VERSION_NUMBER VERSION SHOW VARIABLES LIKE 'port'; Variable_name Value -port IM_MYSQLD1_PORT +port IM_MYSQLD2_PORT + +-------------------------------------------------------------------- +-- 1.1.3. +-------------------------------------------------------------------- STOP INSTANCE mysqld2; SHOW INSTANCES; -instance_name status +instance_name state mysqld1 online mysqld2 offline SHOW INSTANCE STATUS mysqld1; -instance_name status version_number version -mysqld1 online VERSION_NUMBER VERSION +instance_name state version_number version mysqld_compatible +mysqld1 online VERSION_NUMBER VERSION no SHOW INSTANCE STATUS mysqld2; -instance_name status version_number version -mysqld2 offline VERSION_NUMBER VERSION +instance_name state version_number version mysqld_compatible +mysqld2 offline VERSION_NUMBER VERSION no + +-------------------------------------------------------------------- +-- 1.1.4. +-------------------------------------------------------------------- START INSTANCE mysqld3; ERROR HY000: Bad instance name. Check that the instance with such a name exists START INSTANCE mysqld1; ERROR HY000: The instance is already started + +-------------------------------------------------------------------- +-- 1.1.5. +-------------------------------------------------------------------- STOP INSTANCE mysqld3; ERROR HY000: Bad instance name. Check that the instance with such a name exists + +-------------------------------------------------------------------- +-- 1.1.6. +-------------------------------------------------------------------- SHOW INSTANCES; -instance_name status +instance_name state mysqld1 online mysqld2 offline Killing the process... Sleeping... Success: the process was restarted. + +-------------------------------------------------------------------- +-- 1.1.7. +-------------------------------------------------------------------- SHOW INSTANCES; -instance_name status +instance_name state mysqld1 online mysqld2 offline START INSTANCE mysqld2; SHOW INSTANCES; -instance_name status +instance_name state mysqld1 online mysqld2 online Killing the process... Sleeping... Success: the process was killed. SHOW INSTANCES; -instance_name status +instance_name state mysqld1 online mysqld2 offline + +-------------------------------------------------------------------- +-- 1.1.8. +-------------------------------------------------------------------- SHOW INSTANCE STATUS; ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use + +-------------------------------------------------------------------- +-- BUG#12813 +-------------------------------------------------------------------- START INSTANCE mysqld1,mysqld2,mysqld3; ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use STOP INSTANCE mysqld1,mysqld2,mysqld3; diff --git a/mysql-test/r/im_options.result b/mysql-test/r/im_options.result new file mode 100644 index 00000000000..8039333b7d9 --- /dev/null +++ b/mysql-test/r/im_options.result @@ -0,0 +1,150 @@ +-------------------------------------------------------------------- +server_id = 1 +server_id = 2 +-------------------------------------------------------------------- +SHOW VARIABLES LIKE 'server_id'; +Variable_name Value +server_id 1 +SHOW INSTANCES; +instance_name state +mysqld1 starting +mysqld2 offline +UNSET mysqld1.server_id; +ERROR HY000: The instance is active. Stop the instance first +SET mysqld1.server_id = 11; +ERROR HY000: The instance is active. Stop the instance first +CREATE INSTANCE mysqld3 datadir = '/'; +START INSTANCE mysqld3; +UNSET mysqld3.server_id; +ERROR HY000: The instance is active. Stop the instance first +SET mysqld3.server_id = 11; +ERROR HY000: The instance is active. Stop the instance first +STOP INSTANCE mysqld3; +SHOW INSTANCE STATUS mysqld3; +instance_name state version_number version mysqld_compatible +mysqld3 offline VERSION_NUMBER VERSION no +UNSET mysqld2.server_id; +UNSET mysqld2.server_id; +SHOW INSTANCE OPTIONS mysqld2; +option_name value +instance_name option_value +socket option_value +pid-file option_value +port option_value +datadir option_value +log option_value +log-error option_value +log-slow-queries option_value +language option_value +character-sets-dir option_value +basedir option_value +skip-stack-trace option_value +skip-innodb option_value +skip-bdb option_value +skip-ndbcluster option_value +nonguarded option_value +log-output option_value +SET mysqld2.server_id = 2; +SET mysqld2.server_id = 2; +SHOW INSTANCE OPTIONS mysqld2; +option_name value +instance_name option_value +socket option_value +pid-file option_value +port option_value +datadir option_value +log option_value +log-error option_value +log-slow-queries option_value +language option_value +character-sets-dir option_value +basedir option_value +skip-stack-trace option_value +skip-innodb option_value +skip-bdb option_value +skip-ndbcluster option_value +nonguarded option_value +log-output option_value +server_id option_value +UNSET mysqld2.server_id = 11; +ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use +SET mysqld2.aaa, mysqld3.bbb, mysqld2.ccc = 0010, mysqld3.ddd = 0020; +-------------------------------------------------------------------- +aaa +-------------------------------------------------------------------- +bbb +-------------------------------------------------------------------- +ccc=0010 +-------------------------------------------------------------------- +ddd=0020 +-------------------------------------------------------------------- +UNSET mysqld2.aaa, mysqld3.bbb, mysqld2.ccc, mysqld3.ddd; +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +SET mysqld2.aaa, mysqld3.bbb, mysqld.ccc = 0010; +ERROR HY000: Bad instance name. Check that the instance with such a name exists +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +SET mysqld2.aaa, mysqld3.bbb, mysqld1.ccc = 0010; +ERROR HY000: The instance is active. Stop the instance first +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +UNSET mysqld2.server_id, mysqld3.server_id, mysqld.ccc; +ERROR HY000: Bad instance name. Check that the instance with such a name exists +-------------------------------------------------------------------- +server_id = 1 +server_id=2 +-------------------------------------------------------------------- +UNSET mysqld2.server_id, mysqld3.server_id, mysqld1.ccc; +ERROR HY000: The instance is active. Stop the instance first +-------------------------------------------------------------------- +server_id = 1 +server_id=2 +-------------------------------------------------------------------- +DROP INSTANCE mysqld3; +SET mysqld2.server_id=222; +SET mysqld2.server_id = 222; +SET mysqld2.server_id = 222 ; +SET mysqld2 . server_id = 222 ; +SET mysqld2 . server_id = 222 , mysqld2 . aaa , mysqld2 . bbb ; +-------------------------------------------------------------------- +server_id = 1 +server_id=222 +-------------------------------------------------------------------- +aaa +-------------------------------------------------------------------- +bbb +-------------------------------------------------------------------- +UNSET mysqld2 . aaa , mysqld2 . bbb ; +-------------------------------------------------------------------- +server_id = 1 +server_id=222 +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +-------------------------------------------------------------------- +server_id = 1 +server_id=222 +-------------------------------------------------------------------- +SHOW VARIABLES LIKE 'server_id'; +Variable_name Value +server_id 1 +SHOW INSTANCES; +instance_name state +mysqld1 online +mysqld2 offline +FLUSH INSTANCES; +ERROR HY000: At least one instance is active. Stop all instances first +STOP INSTANCE mysqld1; +SHOW INSTANCES; +instance_name state +mysqld1 offline +mysqld2 offline +FLUSH INSTANCES; diff --git a/mysql-test/r/im_options_set.result b/mysql-test/r/im_options_set.result deleted file mode 100644 index 5e6c740624e..00000000000 --- a/mysql-test/r/im_options_set.result +++ /dev/null @@ -1,20 +0,0 @@ -server_id = 1 -server_id = 2 -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 -SET mysqld1.server_id = 11; -server_id =11 -server_id = 2 -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 -SET mysqld2.server_id = 12; -server_id =11 -server_id =12 -FLUSH INSTANCES; -server_id =11 -server_id =12 -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 diff --git a/mysql-test/r/im_options_unset.result b/mysql-test/r/im_options_unset.result deleted file mode 100644 index bf54025edb7..00000000000 --- a/mysql-test/r/im_options_unset.result +++ /dev/null @@ -1,15 +0,0 @@ -server_id = 1 -server_id = 2 -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 -UNSET mysqld1.server_id; -server_id = 2 -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 -UNSET mysqld2.server_id; -FLUSH INSTANCES; -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 diff --git a/mysql-test/r/im_utils.result b/mysql-test/r/im_utils.result index 504b2efe4af..ae8e03bf8ea 100644 --- a/mysql-test/r/im_utils.result +++ b/mysql-test/r/im_utils.result @@ -1,11 +1,10 @@ SHOW INSTANCES; -instance_name status +instance_name state mysqld1 online mysqld2 offline SHOW INSTANCE OPTIONS mysqld1; option_name value instance_name VALUE -mysqld-path VALUE socket VALUE pid-file VALUE port VALUE @@ -25,8 +24,6 @@ log-output VALUE SHOW INSTANCE OPTIONS mysqld2; option_name value instance_name VALUE -mysqld-path VALUE -nonguarded VALUE socket VALUE pid-file VALUE port VALUE @@ -42,6 +39,7 @@ skip-stack-trace VALUE skip-innodb VALUE skip-bdb VALUE skip-ndbcluster VALUE +nonguarded VALUE log-output VALUE START INSTANCE mysqld2; STOP INSTANCE mysqld2; diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index 2164c18823f..0b43024cb0f 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -2,14 +2,14 @@ use mysql; truncate table general_log; select * from general_log; event_time user_host thread_id server_id command_type argument -TIMESTAMP root[root] @ localhost [] 1 1 Query select * from general_log +TIMESTAMP root[root] @ localhost [] THREAD_ID 1 Query select * from general_log truncate table slow_log; select * from slow_log; start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text truncate table general_log; select * from general_log where argument like '%general_log%'; event_time user_host thread_id server_id command_type argument -TIMESTAMP root[root] @ localhost [] 1 1 Query select * from general_log where argument like '%general_log%' +TIMESTAMP root[root] @ localhost [] THREAD_ID 1 Query select * from general_log where argument like '%general_log%' create table join_test (verbose_comment varchar (80), command_type varchar(64)); insert into join_test values ("User performed a usual SQL query", "Query"); insert into join_test values ("New DB connection was registered", "Connect"); @@ -59,10 +59,10 @@ create table bug16905 (s char(15) character set utf8 default 'пусто'); insert into bug16905 values ('новое'); select * from mysql.general_log; event_time user_host thread_id server_id command_type argument -TIMESTAMP root[root] @ localhost [] 2 1 Query set names utf8 -TIMESTAMP root[root] @ localhost [] 2 1 Query create table bug16905 (s char(15) character set utf8 default 'пусто') -TIMESTAMP root[root] @ localhost [] 2 1 Query insert into bug16905 values ('новое') -TIMESTAMP root[root] @ localhost [] 2 1 Query select * from mysql.general_log +TIMESTAMP root[root] @ localhost [] THREAD_ID 1 Query set names utf8 +TIMESTAMP root[root] @ localhost [] THREAD_ID 1 Query create table bug16905 (s char(15) character set utf8 default 'пусто') +TIMESTAMP root[root] @ localhost [] THREAD_ID 1 Query insert into bug16905 values ('новое') +TIMESTAMP root[root] @ localhost [] THREAD_ID 1 Query select * from mysql.general_log drop table bug16905; truncate table mysql.slow_log; set session long_query_time=1; diff --git a/mysql-test/r/not_embedded_server.result b/mysql-test/r/not_embedded_server.result index e471b5a3afa..7cbe91b3753 100644 --- a/mysql-test/r/not_embedded_server.result +++ b/mysql-test/r/not_embedded_server.result @@ -1,5 +1,6 @@ prepare stmt1 from ' show full processlist '; execute stmt1; Id User Host db Command Time State Info +number event_scheduler localhost NULL Connect time Suspended NULL number root localhost test Query time NULL show full processlist deallocate prepare stmt1; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index d0b773dfe34..1a1d6432411 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -299,7 +299,7 @@ t9 MyISAM 10 Dynamic 2 216 432 # 2048 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show status like ''Threads_running'' '; execute stmt4; Variable_name Value -Threads_running 1 +Threads_running 2 prepare stmt4 from ' show variables like ''sql_mode'' '; execute stmt4; Variable_name Value diff --git a/mysql-test/r/skip_name_resolve.result b/mysql-test/r/skip_name_resolve.result index 8ef52e75238..855876825ad 100644 --- a/mysql-test/r/skip_name_resolve.result +++ b/mysql-test/r/skip_name_resolve.result @@ -10,5 +10,6 @@ user() # show processlist; Id User Host db Command Time State Info + event_scheduler NULL