1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.1

into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
This commit is contained in:
msvensson@pilot.blaudden
2007-04-02 11:15:09 +02:00
201 changed files with 3947 additions and 2312 deletions

View File

@ -67,5 +67,5 @@ enum options_client
OPT_SLAP_POST_QUERY, OPT_SLAP_POST_QUERY,
OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID, OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID,
OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT, OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT,
OPT_DEBUG_INFO, OPT_COLUMN_TYPES OPT_DEBUG_INFO, OPT_COLUMN_TYPES, OPT_WRITE_BINLOG
}; };

View File

@ -34,7 +34,8 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0, opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0,
opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0, opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0,
tty_password= 0, opt_frm= 0, info_flag= 0, tty_password= 0, opt_frm= 0, info_flag= 0,
opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0; opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0,
opt_write_binlog= 1;
static uint verbose = 0, opt_mysql_port=0; static uint verbose = 0, opt_mysql_port=0;
static my_string opt_mysql_unix_port = 0; static my_string opt_mysql_unix_port = 0;
static char *opt_password = 0, *current_user = 0, static char *opt_password = 0, *current_user = 0,
@ -123,6 +124,10 @@ static struct my_option my_long_options[] =
{"medium-check", 'm', {"medium-check", 'm',
"Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.", "Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"write-binlog", OPT_WRITE_BINLOG,
"Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Enabled by default; use --skip-write-binlog when commands should not be sent to replication slaves.",
(gptr*) &opt_write_binlog, (gptr*) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
{"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, {"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"password", 'p', {"password", 'p',
@ -598,16 +603,16 @@ static int handle_request_for_tables(char *tables, uint length)
if (opt_upgrade) end = strmov(end, " FOR UPGRADE"); if (opt_upgrade) end = strmov(end, " FOR UPGRADE");
break; break;
case DO_REPAIR: case DO_REPAIR:
op = "REPAIR"; op= (opt_write_binlog) ? "REPAIR" : "REPAIR NO_WRITE_TO_BINLOG";
if (opt_quick) end = strmov(end, " QUICK"); if (opt_quick) end = strmov(end, " QUICK");
if (opt_extended) end = strmov(end, " EXTENDED"); if (opt_extended) end = strmov(end, " EXTENDED");
if (opt_frm) end = strmov(end, " USE_FRM"); if (opt_frm) end = strmov(end, " USE_FRM");
break; break;
case DO_ANALYZE: case DO_ANALYZE:
op = "ANALYZE"; op= (opt_write_binlog) ? "ANALYZE" : "ANALYZE NO_WRITE_TO_BINLOG";
break; break;
case DO_OPTIMIZE: case DO_OPTIMIZE:
op = "OPTIMIZE"; op= (opt_write_binlog) ? "OPTIMIZE" : "OPTIMIZE NO_WRITE_TO_BINLOG";
break; break;
case DO_UPGRADE: case DO_UPGRADE:
return fix_object_name("TABLE", tables); return fix_object_name("TABLE", tables);

File diff suppressed because it is too large Load Diff

View File

@ -3540,7 +3540,7 @@ void do_connect(struct st_command *command)
opt_ssl_capath, opt_ssl_cipher); opt_ssl_capath, opt_ssl_cipher);
#if MYSQL_VERSION_ID >= 50000 #if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */ /* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= !strcmp(ds_connection_name.str, "localhost"); opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost");
mysql_options(&next_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, mysql_options(&next_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert); &opt_ssl_verify_server_cert);
#endif #endif
@ -6012,15 +6012,13 @@ int main(int argc, char **argv)
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
#if MYSQL_VERSION_ID >= 50000
opt_ssl_verify_server_cert= TRUE; /* Always on in mysqltest */
#endif
if (opt_use_ssl) if (opt_use_ssl)
{ {
mysql_ssl_set(&cur_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, mysql_ssl_set(&cur_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher); opt_ssl_capath, opt_ssl_cipher);
#if MYSQL_VERSION_ID >= 50000 #if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= opt_host && !strcmp(opt_host, "localhost");
mysql_options(&cur_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, mysql_options(&cur_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert); &opt_ssl_verify_server_cert);
#endif #endif

View File

@ -1,3 +1,11 @@
*****************yaSSL Release notes, version 1.6.0 (2/22/07)
This release of yaSSL contains bug fixes, portability enhancements, and
better X509 support.
See normal build instructions below under 1.0.6.
See libcurl build instructions below under 1.3.0 and note in 1.5.8.
*****************yaSSL Release notes, version 1.5.8 (1/10/07) *****************yaSSL Release notes, version 1.5.8 (1/10/07)
This release of yaSSL contains bug fixes, portability enhancements, and This release of yaSSL contains bug fixes, portability enhancements, and

View File

@ -49,13 +49,11 @@ const uint AUTO = 0xFEEDBEEF;
// Checking Policy should implement a check function that tests whether the // Checking Policy should implement a check function that tests whether the
// index is within the size limit of the array // index is within the size limit of the array
struct Check { struct Check {
Check() {}
void check(uint i, uint limit); void check(uint i, uint limit);
}; };
struct NoCheck { struct NoCheck {
NoCheck() {}
void check(uint, uint); void check(uint, uint);
}; };
@ -193,7 +191,6 @@ inline void checked_delete(T* p)
// sets pointer to zero so safe for std conatiners // sets pointer to zero so safe for std conatiners
struct del_ptr_zero struct del_ptr_zero
{ {
del_ptr_zero() {}
template <typename T> template <typename T>
void operator()(T*& p) const void operator()(T*& p) const
{ {

View File

@ -42,7 +42,6 @@ namespace yaSSL {
// Digest policy should implement a get_digest, update, and get sizes for pad // Digest policy should implement a get_digest, update, and get sizes for pad
// and digest // and digest
struct Digest : public virtual_base { struct Digest : public virtual_base {
Digest() {}
virtual void get_digest(byte*) = 0; virtual void get_digest(byte*) = 0;
virtual void get_digest(byte*, const byte*, unsigned int) = 0; virtual void get_digest(byte*, const byte*, unsigned int) = 0;
virtual void update(const byte*, unsigned int) = 0; virtual void update(const byte*, unsigned int) = 0;
@ -54,7 +53,6 @@ struct Digest : public virtual_base {
// For use with NULL Digests // For use with NULL Digests
struct NO_MAC : public Digest { struct NO_MAC : public Digest {
NO_MAC() {}
void get_digest(byte*); void get_digest(byte*);
void get_digest(byte*, const byte*, unsigned int); void get_digest(byte*, const byte*, unsigned int);
void update(const byte*, unsigned int); void update(const byte*, unsigned int);
@ -179,7 +177,6 @@ private:
// BulkCipher policy should implement encrypt, decrypt, get block size, // BulkCipher policy should implement encrypt, decrypt, get block size,
// and set keys for encrypt and decrypt // and set keys for encrypt and decrypt
struct BulkCipher : public virtual_base { struct BulkCipher : public virtual_base {
BulkCipher() {}
virtual void encrypt(byte*, const byte*, unsigned int) = 0; virtual void encrypt(byte*, const byte*, unsigned int) = 0;
virtual void decrypt(byte*, const byte*, unsigned int) = 0; virtual void decrypt(byte*, const byte*, unsigned int) = 0;
virtual void set_encryptKey(const byte*, const byte* = 0) = 0; virtual void set_encryptKey(const byte*, const byte* = 0) = 0;
@ -193,7 +190,6 @@ struct BulkCipher : public virtual_base {
// For use with NULL Ciphers // For use with NULL Ciphers
struct NO_Cipher : public BulkCipher { struct NO_Cipher : public BulkCipher {
NO_Cipher() {}
void encrypt(byte*, const byte*, unsigned int) {} void encrypt(byte*, const byte*, unsigned int) {}
void decrypt(byte*, const byte*, unsigned int) {} void decrypt(byte*, const byte*, unsigned int) {}
void set_encryptKey(const byte*, const byte*) {} void set_encryptKey(const byte*, const byte*) {}
@ -315,14 +311,12 @@ struct Auth : public virtual_base {
virtual bool verify(const byte*, unsigned int, const byte*, virtual bool verify(const byte*, unsigned int, const byte*,
unsigned int) = 0; unsigned int) = 0;
virtual uint get_signatureLength() const = 0; virtual uint get_signatureLength() const = 0;
Auth() {}
virtual ~Auth() {} virtual ~Auth() {}
}; };
// For use with NULL Authentication schemes // For use with NULL Authentication schemes
struct NO_Auth : public Auth { struct NO_Auth : public Auth {
NO_Auth() {}
void sign(byte*, const byte*, unsigned int, const RandomPool&) {} void sign(byte*, const byte*, unsigned int, const RandomPool&) {}
bool verify(const byte*, unsigned int, const byte*, unsigned int) bool verify(const byte*, unsigned int, const byte*, unsigned int)
{ return true; } { return true; }

View File

@ -28,7 +28,7 @@ namespace yaSSL {
#ifdef MULTI_THREADED #ifdef MULTI_THREADED
#if defined(_WIN32) || defined(_WIN64) #ifdef _WIN32
#include <windows.h> #include <windows.h>
class Mutex { class Mutex {

View File

@ -33,14 +33,9 @@
#include "opensslv.h" /* for version number */ #include "opensslv.h" /* for version number */
#include "rsa.h" #include "rsa.h"
#define YASSL_VERSION "1.5.8"
#if defined(_WIN32) || defined(_WIN64) #define YASSL_VERSION "1.6.5"
#include <winsock2.h>
typedef SOCKET socket_t;
#else
typedef int socket_t;
#endif
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
@ -195,10 +190,17 @@ enum { /* ERR Constants */
EVP_R_BAD_DECRYPT = 2 EVP_R_BAD_DECRYPT = 2
}; };
/*
Allow type used by SSL_set_fd to be changed, default to int
in order to be compatible with OpenSSL
*/
#ifndef YASSL_SOCKET_T_DEFINED
typedef int YASSL_SOCKET_T;
#endif
SSL_CTX* SSL_CTX_new(SSL_METHOD*); SSL_CTX* SSL_CTX_new(SSL_METHOD*);
SSL* SSL_new(SSL_CTX*); SSL* SSL_new(SSL_CTX*);
int SSL_set_fd (SSL*, socket_t); int SSL_set_fd (SSL*, YASSL_SOCKET_T);
int SSL_connect(SSL*); int SSL_connect(SSL*);
int SSL_write(SSL*, const void*, int); int SSL_write(SSL*, const void*, int);
int SSL_read(SSL*, void*, int); int SSL_read(SSL*, void*, int);

View File

@ -28,8 +28,9 @@
#include <assert.h> #include <assert.h>
#include "openssl/ssl.h" /* for socket_t */ #ifdef _WIN32
#if !defined(_WIN32) && !defined(_WIN64) #include <winsock2.h>
#else
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
@ -43,7 +44,10 @@ namespace yaSSL {
typedef unsigned int uint; typedef unsigned int uint;
#if !defined( _WIN32) && !defined(_WIN64) #ifdef _WIN32
typedef SOCKET socket_t;
#else
typedef int socket_t;
const socket_t INVALID_SOCKET = -1; const socket_t INVALID_SOCKET = -1;
const int SD_RECEIVE = 0; const int SD_RECEIVE = 0;
const int SD_SEND = 1; const int SD_SEND = 1;

View File

@ -28,7 +28,7 @@
namespace yaSSL { namespace yaSSL {
#if defined(_WIN32) || defined(_WIN64) #ifdef _WIN32
typedef unsigned int SOCKET_T; typedef unsigned int SOCKET_T;
#else #else
typedef int SOCKET_T; typedef int SOCKET_T;

View File

@ -64,7 +64,6 @@ struct RecordLayerHeader {
// base for all messages // base for all messages
struct Message : public virtual_base { struct Message : public virtual_base {
Message() {}
virtual input_buffer& set(input_buffer&) =0; virtual input_buffer& set(input_buffer&) =0;
virtual output_buffer& get(output_buffer&) const =0; virtual output_buffer& get(output_buffer&) const =0;
@ -178,7 +177,6 @@ private:
class HandShakeBase : public virtual_base { class HandShakeBase : public virtual_base {
int length_; int length_;
public: public:
HandShakeBase() {}
int get_length() const; int get_length() const;
void set_length(int); void set_length(int);
@ -196,7 +194,6 @@ public:
struct HelloRequest : public HandShakeBase { struct HelloRequest : public HandShakeBase {
HelloRequest() {}
input_buffer& set(input_buffer& in); input_buffer& set(input_buffer& in);
output_buffer& get(output_buffer& out) const; output_buffer& get(output_buffer& out) const;
@ -330,7 +327,6 @@ private:
struct ServerKeyBase : public virtual_base { struct ServerKeyBase : public virtual_base {
ServerKeyBase() {}
virtual ~ServerKeyBase() {} virtual ~ServerKeyBase() {}
virtual void build(SSL&) {} virtual void build(SSL&) {}
virtual void read(SSL&, input_buffer&) {} virtual void read(SSL&, input_buffer&) {}
@ -341,21 +337,15 @@ struct ServerKeyBase : public virtual_base {
// Server random number for FORTEZZA KEA // Server random number for FORTEZZA KEA
struct Fortezza_Server : public ServerKeyBase { struct Fortezza_Server : public ServerKeyBase {
Fortezza_Server() {}
opaque r_s_[FORTEZZA_MAX]; opaque r_s_[FORTEZZA_MAX];
}; };
struct SignatureBase : public virtual_base { struct SignatureBase : public virtual_base {
SignatureBase() {}
virtual ~SignatureBase() {} virtual ~SignatureBase() {}
}; };
struct anonymous_sa : public SignatureBase struct anonymous_sa : public SignatureBase {};
{
public:
anonymous_sa() {}
};
struct Hashes { struct Hashes {
@ -365,13 +355,11 @@ struct Hashes {
struct rsa_sa : public SignatureBase { struct rsa_sa : public SignatureBase {
rsa_sa() {}
Hashes hashes_; Hashes hashes_;
}; };
struct dsa_sa : public SignatureBase { struct dsa_sa : public SignatureBase {
dsa_sa() {}
uint8 sha_[SHA_LEN]; uint8 sha_[SHA_LEN];
}; };
@ -399,7 +387,6 @@ private:
// Server's RSA exchange // Server's RSA exchange
struct RSA_Server : public ServerKeyBase { struct RSA_Server : public ServerKeyBase {
RSA_Server() {}
ServerRSAParams params_; ServerRSAParams params_;
opaque* signature_; // signed rsa_sa hashes opaque* signature_; // signed rsa_sa hashes
}; };
@ -474,7 +461,6 @@ struct PreMasterSecret {
struct ClientKeyBase : public virtual_base { struct ClientKeyBase : public virtual_base {
ClientKeyBase() {}
virtual ~ClientKeyBase() {} virtual ~ClientKeyBase() {}
virtual void build(SSL&) {} virtual void build(SSL&) {}
virtual void read(SSL&, input_buffer&) {} virtual void read(SSL&, input_buffer&) {}
@ -505,7 +491,6 @@ private:
// Fortezza Key Parameters from page 29 // Fortezza Key Parameters from page 29
// hard code lengths cause only used here // hard code lengths cause only used here
struct FortezzaKeys : public ClientKeyBase { struct FortezzaKeys : public ClientKeyBase {
FortezzaKeys() {}
opaque y_c_ [128]; // client's Yc, public value opaque y_c_ [128]; // client's Yc, public value
opaque r_c_ [128]; // client's Rc opaque r_c_ [128]; // client's Rc
opaque y_signature_ [40]; // DSS signed public key opaque y_signature_ [40]; // DSS signed public key

View File

@ -228,7 +228,6 @@ struct BIGNUM {
TaoCrypt::Integer), we need to explicitly state the namespace TaoCrypt::Integer), we need to explicitly state the namespace
here to let gcc 2.96 deduce the correct type. here to let gcc 2.96 deduce the correct type.
*/ */
BIGNUM() {}
yaSSL::Integer int_; yaSSL::Integer int_;
void assign(const byte* b, uint s) { int_.assign(b,s); } void assign(const byte* b, uint s) { int_.assign(b,s); }
}; };

View File

@ -550,7 +550,6 @@ void RandomPool::Fill(opaque* dst, uint sz) const
// Implementation of DSS Authentication // Implementation of DSS Authentication
struct DSS::DSSImpl { struct DSS::DSSImpl {
DSSImpl() {}
void SetPublic (const byte*, unsigned int); void SetPublic (const byte*, unsigned int);
void SetPrivate(const byte*, unsigned int); void SetPrivate(const byte*, unsigned int);
TaoCrypt::DSA_PublicKey publicKey_; TaoCrypt::DSA_PublicKey publicKey_;
@ -623,7 +622,6 @@ bool DSS::verify(const byte* sha_digest, unsigned int /* shaSz */,
// Implementation of RSA key interface // Implementation of RSA key interface
struct RSA::RSAImpl { struct RSA::RSAImpl {
RSAImpl() {}
void SetPublic (const byte*, unsigned int); void SetPublic (const byte*, unsigned int);
void SetPrivate(const byte*, unsigned int); void SetPrivate(const byte*, unsigned int);
TaoCrypt::RSA_PublicKey publicKey_; TaoCrypt::RSA_PublicKey publicKey_;

View File

@ -39,7 +39,6 @@
#include "coding.hpp" // HexDecoder #include "coding.hpp" // HexDecoder
#include "helpers.hpp" // for placement new hack #include "helpers.hpp" // for placement new hack
#include <stdio.h> #include <stdio.h>
#include <assert.h>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> // FindFirstFile etc.. #include <windows.h> // FindFirstFile etc..
@ -233,7 +232,7 @@ void SSL_free(SSL* ssl)
} }
int SSL_set_fd(SSL* ssl, socket_t fd) int SSL_set_fd(SSL* ssl, YASSL_SOCKET_T fd)
{ {
ssl->useSocket().set_fd(fd); ssl->useSocket().set_fd(fd);
return SSL_SUCCESS; return SSL_SUCCESS;

View File

@ -1,4 +1,15 @@
TaoCrypt release 0.9.0 09/18/2006 TaoCrypt release 0.9.2 02/5/2007
This release includes bug fixes, portability enhancements, and some
optimiations.
See 0.9.0 for build instructions.
******************TaoCrypt release 0.9.0 09/18/2006
This is the first release of TaoCrypt, it was previously only included with This is the first release of TaoCrypt, it was previously only included with
yaSSL. TaoCrypt is highly portable and fast, its features include: yaSSL. TaoCrypt is highly portable and fast, its features include:

View File

@ -65,7 +65,7 @@ int main(int argc, char** argv)
const int megs = 5; // how much to test const int megs = 5; // how much to test
const byte global_key[] = const byte key[] =
{ {
0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,
0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10, 0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10,
@ -81,19 +81,19 @@ const byte iv[] =
}; };
byte global_plain [1024*1024]; byte plain [1024*1024];
byte global_cipher[1024*1024]; byte cipher[1024*1024];
void bench_des() void bench_des()
{ {
DES_EDE3_CBC_Encryption enc; DES_EDE3_CBC_Encryption enc;
enc.SetKey(global_key, 16, iv); enc.SetKey(key, 16, iv);
double start = current_time(); double start = current_time();
for(int i = 0; i < megs; i++) for(int i = 0; i < megs; i++)
enc.Process(global_plain, global_cipher, sizeof(global_plain)); enc.Process(plain, cipher, sizeof(plain));
double total = current_time() - start; double total = current_time() - start;
@ -107,12 +107,12 @@ void bench_des()
void bench_aes(bool show) void bench_aes(bool show)
{ {
AES_CBC_Encryption enc; AES_CBC_Encryption enc;
enc.SetKey(global_key, 16, iv); enc.SetKey(key, 16, iv);
double start = current_time(); double start = current_time();
for(int i = 0; i < megs; i++) for(int i = 0; i < megs; i++)
enc.Process(global_plain, global_cipher, sizeof(global_plain)); enc.Process(plain, cipher, sizeof(plain));
double total = current_time() - start; double total = current_time() - start;
@ -127,12 +127,12 @@ void bench_aes(bool show)
void bench_twofish() void bench_twofish()
{ {
Twofish_CBC_Encryption enc; Twofish_CBC_Encryption enc;
enc.SetKey(global_key, 16, iv); enc.SetKey(key, 16, iv);
double start = current_time(); double start = current_time();
for(int i = 0; i < megs; i++) for(int i = 0; i < megs; i++)
enc.Process(global_plain, global_cipher, sizeof(global_plain)); enc.Process(plain, cipher, sizeof(plain));
double total = current_time() - start; double total = current_time() - start;
@ -147,12 +147,12 @@ void bench_twofish()
void bench_blowfish() void bench_blowfish()
{ {
Blowfish_CBC_Encryption enc; Blowfish_CBC_Encryption enc;
enc.SetKey(global_key, 16, iv); enc.SetKey(key, 16, iv);
double start = current_time(); double start = current_time();
for(int i = 0; i < megs; i++) for(int i = 0; i < megs; i++)
enc.Process(global_plain, global_cipher, sizeof(global_plain)); enc.Process(plain, cipher, sizeof(plain));
double total = current_time() - start; double total = current_time() - start;
@ -166,12 +166,12 @@ void bench_blowfish()
void bench_arc4() void bench_arc4()
{ {
ARC4 enc; ARC4 enc;
enc.SetKey(global_key, 16); enc.SetKey(key, 16);
double start = current_time(); double start = current_time();
for(int i = 0; i < megs; i++) for(int i = 0; i < megs; i++)
enc.Process(global_cipher, global_plain, sizeof(global_plain)); enc.Process(cipher, plain, sizeof(plain));
double total = current_time() - start; double total = current_time() - start;
@ -191,7 +191,7 @@ void bench_md5()
for(int i = 0; i < megs; i++) for(int i = 0; i < megs; i++)
hash.Update(global_plain, sizeof(global_plain)); hash.Update(plain, sizeof(plain));
hash.Final(digest); hash.Final(digest);
@ -213,7 +213,7 @@ void bench_sha()
for(int i = 0; i < megs; i++) for(int i = 0; i < megs; i++)
hash.Update(global_plain, sizeof(global_plain)); hash.Update(plain, sizeof(plain));
hash.Final(digest); hash.Final(digest);
@ -241,7 +241,7 @@ void bench_ripemd()
for(int i = 0; i < megs; i++) for(int i = 0; i < megs; i++)
hash.Update(global_plain, sizeof(global_plain)); hash.Update(plain, sizeof(plain));
hash.Final(digest); hash.Final(digest);

View File

@ -40,7 +40,6 @@ class TAOCRYPT_NO_VTABLE AbstractGroup : public virtual_base
public: public:
typedef Integer Element; typedef Integer Element;
AbstractGroup() {}
virtual ~AbstractGroup() {} virtual ~AbstractGroup() {}
virtual bool Equal(const Element &a, const Element &b) const =0; virtual bool Equal(const Element &a, const Element &b) const =0;
@ -95,7 +94,6 @@ private:
class MultiplicativeGroupT : public AbstractGroup class MultiplicativeGroupT : public AbstractGroup
{ {
public: public:
MultiplicativeGroupT() {}
const AbstractRing& GetRing() const const AbstractRing& GetRing() const
{return *m_pRing;} {return *m_pRing;}
@ -147,7 +145,6 @@ class TAOCRYPT_NO_VTABLE AbstractEuclideanDomain
: public AbstractRing : public AbstractRing
{ {
public: public:
AbstractEuclideanDomain() {}
typedef Integer Element; typedef Integer Element;
virtual void DivisionAlgorithm(Element &r, Element &q, const Element &a, virtual void DivisionAlgorithm(Element &r, Element &q, const Element &a,

View File

@ -41,7 +41,6 @@ enum { DES_BLOCK_SIZE = 8, DES_KEY_SIZE = 32 };
class BasicDES { class BasicDES {
public: public:
BasicDES() {}
void SetKey(const byte*, word32, CipherDir dir); void SetKey(const byte*, word32, CipherDir dir);
void RawProcessBlock(word32&, word32&) const; void RawProcessBlock(word32&, word32&) const;
protected: protected:

View File

@ -31,7 +31,6 @@ namespace TaoCrypt {
// HASH // HASH
class HASH : public virtual_base { class HASH : public virtual_base {
public: public:
HASH() {}
virtual ~HASH() {} virtual ~HASH() {}
virtual void Update(const byte*, word32) = 0; virtual void Update(const byte*, word32) = 0;
@ -58,8 +57,7 @@ public:
word32 GetBitCountLo() const { return loLen_ << 3; } word32 GetBitCountLo() const { return loLen_ << 3; }
word32 GetBitCountHi() const { return (loLen_ >> (8*sizeof(loLen_) - 3)) + word32 GetBitCountHi() const { return (loLen_ >> (8*sizeof(loLen_) - 3)) +
(hiLen_ << 3); } (hiLen_ << 3); }
enum { MaxDigestSz = 8, MaxBufferSz = 64 };
enum { MaxDigestSz = 5, MaxBufferSz = 64 };
protected: protected:
typedef word32 HashLengthType; typedef word32 HashLengthType;
word32 buffLen_; // in bytes word32 buffLen_; // in bytes
@ -74,6 +72,38 @@ protected:
}; };
#ifdef WORD64_AVAILABLE
// 64-bit HASH with Transform
class HASH64withTransform : public HASH {
public:
HASH64withTransform(word32 digSz, word32 buffSz);
virtual ~HASH64withTransform() {}
virtual ByteOrder getByteOrder() const = 0;
virtual word32 getPadSize() const = 0;
virtual void Update(const byte*, word32);
virtual void Final(byte*);
word32 GetBitCountLo() const { return loLen_ << 3; }
word32 GetBitCountHi() const { return (loLen_ >> (8*sizeof(loLen_) - 3)) +
(hiLen_ << 3); }
enum { MaxDigestSz = 8, MaxBufferSz = 128 };
protected:
typedef word32 HashLengthType;
word32 buffLen_; // in bytes
HashLengthType loLen_; // length in bytes
HashLengthType hiLen_; // length in bytes
word64 digest_[MaxDigestSz];
word64 buffer_[MaxBufferSz / sizeof(word64)];
virtual void Transform() = 0;
void AddLength(word32);
};
#endif // WORD64_AVAILABLE
} // namespace } // namespace

View File

@ -109,11 +109,11 @@ void HMAC<T>::KeyInnerHash()
// Update // Update
template <class T> template <class T>
void HMAC<T>::Update(const byte* msg_arg, word32 length) void HMAC<T>::Update(const byte* msg, word32 length)
{ {
if (!innerHashKeyed_) if (!innerHashKeyed_)
KeyInnerHash(); KeyInnerHash();
mac_.Update(msg_arg, length); mac_.Update(msg, length);
} }

View File

@ -464,6 +464,25 @@ inline word32 ByteReverse(word32 value)
} }
#ifdef WORD64_AVAILABLE
inline word64 ByteReverse(word64 value)
{
#ifdef TAOCRYPT_SLOW_WORD64
return (word64(ByteReverse(word32(value))) << 32) |
ByteReverse(word32(value>>32));
#else
value = ((value & W64LIT(0xFF00FF00FF00FF00)) >> 8) |
((value & W64LIT(0x00FF00FF00FF00FF)) << 8);
value = ((value & W64LIT(0xFFFF0000FFFF0000)) >> 16) |
((value & W64LIT(0x0000FFFF0000FFFF)) << 16);
return rotlFixed(value, 32U);
#endif
}
#endif // WORD64_AVAILABLE
template <typename T> template <typename T>
inline void ByteReverse(T* out, const T* in, word32 byteCount) inline void ByteReverse(T* out, const T* in, word32 byteCount)
{ {

View File

@ -37,8 +37,8 @@ public:
typedef int RandomizationParameter; typedef int RandomizationParameter;
typedef Integer Element; typedef Integer Element;
ModularArithmetic(const Integer &modulus_arg = Integer::One()) ModularArithmetic(const Integer &modulus = Integer::One())
: modulus(modulus_arg), result((word)0, modulus_arg.reg_.size()) {} : modulus(modulus), result((word)0, modulus.reg_.size()) {}
ModularArithmetic(const ModularArithmetic &ma) ModularArithmetic(const ModularArithmetic &ma)
: AbstractRing(), : AbstractRing(),

View File

@ -42,8 +42,8 @@ public:
{ cipher_.Process(c, p, sz); } { cipher_.Process(c, p, sz); }
void SetKey(const byte* k, word32 sz) void SetKey(const byte* k, word32 sz)
{ cipher_.SetKey(k, sz, DIR); } { cipher_.SetKey(k, sz, DIR); }
void SetKey(const byte* k, word32 sz, const byte* iv_arg) void SetKey(const byte* k, word32 sz, const byte* iv)
{ cipher_.SetKey(k, sz, DIR); cipher_.SetIV(iv_arg); } { cipher_.SetKey(k, sz, DIR); cipher_.SetIV(iv); }
private: private:
T cipher_; T cipher_;

View File

@ -131,7 +131,6 @@ private:
// block type 2 padding // block type 2 padding
class RSA_BlockType2 { class RSA_BlockType2 {
public: public:
RSA_BlockType2() {}
void Pad(const byte*, word32, byte*, word32, void Pad(const byte*, word32, byte*, word32,
RandomNumberGenerator&) const; RandomNumberGenerator&) const;
word32 UnPad(const byte*, word32, byte*) const; word32 UnPad(const byte*, word32, byte*) const;
@ -141,7 +140,6 @@ public:
// block type 1 padding // block type 1 padding
class RSA_BlockType1 { class RSA_BlockType1 {
public: public:
RSA_BlockType1() {}
void Pad(const byte*, word32, byte*, word32, void Pad(const byte*, word32, byte*, word32,
RandomNumberGenerator&) const; RandomNumberGenerator&) const;
word32 UnPad(const byte*, word32, byte*) const; word32 UnPad(const byte*, word32, byte*) const;
@ -176,27 +174,25 @@ public:
// Public Encrypt // Public Encrypt
template<class Pad> template<class Pad>
void RSA_Encryptor<Pad>::Encrypt(const byte* plain_arg, word32 sz, void RSA_Encryptor<Pad>::Encrypt(const byte* plain, word32 sz, byte* cipher,
byte* cipher_arg, RandomNumberGenerator& rng)
RandomNumberGenerator& rng_arg)
{ {
PK_Lengths lengths(key_.GetModulus()); PK_Lengths lengths(key_.GetModulus());
assert(sz <= lengths.FixedMaxPlaintextLength()); assert(sz <= lengths.FixedMaxPlaintextLength());
ByteBlock paddedBlock(lengths.PaddedBlockByteLength()); ByteBlock paddedBlock(lengths.PaddedBlockByteLength());
padding_.Pad(plain_arg, sz, paddedBlock.get_buffer(), padding_.Pad(plain, sz, paddedBlock.get_buffer(),
lengths.PaddedBlockBitLength(), rng_arg); lengths.PaddedBlockBitLength(), rng);
key_.ApplyFunction(Integer(paddedBlock.get_buffer(), paddedBlock.size())). key_.ApplyFunction(Integer(paddedBlock.get_buffer(), paddedBlock.size())).
Encode(cipher_arg, lengths.FixedCiphertextLength()); Encode(cipher, lengths.FixedCiphertextLength());
} }
// Private Decrypt // Private Decrypt
template<class Pad> template<class Pad>
word32 RSA_Decryptor<Pad>::Decrypt(const byte* cipher_arg, word32 sz, word32 RSA_Decryptor<Pad>::Decrypt(const byte* cipher, word32 sz, byte* plain,
byte* plain_arg, RandomNumberGenerator& rng)
RandomNumberGenerator& rng_arg)
{ {
PK_Lengths lengths(key_.GetModulus()); PK_Lengths lengths(key_.GetModulus());
assert(sz == lengths.FixedCiphertextLength()); assert(sz == lengths.FixedCiphertextLength());
@ -205,29 +201,29 @@ word32 RSA_Decryptor<Pad>::Decrypt(const byte* cipher_arg, word32 sz,
return 0; return 0;
ByteBlock paddedBlock(lengths.PaddedBlockByteLength()); ByteBlock paddedBlock(lengths.PaddedBlockByteLength());
Integer x = key_.CalculateInverse(rng_arg, Integer(cipher_arg, Integer x = key_.CalculateInverse(rng, Integer(cipher,
lengths.FixedCiphertextLength()).Ref()); lengths.FixedCiphertextLength()).Ref());
if (x.ByteCount() > paddedBlock.size()) if (x.ByteCount() > paddedBlock.size())
x = Integer::Zero(); // don't return false, prevents timing attack x = Integer::Zero(); // don't return false, prevents timing attack
x.Encode(paddedBlock.get_buffer(), paddedBlock.size()); x.Encode(paddedBlock.get_buffer(), paddedBlock.size());
return padding_.UnPad(paddedBlock.get_buffer(), return padding_.UnPad(paddedBlock.get_buffer(),
lengths.PaddedBlockBitLength(), plain_arg); lengths.PaddedBlockBitLength(), plain);
} }
// Private SSL type (block 1) Encrypt // Private SSL type (block 1) Encrypt
template<class Pad> template<class Pad>
void RSA_Decryptor<Pad>::SSL_Sign(const byte* message, word32 sz, byte* sig, void RSA_Decryptor<Pad>::SSL_Sign(const byte* message, word32 sz, byte* sig,
RandomNumberGenerator& rng_arg) RandomNumberGenerator& rng)
{ {
RSA_PublicKey inverse; RSA_PublicKey inverse;
inverse.Initialize(key_.GetModulus(), key_.GetPrivateExponent()); inverse.Initialize(key_.GetModulus(), key_.GetPrivateExponent());
RSA_Encryptor<RSA_BlockType1> enc(inverse); // SSL Type RSA_Encryptor<RSA_BlockType1> enc(inverse); // SSL Type
enc.Encrypt(message, sz, sig, rng_arg); enc.Encrypt(message, sz, sig, rng);
} }
word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain_arg); word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain);
// Public SSL type (block 1) Decrypt // Public SSL type (block 1) Decrypt
@ -235,11 +231,11 @@ template<class Pad>
bool RSA_Encryptor<Pad>::SSL_Verify(const byte* message, word32 sz, bool RSA_Encryptor<Pad>::SSL_Verify(const byte* message, word32 sz,
const byte* sig) const byte* sig)
{ {
ByteBlock local_plain(PK_Lengths(key_.GetModulus()).FixedMaxPlaintextLength()); ByteBlock plain(PK_Lengths(key_.GetModulus()).FixedMaxPlaintextLength());
if (SSL_Decrypt(key_, sig, local_plain.get_buffer()) != sz) if (SSL_Decrypt(key_, sig, plain.get_buffer()) != sz)
return false; // not right justified or bad padding return false; // not right justified or bad padding
if ( (memcmp(local_plain.get_buffer(), message, sz)) == 0) if ( (memcmp(plain.get_buffer(), message, sz)) == 0)
return true; return true;
return false; return false;
} }

View File

@ -64,6 +64,103 @@ inline void swap(SHA& a, SHA& b)
a.Swap(b); a.Swap(b);
} }
// SHA-256 digest
class SHA256 : public HASHwithTransform {
public:
enum { BLOCK_SIZE = 64, DIGEST_SIZE = 32, PAD_SIZE = 56,
TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes
SHA256() : 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; }
void Init();
SHA256(const SHA256&);
SHA256& operator= (const SHA256&);
void Swap(SHA256&);
private:
void Transform();
};
// SHA-224 digest
class SHA224 : public HASHwithTransform {
public:
enum { BLOCK_SIZE = 64, DIGEST_SIZE = 28, PAD_SIZE = 56,
TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes
SHA224() : HASHwithTransform(SHA256::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; }
void Init();
SHA224(const SHA224&);
SHA224& operator= (const SHA224&);
void Swap(SHA224&);
private:
void Transform();
};
#ifdef WORD64_AVAILABLE
// SHA-512 digest
class SHA512 : public HASH64withTransform {
public:
enum { BLOCK_SIZE = 128, DIGEST_SIZE = 64, PAD_SIZE = 112,
TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes
SHA512() : HASH64withTransform(DIGEST_SIZE / sizeof(word64), 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; }
void Init();
SHA512(const SHA512&);
SHA512& operator= (const SHA512&);
void Swap(SHA512&);
private:
void Transform();
};
// SHA-384 digest
class SHA384 : public HASH64withTransform {
public:
enum { BLOCK_SIZE = 128, DIGEST_SIZE = 48, PAD_SIZE = 112,
TAO_BYTE_ORDER = BigEndianOrder}; // in Bytes
SHA384() : HASH64withTransform(SHA512::DIGEST_SIZE/ sizeof(word64),
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; }
void Init();
SHA384(const SHA384&);
SHA384& operator= (const SHA384&);
void Swap(SHA384&);
private:
void Transform();
};
#endif // WORD64_AVAILABLE
} // namespace } // namespace

View File

@ -62,11 +62,7 @@ MK_FUNDAMENTAL_TYPE(unsigned long)
MK_FUNDAMENTAL_TYPE(float) MK_FUNDAMENTAL_TYPE(float)
MK_FUNDAMENTAL_TYPE( double) MK_FUNDAMENTAL_TYPE( double)
#ifdef LONG_DOUBLE_IS_DISTINCT_TYPE
// Don't define by default as this gives warnings on power mac
MK_FUNDAMENTAL_TYPE(long double) MK_FUNDAMENTAL_TYPE(long double)
#endif
#if defined(WORD64_AVAILABLE) && defined(WORD64_IS_DISTINCT_TYPE) #if defined(WORD64_AVAILABLE) && defined(WORD64_IS_DISTINCT_TYPE)
MK_FUNDAMENTAL_TYPE(word64) MK_FUNDAMENTAL_TYPE(word64)

View File

@ -46,13 +46,16 @@ typedef unsigned int word32;
#define WORD64_AVAILABLE #define WORD64_AVAILABLE
#define WORD64_IS_DISTINCT_TYPE #define WORD64_IS_DISTINCT_TYPE
typedef unsigned __int64 word64; typedef unsigned __int64 word64;
#define W64LIT(x) x##ui64
#elif SIZEOF_LONG == 8 #elif SIZEOF_LONG == 8
#define WORD64_AVAILABLE #define WORD64_AVAILABLE
typedef unsigned long word64; typedef unsigned long word64;
#define W64LIT(x) x##LL
#elif SIZEOF_LONG_LONG == 8 #elif SIZEOF_LONG_LONG == 8
#define WORD64_AVAILABLE #define WORD64_AVAILABLE
#define WORD64_IS_DISTINCT_TYPE #define WORD64_IS_DISTINCT_TYPE
typedef unsigned long long word64; typedef unsigned long long word64;
#define W64LIT(x) x##LL
#endif #endif

View File

@ -27,8 +27,6 @@
namespace mySTL { namespace mySTL {
#undef max
#undef min
template<typename T> template<typename T>
inline const T& max(const T& a, const T&b) inline const T& max(const T& a, const T&b)

View File

@ -231,7 +231,7 @@ void list<T>::push_front(T t)
template<typename T> template<typename T>
void list<T>::pop_front() void list<T>::pop_front()
{ {
node* local_front = head_; node* front = head_;
if (head_ == 0) if (head_ == 0)
return; return;
@ -241,8 +241,8 @@ void list<T>::pop_front()
head_ = head_->next_; head_ = head_->next_;
head_->prev_ = 0; head_->prev_ = 0;
} }
destroy(local_front); destroy(front);
FreeMemory(local_front); FreeMemory(front);
--sz_; --sz_;
} }
@ -303,13 +303,13 @@ T list<T>::back() const
template<typename T> template<typename T>
typename list<T>::node* list<T>::look_up(T t) typename list<T>::node* list<T>::look_up(T t)
{ {
node* local_list = head_; node* list = head_;
if (local_list == 0) return 0; if (list == 0) return 0;
for (; local_list; local_list = local_list->next_) for (; list; list = list->next_)
if (local_list->value_ == t) if (list->value_ == t)
return local_list; return list;
return 0; return 0;
} }

View File

@ -90,14 +90,13 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
rounds_ = keylen/4 + 6; rounds_ = keylen/4 + 6;
word32 temp, *rk = key_; word32 temp, *rk = key_;
unsigned int i=0;
GetUserKey(BigEndianOrder, rk, keylen/4, userKey, keylen); GetUserKey(BigEndianOrder, rk, keylen/4, userKey, keylen);
switch(keylen) switch(keylen)
{ {
case 16: case 16:
{
unsigned int i=0;
while (true) while (true)
{ {
temp = rk[3]; temp = rk[3];
@ -115,10 +114,8 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
rk += 4; rk += 4;
} }
break; break;
}
case 24: case 24:
{
unsigned int i=0;
while (true) // for (;;) here triggers a bug in VC60 SP4 w/ Pro Pack while (true) // for (;;) here triggers a bug in VC60 SP4 w/ Pro Pack
{ {
temp = rk[ 5]; temp = rk[ 5];
@ -139,10 +136,7 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
} }
break; break;
}
case 32: case 32:
{
unsigned int i=0;
while (true) while (true)
{ {
temp = rk[ 7]; temp = rk[ 7];
@ -171,7 +165,6 @@ void AES::SetKey(const byte* userKey, word32 keylen, CipherDir /*dummy*/)
} }
break; break;
} }
}
if (dir_ == DECRYPTION) if (dir_ == DECRYPTION)
{ {

View File

@ -186,10 +186,10 @@ Integer AbstractGroup::CascadeScalarMultiply(const Element &x,
struct WindowSlider struct WindowSlider
{ {
WindowSlider(const Integer &exp_arg, bool fastNegate_arg, WindowSlider(const Integer &exp, bool fastNegate,
unsigned int windowSizeIn=0) unsigned int windowSizeIn=0)
: exp(exp_arg), windowModulus(Integer::One()), windowSize(windowSizeIn), : exp(exp), windowModulus(Integer::One()), windowSize(windowSizeIn),
windowBegin(0), fastNegate(fastNegate_arg), firstTime(true), windowBegin(0), fastNegate(fastNegate), firstTime(true),
finished(false) finished(false)
{ {
if (windowSize == 0) if (windowSize == 0)

View File

@ -737,17 +737,17 @@ void CertDecoder::GetName(NameType nt)
email = true; email = true;
source_.advance(oidSz + 1); source_.advance(oidSz + 1);
word32 length2 = GetLength(source_); word32 length = GetLength(source_);
if (email) { if (email) {
memcpy(&ptr[idx], "/emailAddress=", 14); memcpy(&ptr[idx], "/emailAddress=", 14);
idx += 14; idx += 14;
memcpy(&ptr[idx], source_.get_current(), length2); memcpy(&ptr[idx], source_.get_current(), length);
idx += length2; idx += length;
} }
source_.advance(length2); source_.advance(length);
} }
} }
ptr[idx++] = 0; ptr[idx++] = 0;

View File

@ -108,4 +108,89 @@ void HASHwithTransform::Final(byte* hash)
Init(); // reset state Init(); // reset state
} }
#ifdef WORD64_AVAILABLE
HASH64withTransform::HASH64withTransform(word32 digSz, word32 buffSz)
{
assert(digSz <= MaxDigestSz);
assert(buffSz <= MaxBufferSz);
}
void HASH64withTransform::AddLength(word32 len)
{
HashLengthType tmp = loLen_;
if ( (loLen_ += len) < tmp)
hiLen_++; // carry low to high
hiLen_ += SafeRightShift<8*sizeof(HashLengthType)>(len);
}
// Update digest with data of size len, do in blocks
void HASH64withTransform::Update(const byte* data, word32 len)
{
// do block size increments
word32 blockSz = getBlockSize();
byte* local = reinterpret_cast<byte*>(buffer_);
while (len) {
word32 add = min(len, blockSz - buffLen_);
memcpy(&local[buffLen_], data, add);
buffLen_ += add;
data += add;
len -= add;
if (buffLen_ == blockSz) {
ByteReverseIf(buffer_, buffer_, blockSz, getByteOrder());
Transform();
AddLength(blockSz);
buffLen_ = 0;
}
}
}
// Final process, place digest in hash
void HASH64withTransform::Final(byte* hash)
{
word32 blockSz = getBlockSize();
word32 digestSz = getDigestSize();
word32 padSz = getPadSize();
ByteOrder order = getByteOrder();
AddLength(buffLen_); // before adding pads
HashLengthType preLoLen = GetBitCountLo();
HashLengthType preHiLen = GetBitCountHi();
byte* local = reinterpret_cast<byte*>(buffer_);
local[buffLen_++] = 0x80; // add 1
// pad with zeros
if (buffLen_ > padSz) {
memset(&local[buffLen_], 0, blockSz - buffLen_);
buffLen_ += blockSz - buffLen_;
ByteReverseIf(buffer_, buffer_, blockSz, order);
Transform();
buffLen_ = 0;
}
memset(&local[buffLen_], 0, padSz - buffLen_);
ByteReverseIf(buffer_, buffer_, padSz, order);
buffer_[blockSz / sizeof(word64) - 2] = order ? preHiLen : preLoLen;
buffer_[blockSz / sizeof(word64) - 1] = order ? preLoLen : preHiLen;
Transform();
ByteReverseIf(digest_, digest_, digestSz, order);
memcpy(hash, digest_, digestSz);
Init(); // reset state
}
#endif // WORD64_AVAILABLE
} // namespace } // namespace

View File

@ -3390,7 +3390,7 @@ void Integer::DivideByPowerOf2(Integer &r, Integer &q, const Integer &a,
CopyWords(r.reg_.get_buffer(), a.reg_.get_buffer(), wordCount); CopyWords(r.reg_.get_buffer(), a.reg_.get_buffer(), wordCount);
SetWords(r.reg_+wordCount, 0, r.reg_.size()-wordCount); SetWords(r.reg_+wordCount, 0, r.reg_.size()-wordCount);
if (n % WORD_BITS != 0) if (n % WORD_BITS != 0)
r.reg_[wordCount-1] %= ((word) 1 << (n % WORD_BITS)); r.reg_[wordCount-1] %= (word(1) << (n % WORD_BITS));
} }
else else
{ {

View File

@ -69,6 +69,77 @@ void SHA::Init()
hiLen_ = 0; hiLen_ = 0;
} }
void SHA256::Init()
{
digest_[0] = 0x6A09E667L;
digest_[1] = 0xBB67AE85L;
digest_[2] = 0x3C6EF372L;
digest_[3] = 0xA54FF53AL;
digest_[4] = 0x510E527FL;
digest_[5] = 0x9B05688CL;
digest_[6] = 0x1F83D9ABL;
digest_[7] = 0x5BE0CD19L;
buffLen_ = 0;
loLen_ = 0;
hiLen_ = 0;
}
void SHA224::Init()
{
digest_[0] = 0xc1059ed8;
digest_[1] = 0x367cd507;
digest_[2] = 0x3070dd17;
digest_[3] = 0xf70e5939;
digest_[4] = 0xffc00b31;
digest_[5] = 0x68581511;
digest_[6] = 0x64f98fa7;
digest_[7] = 0xbefa4fa4;
buffLen_ = 0;
loLen_ = 0;
hiLen_ = 0;
}
#ifdef WORD64_AVAILABLE
void SHA512::Init()
{
digest_[0] = W64LIT(0x6a09e667f3bcc908);
digest_[1] = W64LIT(0xbb67ae8584caa73b);
digest_[2] = W64LIT(0x3c6ef372fe94f82b);
digest_[3] = W64LIT(0xa54ff53a5f1d36f1);
digest_[4] = W64LIT(0x510e527fade682d1);
digest_[5] = W64LIT(0x9b05688c2b3e6c1f);
digest_[6] = W64LIT(0x1f83d9abfb41bd6b);
digest_[7] = W64LIT(0x5be0cd19137e2179);
buffLen_ = 0;
loLen_ = 0;
hiLen_ = 0;
}
void SHA384::Init()
{
digest_[0] = W64LIT(0xcbbb9d5dc1059ed8);
digest_[1] = W64LIT(0x629a292a367cd507);
digest_[2] = W64LIT(0x9159015a3070dd17);
digest_[3] = W64LIT(0x152fecd8f70e5939);
digest_[4] = W64LIT(0x67332667ffc00b31);
digest_[5] = W64LIT(0x8eb44a8768581511);
digest_[6] = W64LIT(0xdb0c2e0d64f98fa7);
digest_[7] = W64LIT(0x47b5481dbefa4fa4);
buffLen_ = 0;
loLen_ = 0;
hiLen_ = 0;
}
#endif // WORD64_AVAILABLE
SHA::SHA(const SHA& that) : HASHwithTransform(DIGEST_SIZE / sizeof(word32), SHA::SHA(const SHA& that) : HASHwithTransform(DIGEST_SIZE / sizeof(word32),
BLOCK_SIZE) BLOCK_SIZE)
@ -81,6 +152,59 @@ SHA::SHA(const SHA& that) : HASHwithTransform(DIGEST_SIZE / sizeof(word32),
memcpy(buffer_, that.buffer_, BLOCK_SIZE); memcpy(buffer_, that.buffer_, BLOCK_SIZE);
} }
SHA256::SHA256(const SHA256& 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);
}
SHA224::SHA224(const SHA224& that) : HASHwithTransform(SHA256::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);
}
#ifdef WORD64_AVAILABLE
SHA512::SHA512(const SHA512& that) : HASH64withTransform(DIGEST_SIZE /
sizeof(word64), BLOCK_SIZE)
{
buffLen_ = that.buffLen_;
loLen_ = that.loLen_;
hiLen_ = that.hiLen_;
memcpy(digest_, that.digest_, DIGEST_SIZE);
memcpy(buffer_, that.buffer_, BLOCK_SIZE);
}
SHA384::SHA384(const SHA384& that) : HASH64withTransform(SHA512::DIGEST_SIZE /
sizeof(word64), BLOCK_SIZE)
{
buffLen_ = that.buffLen_;
loLen_ = that.loLen_;
hiLen_ = that.hiLen_;
memcpy(digest_, that.digest_, DIGEST_SIZE);
memcpy(buffer_, that.buffer_, BLOCK_SIZE);
}
#endif // WORD64_AVAILABLE
SHA& SHA::operator= (const SHA& that) SHA& SHA::operator= (const SHA& that)
{ {
SHA tmp(that); SHA tmp(that);
@ -90,6 +214,46 @@ SHA& SHA::operator= (const SHA& that)
} }
SHA256& SHA256::operator= (const SHA256& that)
{
SHA256 tmp(that);
Swap(tmp);
return *this;
}
SHA224& SHA224::operator= (const SHA224& that)
{
SHA224 tmp(that);
Swap(tmp);
return *this;
}
#ifdef WORD64_AVAILABLE
SHA512& SHA512::operator= (const SHA512& that)
{
SHA512 tmp(that);
Swap(tmp);
return *this;
}
SHA384& SHA384::operator= (const SHA384& that)
{
SHA384 tmp(that);
Swap(tmp);
return *this;
}
#endif // WORD64_AVAILABLE
void SHA::Swap(SHA& other) void SHA::Swap(SHA& other)
{ {
STL::swap(loLen_, other.loLen_); STL::swap(loLen_, other.loLen_);
@ -101,6 +265,53 @@ void SHA::Swap(SHA& other)
} }
void SHA256::Swap(SHA256& other)
{
STL::swap(loLen_, other.loLen_);
STL::swap(hiLen_, other.hiLen_);
STL::swap(buffLen_, other.buffLen_);
memcpy(digest_, other.digest_, DIGEST_SIZE);
memcpy(buffer_, other.buffer_, BLOCK_SIZE);
}
void SHA224::Swap(SHA224& other)
{
STL::swap(loLen_, other.loLen_);
STL::swap(hiLen_, other.hiLen_);
STL::swap(buffLen_, other.buffLen_);
memcpy(digest_, other.digest_, DIGEST_SIZE);
memcpy(buffer_, other.buffer_, BLOCK_SIZE);
}
#ifdef WORD64_AVAILABLE
void SHA512::Swap(SHA512& other)
{
STL::swap(loLen_, other.loLen_);
STL::swap(hiLen_, other.hiLen_);
STL::swap(buffLen_, other.buffLen_);
memcpy(digest_, other.digest_, DIGEST_SIZE);
memcpy(buffer_, other.buffer_, BLOCK_SIZE);
}
void SHA384::Swap(SHA384& other)
{
STL::swap(loLen_, other.loLen_);
STL::swap(hiLen_, other.hiLen_);
STL::swap(buffLen_, other.buffLen_);
memcpy(digest_, other.digest_, DIGEST_SIZE);
memcpy(buffer_, other.buffer_, BLOCK_SIZE);
}
#endif // WORD64_AVIALABLE
#ifdef DO_SHA_ASM #ifdef DO_SHA_ASM
@ -203,6 +414,205 @@ void SHA::Transform()
} }
#define blk2(i) (W[i&15]+=s1(W[(i-2)&15])+W[(i-7)&15]+s0(W[(i-15)&15]))
#define Ch(x,y,z) (z^(x&(y^z)))
#define Maj(x,y,z) ((x&y)|(z&(x|y)))
#define a(i) T[(0-i)&7]
#define b(i) T[(1-i)&7]
#define c(i) T[(2-i)&7]
#define d(i) T[(3-i)&7]
#define e(i) T[(4-i)&7]
#define f(i) T[(5-i)&7]
#define g(i) T[(6-i)&7]
#define h(i) T[(7-i)&7]
#define R(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+K[i+j]+(j?blk2(i):blk0(i));\
d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i))
// for SHA256
#define S0(x) (rotrFixed(x,2)^rotrFixed(x,13)^rotrFixed(x,22))
#define S1(x) (rotrFixed(x,6)^rotrFixed(x,11)^rotrFixed(x,25))
#define s0(x) (rotrFixed(x,7)^rotrFixed(x,18)^(x>>3))
#define s1(x) (rotrFixed(x,17)^rotrFixed(x,19)^(x>>10))
static const word32 K256[64] = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
};
static void Transform256(word32* digest_, word32* buffer_)
{
const word32* K = K256;
word32 W[16];
word32 T[8];
// Copy digest to working vars
memcpy(T, digest_, sizeof(T));
// 64 operations, partially loop unrolled
for (unsigned int j = 0; j < 64; j += 16) {
R( 0); R( 1); R( 2); R( 3);
R( 4); R( 5); R( 6); R( 7);
R( 8); R( 9); R(10); R(11);
R(12); R(13); R(14); R(15);
}
// Add the working vars back into digest
digest_[0] += a(0);
digest_[1] += b(0);
digest_[2] += c(0);
digest_[3] += d(0);
digest_[4] += e(0);
digest_[5] += f(0);
digest_[6] += g(0);
digest_[7] += h(0);
// Wipe variables
memset(W, 0, sizeof(W));
memset(T, 0, sizeof(T));
}
// undef for 256
#undef S0
#undef S1
#undef s0
#undef s1
void SHA256::Transform()
{
Transform256(digest_, buffer_);
}
void SHA224::Transform()
{
Transform256(digest_, buffer_);
}
#ifdef WORD64_AVAILABLE
static const word64 K512[80] = {
W64LIT(0x428a2f98d728ae22), W64LIT(0x7137449123ef65cd),
W64LIT(0xb5c0fbcfec4d3b2f), W64LIT(0xe9b5dba58189dbbc),
W64LIT(0x3956c25bf348b538), W64LIT(0x59f111f1b605d019),
W64LIT(0x923f82a4af194f9b), W64LIT(0xab1c5ed5da6d8118),
W64LIT(0xd807aa98a3030242), W64LIT(0x12835b0145706fbe),
W64LIT(0x243185be4ee4b28c), W64LIT(0x550c7dc3d5ffb4e2),
W64LIT(0x72be5d74f27b896f), W64LIT(0x80deb1fe3b1696b1),
W64LIT(0x9bdc06a725c71235), W64LIT(0xc19bf174cf692694),
W64LIT(0xe49b69c19ef14ad2), W64LIT(0xefbe4786384f25e3),
W64LIT(0x0fc19dc68b8cd5b5), W64LIT(0x240ca1cc77ac9c65),
W64LIT(0x2de92c6f592b0275), W64LIT(0x4a7484aa6ea6e483),
W64LIT(0x5cb0a9dcbd41fbd4), W64LIT(0x76f988da831153b5),
W64LIT(0x983e5152ee66dfab), W64LIT(0xa831c66d2db43210),
W64LIT(0xb00327c898fb213f), W64LIT(0xbf597fc7beef0ee4),
W64LIT(0xc6e00bf33da88fc2), W64LIT(0xd5a79147930aa725),
W64LIT(0x06ca6351e003826f), W64LIT(0x142929670a0e6e70),
W64LIT(0x27b70a8546d22ffc), W64LIT(0x2e1b21385c26c926),
W64LIT(0x4d2c6dfc5ac42aed), W64LIT(0x53380d139d95b3df),
W64LIT(0x650a73548baf63de), W64LIT(0x766a0abb3c77b2a8),
W64LIT(0x81c2c92e47edaee6), W64LIT(0x92722c851482353b),
W64LIT(0xa2bfe8a14cf10364), W64LIT(0xa81a664bbc423001),
W64LIT(0xc24b8b70d0f89791), W64LIT(0xc76c51a30654be30),
W64LIT(0xd192e819d6ef5218), W64LIT(0xd69906245565a910),
W64LIT(0xf40e35855771202a), W64LIT(0x106aa07032bbd1b8),
W64LIT(0x19a4c116b8d2d0c8), W64LIT(0x1e376c085141ab53),
W64LIT(0x2748774cdf8eeb99), W64LIT(0x34b0bcb5e19b48a8),
W64LIT(0x391c0cb3c5c95a63), W64LIT(0x4ed8aa4ae3418acb),
W64LIT(0x5b9cca4f7763e373), W64LIT(0x682e6ff3d6b2b8a3),
W64LIT(0x748f82ee5defb2fc), W64LIT(0x78a5636f43172f60),
W64LIT(0x84c87814a1f0ab72), W64LIT(0x8cc702081a6439ec),
W64LIT(0x90befffa23631e28), W64LIT(0xa4506cebde82bde9),
W64LIT(0xbef9a3f7b2c67915), W64LIT(0xc67178f2e372532b),
W64LIT(0xca273eceea26619c), W64LIT(0xd186b8c721c0c207),
W64LIT(0xeada7dd6cde0eb1e), W64LIT(0xf57d4f7fee6ed178),
W64LIT(0x06f067aa72176fba), W64LIT(0x0a637dc5a2c898a6),
W64LIT(0x113f9804bef90dae), W64LIT(0x1b710b35131c471b),
W64LIT(0x28db77f523047d84), W64LIT(0x32caab7b40c72493),
W64LIT(0x3c9ebe0a15c9bebc), W64LIT(0x431d67c49c100d4c),
W64LIT(0x4cc5d4becb3e42b6), W64LIT(0x597f299cfc657e2a),
W64LIT(0x5fcb6fab3ad6faec), W64LIT(0x6c44198c4a475817)
};
// for SHA512
#define S0(x) (rotrFixed(x,28)^rotrFixed(x,34)^rotrFixed(x,39))
#define S1(x) (rotrFixed(x,14)^rotrFixed(x,18)^rotrFixed(x,41))
#define s0(x) (rotrFixed(x,1)^rotrFixed(x,8)^(x>>7))
#define s1(x) (rotrFixed(x,19)^rotrFixed(x,61)^(x>>6))
static void Transform512(word64* digest_, word64* buffer_)
{
const word64* K = K512;
word64 W[16];
word64 T[8];
// Copy digest to working vars
memcpy(T, digest_, sizeof(T));
// 64 operations, partially loop unrolled
for (unsigned int j = 0; j < 80; j += 16) {
R( 0); R( 1); R( 2); R( 3);
R( 4); R( 5); R( 6); R( 7);
R( 8); R( 9); R(10); R(11);
R(12); R(13); R(14); R(15);
}
// Add the working vars back into digest
digest_[0] += a(0);
digest_[1] += b(0);
digest_[2] += c(0);
digest_[3] += d(0);
digest_[4] += e(0);
digest_[5] += f(0);
digest_[6] += g(0);
digest_[7] += h(0);
// Wipe variables
memset(W, 0, sizeof(W));
memset(T, 0, sizeof(T));
}
void SHA512::Transform()
{
Transform512(digest_, buffer_);
}
void SHA384::Transform()
{
Transform512(digest_, buffer_);
}
#endif // WORD64_AVIALABLE
#ifdef DO_SHA_ASM #ifdef DO_SHA_ASM
// f1(x,y,z) (z^(x &(y^z))) // f1(x,y,z) (z^(x &(y^z)))

View File

@ -29,6 +29,12 @@
using TaoCrypt::byte; using TaoCrypt::byte;
using TaoCrypt::word32; using TaoCrypt::word32;
using TaoCrypt::SHA; using TaoCrypt::SHA;
using TaoCrypt::SHA256;
using TaoCrypt::SHA224;
#ifdef WORD64_AVAILABLE
using TaoCrypt::SHA512;
using TaoCrypt::SHA384;
#endif
using TaoCrypt::MD5; using TaoCrypt::MD5;
using TaoCrypt::MD2; using TaoCrypt::MD2;
using TaoCrypt::MD4; using TaoCrypt::MD4;
@ -88,8 +94,13 @@ struct testVector {
output_((byte*)out), inLen_(strlen(in)), outLen_(strlen(out)) {} output_((byte*)out), inLen_(strlen(in)), outLen_(strlen(out)) {}
}; };
void file_test(int, char**);
int sha_test(); int sha_test();
int sha256_test();
#ifdef WORD64_AVAILABLE
int sha512_test();
int sha384_test();
#endif
int sha224_test();
int md5_test(); int md5_test();
int md2_test(); int md2_test();
int md4_test(); int md4_test();
@ -139,20 +150,20 @@ const byte msgTmp[] = { // "now is the time for all " w/o trailing 0
0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20
}; };
byte* global_msg = 0; // for block cipher input byte* msg = 0; // for block cipher input
byte* global_plain = 0; // for cipher decrypt comparison byte* plain = 0; // for cipher decrypt comparison
byte* global_cipher = 0; // block output byte* cipher = 0; // block output
void taocrypt_test(void* args) void taocrypt_test(void* args)
{ {
((func_args*)args)->return_code = -1; // error state ((func_args*)args)->return_code = -1; // error state
global_msg = NEW_TC byte[24]; msg = NEW_TC byte[24];
global_plain = NEW_TC byte[24]; plain = NEW_TC byte[24];
global_cipher = NEW_TC byte[24]; cipher = NEW_TC byte[24];
memcpy(global_msg, msgTmp, 24); memcpy(msg, msgTmp, 24);
int ret = 0; int ret = 0;
if ( (ret = sha_test()) ) if ( (ret = sha_test()) )
@ -160,6 +171,30 @@ void taocrypt_test(void* args)
else else
printf( "SHA test passed!\n"); printf( "SHA test passed!\n");
if ( (ret = sha256_test()) )
err_sys("SHA-256 test failed!\n", ret);
else
printf( "SHA-256 test passed!\n");
if ( (ret = sha224_test()) )
err_sys("SHA-224 test failed!\n", ret);
else
printf( "SHA-224 test passed!\n");
#ifdef WORD64_AVAILABLE
if ( (ret = sha512_test()) )
err_sys("SHA-512 test failed!\n", ret);
else
printf( "SHA-512 test passed!\n");
if ( (ret = sha384_test()) )
err_sys("SHA-384 test failed!\n", ret);
else
printf( "SHA-384 test passed!\n");
#endif
if ( (ret = md5_test()) ) if ( (ret = md5_test()) )
err_sys("MD5 test failed!\n", ret); err_sys("MD5 test failed!\n", ret);
else else
@ -237,9 +272,9 @@ void taocrypt_test(void* args)
printf( "PKCS12 test passed!\n"); printf( "PKCS12 test passed!\n");
*/ */
tcArrayDelete(global_cipher); tcArrayDelete(cipher);
tcArrayDelete(global_plain); tcArrayDelete(plain);
tcArrayDelete(global_msg); tcArrayDelete(msg);
((func_args*)args)->return_code = ret; ((func_args*)args)->return_code = ret;
} }
@ -264,7 +299,7 @@ void taocrypt_test(void* args)
#endif // NO_MAIN_DRIVER #endif // NO_MAIN_DRIVER
void file_test(char* file, byte* check) void file_test(const char* file, byte* check)
{ {
FILE* f; FILE* f;
int i(0); int i(0);
@ -328,6 +363,136 @@ int sha_test()
} }
int sha256_test()
{
SHA256 sha;
byte hash[SHA256::DIGEST_SIZE];
testVector test_sha[] =
{
testVector("abc",
"\xBA\x78\x16\xBF\x8F\x01\xCF\xEA\x41\x41\x40\xDE\x5D\xAE\x22"
"\x23\xB0\x03\x61\xA3\x96\x17\x7A\x9C\xB4\x10\xFF\x61\xF2\x00"
"\x15\xAD"),
testVector("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
"\x24\x8D\x6A\x61\xD2\x06\x38\xB8\xE5\xC0\x26\x93\x0C\x3E\x60"
"\x39\xA3\x3C\xE4\x59\x64\xFF\x21\x67\xF6\xEC\xED\xD4\x19\xDB"
"\x06\xC1")
};
int times( sizeof(test_sha) / sizeof(testVector) );
for (int i = 0; i < times; ++i) {
sha.Update(test_sha[i].input_, test_sha[i].inLen_);
sha.Final(hash);
if (memcmp(hash, test_sha[i].output_, SHA256::DIGEST_SIZE) != 0)
return -1 - i;
}
return 0;
}
#ifdef WORD64_AVAILABLE
int sha512_test()
{
SHA512 sha;
byte hash[SHA512::DIGEST_SIZE];
testVector test_sha[] =
{
testVector("abc",
"\xdd\xaf\x35\xa1\x93\x61\x7a\xba\xcc\x41\x73\x49\xae\x20\x41"
"\x31\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2\x0a\x9e\xee\xe6\x4b\x55"
"\xd3\x9a\x21\x92\x99\x2a\x27\x4f\xc1\xa8\x36\xba\x3c\x23\xa3"
"\xfe\xeb\xbd\x45\x4d\x44\x23\x64\x3c\xe8\x0e\x2a\x9a\xc9\x4f"
"\xa5\x4c\xa4\x9f"),
testVector("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhi"
"jklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
"\x8e\x95\x9b\x75\xda\xe3\x13\xda\x8c\xf4\xf7\x28\x14\xfc\x14"
"\x3f\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1\x72\x99\xae\xad\xb6\x88"
"\x90\x18\x50\x1d\x28\x9e\x49\x00\xf7\xe4\x33\x1b\x99\xde\xc4"
"\xb5\x43\x3a\xc7\xd3\x29\xee\xb6\xdd\x26\x54\x5e\x96\xe5\x5b"
"\x87\x4b\xe9\x09")
};
int times( sizeof(test_sha) / sizeof(testVector) );
for (int i = 0; i < times; ++i) {
sha.Update(test_sha[i].input_, test_sha[i].inLen_);
sha.Final(hash);
if (memcmp(hash, test_sha[i].output_, SHA512::DIGEST_SIZE) != 0)
return -1 - i;
}
return 0;
}
int sha384_test()
{
SHA384 sha;
byte hash[SHA384::DIGEST_SIZE];
testVector test_sha[] =
{
testVector("abc",
"\xcb\x00\x75\x3f\x45\xa3\x5e\x8b\xb5\xa0\x3d\x69\x9a\xc6\x50"
"\x07\x27\x2c\x32\xab\x0e\xde\xd1\x63\x1a\x8b\x60\x5a\x43\xff"
"\x5b\xed\x80\x86\x07\x2b\xa1\xe7\xcc\x23\x58\xba\xec\xa1\x34"
"\xc8\x25\xa7"),
testVector("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhi"
"jklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
"\x09\x33\x0c\x33\xf7\x11\x47\xe8\x3d\x19\x2f\xc7\x82\xcd\x1b"
"\x47\x53\x11\x1b\x17\x3b\x3b\x05\xd2\x2f\xa0\x80\x86\xe3\xb0"
"\xf7\x12\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9\x66\xc3\xe9\xfa\x91"
"\x74\x60\x39")
};
int times( sizeof(test_sha) / sizeof(testVector) );
for (int i = 0; i < times; ++i) {
sha.Update(test_sha[i].input_, test_sha[i].inLen_);
sha.Final(hash);
if (memcmp(hash, test_sha[i].output_, SHA384::DIGEST_SIZE) != 0)
return -1 - i;
}
return 0;
}
#endif // WORD64_AVAILABLE
int sha224_test()
{
SHA224 sha;
byte hash[SHA224::DIGEST_SIZE];
testVector test_sha[] =
{
testVector("abc",
"\x23\x09\x7d\x22\x34\x05\xd8\x22\x86\x42\xa4\x77\xbd\xa2\x55"
"\xb3\x2a\xad\xbc\xe4\xbd\xa0\xb3\xf7\xe3\x6c\x9d\xa7"),
testVector("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
"\x75\x38\x8b\x16\x51\x27\x76\xcc\x5d\xba\x5d\xa1\xfd\x89\x01"
"\x50\xb0\xc6\x45\x5c\xb4\xf5\x8b\x19\x52\x52\x25\x25")
};
int times( sizeof(test_sha) / sizeof(testVector) );
for (int i = 0; i < times; ++i) {
sha.Update(test_sha[i].input_, test_sha[i].inLen_);
sha.Final(hash);
if (memcmp(hash, test_sha[i].output_, SHA224::DIGEST_SIZE) != 0)
return -1 - i;
}
return 0;
}
int md5_test() int md5_test()
{ {
MD5 md5; MD5 md5;
@ -606,11 +771,11 @@ int des_test()
const byte iv[] = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef }; const byte iv[] = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef };
enc.SetKey(key, sizeof(key)); enc.SetKey(key, sizeof(key));
enc.Process(global_cipher, global_msg, sz); enc.Process(cipher, msg, sz);
dec.SetKey(key, sizeof(key)); dec.SetKey(key, sizeof(key));
dec.Process(global_plain, global_cipher, sz); dec.Process(plain, cipher, sz);
if (memcmp(global_plain, global_msg, sz)) if (memcmp(plain, msg, sz))
return -50; return -50;
const byte verify1[] = const byte verify1[] =
@ -620,7 +785,7 @@ int des_test()
0x89,0x3d,0x51,0xec,0x4b,0x56,0x3b,0x53 0x89,0x3d,0x51,0xec,0x4b,0x56,0x3b,0x53
}; };
if (memcmp(global_cipher, verify1, sz)) if (memcmp(cipher, verify1, sz))
return -51; return -51;
// CBC mode // CBC mode
@ -628,11 +793,11 @@ int des_test()
DES_CBC_Decryption dec2; DES_CBC_Decryption dec2;
enc2.SetKey(key, sizeof(key), iv); enc2.SetKey(key, sizeof(key), iv);
enc2.Process(global_cipher, global_msg, sz); enc2.Process(cipher, msg, sz);
dec2.SetKey(key, sizeof(key), iv); dec2.SetKey(key, sizeof(key), iv);
dec2.Process(global_plain, global_cipher, sz); dec2.Process(plain, cipher, sz);
if (memcmp(global_plain, global_msg, sz)) if (memcmp(plain, msg, sz))
return -52; return -52;
const byte verify2[] = const byte verify2[] =
@ -642,7 +807,7 @@ int des_test()
0x15,0x85,0xb3,0x22,0x4b,0x86,0x2b,0x4b 0x15,0x85,0xb3,0x22,0x4b,0x86,0x2b,0x4b
}; };
if (memcmp(global_cipher, verify2, sz)) if (memcmp(cipher, verify2, sz))
return -53; return -53;
// EDE3 CBC mode // EDE3 CBC mode
@ -664,11 +829,11 @@ int des_test()
}; };
enc3.SetKey(key3, sizeof(key3), iv3); enc3.SetKey(key3, sizeof(key3), iv3);
enc3.Process(global_cipher, global_msg, sz); enc3.Process(cipher, msg, sz);
dec3.SetKey(key3, sizeof(key3), iv3); dec3.SetKey(key3, sizeof(key3), iv3);
dec3.Process(global_plain, global_cipher, sz); dec3.Process(plain, cipher, sz);
if (memcmp(global_plain, global_msg, sz)) if (memcmp(plain, msg, sz))
return -54; return -54;
const byte verify3[] = const byte verify3[] =
@ -678,7 +843,7 @@ int des_test()
0x18,0xbc,0xbb,0x6d,0xd2,0xb1,0x16,0xda 0x18,0xbc,0xbb,0x6d,0xd2,0xb1,0x16,0xda
}; };
if (memcmp(global_cipher, verify3, sz)) if (memcmp(cipher, verify3, sz))
return -55; return -55;
return 0; return 0;
@ -697,10 +862,10 @@ int aes_test()
enc.SetKey(key, bs, iv); enc.SetKey(key, bs, iv);
dec.SetKey(key, bs, iv); dec.SetKey(key, bs, iv);
enc.Process(global_cipher, global_msg, bs); enc.Process(cipher, msg, bs);
dec.Process(global_plain, global_cipher, bs); dec.Process(plain, cipher, bs);
if (memcmp(global_plain, global_msg, bs)) if (memcmp(plain, msg, bs))
return -60; return -60;
const byte verify[] = const byte verify[] =
@ -709,7 +874,7 @@ int aes_test()
0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb 0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb
}; };
if (memcmp(global_cipher, verify, bs)) if (memcmp(cipher, verify, bs))
return -61; return -61;
AES_ECB_Encryption enc2; AES_ECB_Encryption enc2;
@ -718,10 +883,10 @@ int aes_test()
enc2.SetKey(key, bs, iv); enc2.SetKey(key, bs, iv);
dec2.SetKey(key, bs, iv); dec2.SetKey(key, bs, iv);
enc2.Process(global_cipher, global_msg, bs); enc2.Process(cipher, msg, bs);
dec2.Process(global_plain, global_cipher, bs); dec2.Process(plain, cipher, bs);
if (memcmp(global_plain, global_msg, bs)) if (memcmp(plain, msg, bs))
return -62; return -62;
const byte verify2[] = const byte verify2[] =
@ -730,7 +895,7 @@ int aes_test()
0xc8,0x8c,0x33,0x3b,0xb5,0x8f,0x85,0xd1 0xc8,0x8c,0x33,0x3b,0xb5,0x8f,0x85,0xd1
}; };
if (memcmp(global_cipher, verify2, bs)) if (memcmp(cipher, verify2, bs))
return -63; return -63;
return 0; return 0;
@ -749,10 +914,10 @@ int twofish_test()
enc.SetKey(key, bs, iv); enc.SetKey(key, bs, iv);
dec.SetKey(key, bs, iv); dec.SetKey(key, bs, iv);
enc.Process(global_cipher, global_msg, bs); enc.Process(cipher, msg, bs);
dec.Process(global_plain, global_cipher, bs); dec.Process(plain, cipher, bs);
if (memcmp(global_plain, global_msg, bs)) if (memcmp(plain, msg, bs))
return -60; return -60;
const byte verify[] = const byte verify[] =
@ -761,7 +926,7 @@ int twofish_test()
0x21,0x03,0x58,0x79,0x5F,0x02,0x27,0x2C 0x21,0x03,0x58,0x79,0x5F,0x02,0x27,0x2C
}; };
if (memcmp(global_cipher, verify, bs)) if (memcmp(cipher, verify, bs))
return -61; return -61;
Twofish_ECB_Encryption enc2; Twofish_ECB_Encryption enc2;
@ -770,10 +935,10 @@ int twofish_test()
enc2.SetKey(key, bs, iv); enc2.SetKey(key, bs, iv);
dec2.SetKey(key, bs, iv); dec2.SetKey(key, bs, iv);
enc2.Process(global_cipher, global_msg, bs); enc2.Process(cipher, msg, bs);
dec2.Process(global_plain, global_cipher, bs); dec2.Process(plain, cipher, bs);
if (memcmp(global_plain, global_msg, bs)) if (memcmp(plain, msg, bs))
return -62; return -62;
const byte verify2[] = const byte verify2[] =
@ -782,7 +947,7 @@ int twofish_test()
0xC4,0xCD,0x6B,0x91,0x14,0xC5,0x3A,0x09 0xC4,0xCD,0x6B,0x91,0x14,0xC5,0x3A,0x09
}; };
if (memcmp(global_cipher, verify2, bs)) if (memcmp(cipher, verify2, bs))
return -63; return -63;
return 0; return 0;
@ -801,10 +966,10 @@ int blowfish_test()
enc.SetKey(key, 16, iv); enc.SetKey(key, 16, iv);
dec.SetKey(key, 16, iv); dec.SetKey(key, 16, iv);
enc.Process(global_cipher, global_msg, bs * 2); enc.Process(cipher, msg, bs * 2);
dec.Process(global_plain, global_cipher, bs * 2); dec.Process(plain, cipher, bs * 2);
if (memcmp(global_plain, global_msg, bs)) if (memcmp(plain, msg, bs))
return -60; return -60;
const byte verify[] = const byte verify[] =
@ -813,7 +978,7 @@ int blowfish_test()
0xBC,0xD9,0x08,0xC4,0x94,0x6C,0x89,0xA3 0xBC,0xD9,0x08,0xC4,0x94,0x6C,0x89,0xA3
}; };
if (memcmp(global_cipher, verify, bs)) if (memcmp(cipher, verify, bs))
return -61; return -61;
Blowfish_ECB_Encryption enc2; Blowfish_ECB_Encryption enc2;
@ -822,10 +987,10 @@ int blowfish_test()
enc2.SetKey(key, 16, iv); enc2.SetKey(key, 16, iv);
dec2.SetKey(key, 16, iv); dec2.SetKey(key, 16, iv);
enc2.Process(global_cipher, global_msg, bs * 2); enc2.Process(cipher, msg, bs * 2);
dec2.Process(global_plain, global_cipher, bs * 2); dec2.Process(plain, cipher, bs * 2);
if (memcmp(global_plain, global_msg, bs)) if (memcmp(plain, msg, bs))
return -62; return -62;
const byte verify2[] = const byte verify2[] =
@ -834,7 +999,7 @@ int blowfish_test()
0x8F,0xCE,0x39,0x32,0xDE,0xD7,0xBC,0x5B 0x8F,0xCE,0x39,0x32,0xDE,0xD7,0xBC,0x5B
}; };
if (memcmp(global_cipher, verify2, bs)) if (memcmp(cipher, verify2, bs))
return -63; return -63;
return 0; return 0;

View File

@ -7,7 +7,7 @@
typedef unsigned char byte; typedef unsigned char byte;
void taocrypt_test(void*); void taocrypt_test(void*);
void file_test(char*, byte*); void file_test(const char*, byte*);
void client_test(void*); void client_test(void*);
void echoclient_test(void*); void echoclient_test(void*);
@ -86,8 +86,8 @@ int main(int argc, char** argv)
// input output compare // input output compare
byte input[TaoCrypt::MD5::DIGEST_SIZE]; byte input[TaoCrypt::MD5::DIGEST_SIZE];
byte output[TaoCrypt::MD5::DIGEST_SIZE]; byte output[TaoCrypt::MD5::DIGEST_SIZE];
file_test((char*) "input", input); file_test("input", input);
file_test((char*) "output", output); file_test("output", output);
assert(memcmp(input, output, sizeof(input)) == 0); assert(memcmp(input, output, sizeof(input)) == 0);
printf("\nAll tests passed!\n"); printf("\nAll tests passed!\n");
@ -141,17 +141,16 @@ int test_openSSL_des()
/* test des encrypt/decrypt */ /* test des encrypt/decrypt */
char data[] = "this is my data "; char data[] = "this is my data ";
int dataSz = strlen(data); int dataSz = strlen(data);
DES_key_schedule local_key[3]; DES_key_schedule key[3];
byte iv[8]; byte iv[8];
EVP_BytesToKey(EVP_des_ede3_cbc(), EVP_md5(), NULL, (byte*)data, dataSz, 1, EVP_BytesToKey(EVP_des_ede3_cbc(), EVP_md5(), NULL, (byte*)data, dataSz, 1,
(byte*)local_key, iv); (byte*)key, iv);
byte cipher[16]; byte cipher[16];
DES_ede3_cbc_encrypt((byte*)data, cipher, dataSz, DES_ede3_cbc_encrypt((byte*)data, cipher, dataSz, &key[0], &key[1],
&local_key[0], &local_key[1], &key[2], &iv, true);
&local_key[2], &iv, true);
byte plain[16]; byte plain[16];
DES_ede3_cbc_encrypt(cipher, plain, 16, &local_key[0], &local_key[1], DES_ede3_cbc_encrypt(cipher, plain, 16, &key[0], &key[1], &key[2],
&local_key[2], &iv, false); &iv, false);
return 0; return 0;
} }

View File

@ -525,7 +525,7 @@ MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);
MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild); MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);
MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql); MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql);
int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option,
const char *arg); const void *arg);
void STDCALL mysql_free_result(MYSQL_RES *result); void STDCALL mysql_free_result(MYSQL_RES *result);
void STDCALL mysql_data_seek(MYSQL_RES *result, void STDCALL mysql_data_seek(MYSQL_RES *result,
my_ulonglong offset); my_ulonglong offset);

View File

@ -102,6 +102,9 @@ void vio_timeout(Vio *vio,uint which, uint timeout);
#define HEADER_DES_LOCL_H dummy_something #define HEADER_DES_LOCL_H dummy_something
#define YASSL_MYSQL_COMPATIBLE #define YASSL_MYSQL_COMPATIBLE
#define YASSL_PREFIX #define YASSL_PREFIX
/* Set yaSSL to use same type as MySQL do for socket handles */
typedef my_socket YASSL_SOCKET_T;
#define YASSL_SOCKET_T_DEFINED
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/err.h> #include <openssl/err.h>

View File

@ -178,4 +178,73 @@ insert into t1 (fl) values (pointfromtext('point(1,1)'));
drop table t1; drop table t1;
# End of 5.0 tests --echo End of 4.1 tests
#
# Bug#24563: MBROverlaps does not seem to function propertly
# Bug#54888: MBROverlaps missing in 5.1?
#
# Test all MBR* functions and their non-MBR-prefixed aliases,
# using shifted squares to verify the spatial relations.
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
# Overlaps needs a few more tests, with point and line dimensions
SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))');
SET @point1 = GeomFromText('POLYGON ((0 0))');
SET @point2 = GeomFromText('POLYGON ((-2 0))');
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name;
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name;
SELECT Overlaps(@horiz1, @vert1) FROM DUAL;
SELECT Overlaps(@horiz1, @horiz2) FROM DUAL;
SELECT Overlaps(@horiz1, @horiz3) FROM DUAL;
SELECT Overlaps(@horiz1, @point1) FROM DUAL;
SELECT Overlaps(@horiz1, @point2) FROM DUAL;
DROP TABLE t1;
--echo End of 5.0 tests

View File

@ -498,6 +498,17 @@ sub collect_one_test_case($$$$$$$) {
{ {
mtr_options_from_test_file($tinfo,"$testdir/${tname}.test"); mtr_options_from_test_file($tinfo,"$testdir/${tname}.test");
if ( defined $::used_default_engine )
{
# Different default engine is used
# tag test to require that engine
$tinfo->{'ndb_test'}= 1
if ( $::used_default_engine =~ /^ndb/i );
$tinfo->{'innodb_test'}= 1
if ( $::used_default_engine =~ /^innodb/i );
}
if ( $tinfo->{'big_test'} and ! $::opt_big_test ) if ( $tinfo->{'big_test'} and ! $::opt_big_test )
{ {
$tinfo->{'skip'}= 1; $tinfo->{'skip'}= 1;

View File

@ -38,8 +38,8 @@ sub mtr_kill_processes ($);
sub mtr_ping_with_timeout($); sub mtr_ping_with_timeout($);
sub mtr_ping_port ($); sub mtr_ping_port ($);
# static in C # Local function
sub spawn_impl ($$$$$$$$); sub spawn_impl ($$$$$$$);
############################################################################## ##############################################################################
# #
@ -47,18 +47,16 @@ sub spawn_impl ($$$$$$$$);
# #
############################################################################## ##############################################################################
# This function try to mimic the C version used in "netware/mysql_test_run.c"
sub mtr_run ($$$$$$;$) { sub mtr_run ($$$$$$;$) {
my $path= shift; my $path= shift;
my $arg_list_t= shift; my $arg_list_t= shift;
my $input= shift; my $input= shift;
my $output= shift; my $output= shift;
my $error= shift; my $error= shift;
my $pid_file= shift; my $pid_file= shift; # Not used
my $spawn_opts= shift; my $spawn_opts= shift;
return spawn_impl($path,$arg_list_t,'run',$input,$output,$error,$pid_file, return spawn_impl($path,$arg_list_t,'run',$input,$output,$error,
$spawn_opts); $spawn_opts);
} }
@ -68,10 +66,10 @@ sub mtr_run_test ($$$$$$;$) {
my $input= shift; my $input= shift;
my $output= shift; my $output= shift;
my $error= shift; my $error= shift;
my $pid_file= shift; my $pid_file= shift; # Not used
my $spawn_opts= shift; my $spawn_opts= shift;
return spawn_impl($path,$arg_list_t,'test',$input,$output,$error,$pid_file, return spawn_impl($path,$arg_list_t,'test',$input,$output,$error,
$spawn_opts); $spawn_opts);
} }
@ -81,28 +79,22 @@ sub mtr_spawn ($$$$$$;$) {
my $input= shift; my $input= shift;
my $output= shift; my $output= shift;
my $error= shift; my $error= shift;
my $pid_file= shift; my $pid_file= shift; # Not used
my $spawn_opts= shift; my $spawn_opts= shift;
return spawn_impl($path,$arg_list_t,'spawn',$input,$output,$error,$pid_file, return spawn_impl($path,$arg_list_t,'spawn',$input,$output,$error,
$spawn_opts); $spawn_opts);
} }
##############################################################################
#
# If $join is set, we return the error code, else we return the PID
#
##############################################################################
sub spawn_impl ($$$$$$$$) { sub spawn_impl ($$$$$$$) {
my $path= shift; my $path= shift;
my $arg_list_t= shift; my $arg_list_t= shift;
my $mode= shift; my $mode= shift;
my $input= shift; my $input= shift;
my $output= shift; my $output= shift;
my $error= shift; my $error= shift;
my $pid_file= shift; # FIXME
my $spawn_opts= shift; my $spawn_opts= shift;
if ( $::opt_script_debug ) if ( $::opt_script_debug )
@ -155,10 +147,6 @@ sub spawn_impl ($$$$$$$$) {
else else
{ {
# Child, redirect output and exec # Child, redirect output and exec
# FIXME I tried POSIX::setsid() here to detach and, I hoped,
# avoid zombies. But everything went wild, somehow the parent
# became a deamon as well, and was hard to kill ;-)
# Need to catch SIGCHLD and do waitpid or something instead......
$SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't $SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't
@ -196,7 +184,15 @@ sub spawn_impl ($$$$$$$$) {
} }
else else
{ {
if ( ! open(STDERR,$log_file_open_mode,$error) ) if ( $::glob_win32_perl )
{
# Don't redirect stdout on ActiveState perl since this is
# just another thread in the same process.
# Should be fixed so that the thread that is created with fork
# executes the exe in another process and wait's for it to return.
# In the meanwhile, we get all the output from mysqld's to screen
}
elsif ( ! open(STDERR,$log_file_open_mode,$error) )
{ {
mtr_child_error("can't redirect STDERR to \"$error\": $!"); mtr_child_error("can't redirect STDERR to \"$error\": $!");
} }
@ -259,9 +255,7 @@ sub spawn_parent_impl {
# We do blocking waitpid() until we get the return from the # We do blocking waitpid() until we get the return from the
# "mysqltest" call. But if a mysqld process dies that we # "mysqltest" call. But if a mysqld process dies that we
# started, we take this as an error, and kill mysqltest. # started, we take this as an error, and kill mysqltest.
#
# FIXME is this as it should be? Can't mysqld terminate
# normally from running a test case?
my $exit_value= -1; my $exit_value= -1;
my $saved_exit_value; my $saved_exit_value;
@ -450,7 +444,6 @@ sub mtr_kill_leftovers () {
# We scan the "var/run/" directory for other process id's to kill # We scan the "var/run/" directory for other process id's to kill
# FIXME $path_run_dir or something
my $rundir= "$::opt_vardir/run"; my $rundir= "$::opt_vardir/run";
mtr_debug("Processing PID files in directory '$rundir'..."); mtr_debug("Processing PID files in directory '$rundir'...");

View File

@ -305,6 +305,7 @@ our $path_sql_dir;
our @data_dir_lst; our @data_dir_lst;
our $used_binlog_format; our $used_binlog_format;
our $used_default_engine;
our $debug_compiled_binaries; our $debug_compiled_binaries;
our $glob_tot_real_time= 0; our $glob_tot_real_time= 0;
@ -520,7 +521,7 @@ sub command_line_setup () {
'compress' => \$opt_compress, 'compress' => \$opt_compress,
'bench' => \$opt_bench, 'bench' => \$opt_bench,
'small-bench' => \$opt_small_bench, 'small-bench' => \$opt_small_bench,
'with-ndbcluster' => \$opt_with_ndbcluster, 'with-ndbcluster|ndb' => \$opt_with_ndbcluster,
'vs-config' => \$opt_vs_config, 'vs-config' => \$opt_vs_config,
# Control what test suites or cases to run # Control what test suites or cases to run
@ -777,6 +778,26 @@ sub command_line_setup () {
mtr_report("Using binlog format '$used_binlog_format'"); mtr_report("Using binlog format '$used_binlog_format'");
} }
# --------------------------------------------------------------------------
# Find out default storage engine being used(if any)
# --------------------------------------------------------------------------
if ( $opt_with_ndbcluster )
{
# --ndb or --with-ndbcluster turns on --default-storage-engine=ndbcluster
push(@opt_extra_mysqld_opt, "--default-storage-engine=ndbcluster");
}
foreach my $arg ( @opt_extra_mysqld_opt )
{
if ( $arg =~ /default-storage-engine=(\S+)/ )
{
$used_default_engine= $1;
}
}
mtr_report("Using default engine '$used_default_engine'")
if defined $used_default_engine;
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Check if we should speed up tests by trying to run on tmpfs # Check if we should speed up tests by trying to run on tmpfs
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
@ -849,20 +870,22 @@ sub command_line_setup () {
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Check im suport # Check im suport
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
if (!$opt_extern) if ($opt_extern)
{
mtr_report("Disable instance manager when running with extern mysqld");
$opt_skip_im= 1;
}
elsif ( $mysql_version_id < 50000 )
{ {
if ( $mysql_version_id < 50000 ) {
# Instance manager is not supported until 5.0 # Instance manager is not supported until 5.0
$opt_skip_im= 1; $opt_skip_im= 1;
} }
elsif ( $glob_win32 )
if ( $glob_win32 ) { {
mtr_report("Disable Instance manager - not supported on Windows"); mtr_report("Disable Instance manager - testing not supported on Windows");
$opt_skip_im= 1; $opt_skip_im= 1;
} }
}
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Record flag # Record flag
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
@ -900,10 +923,6 @@ sub command_line_setup () {
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Ndb cluster flags # Ndb cluster flags
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
if ( $opt_with_ndbcluster and !$opt_bench)
{
mtr_error("Can only use --with-ndbcluster together with --bench");
}
if ( $opt_ndbconnectstring ) if ( $opt_ndbconnectstring )
{ {
@ -1056,8 +1075,6 @@ sub command_line_setup () {
# socket path names. # socket path names.
$sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) > 80 ); $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) > 80 );
# Put this into a hash, will be a C struct
$master->[0]= $master->[0]=
{ {
pid => 0, pid => 0,
@ -1065,7 +1082,6 @@ sub command_line_setup () {
idx => 0, idx => 0,
path_myddir => "$opt_vardir/master-data", path_myddir => "$opt_vardir/master-data",
path_myerr => "$opt_vardir/log/master.err", path_myerr => "$opt_vardir/log/master.err",
path_mylog => "$opt_vardir/log/master.log",
path_pid => "$opt_vardir/run/master.pid", path_pid => "$opt_vardir/run/master.pid",
path_sock => "$sockdir/master.sock", path_sock => "$sockdir/master.sock",
port => $opt_master_myport, port => $opt_master_myport,
@ -1081,7 +1097,6 @@ sub command_line_setup () {
idx => 1, idx => 1,
path_myddir => "$opt_vardir/master1-data", path_myddir => "$opt_vardir/master1-data",
path_myerr => "$opt_vardir/log/master1.err", path_myerr => "$opt_vardir/log/master1.err",
path_mylog => "$opt_vardir/log/master1.log",
path_pid => "$opt_vardir/run/master1.pid", path_pid => "$opt_vardir/run/master1.pid",
path_sock => "$sockdir/master1.sock", path_sock => "$sockdir/master1.sock",
port => $opt_master_myport + 1, port => $opt_master_myport + 1,
@ -1097,7 +1112,6 @@ sub command_line_setup () {
idx => 0, idx => 0,
path_myddir => "$opt_vardir/slave-data", path_myddir => "$opt_vardir/slave-data",
path_myerr => "$opt_vardir/log/slave.err", path_myerr => "$opt_vardir/log/slave.err",
path_mylog => "$opt_vardir/log/slave.log",
path_pid => "$opt_vardir/run/slave.pid", path_pid => "$opt_vardir/run/slave.pid",
path_sock => "$sockdir/slave.sock", path_sock => "$sockdir/slave.sock",
port => $opt_slave_myport, port => $opt_slave_myport,
@ -1114,7 +1128,6 @@ sub command_line_setup () {
idx => 1, idx => 1,
path_myddir => "$opt_vardir/slave1-data", path_myddir => "$opt_vardir/slave1-data",
path_myerr => "$opt_vardir/log/slave1.err", path_myerr => "$opt_vardir/log/slave1.err",
path_mylog => "$opt_vardir/log/slave1.log",
path_pid => "$opt_vardir/run/slave1.pid", path_pid => "$opt_vardir/run/slave1.pid",
path_sock => "$sockdir/slave1.sock", path_sock => "$sockdir/slave1.sock",
port => $opt_slave_myport + 1, port => $opt_slave_myport + 1,
@ -1130,7 +1143,6 @@ sub command_line_setup () {
idx => 2, idx => 2,
path_myddir => "$opt_vardir/slave2-data", path_myddir => "$opt_vardir/slave2-data",
path_myerr => "$opt_vardir/log/slave2.err", path_myerr => "$opt_vardir/log/slave2.err",
path_mylog => "$opt_vardir/log/slave2.log",
path_pid => "$opt_vardir/run/slave2.pid", path_pid => "$opt_vardir/run/slave2.pid",
path_sock => "$sockdir/slave2.sock", path_sock => "$sockdir/slave2.sock",
port => $opt_slave_myport + 2, port => $opt_slave_myport + 2,
@ -1334,7 +1346,7 @@ sub collect_mysqld_features () {
# #
# Execute "mysqld --no-defaults --help --verbose" to get a # Execute "mysqld --no-defaults --help --verbose" to get a
# of all features and settings # list of all features and settings
# #
my $list= `$exe_mysqld --no-defaults --verbose --help`; my $list= `$exe_mysqld --no-defaults --verbose --help`;
@ -1398,6 +1410,40 @@ sub collect_mysqld_features () {
} }
sub run_query($$) {
my ($mysqld, $query)= @_;
my $args;
mtr_init_args(\$args);
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--user=%s", $opt_user);
mtr_add_arg($args, "--port=%d", $mysqld->{'port'});
mtr_add_arg($args, "--socket=%s", $mysqld->{'path_sock'});
mtr_add_arg($args, "--silent"); # Tab separated output
mtr_add_arg($args, "-e '%s'", $query);
my $cmd= "$exe_mysql " . join(' ', @$args);
mtr_verbose("cmd: $cmd");
return `$cmd`;
}
sub collect_mysqld_features_from_running_server ()
{
my $list= run_query($master->[0], "use mysql; SHOW VARIABLES");
foreach my $line (split('\n', $list))
{
# Put variables into hash
if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ )
{
print "$1=\"$2\"\n";
$mysqld_variables{$1}= $2;
}
}
}
sub executable_setup_im () { sub executable_setup_im () {
# Look for instance manager binary - mysqlmanager # Look for instance manager binary - mysqlmanager
@ -1933,7 +1979,7 @@ sub environment_setup () {
# ---------------------------------------------------- # ----------------------------------------------------
my $cmdline_mysqlbinlog= my $cmdline_mysqlbinlog=
mtr_native_path($exe_mysqlbinlog) . mtr_native_path($exe_mysqlbinlog) .
" --no-defaults --disable-force-if-open --debug-info --local-load=$opt_tmpdir"; " --no-defaults --disable-force-if-open --debug-info";
if ( !$opt_extern && $mysql_version_id >= 50000 ) if ( !$opt_extern && $mysql_version_id >= 50000 )
{ {
$cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir"; $cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
@ -2802,10 +2848,7 @@ sub initialize_servers () {
} }
else else
{ {
if ($opt_verbose) mtr_verbose("No need to create '$opt_vardir' it already exists");
{
mtr_report("No need to create '$opt_vardir' it already exists");
}
} }
} }
else else
@ -3712,8 +3755,10 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s--log-output=table,file", $prefix); mtr_add_arg($args, "%s--log-output=table,file", $prefix);
} }
mtr_add_arg($args, "%s--log=%s", $prefix, $mysqld->{'path_mylog'}); my $log_base_path= "$opt_vardir/log/$mysqld->{'type'}$sidx";
mtr_add_arg($args, "%s--log=%s.log", $prefix, $log_base_path);
mtr_add_arg($args,
"%s--log-slow-queries=%s-slow.log", $prefix, $log_base_path);
# Check if "extra_opt" contains --skip-log-bin # Check if "extra_opt" contains --skip-log-bin
my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt); my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt);
@ -5016,7 +5061,7 @@ Options to control what engine/variation to run
skip-ssl Dont start server with support for ssl connections skip-ssl Dont start server with support for ssl connections
bench Run the benchmark suite bench Run the benchmark suite
small-bench Run the benchmarks with --small-tests --small-tables small-bench Run the benchmarks with --small-tests --small-tables
with-ndbcluster Use cluster as default table type for benchmark ndb|with-ndbcluster Use cluster as default table type
vs-config Visual Studio configuration used to create executables vs-config Visual Studio configuration used to create executables
(default: MTR_VS_CONFIG environment variable) (default: MTR_VS_CONFIG environment variable)

View File

@ -393,7 +393,7 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r first second w c o e d t i r
120 120 1 1 0 1 0 0 1 0 120 120 1 1 0 1 0 0 1 0
120 121 0 0 0 0 0 0 1 0 120 121 0 0 1 0 0 0 1 0
121 120 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0
121 121 1 1 0 1 0 0 1 0 121 121 1 1 0 1 0 0 1 0
explain extended SELECT g1.fid as first, g2.fid as second, explain extended SELECT g1.fid as first, g2.fid as second,
@ -460,3 +460,89 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)')); insert into t1 (fl) values (pointfromtext('point(1,1)'));
ERROR 23000: Column 'fl' cannot be null ERROR 23000: Column 'fl' cannot be null
drop table t1; drop table t1;
End of 4.1 tests
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrcontains
center,small
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrdisjoint
down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrequal
center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrintersect
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbroverlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrtouches
down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrwithin
big,center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
contains
center,small
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
disjoint
down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
equals
center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
intersect
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
overlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
touches
down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
within
big,center
SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))');
SET @point1 = GeomFromText('POLYGON ((0 0))');
SET @point2 = GeomFromText('POLYGON ((-2 0))');
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name;
overlaps
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name;
overlaps
SELECT Overlaps(@horiz1, @vert1) FROM DUAL;
Overlaps(@horiz1, @vert1)
0
SELECT Overlaps(@horiz1, @horiz2) FROM DUAL;
Overlaps(@horiz1, @horiz2)
1
SELECT Overlaps(@horiz1, @horiz3) FROM DUAL;
Overlaps(@horiz1, @horiz3)
0
SELECT Overlaps(@horiz1, @point1) FROM DUAL;
Overlaps(@horiz1, @point1)
0
SELECT Overlaps(@horiz1, @point2) FROM DUAL;
Overlaps(@horiz1, @point2)
0
DROP TABLE t1;
End of 5.0 tests

View File

@ -784,6 +784,7 @@ t1 CREATE TABLE `t1` (
drop table t1; drop table t1;
create table t1 (upgrade int); create table t1 (upgrade int);
drop table t1; drop table t1;
End of 5.0 tests
CREATE TABLE t1 (a int, b int); CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2); insert into t1 values (1,1),(1,2);
CREATE TABLE t2 (primary key (a)) select * from t1; CREATE TABLE t2 (primary key (a)) select * from t1;
@ -838,3 +839,4 @@ USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
End of 5.1 tests

View File

@ -189,12 +189,12 @@ date format datetime
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450 2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12 2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12
10:20:10 %H:%i:%s 0000-00-00 00:00:00 10:20:10 %H:%i:%s 0000-00-00 10:20:10
10:20:10 %h:%i:%s.%f 0000-00-00 00:00:00 10:20:10 %h:%i:%s.%f 0000-00-00 10:20:10
10:20:10 %T 0000-00-00 00:00:00 10:20:10 %T 0000-00-00 10:20:10
10:20:10AM %h:%i:%s%p 0000-00-00 00:00:00 10:20:10AM %h:%i:%s%p 0000-00-00 10:20:10
10:20:10AM %r 0000-00-00 00:00:00 10:20:10AM %r 0000-00-00 10:20:10
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 00:00:00 10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58 15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00 15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00 15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
@ -211,13 +211,6 @@ Tuesday 52 2001 %W %V %X 2002-01-01 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00 15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00
15-01-20 %d-%m-%y 2020-01-15 00:00:00 15-01-20 %d-%m-%y 2020-01-15 00:00:00
15-2001-1 %d-%Y-%c 2001-01-15 00:00:00 15-2001-1 %d-%Y-%c 2001-01-15 00:00:00
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Incorrect datetime value: '0000-00-00 10:20:10'
Warning 1292 Incorrect datetime value: '0000-00-00 10:20:10.440000'
select date,format,DATE(str_to_date(date, format)) as date2 from t1; select date,format,DATE(str_to_date(date, format)) as date2 from t1;
date format date2 date format date2
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02
@ -258,12 +251,12 @@ date format time
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450 2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12 2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
10:20:10 %H:%i:%s NULL 10:20:10 %H:%i:%s 10:20:10
10:20:10 %h:%i:%s.%f NULL 10:20:10 %h:%i:%s.%f 10:20:10
10:20:10 %T NULL 10:20:10 %T 10:20:10
10:20:10AM %h:%i:%s%p NULL 10:20:10AM %h:%i:%s%p 10:20:10
10:20:10AM %r NULL 10:20:10AM %r 10:20:10
10:20:10.44AM %h:%i:%s.%f%p NULL 10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58 15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15 September 2001 %d %M %Y 00:00:00 15 September 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00 15 SEPTEMB 2001 %d %M %Y 00:00:00
@ -280,13 +273,6 @@ Tuesday 52 2001 %W %V %X 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00 15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00
15-01-20 %d-%m-%y 00:00:00 15-01-20 %d-%m-%y 00:00:00
15-2001-1 %d-%Y-%c 00:00:00 15-2001-1 %d-%Y-%c 00:00:00
Warnings:
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10.440000'
select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1; select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1;
date format time2 date format time2
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12 2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12
@ -296,12 +282,12 @@ date format time2
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450 2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450 2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12 2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
10:20:10 %H:%i:%s NULL 10:20:10 %H:%i:%s 10:20:10
10:20:10 %h:%i:%s.%f NULL 10:20:10 %h:%i:%s.%f 10:20:10
10:20:10 %T NULL 10:20:10 %T 10:20:10
10:20:10AM %h:%i:%s%p NULL 10:20:10AM %h:%i:%s%p 10:20:10
10:20:10AM %r NULL 10:20:10AM %r 10:20:10
10:20:10.44AM %h:%i:%s.%f%p NULL 10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58 15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15 September 2001 %d %M %Y 00:00:00 15 September 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00 15 SEPTEMB 2001 %d %M %Y 00:00:00
@ -318,13 +304,6 @@ Tuesday 52 2001 %W %V %X 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00 15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00
15-01-20 %d-%m-%y 00:00:00 15-01-20 %d-%m-%y 00:00:00
15-2001-1 %d-%Y-%c 00:00:00 15-2001-1 %d-%Y-%c 00:00:00
Warnings:
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10'
Warning 1292 Truncated incorrect time value: '0000-00-00 10:20:10.440000'
select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')); select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'));
concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')) concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'))
2003-01-02 08:11:02.123456 2003-01-02 08:11:02.123456
@ -473,8 +452,6 @@ create table t1 select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%
str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2, str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2,
str_to_date("2003-01-02", "%Y-%m-%d") as f3, str_to_date("2003-01-02", "%Y-%m-%d") as f3,
str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5; str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5;
Warnings:
Warning 1265 Data truncated for column 'f4' at row 1
describe t1; describe t1;
Field Type Null Key Default Extra Field Type Null Key Default Extra
f1 datetime YES NULL f1 datetime YES NULL
@ -484,7 +461,7 @@ f4 date YES NULL
f5 time YES NULL f5 time YES NULL
select * from t1; select * from t1;
f1 f2 f3 f4 f5 f1 f2 f3 f4 f5
2003-01-02 10:11:12 10:11:12 2003-01-02 0000-00-00 58:00:00 2003-01-02 10:11:12 10:11:12 2003-01-02 0000-00-02 58:00:00
drop table t1; drop table t1;
create table t1 select "02 10" as a, "%d %H" as b; create table t1 select "02 10" as a, "%d %H" as b;
select str_to_date(a,b) from t1; select str_to_date(a,b) from t1;

View File

@ -1287,6 +1287,15 @@ select var_samp(e) as '0.5', var_pop(e) as '0.25' from bug22555;
0.5 0.25 0.5 0.25
0.5000 0.2500 0.5000 0.2500
drop table bug22555; drop table bug22555;
create table t1 (a decimal(20));
insert into t1 values (12345678901234567890);
select count(a) from t1;
count(a)
1
select count(distinct a) from t1;
count(distinct a)
1
drop table t1;
CREATE TABLE t1 (a INT, b INT); CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8); INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8);
INSERT INTO t1 SELECT a, b+8 FROM t1; INSERT INTO t1 SELECT a, b+8 FROM t1;

View File

@ -2297,6 +2297,15 @@ A B tire
0 0
# # 1 # # 1
## ## 2 ## ## 2
SELECT REPEAT('0', CAST(0 AS UNSIGNED));
REPEAT('0', CAST(0 AS UNSIGNED))
SELECT REPEAT('0', -2);
REPEAT('0', -2)
SELECT REPEAT('0', 2);
REPEAT('0', 2)
00
DROP TABLE t1; DROP TABLE t1;
SELECT UNHEX('G'); SELECT UNHEX('G');
UNHEX('G') UNHEX('G')

View File

@ -385,7 +385,7 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r first second w c o e d t i r
120 120 1 1 0 1 0 0 1 0 120 120 1 1 0 1 0 0 1 0
120 121 0 0 0 0 0 0 1 0 120 121 0 0 1 0 0 0 1 0
121 120 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0
121 121 1 1 0 1 0 0 1 0 121 121 1 1 0 1 0 0 1 0
explain extended SELECT g1.fid as first, g2.fid as second, explain extended SELECT g1.fid as first, g2.fid as second,
@ -781,6 +781,91 @@ Field Type Null Key Default Extra
a geometry YES NULL a geometry YES NULL
DROP VIEW v1,v2; DROP VIEW v1,v2;
DROP TABLE t1; DROP TABLE t1;
create table t1 (name VARCHAR(100), square GEOMETRY);
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrcontains
center,small
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrdisjoint
down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrequal
center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrintersect
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbroverlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrtouches
down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrwithin
big,center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
contains
center,small
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
disjoint
down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
equals
center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
intersect
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
overlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
touches
down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
within
big,center
SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))');
SET @point1 = GeomFromText('POLYGON ((0 0))');
SET @point2 = GeomFromText('POLYGON ((-2 0))');
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name;
overlaps
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name;
overlaps
SELECT Overlaps(@horiz1, @vert1) FROM DUAL;
Overlaps(@horiz1, @vert1)
0
SELECT Overlaps(@horiz1, @horiz2) FROM DUAL;
Overlaps(@horiz1, @horiz2)
1
SELECT Overlaps(@horiz1, @horiz3) FROM DUAL;
Overlaps(@horiz1, @horiz3)
0
SELECT Overlaps(@horiz1, @point1) FROM DUAL;
Overlaps(@horiz1, @point1)
0
SELECT Overlaps(@horiz1, @point2) FROM DUAL;
Overlaps(@horiz1, @point2)
0
DROP TABLE t1;
End of 5.0 tests
create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime); create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
create view v1 as select * from t1; create view v1 as select * from t1;
desc v1; desc v1;
@ -792,3 +877,4 @@ f4 geometry YES NULL
f5 datetime YES NULL f5 datetime YES NULL
drop view v1; drop view v1;
drop table t1; drop table t1;
End of 5.1 tests

View File

@ -706,7 +706,7 @@ Warnings:
Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
show create table v3; show create table v3;
View Create View View Create View
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `test`.`sub1`(1) AS `c` v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `sub1`(1) AS `c`
Warnings: Warnings:
Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop view v2; drop view v2;

View File

@ -3159,3 +3159,21 @@ t2 CREATE TABLE `t2` (
CONSTRAINT `t2_t1` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT `t2_t1` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t2, t1; DROP TABLE t2, t1;
CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB;
CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
ALTER TABLE t2 MODIFY a INT NOT NULL;
ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
DELETE FROM t1;
DROP TABLE t2,t1;
CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY)
ENGINE=InnoDB;
INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4);
DELETE FROM t1;
INSERT INTO t1 VALUES ('DDD');
SELECT * FROM t1;
a
DDD
DROP TABLE t1;

View File

@ -393,7 +393,7 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r first second w c o e d t i r
120 120 1 1 0 1 0 0 1 0 120 120 1 1 0 1 0 0 1 0
120 121 0 0 0 0 0 0 1 0 120 121 0 0 1 0 0 0 1 0
121 120 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0
121 121 1 1 0 1 0 0 1 0 121 121 1 1 0 1 0 0 1 0
explain extended SELECT g1.fid as first, g2.fid as second, explain extended SELECT g1.fid as first, g2.fid as second,
@ -460,5 +460,91 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)')); insert into t1 (fl) values (pointfromtext('point(1,1)'));
ERROR 23000: Column 'fl' cannot be null ERROR 23000: Column 'fl' cannot be null
drop table t1; drop table t1;
End of 4.1 tests
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrcontains
center,small
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrdisjoint
down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrequal
center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrintersect
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbroverlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrtouches
down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrwithin
big,center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
contains
center,small
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
disjoint
down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
equals
center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
intersect
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
overlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
touches
down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
within
big,center
SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))');
SET @point1 = GeomFromText('POLYGON ((0 0))');
SET @point2 = GeomFromText('POLYGON ((-2 0))');
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name;
overlaps
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name;
overlaps
SELECT Overlaps(@horiz1, @vert1) FROM DUAL;
Overlaps(@horiz1, @vert1)
0
SELECT Overlaps(@horiz1, @horiz2) FROM DUAL;
Overlaps(@horiz1, @horiz2)
1
SELECT Overlaps(@horiz1, @horiz3) FROM DUAL;
Overlaps(@horiz1, @horiz3)
0
SELECT Overlaps(@horiz1, @point1) FROM DUAL;
Overlaps(@horiz1, @point1)
0
SELECT Overlaps(@horiz1, @point2) FROM DUAL;
Overlaps(@horiz1, @point2)
0
DROP TABLE t1;
End of 5.0 tests
create table t1 (g geometry not null, spatial gk(g)) engine=innodb; create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
ERROR HY000: The used table type doesn't support SPATIAL indexes ERROR HY000: The used table type doesn't support SPATIAL indexes

View File

@ -290,23 +290,23 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
create table t1 (a varchar(64) character set utf8)/*!*/; create table t1 (a varchar(64) character set utf8)/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-6-0' INTO table t1/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-6-0' INTO table t1/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/; SET @@session.collation_database=7/*!*/;
load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-7-0' INTO table t1/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-7-0' INTO table t1/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/; SET @@session.collation_database=DEFAULT/*!*/;
load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-8-0' INTO table t1/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-8-0' INTO table t1/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-9-0' INTO table t1/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-9-0' INTO table t1/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/; SET @@session.collation_database=7/*!*/;
load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-a-0' INTO table t1/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO table t1/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/; SET @@session.collation_database=DEFAULT/*!*/;
load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-b-0' INTO table t1/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO table t1/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQL_TMP_DIR/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
drop table t1/*!*/; drop table t1/*!*/;
DELIMITER ; DELIMITER ;

View File

@ -1568,29 +1568,17 @@ create table t3(a varchar(30) primary key, b int not null);
test_sequence test_sequence
------ Testing with illegal table names ------ ------ Testing with illegal table names ------
mysqldump: Couldn't find table: "\d-2-1.sql" mysqldump: Couldn't find table: "\d-2-1.sql"
mysqldump: Couldn't find table: "\t1" mysqldump: Couldn't find table: "\t1"
mysqldump: Couldn't find table: "\t1" mysqldump: Couldn't find table: "\t1"
mysqldump: Couldn't find table: "\\t1" mysqldump: Couldn't find table: "\\t1"
mysqldump: Couldn't find table: "t\1" mysqldump: Couldn't find table: "t\1"
mysqldump: Couldn't find table: "t\1" mysqldump: Couldn't find table: "t\1"
mysqldump: Couldn't find table: "t/1" mysqldump: Couldn't find table: "t/1"
mysqldump: Couldn't find table: "T_1" mysqldump: Couldn't find table: "T_1"
mysqldump: Couldn't find table: "T%1" mysqldump: Couldn't find table: "T%1"
mysqldump: Couldn't find table: "T'1" mysqldump: Couldn't find table: "T'1"
mysqldump: Couldn't find table: "T_1" mysqldump: Couldn't find table: "T_1"
mysqldump: Couldn't find table: "T_" mysqldump: Couldn't find table: "T_"
test_sequence test_sequence
------ Testing with illegal database names ------ ------ Testing with illegal database names ------
mysqldump: Got error: 1049: Unknown database 'mysqldump_test_d' when selecting the database mysqldump: Got error: 1049: Unknown database 'mysqldump_test_d' when selecting the database
@ -3217,6 +3205,83 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
</mysqldump> </mysqldump>
DROP TABLE t1; DROP TABLE t1;
# #
# Bug#26346: stack + buffer overrun in mysqldump
#
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
mysqldump: Input filename or options too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t1;
CREATE TABLE t2 (a int);
CREATE TABLE t3 (a int);
CREATE TABLE t1 (a int) ENGINE=merge UNION=(t2, t3);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t2`,`t3`);
DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `t3`;
CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
LOCK TABLES `t3` WRITE;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */;
/*!40000 ALTER TABLE `t3` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1, t2, t3;
#
# Bug #23491: MySQLDump prefix function call in a view by database name
#
create database bug23491_original;
create database bug23491_restore;
use bug23491_original;
create table t1 (c1 int);
create view v1 as select * from t1;
create procedure p1() select 1;
create function f1() returns int return 1;
create view v2 as select f1();
create function f2() returns int return f1();
create view v3 as select bug23491_original.f1();
use bug23491_restore;
show create view bug23491_restore.v2;
View Create View
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `f1`() AS `f1()`
show create view bug23491_restore.v3;
View Create View
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `bug23491_original`.`f1`() AS `bug23491_original.f1()`
drop database bug23491_original;
drop database bug23491_restore;
use test;
#
# End of 5.0 tests # End of 5.0 tests
# #
drop table if exists t1; drop table if exists t1;

View File

@ -393,7 +393,7 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r first second w c o e d t i r
120 120 1 1 0 1 0 0 1 0 120 120 1 1 0 1 0 0 1 0
120 121 0 0 0 0 0 0 1 0 120 121 0 0 1 0 0 0 1 0
121 120 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0
121 121 1 1 0 1 0 0 1 0 121 121 1 1 0 1 0 0 1 0
explain extended SELECT g1.fid as first, g2.fid as second, explain extended SELECT g1.fid as first, g2.fid as second,
@ -460,6 +460,94 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)')); insert into t1 (fl) values (pointfromtext('point(1,1)'));
ERROR 23000: Column 'fl' cannot be null ERROR 23000: Column 'fl' cannot be null
drop table t1; drop table t1;
End of 4.1 tests
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
Warnings:
Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrcontains
center,small
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrdisjoint
down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrequal
center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrintersect
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbroverlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrtouches
down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrwithin
big,center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
contains
center,small
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
disjoint
down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
equals
center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
intersect
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
overlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
touches
down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
within
big,center
SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))');
SET @point1 = GeomFromText('POLYGON ((0 0))');
SET @point2 = GeomFromText('POLYGON ((-2 0))');
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name;
overlaps
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name;
overlaps
SELECT Overlaps(@horiz1, @vert1) FROM DUAL;
Overlaps(@horiz1, @vert1)
0
SELECT Overlaps(@horiz1, @horiz2) FROM DUAL;
Overlaps(@horiz1, @horiz2)
1
SELECT Overlaps(@horiz1, @horiz3) FROM DUAL;
Overlaps(@horiz1, @horiz3)
0
SELECT Overlaps(@horiz1, @point1) FROM DUAL;
Overlaps(@horiz1, @point1)
0
SELECT Overlaps(@horiz1, @point2) FROM DUAL;
Overlaps(@horiz1, @point2)
0
DROP TABLE t1;
End of 5.0 tests
set engine_condition_pushdown = on; set engine_condition_pushdown = on;
DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT); CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT);
@ -855,7 +943,7 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r first second w c o e d t i r
120 120 1 1 0 1 0 0 1 0 120 120 1 1 0 1 0 0 1 0
120 121 0 0 0 0 0 0 1 0 120 121 0 0 1 0 0 0 1 0
121 120 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0
121 121 1 1 0 1 0 0 1 0 121 121 1 1 0 1 0 0 1 0
explain extended SELECT g1.fid as first, g2.fid as second, explain extended SELECT g1.fid as first, g2.fid as second,
@ -922,3 +1010,91 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)')); insert into t1 (fl) values (pointfromtext('point(1,1)'));
ERROR 23000: Column 'fl' cannot be null ERROR 23000: Column 'fl' cannot be null
drop table t1; drop table t1;
End of 4.1 tests
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
Warnings:
Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
INSERT INTO t1 VALUES("up", GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
INSERT INTO t1 VALUES("up2", GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
INSERT INTO t1 VALUES("up3", GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
INSERT INTO t1 VALUES("down", GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
INSERT INTO t1 VALUES("down2", GeomFromText('POLYGON (( 0 -2, 0 0, 2 0, 2 -2, 0 -2))'));
INSERT INTO t1 VALUES("down3", GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
INSERT INTO t1 VALUES("right", GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
INSERT INTO t1 VALUES("left", GeomFromText('POLYGON (( -1 0, -1 2, 1 2, 1 0, -1 0))'));
INSERT INTO t1 VALUES("left2", GeomFromText('POLYGON (( -2 0, -2 2, 0 2, 0 0, -2 0))'));
INSERT INTO t1 VALUES("left3", GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains FROM t1 a1 JOIN t1 a2 ON MBRContains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrcontains
center,small
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint FROM t1 a1 JOIN t1 a2 ON MBRDisjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrdisjoint
down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal FROM t1 a1 JOIN t1 a2 ON MBREqual( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrequal
center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrintersect
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps FROM t1 a1 JOIN t1 a2 ON MBROverlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbroverlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrtouches
down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
mbrwithin
big,center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
contains
center,small
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
disjoint
down3,left3,right3,up3
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals FROM t1 a1 JOIN t1 a2 ON Equals( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
equals
center
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect FROM t1 a1 JOIN t1 a2 ON Intersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
intersect
big,center,down,down2,left,left2,right,right2,small,up,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps FROM t1 a1 JOIN t1 a2 ON Overlaps( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
overlaps
down,left,right,up
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
touches
down2,left2,right2,up2
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
within
big,center
SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))');
SET @point1 = GeomFromText('POLYGON ((0 0))');
SET @point2 = GeomFromText('POLYGON ((-2 0))');
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name;
overlaps
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name;
overlaps
SELECT Overlaps(@horiz1, @vert1) FROM DUAL;
Overlaps(@horiz1, @vert1)
0
SELECT Overlaps(@horiz1, @horiz2) FROM DUAL;
Overlaps(@horiz1, @horiz2)
1
SELECT Overlaps(@horiz1, @horiz3) FROM DUAL;
Overlaps(@horiz1, @horiz3)
0
SELECT Overlaps(@horiz1, @point1) FROM DUAL;
Overlaps(@horiz1, @point1)
0
SELECT Overlaps(@horiz1, @point2) FROM DUAL;
Overlaps(@horiz1, @point2)
0
DROP TABLE t1;
End of 5.0 tests

View File

@ -51,3 +51,5 @@ SSL error: Unable to get private key from ''
mysqltest: Could not open connection 'default': 2026 SSL connection error mysqltest: Could not open connection 'default': 2026 SSL connection error
SSL error: Unable to get certificate from '' SSL error: Unable to get certificate from ''
mysqltest: Could not open connection 'default': 2026 SSL connection error mysqltest: Could not open connection 'default': 2026 SSL connection error
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA

View File

@ -4,20 +4,20 @@ File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106 master-bin.000001 106
reset slave; reset slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
change master to master_host='127.0.0.1'; change master to master_host='127.0.0.1';
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 test DEFAULT_MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No # # 127.0.0.1 test DEFAULT_MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No # No
change master to master_host='127.0.0.1',master_user='root', change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT; master_password='',master_port=MASTER_PORT;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No # # 127.0.0.1 root MASTER_PORT 7 4 # # No No 0 0 0 # None 0 No # No
start slave; start slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 106 # # master-bin.000001 Yes Yes 0 0 106 # None 0 No # # 127.0.0.1 root MASTER_PORT 7 master-bin.000001 106 # # master-bin.000001 Yes Yes 0 0 106 # None 0 No # No
drop table if exists t1; drop table if exists t1;
create table t1 (n int, PRIMARY KEY(n)); create table t1 (n int, PRIMARY KEY(n));
insert into t1 values (10),(45),(90); insert into t1 values (10),(45),(90);

View File

@ -12,12 +12,12 @@ insert into t1 values(1);
insert into t1 values(2); insert into t1 values(2);
stop slave; stop slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 191 # None 0 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 191 # None 0 No # No
change master to master_user='root'; change master to master_user='root';
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 191 # None 0 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 191 # None 0 No # No
start slave; start slave;
select * from t1; select * from t1;
n n

View File

@ -78,6 +78,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
stop slave; stop slave;
delete from t3; delete from t3;
change master to master_log_pos=548; change master to master_log_pos=548;
@ -132,6 +133,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
set @my_max_relay_log_size= @@global.max_relay_log_size; set @my_max_relay_log_size= @@global.max_relay_log_size;
set global max_relay_log_size=0; set global max_relay_log_size=0;
stop slave; stop slave;
@ -191,6 +193,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
drop table t1,t2,t3,t4; drop table t1,t2,t3,t4;
set global max_relay_log_size= @my_max_relay_log_size; set global max_relay_log_size= @my_max_relay_log_size;
End of 5.1 tests End of 5.1 tests

View File

@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
load table t1 from master; load table t1 from master;
ERROR 08S01: Error connecting to master: Master is not configured ERROR 08S01: Error connecting to master: Master is not configured
load table t1 from master; load table t1 from master;

View File

@ -87,6 +87,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t3 *** *** Drop t3 ***
@ -144,6 +145,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t4 *** *** Drop t4 ***
@ -201,6 +203,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t5 *** *** Drop t5 ***
@ -257,6 +260,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
*** Drop t6 *** *** Drop t6 ***
DROP TABLE t6; DROP TABLE t6;
@ -364,6 +368,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t10 *** *** Drop t10 ***
@ -420,6 +425,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t11 *** *** Drop t11 ***
@ -605,6 +611,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Try to insert in master **** *** Try to insert in master ****
@ -735,6 +742,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
** DROP table t17 *** ** DROP table t17 ***

View File

@ -87,6 +87,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t3 *** *** Drop t3 ***
@ -144,6 +145,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t4 *** *** Drop t4 ***
@ -201,6 +203,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t5 *** *** Drop t5 ***
@ -257,6 +260,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
*** Drop t6 *** *** Drop t6 ***
DROP TABLE t6; DROP TABLE t6;
@ -364,6 +368,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t10 *** *** Drop t10 ***
@ -420,6 +425,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t11 *** *** Drop t11 ***
@ -605,6 +611,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Try to insert in master **** *** Try to insert in master ****
@ -735,6 +742,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
** DROP table t17 *** ** DROP table t17 ***

View File

@ -51,3 +51,4 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No

View File

@ -14,6 +14,113 @@ SELECT * FROM t4;
a a
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t4; DROP TABLE t4;
**** Test case for BUG#25482 ****
**** Adding GRANTS on master ****
create table test.t1(a int);
create table test.t4(a int);
GRANT SELECT ON test.t1 TO mysqltest1@localhost;
GRANT INSERT ON test.t4 TO mysqltest2@localhost;
GRANT select, update, insert, references on t1
to mysqltest2@localhost;
GRANT SELECT ON test.* TO mysqltest3@localhost;
GRANT INSERT ON test.t4 TO mysqltest3@localhost;
GRANT select(a), update(a), insert(a), references(a) on t4
to mysqltest3@localhost;
create database mysqltest2;
create table mysqltest2.t2 (id int);
GRANT SELECT ON mysqltest2.t2 TO mysqltest4@localhost IDENTIFIED BY 'pass';
insert into mysql.user (user, host) values ("mysqltest5", "somehost");
Warnings:
Warning 1364 Field 'ssl_cipher' doesn't have a default value
Warning 1364 Field 'x509_issuer' doesn't have a default value
Warning 1364 Field 'x509_subject' doesn't have a default value
GRANT SELECT ON *.* TO mysqltest6@localhost;
GRANT INSERT ON *.* TO mysqltest6@localhost;
GRANT INSERT ON test.* TO mysqltest6@localhost;
GRANT INSERT ON test.t1 TO mysqltest6@localhost;
show grants for mysqltest1@localhost;
Grants for mysqltest1@localhost
GRANT USAGE ON *.* TO 'mysqltest1'@'localhost'
GRANT SELECT ON `test`.`t1` TO 'mysqltest1'@'localhost'
show grants for mysqltest2@localhost;
Grants for mysqltest2@localhost
GRANT USAGE ON *.* TO 'mysqltest2'@'localhost'
GRANT SELECT, INSERT, UPDATE, REFERENCES ON `test`.`t1` TO 'mysqltest2'@'localhost'
GRANT INSERT ON `test`.`t4` TO 'mysqltest2'@'localhost'
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
GRANT SELECT ON `mysqltest2`.`t2` TO 'mysqltest4'@'localhost'
show grants for mysqltest6@localhost;
Grants for mysqltest6@localhost
GRANT SELECT, INSERT ON *.* TO 'mysqltest6'@'localhost'
GRANT INSERT ON `test`.* TO 'mysqltest6'@'localhost'
GRANT INSERT ON `test`.`t1` TO 'mysqltest6'@'localhost'
flush privileges;
show grants for mysqltest5@somehost;
Grants for mysqltest5@somehost
GRANT USAGE ON *.* TO 'mysqltest5'@'somehost'
**** Checking grants on slave ****
show grants for mysqltest2@localhost;
Grants for mysqltest2@localhost
GRANT USAGE ON *.* TO 'mysqltest2'@'localhost'
GRANT INSERT ON `test`.`t4` TO 'mysqltest2'@'localhost'
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
GRANT SELECT ON `mysqltest2`.`t2` TO 'mysqltest4'@'localhost'
show grants for mysqltest5@somehost;
Grants for mysqltest5@somehost
GRANT USAGE ON *.* TO 'mysqltest5'@'somehost'
show grants for mysqltest6@localhost;
Grants for mysqltest6@localhost
GRANT SELECT, INSERT ON *.* TO 'mysqltest6'@'localhost'
GRANT INSERT ON `test`.* TO 'mysqltest6'@'localhost'
show grants for mysqltest1@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost'
**** Revoking grants on master ****
REVOKE SELECT ON test.t1 FROM mysqltest1@localhost;
REVOKE SELECT ON mysqltest2.t2 FROM mysqltest4@localhost;
REVOKE select(a) on t4
from mysqltest3@localhost;
show grants for mysqltest1@localhost;
Grants for mysqltest1@localhost
GRANT USAGE ON *.* TO 'mysqltest1'@'localhost'
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
**** Checking grants on slave ****
show grants for mysqltest1@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost'
show grants for mysqltest3@localhost;
Grants for mysqltest3@localhost
GRANT USAGE ON *.* TO 'mysqltest3'@'localhost'
GRANT SELECT ON `test`.* TO 'mysqltest3'@'localhost'
GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltest3'@'localhost'
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
drop table t1, t4, mysqltest2.t2;
drop database mysqltest2;
delete from mysql.user where user like "mysqltest%";
delete from mysql.db where user like "mysqltest%";
delete from mysql.tables_priv where user like "mysqltest%";
delete from mysql.columns_priv where user like "mysqltest%";
DROP TABLE IF EXISTS t5; DROP TABLE IF EXISTS t5;
CREATE TABLE t5 ( CREATE TABLE t5 (
word varchar(50) collate utf8_unicode_ci NOT NULL default '' word varchar(50) collate utf8_unicode_ci NOT NULL default ''

View File

@ -45,6 +45,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SELECT * FROM t1; SELECT * FROM t1;
a b a b
stop slave; stop slave;
@ -127,6 +128,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SELECT * FROM t1; SELECT * FROM t1;
id field_1 field_2 field_3 id field_1 field_2 field_3
drop table t1, t2; drop table t1, t2;

View File

@ -38,8 +38,8 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
set global sql_slave_skip_counter=1; set global sql_slave_skip_counter=1;
start slave; start slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1797 # # master-bin.000001 Yes Yes # 0 0 1797 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1797 # # master-bin.000001 Yes Yes # 0 0 1797 # None 0 No # No
set sql_log_bin=0; set sql_log_bin=0;
delete from t1; delete from t1;
set sql_log_bin=1; set sql_log_bin=1;
@ -48,8 +48,8 @@ stop slave;
change master to master_user='test'; change master to master_user='test';
change master to master_user='root'; change master to master_user='root';
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1832 # # master-bin.000001 No No # 0 0 1832 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1832 # # master-bin.000001 No No # 0 0 1832 # None 0 No # No
set global sql_slave_skip_counter=1; set global sql_slave_skip_counter=1;
start slave; start slave;
set sql_log_bin=0; set sql_log_bin=0;
@ -59,8 +59,8 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
stop slave; stop slave;
reset slave; reset slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # No
reset master; reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM; unique(day)) engine=MyISAM;

View File

@ -8,26 +8,26 @@ show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106 <Binlog_Ignore_DB> master-bin.000001 106 <Binlog_Ignore_DB>
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes 0 0 106 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes 0 0 106 # None 0 No # No
stop slave; stop slave;
change master to master_log_pos=75; change master to master_log_pos=75;
start slave; start slave;
stop slave; stop slave;
change master to master_log_pos=75; change master to master_log_pos=75;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 75 # # master-bin.000001 No No 0 0 75 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 75 # # master-bin.000001 No No 0 0 75 # None 0 No # No
start slave; start slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 75 # # master-bin.000001 No Yes 0 0 75 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 75 # # master-bin.000001 No Yes 0 0 75 # None 0 No # No
stop slave; stop slave;
change master to master_log_pos=178; change master to master_log_pos=178;
start slave; start slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 178 # # master-bin.000001 No Yes 0 0 178 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 178 # # master-bin.000001 No Yes 0 0 178 # None 0 No # No
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106 <Binlog_Ignore_DB> master-bin.000001 106 <Binlog_Ignore_DB>

View File

@ -147,6 +147,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master <Seconds_Behind_Master> Seconds_Behind_Master <Seconds_Behind_Master>
Master_SSL_Verify_Server_Cert No
set GLOBAL slave_transaction_retries=10; set GLOBAL slave_transaction_retries=10;
START SLAVE; START SLAVE;
select * from t1 order by nid; select * from t1 order by nid;

View File

@ -87,6 +87,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t3 *** *** Drop t3 ***
@ -144,6 +145,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t4 *** *** Drop t4 ***
@ -201,6 +203,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t5 *** *** Drop t5 ***
@ -257,6 +260,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
*** Drop t6 *** *** Drop t6 ***
DROP TABLE t6; DROP TABLE t6;
@ -364,6 +368,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t10 *** *** Drop t10 ***
@ -420,6 +425,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Drop t11 *** *** Drop t11 ***
@ -605,6 +611,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
*** Try to insert in master **** *** Try to insert in master ****
@ -736,6 +743,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
** DROP table t17 *** ** DROP table t17 ***

View File

@ -33,15 +33,15 @@ c1 c2 c3
row3 C 3 row3 C 3
row4 D 4 row4 D 4
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> <Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> No
STOP SLAVE; STOP SLAVE;
CHANGE MASTER TO CHANGE MASTER TO
master_log_file = 'master-bin.000001', master_log_file = 'master-bin.000001',
master_log_pos = <the_pos> ; master_log_pos = <the_pos> ;
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 No No <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> <Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 No No <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> No
START SLAVE; START SLAVE;
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
c1 c2 c3 c1 c2 c3
@ -68,6 +68,6 @@ SELECT * FROM t1;
c1 c2 c3 c1 c2 c3
row2 new on slave 2 row2 new on slave 2
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> <Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> No
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;

View File

@ -127,8 +127,8 @@ slave-bin.000002 # Write_rows 2 # table_id: #
slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F
slave-bin.000002 # Query 2 # COMMIT slave-bin.000002 # Query 2 # COMMIT
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 617 # # master-bin.000002 Yes Yes # 0 0 617 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000002 617 # # master-bin.000002 Yes Yes # 0 0 617 # None 0 No # No
show binlog events in 'slave-bin.000005' from 4; show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1; DROP TABLE t1;

View File

@ -72,8 +72,8 @@ master_log_file = 'master-bin.000001',
master_log_pos = <the_pos> ; master_log_pos = <the_pos> ;
START SLAVE; START SLAVE;
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> <Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> No
SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
hex(c1) hex(c2) c3 hex(c1) hex(c2) c3
1 1 row1 1 1 row1

View File

@ -1,31 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int);
stop slave;
change master to master_user='replssl',master_password='';
start slave;
insert into t1 values (1);
select * from t1;
t
stop slave;
change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem';
start slave;
select * from t1;
t
1
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 replssl MASTER_MYPORT 1 # # # # # # Yes # 0 0 # # None 0 Yes MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem #
stop slave;
change master to master_user='root',master_password='', master_ssl=0;
start slave;
drop user replssl@localhost;
drop table t1;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_MYPORT 1 # # # # # # Yes # 0 0 # # None 0 No MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem #

View File

@ -55,6 +55,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SHOW BINLOG EVENTS; SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4

View File

@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
SHOW SLAVE HOSTS; SHOW SLAVE HOSTS;
Server_id Host Port Rpl_recovery_rank Master_id Server_id Host Port Rpl_recovery_rank Master_id
2 127.0.0.1 SLAVE_PORT 2 1 2 127.0.0.1 SLAVE_PORT 2 1

View File

@ -27,8 +27,8 @@ select * from t11;
ERROR 42S02: Table 'test.t11' doesn't exist ERROR 42S02: Table 'test.t11' doesn't exist
drop table if exists t1,t2,t11; drop table if exists t1,t2,t11;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 # # # master-bin.000001 Yes Yes test.t1 # 0 0 # # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 # # # master-bin.000001 Yes Yes test.t1 # 0 0 # # None 0 No # No
create table t1 (ts timestamp); create table t1 (ts timestamp);
set one_shot time_zone='met'; set one_shot time_zone='met';
insert into t1 values('2005-08-12 00:00:00'); insert into t1 values('2005-08-12 00:00:00');

View File

@ -15,8 +15,8 @@ insert into temp_table values ("testing temporary tables");
create table t1 (s text); create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard'); insert into t1 values('Could not break slave'),('Tried hard');
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 556 # # master-bin.000001 Yes Yes # 0 0 556 # None 0 No # # 127.0.0.1 root MASTER_PORT 60 master-bin.000001 556 # # master-bin.000001 Yes Yes # 0 0 556 # None 0 No # No
select * from t1; select * from t1;
s s
Could not break slave Could not break slave
@ -56,8 +56,8 @@ Log_name File_size
master-bin.000003 415 master-bin.000003 415
insert into t2 values (65); insert into t2 values (65);
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 504 # # master-bin.000003 Yes Yes # 0 0 504 # None 0 No # # 127.0.0.1 root MASTER_PORT 60 master-bin.000003 504 # # master-bin.000003 Yes Yes # 0 0 504 # None 0 No # No
select * from t2; select * from t2;
m m
34 34
@ -84,8 +84,8 @@ select * from t4;
a a
testing temporary tables part 2 testing temporary tables part 2
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2040 # # master-bin.000005 Yes Yes # 0 0 2040 # None 0 No # # 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2040 # # master-bin.000005 Yes Yes # 0 0 2040 # None 0 No # No
lock tables t3 read; lock tables t3 read;
select count(*) from t3 where n >= 4; select count(*) from t3 where n >= 4;
count(*) count(*)

View File

@ -51,4 +51,5 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
drop table t1, t2; drop table t1, t2;

View File

@ -92,8 +92,8 @@ slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
slave-bin.000002 # Table_map 1 # table_id: # (test.t2) slave-bin.000002 # Table_map 1 # table_id: # (test.t2)
slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 377 # # master-bin.000002 Yes Yes # 0 0 377 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000002 377 # # master-bin.000002 Yes Yes # 0 0 377 # None 0 No # No
show binlog events in 'slave-bin.000005' from 4; show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1; DROP TABLE t1;

View File

@ -100,8 +100,8 @@ slave-bin.000002 # Table_map 1 # table_id: # (test.t2)
slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000002 # Xid 1 # COMMIT /* XID */ slave-bin.000002 # Xid 1 # COMMIT /* XID */
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 404 # # master-bin.000002 Yes Yes # 0 0 404 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000002 404 # # master-bin.000002 Yes Yes # 0 0 404 # None 0 No # No
show binlog events in 'slave-bin.000005' from 4; show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1; DROP TABLE t1;

View File

@ -57,6 +57,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
# #
# Test 2 # Test 2
# #
@ -100,6 +101,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
# #
# Test 3: max_relay_log_size = 0 # Test 3: max_relay_log_size = 0
# #
@ -143,6 +145,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
# #
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
# #
@ -183,6 +186,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
# #
# Test 5 # Test 5
# #
@ -224,6 +228,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
# #
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
# #
@ -263,6 +268,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
flush logs; flush logs;
show master status; show master status;
File master-bin.000002 File master-bin.000002

View File

@ -5,21 +5,21 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # No
stop slave; stop slave;
change master to master_user='test'; change master to master_user='test';
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 No No # 0 0 106 # None 0 No # # 127.0.0.1 test MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 No No # 0 0 106 # None 0 No # No
reset slave; reset slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # No
start slave; start slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # No
stop slave; stop slave;
reset slave; reset slave;
start slave; start slave;

View File

@ -137,6 +137,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (2); INSERT INTO t9 VALUES (2);
@ -175,6 +176,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (4); INSERT INTO t9 VALUES (4);
@ -213,6 +215,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (5); INSERT INTO t9 VALUES (5);
@ -251,6 +254,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
@ -289,6 +293,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
@ -326,6 +331,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a; SELECT * FROM t7 ORDER BY a;

View File

@ -137,6 +137,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (2); INSERT INTO t9 VALUES (2);
@ -175,6 +176,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (4); INSERT INTO t9 VALUES (4);
@ -213,6 +215,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (5); INSERT INTO t9 VALUES (5);
@ -251,6 +254,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
@ -289,6 +293,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
@ -326,6 +331,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
INSERT INTO t7 VALUES (1),(2),(3); INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3); INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a; SELECT * FROM t7 ORDER BY a;

View File

@ -20,8 +20,8 @@ n
3 3
4 4
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 # No 0 0 315 # Master master-bin.000001 311 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 # No 0 0 315 # Master master-bin.000001 311 No # No
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
select * from t1; select * from t1;
n n
@ -30,22 +30,22 @@ n
3 3
4 4
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 # No 0 0 315 # Master master-no-such-bin.000001 291 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 # No 0 0 315 # Master master-no-such-bin.000001 291 No # No
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728; start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
select * from t2; select * from t2;
n n
1 1
2 2
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 # No 0 0 590 # Relay slave-relay-bin.000004 728 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 # No 0 0 590 # Relay slave-relay-bin.000004 728 No # No
start slave; start slave;
stop slave; stop slave;
start slave until master_log_file='master-bin.000001', master_log_pos=740; start slave until master_log_file='master-bin.000001', master_log_pos=740;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 744 # Master master-bin.000001 740 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 744 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 744 # Master master-bin.000001 740 No # No
start slave until master_log_file='master-bin', master_log_pos=561; start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;

View File

@ -9,8 +9,8 @@ reset master;
stop slave; stop slave;
change master to master_port=SLAVE_PORT; change master to master_port=SLAVE_PORT;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 106 None 0 No NULL 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 106 None 0 No NULL No
start slave; start slave;
insert into t1 values (1); insert into t1 values (1);
show status like "slave_running"; show status like "slave_running";

View File

@ -9,8 +9,8 @@ reset master;
stop slave; stop slave;
change master to master_port=SLAVE_PORT; change master to master_port=SLAVE_PORT;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 106 None 0 No NULL 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 106 None 0 No NULL No
start slave; start slave;
insert into t1 values (1); insert into t1 values (1);
select * from t1; select * from t1;

View File

@ -52,6 +52,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master NULL Seconds_Behind_Master NULL
Master_SSL_Verify_Server_Cert No
drop table t1; drop table t1;
delete from mysql.user where user='rpl'; delete from mysql.user where user='rpl';
drop table t1; drop table t1;

View File

@ -53,6 +53,7 @@ Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
STOP SLAVE; STOP SLAVE;
select * from t1; select * from t1;
t t
@ -91,3 +92,4 @@ Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No

View File

@ -0,0 +1,146 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int);
stop slave;
change master to master_user='replssl',master_password='';
start slave;
insert into t1 values (1);
select * from t1;
t
stop slave;
change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem';
start slave;
select * from t1;
t
1
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User replssl
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File #
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File #
Slave_IO_Running #
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed Yes
Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
Master_SSL_CA_Path
Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
Master_SSL_Cipher
Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
stop slave;
change master to master_user='root',master_password='', master_ssl=0;
start slave;
drop user replssl@localhost;
drop table t1;
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File #
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File #
Slave_IO_Running #
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
Master_SSL_CA_Path
Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
Master_SSL_Cipher
Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
stop slave;
change master to
master_host="localhost",
master_ssl=1 ,
master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem',
master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem',
master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem',
master_ssl_verify_server_cert=1;
start slave;
create table t1 (t int);
insert into t1 values (1);
on slave
select * from t1;
t
1
show slave status;
Slave_IO_State #
Master_Host localhost
Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File #
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File #
Slave_IO_Running #
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed Yes
Master_SSL_CA_File MYSQL_TEST_DIR/std_data/cacert.pem
Master_SSL_CA_Path
Master_SSL_Cert MYSQL_TEST_DIR/std_data/client-cert.pem
Master_SSL_Cipher
Master_SSL_Key MYSQL_TEST_DIR/std_data/client-key.pem
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert Yes
drop table t1;

View File

@ -90,8 +90,8 @@ slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
slave-bin.000002 # Query 1 # use `test`; insert into t2 values (1) slave-bin.000002 # Query 1 # use `test`; insert into t2 values (1)
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 392 # # master-bin.000002 Yes Yes # 0 0 392 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000002 392 # # master-bin.000002 Yes Yes # 0 0 392 # None 0 No # No
show binlog events in 'slave-bin.000005' from 4; show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1; DROP TABLE t1;

View File

@ -55,6 +55,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
# #
# Test 2 # Test 2
# #
@ -98,6 +99,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
# #
# Test 3: max_relay_log_size = 0 # Test 3: max_relay_log_size = 0
# #
@ -141,6 +143,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
# #
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
# #
@ -181,6 +184,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
# #
# Test 5 # Test 5
# #
@ -222,6 +226,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
# #
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
# #
@ -261,6 +266,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
flush logs; flush logs;
show master status; show master status;
File master-bin.000002 File master-bin.000002

View File

@ -5,21 +5,21 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # No
stop slave; stop slave;
change master to master_user='test'; change master to master_user='test';
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 No No # 0 0 106 # None 0 No # # 127.0.0.1 test MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 No No # 0 0 106 # None 0 No # No
reset slave; reset slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No # No
start slave; start slave;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 106 # # master-bin.000001 Yes Yes # 0 0 106 # None 0 No # No
stop slave; stop slave;
reset slave; reset slave;
start slave; start slave;

View File

@ -53,6 +53,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
select * from t1; select * from t1;
n n
@ -94,6 +95,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746; start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
select * from t2; select * from t2;
n n
@ -133,6 +135,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
start slave; start slave;
stop slave; stop slave;
start slave until master_log_file='master-bin.000001', master_log_pos=776; start slave until master_log_file='master-bin.000001', master_log_pos=776;
@ -170,6 +173,7 @@ Master_SSL_Cert
Master_SSL_Cipher Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
start slave until master_log_file='master-bin', master_log_pos=561; start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;

View File

@ -187,7 +187,7 @@ Pos Instruction
32 set v_dig@4 (v_dig@4 + 1) 32 set v_dig@4 (v_dig@4 + 1)
33 stmt 4 "update sudoku_work set dig = v_dig wh..." 33 stmt 4 "update sudoku_work set dig = v_dig wh..."
34 set v_tcounter@6 (v_tcounter@6 + 1) 34 set v_tcounter@6 (v_tcounter@6 + 1)
35 jump_if_not 37(37) (not(`test`.`sudoku_digit_ok`(v_row@7,v_col@8,v_dig@4))) 35 jump_if_not 37(37) (not(`sudoku_digit_ok`(v_row@7,v_col@8,v_dig@4)))
36 jump 15 36 jump 15
37 set v_i@3 (v_i@3 + 1) 37 set v_i@3 (v_i@3 + 1)
38 jump 15 38 jump 15

View File

@ -7,7 +7,6 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (col1 date); CREATE TABLE t1 (col1 date);
INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29'); INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
INSERT INTO t1 VALUES('0000-10-31'); INSERT INTO t1 VALUES('0000-10-31');
ERROR 22007: Incorrect date value: '0000-10-31' for column 'col1' at row 1
INSERT INTO t1 VALUES('2004-0-31'); INSERT INTO t1 VALUES('2004-0-31');
ERROR 22007: Incorrect date value: '2004-0-31' for column 'col1' at row 1 ERROR 22007: Incorrect date value: '2004-0-31' for column 'col1' at row 1
INSERT INTO t1 VALUES('2004-01-02'),('2004-0-31'); INSERT INTO t1 VALUES('2004-01-02'),('2004-0-31');
@ -57,6 +56,7 @@ select * from t1;
col1 col1
2004-01-01 2004-01-01
2004-02-29 2004-02-29
0000-10-31
2004-01-02 2004-01-02
2004-01-03 2004-01-03
2004-00-31 2004-00-31
@ -124,7 +124,6 @@ set @@sql_mode='ansi,traditional';
CREATE TABLE t1 (col1 datetime); CREATE TABLE t1 (col1 datetime);
INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00'); INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00');
INSERT INTO t1 VALUES('0000-10-31 15:30:00'); INSERT INTO t1 VALUES('0000-10-31 15:30:00');
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col1' at row 1
INSERT INTO t1 VALUES('2004-0-31 15:30:00'); INSERT INTO t1 VALUES('2004-0-31 15:30:00');
ERROR 22007: Incorrect datetime value: '2004-0-31 15:30:00' for column 'col1' at row 1 ERROR 22007: Incorrect datetime value: '2004-0-31 15:30:00' for column 'col1' at row 1
INSERT INTO t1 VALUES('2004-10-0 15:30:00'); INSERT INTO t1 VALUES('2004-10-0 15:30:00');
@ -145,6 +144,7 @@ select * from t1;
col1 col1
2004-10-31 15:30:00 2004-10-31 15:30:00
2004-02-29 15:30:00 2004-02-29 15:30:00
0000-10-31 15:30:00
drop table t1; drop table t1;
CREATE TABLE t1 (col1 timestamp); CREATE TABLE t1 (col1 timestamp);
INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00'); INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00');
@ -206,7 +206,6 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y'));
INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect date value: '0000-10-31 15:30:00' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect date value: '2004-00-31 15:30:00' for column 'col1' at row 1 ERROR 22007: Incorrect date value: '2004-00-31 15:30:00' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
@ -222,7 +221,6 @@ ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_ti
INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1 ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col2' at row 1
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
ERROR 22007: Incorrect datetime value: '2004-00-31 15:30:00' for column 'col2' at row 1 ERROR 22007: Incorrect datetime value: '2004-00-31 15:30:00' for column 'col2' at row 1
INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
@ -259,7 +257,6 @@ INSERT INTO t1 (col1) VALUES (CAST('2004-10-15' AS DATE));
INSERT INTO t1 (col2) VALUES (CAST('2004-10-15 10:15' AS DATETIME)); INSERT INTO t1 (col2) VALUES (CAST('2004-10-15 10:15' AS DATETIME));
INSERT INTO t1 (col3) VALUES (CAST('2004-10-15 10:15' AS DATETIME)); INSERT INTO t1 (col3) VALUES (CAST('2004-10-15 10:15' AS DATETIME));
INSERT INTO t1 (col1) VALUES(CAST('0000-10-31' AS DATE)); INSERT INTO t1 (col1) VALUES(CAST('0000-10-31' AS DATE));
ERROR 22007: Incorrect datetime value: '0000-10-31'
INSERT INTO t1 (col1) VALUES(CAST('2004-10-0' AS DATE)); INSERT INTO t1 (col1) VALUES(CAST('2004-10-0' AS DATE));
ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1 ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(CAST('2004-0-10' AS DATE)); INSERT INTO t1 (col1) VALUES(CAST('2004-0-10' AS DATE));
@ -267,7 +264,6 @@ ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(CAST('0000-00-00' AS DATE)); INSERT INTO t1 (col1) VALUES(CAST('0000-00-00' AS DATE));
ERROR 22007: Incorrect datetime value: '0000-00-00' ERROR 22007: Incorrect datetime value: '0000-00-00'
INSERT INTO t1 (col2) VALUES(CAST('0000-10-31 15:30' AS DATETIME)); INSERT INTO t1 (col2) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30'
INSERT INTO t1 (col2) VALUES(CAST('2004-10-0 15:30' AS DATETIME)); INSERT INTO t1 (col2) VALUES(CAST('2004-10-0 15:30' AS DATETIME));
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1 ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1
INSERT INTO t1 (col2) VALUES(CAST('2004-0-10 15:30' AS DATETIME)); INSERT INTO t1 (col2) VALUES(CAST('2004-0-10 15:30' AS DATETIME));
@ -275,7 +271,7 @@ ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' a
INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME)); INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME));
ERROR 22007: Incorrect datetime value: '0000-00-00' ERROR 22007: Incorrect datetime value: '0000-00-00'
INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME)); INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30' ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
INSERT INTO t1 (col3) VALUES(CAST('2004-10-0 15:30' AS DATETIME)); INSERT INTO t1 (col3) VALUES(CAST('2004-10-0 15:30' AS DATETIME));
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1 ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1
INSERT INTO t1 (col3) VALUES(CAST('2004-0-10 15:30' AS DATETIME)); INSERT INTO t1 (col3) VALUES(CAST('2004-0-10 15:30' AS DATETIME));
@ -288,7 +284,6 @@ INSERT INTO t1 (col1) VALUES (CONVERT('2004-10-15',DATE));
INSERT INTO t1 (col2) VALUES (CONVERT('2004-10-15 10:15',DATETIME)); INSERT INTO t1 (col2) VALUES (CONVERT('2004-10-15 10:15',DATETIME));
INSERT INTO t1 (col3) VALUES (CONVERT('2004-10-15 10:15',DATETIME)); INSERT INTO t1 (col3) VALUES (CONVERT('2004-10-15 10:15',DATETIME));
INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE)); INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE));
ERROR 22007: Incorrect datetime value: '0000-10-31'
INSERT INTO t1 (col1) VALUES(CONVERT('2004-10-0' , DATE)); INSERT INTO t1 (col1) VALUES(CONVERT('2004-10-0' , DATE));
ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1 ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(CONVERT('2004-0-10' , DATE)); INSERT INTO t1 (col1) VALUES(CONVERT('2004-0-10' , DATE));
@ -296,7 +291,6 @@ ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(CONVERT('0000-00-00',DATE)); INSERT INTO t1 (col1) VALUES(CONVERT('0000-00-00',DATE));
ERROR 22007: Incorrect datetime value: '0000-00-00' ERROR 22007: Incorrect datetime value: '0000-00-00'
INSERT INTO t1 (col2) VALUES(CONVERT('0000-10-31 15:30',DATETIME)); INSERT INTO t1 (col2) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30'
INSERT INTO t1 (col2) VALUES(CONVERT('2004-10-0 15:30',DATETIME)); INSERT INTO t1 (col2) VALUES(CONVERT('2004-10-0 15:30',DATETIME));
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1 ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1
INSERT INTO t1 (col2) VALUES(CONVERT('2004-0-10 15:30',DATETIME)); INSERT INTO t1 (col2) VALUES(CONVERT('2004-0-10 15:30',DATETIME));
@ -304,7 +298,7 @@ ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' a
INSERT INTO t1 (col2) VALUES(CONVERT('0000-00-00',DATETIME)); INSERT INTO t1 (col2) VALUES(CONVERT('0000-00-00',DATETIME));
ERROR 22007: Incorrect datetime value: '0000-00-00' ERROR 22007: Incorrect datetime value: '0000-00-00'
INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME)); INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
ERROR 22007: Incorrect datetime value: '0000-10-31 15:30' ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
INSERT INTO t1 (col3) VALUES(CONVERT('2004-10-0 15:30',DATETIME)); INSERT INTO t1 (col3) VALUES(CONVERT('2004-10-0 15:30',DATETIME));
ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1 ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1
INSERT INTO t1 (col3) VALUES(CONVERT('2004-0-10 15:30',DATETIME)); INSERT INTO t1 (col3) VALUES(CONVERT('2004-0-10 15:30',DATETIME));
@ -1352,3 +1346,44 @@ t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL `i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*'
drop table t1; drop table t1;
set sql_mode= 'traditional';
create table t1(col1 tinyint, col2 tinyint unsigned,
col3 smallint, col4 smallint unsigned,
col5 mediumint, col6 mediumint unsigned,
col7 int, col8 int unsigned,
col9 bigint, col10 bigint unsigned);
insert into t1(col1) values('-');
ERROR HY000: Incorrect integer value: '-' for column 'col1' at row 1
insert into t1(col2) values('+');
ERROR HY000: Incorrect integer value: '+' for column 'col2' at row 1
insert into t1(col3) values('-');
ERROR HY000: Incorrect integer value: '-' for column 'col3' at row 1
insert into t1(col4) values('+');
ERROR HY000: Incorrect integer value: '+' for column 'col4' at row 1
insert into t1(col5) values('-');
ERROR HY000: Incorrect integer value: '-' for column 'col5' at row 1
insert into t1(col6) values('+');
ERROR HY000: Incorrect integer value: '+' for column 'col6' at row 1
insert into t1(col7) values('-');
ERROR HY000: Incorrect integer value: '-' for column 'col7' at row 1
insert into t1(col8) values('+');
ERROR HY000: Incorrect integer value: '+' for column 'col8' at row 1
insert into t1(col9) values('-');
ERROR HY000: Incorrect integer value: '-' for column 'col9' at row 1
insert into t1(col10) values('+');
ERROR HY000: Incorrect integer value: '+' for column 'col10' at row 1
drop table t1;
set sql_mode='traditional';
create table t1(a year);
insert into t1 values ('-');
ERROR HY000: Incorrect integer value: '-' for column 'a' at row 1
insert into t1 values ('+');
ERROR HY000: Incorrect integer value: '+' for column 'a' at row 1
insert into t1 values ('');
ERROR HY000: Incorrect integer value: '' for column 'a' at row 1
insert into t1 values ('2000a');
ERROR 01000: Data truncated for column 'a' at row 1
insert into t1 values ('2E3x');
ERROR 01000: Data truncated for column 'a' at row 1
drop table t1;
End of 5.0 tests

View File

@ -99,7 +99,7 @@ DROP TABLE t1, t2, t3;
CREATE TABLE t1 (y YEAR); CREATE TABLE t1 (y YEAR);
INSERT INTO t1 VALUES ('abc'); INSERT INTO t1 VALUES ('abc');
Warnings: Warnings:
Warning 1264 Out of range value for column 'y' at row 1 Warning 1366 Incorrect integer value: 'abc' for column 'y' at row 1
SELECT * FROM t1; SELECT * FROM t1;
y y
0000 0000

View File

@ -26,8 +26,6 @@ Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
delete from t1; delete from t1;
insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000"); insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000");
Warnings:
Warning 1264 Out of range value for column 't' at row 5
insert into t1 values ("2003-003-03"); insert into t1 values ("2003-003-03");
insert into t1 values ("20030102T131415"),("2001-01-01T01:01:01"), ("2001-1-1T1:01:01"); insert into t1 values ("20030102T131415"),("2001-01-01T01:01:01"), ("2001-1-1T1:01:01");
select * from t1; select * from t1;
@ -36,7 +34,7 @@ t
2069-12-31 00:00:00 2069-12-31 00:00:00
1970-01-01 00:00:00 1970-01-01 00:00:00
1999-12-31 00:00:00 1999-12-31 00:00:00
0000-00-00 00:00:00 0000-01-01 00:00:00
0001-01-01 00:00:00 0001-01-01 00:00:00
9999-12-31 00:00:00 9999-12-31 00:00:00
2000-10-10 00:00:00 2000-10-10 00:00:00

View File

@ -34,3 +34,15 @@ select if(y = now(), 1, 0) from t1;
if(y = now(), 1, 0) if(y = now(), 1, 0)
1 1
drop table t1; drop table t1;
create table t1(a year);
insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3');
Warnings:
Warning 1265 Data truncated for column 'a' at row 3
select * from t1;
a
2001
2001
2001
2001
drop table t1;
End of 5.0 tests

Some files were not shown because too many files have changed in this diff Show More