1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-08 17:02:21 +03:00

Merge mysql.com:/home/mydev/mysql-5.1--main

into  mysql.com:/home/mydev/mysql-5.1-amerge
This commit is contained in:
unknown
2006-06-09 13:51:41 +02:00
210 changed files with 5633 additions and 2657 deletions

View File

@ -1,3 +1,4 @@
*-t
*.a
*.bb
*.bbg
@ -458,6 +459,7 @@ libmysqld/emb_qcache.cpp
libmysqld/errmsg.c
libmysqld/event.cc
libmysqld/event_executor.cc
libmysqld/event_scheduler.cc
libmysqld/event_timed.cc
libmysqld/examples/client_test.c
libmysqld/examples/client_test.cc
@ -788,6 +790,8 @@ mysys/main.cc
mysys/my_new.cpp
mysys/raid.cpp
mysys/ste5KbMa
mysys/test_atomic
mysys/test_bitmap
mysys/test_charset
mysys/test_dir
mysys/test_gethwaddr
@ -1770,6 +1774,3 @@ vio/viotest-sslconnect.cpp
vio/viotest.cpp
zlib/*.ds?
zlib/*.vcproj
libmysqld/event_scheduler.cc
mysys/test_atomic
*-t

13
BUILD/compile-pentium64 Executable file
View File

@ -0,0 +1,13 @@
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh" $@ --with-debug=full
extra_flags="$pentium64_cflags $fast_cflags"
c_warnings="$c_warnings"
cxx_warnings="$cxx_warnings"
extra_configs="$pentium_configs $static_link"
extra_configs="$extra_configs "
CC="$CC --pipe"
. "$path/FINISH.sh"

View File

@ -7,5 +7,5 @@ extra_flags="$pentium64_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $static_link"
extra_configs="$extra_configs "
CC="$CC --pipe"
. "$path/FINISH.sh"

View File

@ -7,5 +7,5 @@ extra_flags="$pentium64_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $max_configs"
extra_configs="$extra_configs "
CC="$CC --pipe"
. "$path/FINISH.sh"

View File

@ -0,0 +1,85 @@
#! /usr/bin/perl
use strict;
use warnings;
my $event= $ENV{BK_EVENT};
unless($event eq 'outgoing pull' || $event eq 'outgoing push' ||
$event eq 'resolve') {
exit 0;
}
print "Checking for bad changesets from old crashed 5.1 tree...\n";
my @bad_csets=
( 'monty@mysql.com|ChangeSet|20060418090255|16983',
'monty@mysql.com|ChangeSet|20060418090458|02628',
'monty@mysql.com|ChangeSet|20060419084236|49576',
'monty@mysql.com|ChangeSet|20060503164655|51444',
'monty@mysql.com|ChangeSet|20060503225814|60133',
'monty@mysql.com|ChangeSet|20060504033006|54878',
'monty@mysql.com|ChangeSet|20060504130520|48660',
'monty@mysql.com|ChangeSet|20060504164102|03511',
'monty@mysql.com|ChangeSet|20060504193112|04109',
'monty@mysql.com|ChangeSet|20060505015314|02799',
'monty@mysql.com|ChangeSet|20060505084007|16704',
'monty@mysql.com|ChangeSet|20060505104008|16695',
'monty@mysql.com|ChangeSet|20060505171041|13924',
'monty@mysql.com|ChangeSet|20060508121933|13866',
'monty@mysql.com|ChangeSet|20060508160902|15029',
'monty@mysql.com|ChangeSet|20060509145448|38636',
'monty@mysql.com|ChangeSet|20060509224111|40037',
'monty@mysql.com|ChangeSet|20060510090758|40678',
'monty@mysql.com|ChangeSet|20060515164104|46760',
'monty@mysql.com|ChangeSet|20060530114549|35852',
'monty@mysql.com|ChangeSet|20060605032828|23579',
'monty@mysql.com|ChangeSet|20060605033011|10641',
'monty@mysql.com|ChangeSet|20060605060652|09843',
'msvensson@neptunus.(none)|ChangeSet|20060605094744|10838',
'msvensson@neptunus.(none)|ChangeSet|20060605105746|11800',
'msvensson@neptunus.(none)|ChangeSet|20060605122345|12772',
'jmiller@mysql.com|ChangeSet|20060531210831|36442',
'jmiller@mysql.com|ChangeSet|20060602151941|36118',
'jmiller@mysql.com|ChangeSet|20060602152136|27762',
'jmiller@mysql.com|ChangeSet|20060605121748|12864',
'jmiller@mysql.com|ChangeSet|20060605160304|14798',
'jimw@mysql.com|ChangeSet|20060605210201|14667',
'igor@rurik.mysql.com|ChangeSet|20060605220727|15265',
'igor@rurik.mysql.com|ChangeSet|20060605221206|15134',
'stewart@mysql.com|ChangeSet|20060525073521|11169',
'stewart@mysql.com|ChangeSet|20060605154220|12975',
'stewart@mysql.com|ChangeSet|20060606040001|15337',
);
# Read the list of changesets.
my $csetlist = $ENV{BK_CSETLIST};
if(!defined($csetlist) || !open(FH, '<', $csetlist)) {
die "Failed to open list of incoming changesets '$csetlist': $!.\n";
}
my @csets = <FH>;
close FH;
# Reject any attempt to push/pull a bad changeset.
for my $cs (@csets) {
# Do this the raw way, don't want to be bitten by different EOL conventions
# on server and client (Unix/Windows/Mac).
$cs =~ s/\x0d?\x0a?$//s;
if(grep($_ eq $cs, @bad_csets)) {
print <<END;
BAD CHANGESET DETECTED! $event REJECTED!
The changeset with key '$cs' was detected in the attempted push or pull.
This changeset is from the corrupt part of the crashed mysql-5.1-new tree.
Pushing or pulling this changeset would result in corruption of the new tree,
and therefore the operation has been rejected.
Contact Kristian Nielsen (knielsen\@mysql.com, IRC knielsen) if you have any
questions regarding this.
END
exit 1;
}
}
print "No bad changesets found, proceeding.\n";
exit 0;

View File

@ -0,0 +1,85 @@
#! /usr/bin/perl
use strict;
use warnings;
my $event= $ENV{BK_EVENT};
unless($event eq 'outgoing pull' || $event eq 'outgoing push' ||
$event eq 'resolve') {
exit 0;
}
print "Checking for bad changesets from old crashed 5.1 tree...\n";
my @bad_csets=
( 'monty@mysql.com|ChangeSet|20060418090255|16983',
'monty@mysql.com|ChangeSet|20060418090458|02628',
'monty@mysql.com|ChangeSet|20060419084236|49576',
'monty@mysql.com|ChangeSet|20060503164655|51444',
'monty@mysql.com|ChangeSet|20060503225814|60133',
'monty@mysql.com|ChangeSet|20060504033006|54878',
'monty@mysql.com|ChangeSet|20060504130520|48660',
'monty@mysql.com|ChangeSet|20060504164102|03511',
'monty@mysql.com|ChangeSet|20060504193112|04109',
'monty@mysql.com|ChangeSet|20060505015314|02799',
'monty@mysql.com|ChangeSet|20060505084007|16704',
'monty@mysql.com|ChangeSet|20060505104008|16695',
'monty@mysql.com|ChangeSet|20060505171041|13924',
'monty@mysql.com|ChangeSet|20060508121933|13866',
'monty@mysql.com|ChangeSet|20060508160902|15029',
'monty@mysql.com|ChangeSet|20060509145448|38636',
'monty@mysql.com|ChangeSet|20060509224111|40037',
'monty@mysql.com|ChangeSet|20060510090758|40678',
'monty@mysql.com|ChangeSet|20060515164104|46760',
'monty@mysql.com|ChangeSet|20060530114549|35852',
'monty@mysql.com|ChangeSet|20060605032828|23579',
'monty@mysql.com|ChangeSet|20060605033011|10641',
'monty@mysql.com|ChangeSet|20060605060652|09843',
'msvensson@neptunus.(none)|ChangeSet|20060605094744|10838',
'msvensson@neptunus.(none)|ChangeSet|20060605105746|11800',
'msvensson@neptunus.(none)|ChangeSet|20060605122345|12772',
'jmiller@mysql.com|ChangeSet|20060531210831|36442',
'jmiller@mysql.com|ChangeSet|20060602151941|36118',
'jmiller@mysql.com|ChangeSet|20060602152136|27762',
'jmiller@mysql.com|ChangeSet|20060605121748|12864',
'jmiller@mysql.com|ChangeSet|20060605160304|14798',
'jimw@mysql.com|ChangeSet|20060605210201|14667',
'igor@rurik.mysql.com|ChangeSet|20060605220727|15265',
'igor@rurik.mysql.com|ChangeSet|20060605221206|15134',
'stewart@mysql.com|ChangeSet|20060525073521|11169',
'stewart@mysql.com|ChangeSet|20060605154220|12975',
'stewart@mysql.com|ChangeSet|20060606040001|15337',
);
# Read the list of changesets.
my $csetlist = $ENV{BK_CSETLIST};
if(!defined($csetlist) || !open(FH, '<', $csetlist)) {
die "Failed to open list of incoming changesets '$csetlist': $!.\n";
}
my @csets = <FH>;
close FH;
# Reject any attempt to push/pull a bad changeset.
for my $cs (@csets) {
# Do this the raw way, don't want to be bitten by different EOL conventions
# on server and client (Unix/Windows/Mac).
$cs =~ s/\x0d?\x0a?$//s;
if(grep($_ eq $cs, @bad_csets)) {
print <<END;
BAD CHANGESET DETECTED! $event REJECTED!
The changeset with key '$cs' was detected in the attempted push or pull.
This changeset is from the corrupt part of the crashed mysql-5.1-new tree.
Pushing or pulling this changeset would result in corruption of the new tree,
and therefore the operation has been rejected.
Contact Kristian Nielsen (knielsen\@mysql.com, IRC knielsen) if you have any
questions regarding this.
END
exit 1;
}
}
print "No bad changesets found, proceeding.\n";
exit 0;

View File

@ -32,7 +32,7 @@ endif
INCLUDES = -I$(top_builddir)/include \
-I$(top_srcdir)/include \
-I$(top_srcdir)/regex \
$(openssl_includes) $(yassl_includes)
$(openssl_includes)
LIBS = @CLIENT_LIBS@
LDADD= @CLIENT_EXTRA_LDFLAGS@ $(CLIENT_THREAD_LIBS) \
$(top_builddir)/libmysql/libmysqlclient.la

View File

@ -2757,6 +2757,9 @@ int do_connect(struct st_query *q)
#ifdef HAVE_OPENSSL
if (opt_use_ssl || con_ssl)
{
/* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= !strcmp(con_host, "localhost");
mysql_ssl_set(&next_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
mysql_options(&next_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,

View File

@ -1,4 +1,4 @@
ADD_DEFINITIONS("-DWIN32 -D_LIB")
ADD_DEFINITIONS("-DWIN32 -D_LIB -DYASSL_PREFIX")
INCLUDE_DIRECTORIES(include taocrypt/include mySTL)
ADD_LIBRARY(yassl src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp

View File

@ -3,6 +3,10 @@
#ifndef ysSSL_crypto_h__
#define yaSSL_crypto_h__
#ifdef YASSL_PREFIX
#include "prefix_crypto.h"
#endif
const char* SSLeay_version(int type);
#define SSLEAY_VERSION 0x0900L

View File

@ -0,0 +1,45 @@
#!/usr/bin/perl
#
# This script generates defines for all functions
# in yassl/include/openssl/ so they are renamed to
# ya<old_function_name>. Hopefully that is unique enough.
#
# The script is to be run manually when we import
# a new version of yaSSL
#
# Find all functions in "input" and add macros
# to prefix/rename them into "output
sub generate_prefix($$)
{
my $input= shift;
my $output= shift;
open(IN, $input)
or die("Can't open input file $input: $!");
open(OUT, ">", $output)
or mtr_error("Can't open output file $output: $!");
while (<IN>)
{
chomp;
if ( /typedef/ )
{
next;
}
if ( /^\s*[a-zA-Z0-9*_ ]+\s+([_a-zA-Z0-9]+)\s*\(/ )
{
print OUT "#define $1 ya$1\n";
}
}
close OUT;
close IN;
}
generate_prefix("ssl.h", "prefix_ssl.h");
generate_prefix("crypto.h", "prefix_crypto.h");

View File

@ -0,0 +1 @@
#define SSLeay_version yaSSLeay_version

View File

@ -0,0 +1,152 @@
#define Copyright yaCopyright
#define yaSSL_CleanUp yayaSSL_CleanUp
#define DH_new yaDH_new
#define DH_free yaDH_free
#define RSA_free yaRSA_free
#define RSA_generate_key yaRSA_generate_key
#define X509_free yaX509_free
#define X509_STORE_CTX_get_current_cert yaX509_STORE_CTX_get_current_cert
#define X509_STORE_CTX_get_error yaX509_STORE_CTX_get_error
#define X509_STORE_CTX_get_error_depth yaX509_STORE_CTX_get_error_depth
#define X509_NAME_oneline yaX509_NAME_oneline
#define X509_get_issuer_name yaX509_get_issuer_name
#define X509_get_subject_name yaX509_get_subject_name
#define X509_verify_cert_error_string yaX509_verify_cert_error_string
#define X509_LOOKUP_add_dir yaX509_LOOKUP_add_dir
#define X509_LOOKUP_load_file yaX509_LOOKUP_load_file
#define X509_LOOKUP_hash_dir yaX509_LOOKUP_hash_dir
#define X509_LOOKUP_file yaX509_LOOKUP_file
#define X509_STORE_add_lookup yaX509_STORE_add_lookup
#define X509_STORE_new yaX509_STORE_new
#define X509_STORE_get_by_subject yaX509_STORE_get_by_subject
#define ERR_get_error_line_data yaERR_get_error_line_data
#define ERR_print_errors_fp yaERR_print_errors_fp
#define ERR_error_string yaERR_error_string
#define ERR_remove_state yaERR_remove_state
#define ERR_get_error yaERR_get_error
#define ERR_peek_error yaERR_peek_error
#define ERR_GET_REASON yaERR_GET_REASON
#define SSL_CTX_new yaSSL_CTX_new
#define SSL_new yaSSL_new
#define SSL_set_fd yaSSL_set_fd
#define SSL_connect yaSSL_connect
#define SSL_write yaSSL_write
#define SSL_read yaSSL_read
#define SSL_accept yaSSL_accept
#define SSL_CTX_free yaSSL_CTX_free
#define SSL_free yaSSL_free
#define SSL_clear yaSSL_clear
#define SSL_shutdown yaSSL_shutdown
#define SSL_set_connect_state yaSSL_set_connect_state
#define SSL_set_accept_state yaSSL_set_accept_state
#define SSL_do_handshake yaSSL_do_handshake
#define SSL_get_cipher yaSSL_get_cipher
#define SSL_get_cipher_name yaSSL_get_cipher_name
#define SSL_get_shared_ciphers yaSSL_get_shared_ciphers
#define SSL_get_cipher_list yaSSL_get_cipher_list
#define SSL_get_version yaSSL_get_version
#define SSLeay_version yaSSLeay_version
#define SSL_get_error yaSSL_get_error
#define SSL_load_error_strings yaSSL_load_error_strings
#define SSL_set_session yaSSL_set_session
#define SSL_get_session yaSSL_get_session
#define SSL_SESSION_set_timeout yaSSL_SESSION_set_timeout
#define SSL_get_peer_certificate yaSSL_get_peer_certificate
#define SSL_get_verify_result yaSSL_get_verify_result
#define SSL_CTX_set_verify yaSSL_CTX_set_verify
#define SSL_CTX_load_verify_locations yaSSL_CTX_load_verify_locations
#define SSL_CTX_set_default_verify_paths yaSSL_CTX_set_default_verify_paths
#define SSL_CTX_check_private_key yaSSL_CTX_check_private_key
#define SSL_CTX_set_session_id_context yaSSL_CTX_set_session_id_context
#define SSL_CTX_set_tmp_rsa_callback yaSSL_CTX_set_tmp_rsa_callback
#define SSL_CTX_set_options yaSSL_CTX_set_options
#define SSL_CTX_set_session_cache_mode yaSSL_CTX_set_session_cache_mode
#define SSL_CTX_set_timeout yaSSL_CTX_set_timeout
#define SSL_CTX_use_certificate_chain_file yaSSL_CTX_use_certificate_chain_file
#define SSL_CTX_set_default_passwd_cb yaSSL_CTX_set_default_passwd_cb
#define SSL_CTX_use_RSAPrivateKey_file yaSSL_CTX_use_RSAPrivateKey_file
#define SSL_CTX_set_info_callback yaSSL_CTX_set_info_callback
#define SSL_CTX_sess_accept yaSSL_CTX_sess_accept
#define SSL_CTX_sess_connect yaSSL_CTX_sess_connect
#define SSL_CTX_sess_accept_good yaSSL_CTX_sess_accept_good
#define SSL_CTX_sess_connect_good yaSSL_CTX_sess_connect_good
#define SSL_CTX_sess_accept_renegotiate yaSSL_CTX_sess_accept_renegotiate
#define SSL_CTX_sess_connect_renegotiate yaSSL_CTX_sess_connect_renegotiate
#define SSL_CTX_sess_hits yaSSL_CTX_sess_hits
#define SSL_CTX_sess_cb_hits yaSSL_CTX_sess_cb_hits
#define SSL_CTX_sess_cache_full yaSSL_CTX_sess_cache_full
#define SSL_CTX_sess_misses yaSSL_CTX_sess_misses
#define SSL_CTX_sess_timeouts yaSSL_CTX_sess_timeouts
#define SSL_CTX_sess_number yaSSL_CTX_sess_number
#define SSL_CTX_sess_get_cache_size yaSSL_CTX_sess_get_cache_size
#define SSL_CTX_get_verify_mode yaSSL_CTX_get_verify_mode
#define SSL_get_verify_mode yaSSL_get_verify_mode
#define SSL_CTX_get_verify_depth yaSSL_CTX_get_verify_depth
#define SSL_get_verify_depth yaSSL_get_verify_depth
#define SSL_get_default_timeout yaSSL_get_default_timeout
#define SSL_CTX_get_session_cache_mode yaSSL_CTX_get_session_cache_mode
#define SSL_session_reused yaSSL_session_reused
#define SSL_set_rfd yaSSL_set_rfd
#define SSL_set_wfd yaSSL_set_wfd
#define SSL_set_shutdown yaSSL_set_shutdown
#define SSL_want_read yaSSL_want_read
#define SSL_want_write yaSSL_want_write
#define SSL_pending yaSSL_pending
#define SSL_CTX_use_certificate_file yaSSL_CTX_use_certificate_file
#define SSL_CTX_use_PrivateKey_file yaSSL_CTX_use_PrivateKey_file
#define SSL_CTX_set_cipher_list yaSSL_CTX_set_cipher_list
#define SSL_CTX_sess_set_cache_size yaSSL_CTX_sess_set_cache_size
#define SSL_CTX_set_tmp_dh yaSSL_CTX_set_tmp_dh
#define OpenSSL_add_all_algorithms yaOpenSSL_add_all_algorithms
#define SSL_library_init yaSSL_library_init
#define SSLeay_add_ssl_algorithms yaSSLeay_add_ssl_algorithms
#define SSL_get_current_cipher yaSSL_get_current_cipher
#define SSL_CIPHER_description yaSSL_CIPHER_description
#define SSL_alert_type_string_long yaSSL_alert_type_string_long
#define SSL_alert_desc_string_long yaSSL_alert_desc_string_long
#define SSL_state_string_long yaSSL_state_string_long
#define EVP_md5 yaEVP_md5
#define EVP_des_ede3_cbc yaEVP_des_ede3_cbc
#define EVP_BytesToKey yaEVP_BytesToKey
#define DES_set_key_unchecked yaDES_set_key_unchecked
#define DES_ede3_cbc_encrypt yaDES_ede3_cbc_encrypt
#define RAND_screen yaRAND_screen
#define RAND_file_name yaRAND_file_name
#define RAND_write_file yaRAND_write_file
#define RAND_load_file yaRAND_load_file
#define RAND_status yaRAND_status
#define DES_set_key yaDES_set_key
#define DES_set_odd_parity yaDES_set_odd_parity
#define DES_ecb_encrypt yaDES_ecb_encrypt
#define SSL_CTX_set_default_passwd_cb_userdata yaSSL_CTX_set_default_passwd_cb_userdata
#define SSL_SESSION_free yaSSL_SESSION_free
#define SSL_get_certificate yaSSL_get_certificate
#define SSL_get_privatekey yaSSL_get_privatekey
#define X509_get_pubkey yaX509_get_pubkey
#define EVP_PKEY_copy_parameters yaEVP_PKEY_copy_parameters
#define EVP_PKEY_free yaEVP_PKEY_free
#define ERR_error_string_n yaERR_error_string_n
#define ERR_free_strings yaERR_free_strings
#define EVP_cleanup yaEVP_cleanup
#define X509_get_ext_d2i yaX509_get_ext_d2i
#define GENERAL_NAMES_free yaGENERAL_NAMES_free
#define sk_GENERAL_NAME_num yask_GENERAL_NAME_num
#define sk_GENERAL_NAME_value yask_GENERAL_NAME_value
#define ASN1_STRING_data yaASN1_STRING_data
#define ASN1_STRING_length yaASN1_STRING_length
#define ASN1_STRING_type yaASN1_STRING_type
#define X509_NAME_get_index_by_NID yaX509_NAME_get_index_by_NID
#define X509_NAME_ENTRY_get_data yaX509_NAME_ENTRY_get_data
#define X509_NAME_get_entry yaX509_NAME_get_entry
#define ASN1_STRING_to_UTF8 yaASN1_STRING_to_UTF8
#define SSLv23_client_method yaSSLv23_client_method
#define SSLv2_client_method yaSSLv2_client_method
#define SSL_get1_session yaSSL_get1_session
#define X509_get_notBefore yaX509_get_notBefore
#define X509_get_notAfter yaX509_get_notAfter
#define MD4_Init yaMD4_Init
#define MD4_Update yaMD4_Update
#define MD4_Final yaMD4_Final
#define MD5_Init yaMD5_Init
#define MD5_Update yaMD5_Update
#define MD5_Final yaMD5_Final

View File

@ -28,6 +28,10 @@
#ifndef yaSSL_openssl_h__
#define yaSSL_openssl_h__
#ifdef YASSL_PREFIX
#include "prefix_ssl.h"
#endif
#include <stdio.h> /* ERR_print fp */
#include "opensslv.h" /* for version number */
#include "rsa.h"
@ -373,11 +377,9 @@ char* SSL_state_string_long(SSL*);
/* EVP stuff, des and md5, different file? */
typedef struct Digest Digest;
typedef Digest EVP_MD;
typedef char EVP_MD;
typedef struct BulkCipher BulkCipher;
typedef BulkCipher EVP_CIPHER;
typedef char EVP_CIPHER;
typedef struct EVP_PKEY EVP_PKEY;

View File

@ -127,25 +127,6 @@ private:
};
// hold add crypt references provided to callers
class CryptProvider {
mySTL::list<Digest*> digestList_;
mySTL::list<BulkCipher*> cipherList_;
CryptProvider() {} // only GetCryptProvider creates
public:
~CryptProvider();
Digest* NewMd5();
BulkCipher* NewDesEde();
friend CryptProvider& GetCryptProvider();
private:
CryptProvider(const CryptProvider&); // hide copy
CryptProvider& operator=(const CryptProvider&); // and assign
};
CryptProvider& GetCryptProvider();
#undef X509_NAME // wincrypt.h clash
// openSSL X509 names

View File

@ -5,4 +5,4 @@ libyassl_la_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \
handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \
template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp
EXTRA_DIST = $(wildcard ../include/*.hpp) $(wildcard ../include/openssl/*.h)
AM_CXXFLAGS = -DYASSL_PURE_C
AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX

View File

@ -811,25 +811,34 @@ const char* X509_verify_cert_error_string(long /* error */)
const EVP_MD* EVP_md5(void)
{
return GetCryptProvider().NewMd5();
static const char* type = "MD5";
return type;
}
const EVP_CIPHER* EVP_des_ede3_cbc(void)
{
return GetCryptProvider().NewDesEde();
static const char* type = "DES_EDE3_CBC";
return type;
}
int EVP_BytesToKey(const EVP_CIPHER* type, const EVP_MD* md, const byte* salt,
const byte* data, int sz, int count, byte* key, byte* iv)
{
EVP_MD* myMD = const_cast<EVP_MD*>(md);
uint digestSz = myMD->get_digestSize();
// only support MD5 for now
if (strncmp(md, "MD5", 3)) return 0;
// only support DES_EDE3_CBC for now
if (strncmp(type, "DES_EDE3_CBC", 12)) return 0;
yaSSL::MD5 myMD;
uint digestSz = myMD.get_digestSize();
byte digest[SHA_LEN]; // max size
int keyLen = type->get_keySize();
int ivLen = type->get_ivSize();
yaSSL::DES_EDE cipher;
int keyLen = cipher.get_keySize();
int ivLen = cipher.get_ivSize();
int keyLeft = keyLen;
int ivLeft = ivLen;
int keyOutput = 0;
@ -838,17 +847,17 @@ int EVP_BytesToKey(const EVP_CIPHER* type, const EVP_MD* md, const byte* salt,
int digestLeft = digestSz;
// D_(i - 1)
if (keyOutput) // first time D_0 is empty
myMD->update(digest, digestSz);
myMD.update(digest, digestSz);
// data
myMD->update(data, sz);
myMD.update(data, sz);
// salt
if (salt)
myMD->update(salt, EVP_SALT_SZ);
myMD->get_digest(digest);
myMD.update(salt, EVP_SALT_SZ);
myMD.get_digest(digest);
// count
for (int j = 1; j < count; j++) {
myMD->update(digest, digestSz);
myMD->get_digest(digest);
myMD.update(digest, digestSz);
myMD.get_digest(digest);
}
if (keyLeft) {

View File

@ -86,7 +86,6 @@ template void ysDelete<X509>(X509*);
template void ysDelete<Message>(Message*);
template void ysDelete<sslFactory>(sslFactory*);
template void ysDelete<Sessions>(Sessions*);
template void ysDelete<CryptProvider>(CryptProvider*);
template void ysArrayDelete<unsigned char>(unsigned char*);
template void ysArrayDelete<char>(char*);
}

View File

@ -1382,38 +1382,6 @@ sslFactory& GetSSL_Factory()
}
static CryptProvider* cryptProviderInstance = 0;
CryptProvider& GetCryptProvider()
{
if (!cryptProviderInstance)
cryptProviderInstance = NEW_YS CryptProvider;
return *cryptProviderInstance;
}
CryptProvider::~CryptProvider()
{
mySTL::for_each(digestList_.begin(), digestList_.end(), del_ptr_zero());
mySTL::for_each(cipherList_.begin(), cipherList_.end(), del_ptr_zero());
}
Digest* CryptProvider::NewMd5()
{
Digest* ptr = NEW_YS MD5();
digestList_.push_back(ptr);
return ptr;
}
BulkCipher* CryptProvider::NewDesEde()
{
BulkCipher* ptr = NEW_YS DES_EDE();
cipherList_.push_back(ptr);
return ptr;
}
typedef Mutex::Lock Lock;
@ -2106,12 +2074,10 @@ ASN1_STRING* StringHolder::GetString()
extern "C" void yaSSL_CleanUp()
{
TaoCrypt::CleanUp();
yaSSL::ysDelete(yaSSL::cryptProviderInstance);
yaSSL::ysDelete(yaSSL::sslFactoryInstance);
yaSSL::ysDelete(yaSSL::sessionsInstance);
// In case user calls more than once, prevent seg fault
yaSSL::cryptProviderInstance = 0;
yaSSL::sslFactoryInstance = 0;
yaSSL::sessionsInstance = 0;
}

View File

@ -5,7 +5,7 @@ testsuite_SOURCES = testsuite.cpp ../taocrypt/test/test.cpp \
../examples/echoclient/echoclient.cpp \
../examples/echoserver/echoserver.cpp
testsuite_LDFLAGS = -L../src/ -L../taocrypt/src
testsuite_CXXFLAGS = -DYASSL_PURE_C -DNO_MAIN_DRIVER
testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER
testsuite_LDADD = -lyassl -ltaocrypt
testsuite_DEPENDENCIES = ../src/libyassl.la ../taocrypt/src/libtaocrypt.la
EXTRA_DIST = testsuite.dsp test.hpp input quit make.bat

View File

@ -22,7 +22,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="include,taocrypt\include,mySTL"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;YASSL_PREFIX"
ExceptionHandling="FALSE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -76,7 +76,7 @@
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="include,taocrypt\include,mySTL"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;YASSL_PREFIX"
StringPooling="TRUE"
ExceptionHandling="FALSE"
RuntimeLibrary="0"

View File

@ -21,8 +21,6 @@
extern "C" {
#endif
#include <my_global.h>
/*
Calculate how much memory needed for dst of base64_encode()
*/

View File

@ -209,6 +209,7 @@ extern int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
extern int heap_delete_table(const char *name);
extern void heap_drop_table(HP_INFO *info);
extern int heap_extra(HP_INFO *info,enum ha_extra_function function);
extern int heap_reset(HP_INFO *info);
extern int heap_rename(const char *old_name,const char *new_name);
extern int heap_panic(enum ha_panic_function flag);
extern int heap_rsame(HP_INFO *info,byte *record,int inx);

View File

@ -102,7 +102,7 @@ enum ha_key_alg {
enum ha_extra_function {
HA_EXTRA_NORMAL=0, /* Optimize for space (def) */
HA_EXTRA_QUICK=1, /* Optimize for speed */
HA_EXTRA_RESET=2, /* Reset database to after open */
HA_EXTRA_NOT_USED=2,
HA_EXTRA_CACHE=3, /* Cache record in HA_rrnd() */
HA_EXTRA_NO_CACHE=4, /* End caching of records (def) */
HA_EXTRA_NO_READCHECK=5, /* No readcheck on update */
@ -128,15 +128,6 @@ enum ha_extra_function {
HA_EXTRA_RESET_STATE, /* Reset positions */
HA_EXTRA_IGNORE_DUP_KEY, /* Dup keys don't rollback everything*/
HA_EXTRA_NO_IGNORE_DUP_KEY,
/*
Instructs InnoDB to retrieve all columns (except in key read), not just
those where field->query_id is the same as the current query id
*/
HA_EXTRA_RETRIEVE_ALL_COLS,
/*
Instructs InnoDB to retrieve at least all the primary key columns
*/
HA_EXTRA_RETRIEVE_PRIMARY_KEY,
HA_EXTRA_PREPARE_FOR_DELETE,
HA_EXTRA_PREPARE_FOR_UPDATE, /* Remove read cache if problems */
HA_EXTRA_PRELOAD_BUFFER_SIZE, /* Set buffer size for preloading */

View File

@ -17,19 +17,18 @@
#ifndef _my_bitmap_h_
#define _my_bitmap_h_
#ifdef THREAD
#include <my_pthread.h>
#endif
#define MY_BIT_NONE (~(uint) 0)
#include <m_string.h>
typedef uint32 my_bitmap_map;
typedef struct st_bitmap
{
uint32 *bitmap;
my_bitmap_map *bitmap;
uint n_bits; /* number of bits occupied by the above */
uint32 last_word_mask;
uint32 *last_word_ptr;
my_bitmap_map last_word_mask;
my_bitmap_map *last_word_ptr;
/*
mutex will be acquired for the duration of each bitmap operation if
thread_safe flag in bitmap_init was set. Otherwise, we optimize by not
@ -43,12 +42,16 @@ typedef struct st_bitmap
#ifdef __cplusplus
extern "C" {
#endif
extern my_bool bitmap_init(MY_BITMAP *map, uint32 *buf, uint n_bits, my_bool thread_safe);
extern my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
my_bool thread_safe);
extern my_bool bitmap_is_clear_all(const MY_BITMAP *map);
extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size);
extern my_bool bitmap_is_set_all(const MY_BITMAP *map);
extern my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2);
extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1,
const MY_BITMAP *map2);
extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit);
extern uint bitmap_set_next(MY_BITMAP *map);
extern uint bitmap_get_first(const MY_BITMAP *map);
@ -62,6 +65,7 @@ extern void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_invert(MY_BITMAP *map);
extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2);
extern uint bitmap_lock_set_next(MY_BITMAP *map);
extern void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit);
@ -88,7 +92,7 @@ extern void bitmap_lock_xor(MY_BITMAP *map, const MY_BITMAP *map2);
extern void bitmap_lock_invert(MY_BITMAP *map);
#endif
/* Fast, not thread safe, bitmap functions */
#define bitmap_buffer_size(bits) 4*(((bits)+31)/32);
#define bitmap_buffer_size(bits) (((bits)+31)/32)*4
#define no_bytes_in_map(map) (((map)->n_bits + 7)/8)
#define no_words_in_map(map) (((map)->n_bits + 31)/32)
#define bytes_word_aligned(bytes) (4*((bytes + 3)/4))
@ -98,28 +102,28 @@ extern void bitmap_lock_invert(MY_BITMAP *map);
^= (1 << ((BIT) & 7)))
#define _bitmap_clear_bit(MAP, BIT) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \
&= ~ (1 << ((BIT) & 7)))
#define _bitmap_is_set(MAP, BIT) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \
#define _bitmap_is_set(MAP, BIT) (uint) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \
& (1 << ((BIT) & 7)))
#ifndef DBUG_OFF
static inline uint32
static inline void
bitmap_set_bit(MY_BITMAP *map,uint bit)
{
DBUG_ASSERT(bit < (map)->n_bits);
return _bitmap_set_bit(map,bit);
_bitmap_set_bit(map,bit);
}
static inline uint32
static inline void
bitmap_flip_bit(MY_BITMAP *map,uint bit)
{
DBUG_ASSERT(bit < (map)->n_bits);
return _bitmap_flip_bit(map,bit);
_bitmap_flip_bit(map,bit);
}
static inline uint32
static inline void
bitmap_clear_bit(MY_BITMAP *map,uint bit)
{
DBUG_ASSERT(bit < (map)->n_bits);
return _bitmap_clear_bit(map,bit);
_bitmap_clear_bit(map,bit);
}
static inline uint32
static inline uint
bitmap_is_set(const MY_BITMAP *map,uint bit)
{
DBUG_ASSERT(bit < (map)->n_bits);
@ -131,11 +135,16 @@ bitmap_is_set(const MY_BITMAP *map,uint bit)
#define bitmap_clear_bit(MAP, BIT) _bitmap_clear_bit(MAP, BIT)
#define bitmap_is_set(MAP, BIT) _bitmap_is_set(MAP, BIT)
#endif
#define bitmap_cmp(MAP1, MAP2) \
(memcmp((MAP1)->bitmap, (MAP2)->bitmap, 4*no_words_in_map((MAP1)))==0)
static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
{
*(map1)->last_word_ptr|= (map1)->last_word_mask;
*(map2)->last_word_ptr|= (map2)->last_word_mask;
return memcmp((map1)->bitmap, (map2)->bitmap, 4*no_words_in_map((map1)))==0;
}
#define bitmap_clear_all(MAP) \
{ memset((MAP)->bitmap, 0, 4*no_words_in_map((MAP))); \
*(MAP)->last_word_ptr|= (MAP)->last_word_mask; }
{ memset((MAP)->bitmap, 0, 4*no_words_in_map((MAP))); }
#define bitmap_set_all(MAP) \
(memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP))))

View File

@ -303,6 +303,7 @@ extern int mi_rename(const char *from, const char *to);
extern int mi_extra(struct st_myisam_info *file,
enum ha_extra_function function,
void *extra_arg);
extern int mi_reset(struct st_myisam_info *file);
extern ha_rows mi_records_in_range(struct st_myisam_info *info,int inx,
key_range *min_key, key_range *max_key);
extern int mi_log(int activate_log);

View File

@ -99,6 +99,7 @@ extern int myrg_create(const char *name, const char **table_names,
uint insert_method, my_bool fix_names);
extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function,
void *extra_arg);
extern int myrg_reset(MYRG_INFO *info);
extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv);
extern ha_rows myrg_records_in_range(MYRG_INFO *info,int inx,
key_range *min_key, key_range *max_key);

View File

@ -98,6 +98,7 @@ enum enum_server_command
#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */
#define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree */
#define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */
#define FIELD_IN_ADD_INDEX (1<< 20) /* Intern: Field used in ADD INDEX */
#define REFRESH_GRANT 1 /* Refresh grant tables */
#define REFRESH_LOG 2 /* Start on new log file */

View File

@ -102,6 +102,7 @@ void vio_timeout(Vio *vio,uint which, uint timeout);
#define HEADER_DES_LOCL_H dummy_something
#define YASSL_MYSQL_COMPATIBLE
#define YASSL_PREFIX
#include <openssl/ssl.h>
#include <openssl/err.h>

View File

@ -24,7 +24,7 @@ target = libmysqlclient.la
target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@
LIBS = @CLIENT_LIBS@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
$(openssl_includes) $(yassl_includes) @ZLIB_INCLUDES@
$(openssl_includes) @ZLIB_INCLUDES@
include $(srcdir)/Makefile.shared

View File

@ -25,7 +25,7 @@ target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
$(openssl_includes) $(yassl_includes) @ZLIB_INCLUDES@
$(openssl_includes) @ZLIB_INCLUDES@
## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include
include $(top_srcdir)/libmysql/Makefile.shared

View File

@ -32,7 +32,7 @@ INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples \
-I$(top_srcdir)/regex \
$(openssl_includes) $(yassl_includes) @ZLIB_INCLUDES@
$(openssl_includes) @ZLIB_INCLUDES@
noinst_LIBRARIES = libmysqld_int.a
pkglib_LIBRARIES = libmysqld.a

View File

@ -34,7 +34,7 @@ link_sources:
DEFS = -DEMBEDDED_LIBRARY
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) \
-I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \
$(openssl_includes) $(yassl_includes)
$(openssl_includes)
LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs)
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS)

View File

@ -234,8 +234,8 @@ select (@after-@before) >= 2;
drop table t1,t2;
commit;
# test for BUG#7947 - DO RELEASE_LOCK() not written to binlog on rollback in the middle
# of a transaction
# test for BUG#7947 - DO RELEASE_LOCK() not written to binlog on rollback in
# the middle of a transaction
connection con2;
begin;
@ -265,6 +265,68 @@ drop table t0,t2;
# End of 4.1 tests
#
# Test behaviour of CREATE ... SELECT when mixing MyISAM and InnoDB tables
#
set autocommit=0;
CREATE TABLE t1 (a int, b int) engine=myisam;
reset master;
INSERT INTO t1 values (1,1),(1,2);
--error 1062
CREATE TABLE t2 (primary key (a)) engine=innodb select * from t1;
# This should give warning
DROP TABLE if exists t2;
INSERT INTO t1 values (3,3);
--error 1062
CREATE TEMPORARY TABLE t2 (primary key (a)) engine=innodb select * from t1;
ROLLBACK;
# This should give warning
DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb;
INSERT INTO t1 VALUES (4,4);
--error 1062
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
SELECT * from t2;
TRUNCATE table t2;
INSERT INTO t1 VALUES (5,5);
--error 1062
INSERT INTO t2 select * from t1;
SELECT * FROM t2;
DROP TABLE t2;
INSERT INTO t1 values (6,6);
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb ;
INSERT INTO t1 values (7,7);
ROLLBACK;
INSERT INTO t1 values (8,8);
--error 1062
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
COMMIT;
INSERT INTO t1 values (9,9);
--error 1062
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ROLLBACK;
SELECT * from t2;
TRUNCATE table t2;
INSERT INTO t1 values (10,10);
--error 1062
INSERT INTO t2 select * from t1;
SELECT * from t1;
INSERT INTO t2 values (100,100);
--error 1062
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
COMMIT;
INSERT INTO t2 values (101,101);
--error 1062
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ROLLBACK;
SELECT * from t2;
DROP TABLE t1,t2;
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
# Test for BUG#16559 (ROLLBACK should always have a zero error code in
# binlog). Has to be here and not earlier, as the SELECTs influence
# XIDs differently between normal and ps-protocol (and SHOW BINLOG
@ -283,3 +345,4 @@ disconnect con3;
connection con4;
select get_lock("a",10); # wait for rollback to finish

View File

@ -1296,9 +1296,9 @@ explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
# The next should give an error
#
-- error 1072
-- error 1176
explain select fld3 from t2 ignore index (fld3,not_used);
-- error 1072
-- error 1176
explain select fld3 from t2 use index (not_used);
#

View File

@ -34,7 +34,6 @@ if [ x$1 = x"-slave" ]
then
shift 1
data=var/slave-data
ldata=$fix_bin/var/slave-data
else
if [ x$1 = x"-1" ]
then
@ -42,8 +41,8 @@ else
else
data=var/master-data
fi
ldata=$fix_bin/$data
fi
ldata=$fix_bin/$data
mdata=$data/mysql
EXTRA_ARG=""
@ -81,9 +80,7 @@ basedir=.
EXTRA_ARG="--language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/"
fi
mysqld_boot=" $execdir/mysqld --no-defaults --bootstrap --skip-grant-tables \
--basedir=$basedir --datadir=$ldata --skip-innodb --skip-ndbcluster --skip-bdb \
$EXTRA_ARG"
mysqld_boot=" $execdir/mysqld --no-defaults --bootstrap --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb --skip-ndbcluster --skip-bdb --tmpdir=. $EXTRA_ARG"
echo "running $mysqld_boot"
if $scriptdir/mysql_create_system_tables test $mdata $hostname | $mysqld_boot

View File

@ -1943,6 +1943,7 @@ sub install_db ($$) {
mtr_add_arg($args, "--skip-innodb");
mtr_add_arg($args, "--skip-ndbcluster");
mtr_add_arg($args, "--skip-bdb");
mtr_add_arg($args, "--tmpdir=.");
if ( ! $opt_netware )
{

View File

@ -1121,7 +1121,10 @@ mysql_install_db () {
if [ ! -z "$USE_NDBCLUSTER" ]
then
$ECHO "Installing Master Databases 1"
$INSTALL_DB -1
# $INSTALL_DB -1
$RM -rf var/master-data1
mkdir var/master-data1
cp -r var/master-data/* var/master-data1
if [ $? != 0 ]; then
error "Could not install master test DBs 1"
exit 1
@ -1129,7 +1132,9 @@ mysql_install_db () {
fi
$ECHO "Installing Slave Databases"
$RM -rf $SLAVE_MYDDIR $MY_LOG_DIR/*
$INSTALL_DB -slave
# $INSTALL_DB -slave
mkdir var/slave-data
cp -r var/master-data/* var/slave-data
if [ $? != 0 ]; then
error "Could not install slave test DBs"
exit 1
@ -2155,6 +2160,7 @@ then
# Remove files that can cause problems
$RM -rf $MYSQL_TEST_DIR/var/ndbcluster
$RM -rf $MYSQL_TEST_DIR/var/tmp/snapshot*
$RM -f $MYSQL_TEST_DIR/var/run/* $MYSQL_TEST_DIR/var/tmp/*
# Remove old berkeley db log files that can confuse the server

View File

@ -46,6 +46,7 @@ Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_
execute stmt1;
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
deallocate prepare stmt1;
drop table t1;
create temporary table t1(a int, index(a));
insert into t1 values('1'),('2'),('3'),('4'),('5');
analyze table t1;

View File

@ -234,8 +234,6 @@ commit;
begin;
create temporary table ti (a int) engine=innodb;
rollback;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
insert into ti values(1);
set autocommit=0;
create temporary table t1 (a int) engine=myisam;
@ -285,6 +283,162 @@ master-bin.000001 1260 Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 1294 Query 1 # use `test`; create table t2 (n int) engine=innodb
do release_lock("lock1");
drop table t0,t2;
set autocommit=0;
CREATE TABLE t1 (a int, b int) engine=myisam;
reset master;
INSERT INTO t1 values (1,1),(1,2);
CREATE TABLE t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
DROP TABLE if exists t2;
Warnings:
Note 1051 Unknown table 't2'
INSERT INTO t1 values (3,3);
CREATE TEMPORARY TABLE t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
DROP TABLE IF EXISTS t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb;
INSERT INTO t1 VALUES (4,4);
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
TRUNCATE table t2;
INSERT INTO t1 VALUES (5,5);
INSERT INTO t2 select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * FROM t2;
a b
DROP TABLE t2;
INSERT INTO t1 values (6,6);
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb ;
INSERT INTO t1 values (7,7);
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
INSERT INTO t1 values (8,8);
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
COMMIT;
INSERT INTO t1 values (9,9);
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT * from t2;
a b
TRUNCATE table t2;
INSERT INTO t1 values (10,10);
INSERT INTO t2 select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t1;
a b
1 1
1 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
INSERT INTO t2 values (100,100);
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
COMMIT;
INSERT INTO t2 values (101,101);
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
ROLLBACK;
SELECT * from t2;
a b
100 100
DROP TABLE t1,t2;
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 102 Table_map 1 142 table_id: # (test.t1)
master-bin.000001 142 Write_rows 1 189 table_id: # flags: STMT_END_F
master-bin.000001 189 Query 1 257 use `test`; BEGIN
master-bin.000001 257 Query 1 182 use `test`; CREATE TABLE `t2` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB
master-bin.000001 439 Table_map 1 222 table_id: # (test.t2)
master-bin.000001 479 Write_rows 1 260 table_id: # flags: STMT_END_F
master-bin.000001 517 Xid 1 544 COMMIT /* xid= */
master-bin.000001 544 Query 1 630 use `test`; DROP TABLE if exists t2
master-bin.000001 630 Table_map 1 670 table_id: # (test.t1)
master-bin.000001 670 Write_rows 1 708 table_id: # flags: STMT_END_F
master-bin.000001 708 Query 1 776 use `test`; BEGIN
master-bin.000001 776 Query 1 192 use `test`; CREATE TEMPORARY TABLE `t2` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB
master-bin.000001 968 Query 1 1039 use `test`; ROLLBACK
master-bin.000001 1039 Query 1 1125 use `test`; DROP TABLE IF EXISTS t2
master-bin.000001 1125 Query 1 1249 use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
master-bin.000001 1249 Table_map 1 1289 table_id: # (test.t1)
master-bin.000001 1289 Write_rows 1 1327 table_id: # flags: STMT_END_F
master-bin.000001 1327 Query 1 1395 use `test`; BEGIN
master-bin.000001 1395 Query 1 182 use `test`; CREATE TABLE `t2` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB
master-bin.000001 1577 Table_map 1 222 table_id: # (test.t2)
master-bin.000001 1617 Write_rows 1 260 table_id: # flags: STMT_END_F
master-bin.000001 1655 Xid 1 1682 COMMIT /* xid= */
master-bin.000001 1682 Query 1 80 use `test`; TRUNCATE table t2
master-bin.000001 1762 Xid 1 1789 COMMIT /* xid= */
master-bin.000001 1789 Table_map 1 1829 table_id: # (test.t1)
master-bin.000001 1829 Write_rows 1 1867 table_id: # flags: STMT_END_F
master-bin.000001 1867 Query 1 1935 use `test`; BEGIN
master-bin.000001 1935 Table_map 1 40 table_id: # (test.t2)
master-bin.000001 1975 Write_rows 1 78 table_id: # flags: STMT_END_F
master-bin.000001 2013 Xid 1 2040 COMMIT /* xid= */
master-bin.000001 2040 Query 1 2116 use `test`; DROP TABLE t2
master-bin.000001 2116 Table_map 1 2156 table_id: # (test.t1)
master-bin.000001 2156 Write_rows 1 2194 table_id: # flags: STMT_END_F
master-bin.000001 2194 Table_map 1 2234 table_id: # (test.t1)
master-bin.000001 2234 Write_rows 1 2272 table_id: # flags: STMT_END_F
master-bin.000001 2272 Table_map 1 2312 table_id: # (test.t1)
master-bin.000001 2312 Write_rows 1 2350 table_id: # flags: STMT_END_F
master-bin.000001 2350 Query 1 2418 use `test`; BEGIN
master-bin.000001 2418 Query 1 192 use `test`; CREATE TEMPORARY TABLE `t2` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB
master-bin.000001 2610 Xid 1 2637 COMMIT /* xid= */
master-bin.000001 2637 Table_map 1 2677 table_id: # (test.t1)
master-bin.000001 2677 Write_rows 1 2715 table_id: # flags: STMT_END_F
master-bin.000001 2715 Query 1 2783 use `test`; BEGIN
master-bin.000001 2783 Query 1 192 use `test`; CREATE TEMPORARY TABLE `t2` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB
master-bin.000001 2975 Query 1 3046 use `test`; ROLLBACK
master-bin.000001 3046 Query 1 80 use `test`; TRUNCATE table t2
master-bin.000001 3126 Xid 1 3153 COMMIT /* xid= */
master-bin.000001 3153 Table_map 1 3193 table_id: # (test.t1)
master-bin.000001 3193 Write_rows 1 3231 table_id: # flags: STMT_END_F
master-bin.000001 3231 Query 1 3299 use `test`; BEGIN
master-bin.000001 3299 Query 1 192 use `test`; CREATE TEMPORARY TABLE `t2` (
`a` int(11) NOT NULL DEFAULT '0',
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB
master-bin.000001 3491 Xid 1 3518 COMMIT /* xid= */
master-bin.000001 3518 Query 1 3622 use `test`; DROP TABLE `t1` /* generated by server */
reset master;
create table t1 (a int) engine=innodb;
create table t2 (a int) engine=myisam;

View File

@ -209,8 +209,6 @@ commit;
begin;
create temporary table ti (a int) engine=innodb;
rollback;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
insert into ti values(1);
set autocommit=0;
create temporary table t1 (a int) engine=myisam;
@ -256,6 +254,107 @@ master-bin.000001 1654 Query 1 # use `test`; create table t2 (n int) engine=inno
master-bin.000001 1754 Query 1 # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti`
do release_lock("lock1");
drop table t0,t2;
set autocommit=0;
CREATE TABLE t1 (a int, b int) engine=myisam;
reset master;
INSERT INTO t1 values (1,1),(1,2);
CREATE TABLE t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
DROP TABLE if exists t2;
Warnings:
Note 1051 Unknown table 't2'
INSERT INTO t1 values (3,3);
CREATE TEMPORARY TABLE t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
DROP TABLE IF EXISTS t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb;
INSERT INTO t1 VALUES (4,4);
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
TRUNCATE table t2;
INSERT INTO t1 VALUES (5,5);
INSERT INTO t2 select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * FROM t2;
a b
DROP TABLE t2;
INSERT INTO t1 values (6,6);
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb ;
INSERT INTO t1 values (7,7);
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
INSERT INTO t1 values (8,8);
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
COMMIT;
INSERT INTO t1 values (9,9);
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT * from t2;
a b
TRUNCATE table t2;
INSERT INTO t1 values (10,10);
INSERT INTO t2 select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t1;
a b
1 1
1 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
INSERT INTO t2 values (100,100);
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
COMMIT;
INSERT INTO t2 values (101,101);
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
ROLLBACK;
SELECT * from t2;
a b
100 100
DROP TABLE t1,t2;
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 102 Query 1 198 use `test`; INSERT INTO t1 values (1,1),(1,2)
master-bin.000001 198 Query 1 284 use `test`; DROP TABLE if exists t2
master-bin.000001 284 Query 1 374 use `test`; INSERT INTO t1 values (3,3)
master-bin.000001 374 Query 1 460 use `test`; DROP TABLE IF EXISTS t2
master-bin.000001 460 Query 1 584 use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
master-bin.000001 584 Query 1 674 use `test`; INSERT INTO t1 VALUES (4,4)
master-bin.000001 674 Query 1 80 use `test`; TRUNCATE table t2
master-bin.000001 754 Xid 1 781 COMMIT /* xid= */
master-bin.000001 781 Query 1 871 use `test`; INSERT INTO t1 VALUES (5,5)
master-bin.000001 871 Query 1 947 use `test`; DROP TABLE t2
master-bin.000001 947 Query 1 1037 use `test`; INSERT INTO t1 values (6,6)
master-bin.000001 1037 Query 1 1171 use `test`; CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb
master-bin.000001 1171 Query 1 1261 use `test`; INSERT INTO t1 values (7,7)
master-bin.000001 1261 Query 1 1351 use `test`; INSERT INTO t1 values (8,8)
master-bin.000001 1351 Query 1 1441 use `test`; INSERT INTO t1 values (9,9)
master-bin.000001 1441 Query 1 80 use `test`; TRUNCATE table t2
master-bin.000001 1521 Xid 1 1548 COMMIT /* xid= */
master-bin.000001 1548 Query 1 1640 use `test`; INSERT INTO t1 values (10,10)
master-bin.000001 1640 Query 1 1708 use `test`; BEGIN
master-bin.000001 1708 Query 1 94 use `test`; INSERT INTO t2 values (100,100)
master-bin.000001 1802 Xid 1 1829 COMMIT /* xid= */
master-bin.000001 1829 Query 1 1908 use `test`; DROP TABLE t1,t2
reset master;
create table t1 (a int) engine=innodb;
create table t2 (a int) engine=myisam;

View File

@ -145,9 +145,9 @@ explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
explain select fld3 from t2 ignore index (fld3,not_used);
ERROR 42000: Key column 'not_used' doesn't exist in table
ERROR 42000: Key 'not_used' doesn't exist in table 't2'
explain select fld3 from t2 use index (not_used);
ERROR 42000: Key column 'not_used' doesn't exist in table
ERROR 42000: Key 'not_used' doesn't exist in table 't2'
select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
fld3
honeysuckle

View File

@ -266,6 +266,7 @@ select * from t1;
0 1 2
0 0 1
drop table t1;
flush status;
create table t1 (a int not null, b int, primary key (a));
insert into t1 values (1,1);
create table if not exists t1 select 2;
@ -281,6 +282,13 @@ Warnings:
Note 1050 Table 't1' already exists
create table if not exists t1 select 3 as 'a',3 as 'b';
ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
show warnings;
Level Code Message
Note 1050 Table 't1' already exists
Error 1062 Duplicate entry '3' for key 'PRIMARY'
show status like "Opened_tables";
Variable_name Value
Opened_tables 2
select * from t1;
a b
1 1
@ -778,3 +786,41 @@ Warnings:
Warning 1071 Specified key was too long; max key length is 765 bytes
insert into t1 values('aaa');
drop table t1;
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
CREATE TABLE t2 (primary key (a)) select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
drop table if exists t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
drop table if exists t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TABLE t2 (a int, b int, primary key (a));
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
1 1
TRUNCATE table t2;
INSERT INTO t2 select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
1 1
drop table t2;
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
1 1
TRUNCATE table t2;
INSERT INTO t2 select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
1 1
drop table t1,t2;

View File

@ -6,7 +6,7 @@ CREATE TABLE table_3(a int);
CREATE TABLE table_4(a int);
CREATE TABLE T19170(s1 TIMESTAMP);
SET GLOBAL event_scheduler=1;
CREATE EVENT E19170 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO T19170 VALUES(CURRENT_TIMESTAMP);
CREATE EVENT E19170 ON SCHEDULE EVERY 2 SECOND DO INSERT INTO T19170 VALUES(CURRENT_TIMESTAMP);
CREATE EVENT two_sec ON SCHEDULE EVERY 2 SECOND DO INSERT INTO table_1 VALUES(1);
CREATE EVENT start_n_end
ON SCHEDULE EVERY 1 SECOND

View File

@ -24,9 +24,9 @@ explain select * from t1 use key (str,str) where str="foo";
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const str str 11 const 1
explain select * from t1 use key (str,str,foo) where str="foo";
ERROR 42000: Key column 'foo' doesn't exist in table
ERROR 42000: Key 'foo' doesn't exist in table 't1'
explain select * from t1 ignore key (str,str,foo) where str="foo";
ERROR 42000: Key column 'foo' doesn't exist in table
ERROR 42000: Key 'foo' doesn't exist in table 't1'
drop table t1;
explain select 1;
id select_type table type possible_keys key key_len ref rows Extra

View File

@ -1601,6 +1601,7 @@ fld_cid fld_name fld_parentid fld_delt
5 Torkel 0 0
DROP TABLE federated.t1;
DROP TABLE federated.bug_17377_table;
DROP TABLE federated.t1;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;

View File

@ -309,6 +309,12 @@ a grp
1 2
2 4,3
3 5
select group_concat(c order by (select concat(5-t1.c,group_concat(c order by a)) from t2 where t2.a=t1.a)) as grp from t1;
grp
5,4,3,2
select group_concat(c order by (select concat(t1.c,group_concat(c)) from t2 where a=t1.a)) as grp from t1;
grp
2,3,4,5
select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp;
a c grp
3 5 3,3

View File

@ -763,6 +763,7 @@ time_format('100:00:00', '%H %k %h %I %l')
100 100 04 04 4
create table t1 (a timestamp default '2005-05-05 01:01:01',
b timestamp default '2005-05-05 01:01:01');
drop function if exists t_slow_sysdate;
create function t_slow_sysdate() returns timestamp
begin
do sleep(2);

View File

@ -607,6 +607,7 @@ insert into tables_priv values ('','test_db','mysqltest_1','test_table','test_gr
flush privileges;
delete from tables_priv where host = '' and user = 'mysqltest_1';
flush privileges;
use test;
set @user123="non-existent";
select * from mysql.db where user=@user123;
Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv
@ -637,7 +638,6 @@ show grants for mysqltest_7@;
Grants for mysqltest_7@
GRANT USAGE ON *.* TO 'mysqltest_7'@'' IDENTIFIED BY PASSWORD '*2FB071A056F9BB745219D9C876814231DAF46517'
drop user mysqltest_7@;
flush privileges;
show grants for mysqltest_7@;
ERROR 42000: There is no such grant defined for user 'mysqltest_7' on host ''
create database mysqltest;
@ -658,3 +658,214 @@ delete from mysql.db where user='mysqltest1';
delete from mysql.tables_priv where user='mysqltest1';
flush privileges;
drop database mysqltest;
use test;
create table t1 (a int);
create table t2 as select * from mysql.user where user='';
delete from mysql.user where user='';
flush privileges;
create user mysqltest_8@'';
create user mysqltest_8;
create user mysqltest_8@host8;
create user mysqltest_8@'';
ERROR HY000: Operation CREATE USER failed for 'mysqltest_8'@''
create user mysqltest_8;
ERROR HY000: Operation CREATE USER failed for 'mysqltest_8'@'%'
create user mysqltest_8@host8;
ERROR HY000: Operation CREATE USER failed for 'mysqltest_8'@'host8'
select user, QUOTE(host) from mysql.user where user="mysqltest_8";
user QUOTE(host)
mysqltest_8 ''
mysqltest_8 '%'
mysqltest_8 'host8'
Schema privileges
grant select on mysqltest.* to mysqltest_8@'';
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_8'@''
grant select on mysqltest.* to mysqltest_8@;
show grants for mysqltest_8@;
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_8'@''
grant select on mysqltest.* to mysqltest_8;
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_8'@'%'
select * from information_schema.schema_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'%' NULL mysqltest SELECT NO
'mysqltest_8'@'' NULL mysqltest SELECT NO
select * from t1;
a
revoke select on mysqltest.* from mysqltest_8@'';
revoke select on mysqltest.* from mysqltest_8;
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
select * from information_schema.schema_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
show grants for mysqltest_8@;
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
grant select on mysqltest.* to mysqltest_8@'';
flush privileges;
show grants for mysqltest_8@;
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_8'@''
revoke select on mysqltest.* from mysqltest_8@'';
flush privileges;
Column privileges
grant update (a) on t1 to mysqltest_8@'';
grant update (a) on t1 to mysqltest_8;
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
GRANT UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@''
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
GRANT UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
GRANT UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@''
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
GRANT UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
select * from information_schema.column_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'%' NULL test t1 a UPDATE NO
'mysqltest_8'@'' NULL test t1 a UPDATE NO
select * from t1;
a
revoke update (a) on t1 from mysqltest_8@'';
revoke update (a) on t1 from mysqltest_8;
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
select * from information_schema.column_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
Table privileges
grant update on t1 to mysqltest_8@'';
grant update on t1 to mysqltest_8;
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
GRANT UPDATE ON `test`.`t1` TO 'mysqltest_8'@''
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
GRANT UPDATE ON `test`.`t1` TO 'mysqltest_8'@'%'
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
GRANT UPDATE ON `test`.`t1` TO 'mysqltest_8'@''
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
GRANT UPDATE ON `test`.`t1` TO 'mysqltest_8'@'%'
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'%' NULL test t1 UPDATE NO
'mysqltest_8'@'' NULL test t1 UPDATE NO
select * from t1;
a
revoke update on t1 from mysqltest_8@'';
revoke update on t1 from mysqltest_8;
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
"DROP USER" should clear privileges
grant all privileges on mysqltest.* to mysqltest_8@'';
grant select on mysqltest.* to mysqltest_8@'';
grant update on t1 to mysqltest_8@'';
grant update (a) on t1 to mysqltest_8@'';
grant all privileges on mysqltest.* to mysqltest_8;
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@''
GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@''
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
select * from information_schema.user_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'host8' NULL USAGE NO
'mysqltest_8'@'%' NULL USAGE NO
'mysqltest_8'@'' NULL USAGE NO
select * from t1;
a
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@
GRANT USAGE ON *.* TO 'mysqltest_8'@''
GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@''
GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@''
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
drop user mysqltest_8@'';
show grants for mysqltest_8@'';
ERROR 42000: There is no such grant defined for user 'mysqltest_8' on host ''
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
select * from information_schema.user_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'host8' NULL USAGE NO
'mysqltest_8'@'%' NULL USAGE NO
drop user mysqltest_8;
connect(localhost,mysqltest_8,,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'mysqltest_8'@'localhost' (using password: NO)
show grants for mysqltest_8;
ERROR 42000: There is no such grant defined for user 'mysqltest_8' on host '%'
drop user mysqltest_8@host8;
show grants for mysqltest_8@host8;
ERROR 42000: There is no such grant defined for user 'mysqltest_8' on host 'host8'
insert into mysql.user select * from t2;
flush privileges;
drop table t2;
drop table t1;

View File

@ -119,7 +119,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10) )
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM)
select SUBPARTITION_METHOD FROM information_schema.partitions WHERE
table_schema="test" AND table_name="t1";
SUBPARTITION_METHOD

View File

@ -1,4 +1,4 @@
drop table if exists t1,t2;
drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4;
create table t1 (
c_id int(11) not null default '0',
org_id int(11) default null,
@ -268,3 +268,61 @@ explain select distinct f1, f2 from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL PRIMARY 5 NULL 3 Using index for group-by; Using temporary
drop table t1;
set storage_engine=innodb;
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
CREATE TABLE t2 (primary key (a)) select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
drop table if exists t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
drop table if exists t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TABLE t2 (a int, b int, primary key (a));
BEGIN;
INSERT INTO t2 values(100,100);
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
100 100
ROLLBACK;
SELECT * from t2;
a b
100 100
TRUNCATE table t2;
INSERT INTO t2 select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
drop table t2;
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
BEGIN;
INSERT INTO t2 values(100,100);
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
100 100
COMMIT;
BEGIN;
INSERT INTO t2 values(101,101);
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
100 100
101 101
ROLLBACK;
SELECT * from t2;
a b
100 100
TRUNCATE table t2;
INSERT INTO t2 select * from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
drop table t1,t2;

View File

@ -2,8 +2,8 @@ drop table if exists t1,t2,t3;
create table t1 (a int not null);
insert into t1 values (1);
insert into t1 values (a+2);
insert into t1 values (a+3);
insert into t1 values (4),(a+5);
insert into t1 values (a+3),(a+4);
insert into t1 values (5),(a+6);
select * from t1;
a
1
@ -11,6 +11,7 @@ a
3
4
5
6
drop table t1;
create table t1 (id int not null auto_increment primary key, username varchar(32) not null, unique (username));
insert into t1 values (0,"mysql");
@ -299,3 +300,24 @@ select count(*) from t2;
count(*)
25500
drop table t1,t2,t3;
create table t1 (a int, b int);
insert into t1 (a,b) values (a,b);
insert into t1 SET a=1, b=a+1;
insert into t1 (a,b) select 1,2;
INSERT INTO t1 ( a ) SELECT 0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
prepare stmt1 from ' replace into t1 (a,a) select 100, ''hundred'' ';
execute stmt1;
ERROR 42000: Column 'a' specified twice
insert into t1 (a,b,b) values (1,1,1);
ERROR 42000: Column 'b' specified twice
insert into t1 (a,a) values (1,1,1);
ERROR 21S01: Column count doesn't match value count at row 1
insert into t1 (a,a) values (1,1);
ERROR 42000: Column 'a' specified twice
insert into t1 SET a=1,b=2,a=1;
ERROR 42000: Column 'a' specified twice
insert into t1 (b,b) select 1,2;
ERROR 42000: Column 'b' specified twice
INSERT INTO t1 (b,b) SELECT 0,0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
ERROR 42000: Column 'b' specified twice
drop table t1;

View File

@ -191,10 +191,10 @@ cache index t1 in unknown_key_cache;
ERROR HY000: Unknown key cache 'unknown_key_cache'
cache index t1 key (unknown_key) in keycache1;
Table Op Msg_type Msg_text
test.t1 assign_to_keycache error Key column 'unknown_key' doesn't exist in table
test.t1 assign_to_keycache error Key 'unknown_key' doesn't exist in table 't1'
test.t1 assign_to_keycache status Operation failed
Warnings:
Error 1072 Key column 'unknown_key' doesn't exist in table
Error 1176 Key 'unknown_key' doesn't exist in table 't1'
select @@keycache2.key_buffer_size;
@@keycache2.key_buffer_size
4194304

View File

@ -115,6 +115,15 @@ select @a, @b;
@a @b
NULL 15
truncate table t1;
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 set c=b;
Warnings:
Warning 1261 Row 1 doesn't contain data for all columns
Warning 1261 Row 2 doesn't contain data for all columns
select * from t1;
a b c
NULL 10 10
NULL 15 15
truncate table t1;
load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
select * from t1;
a b c

View File

@ -519,3 +519,83 @@ a
30
drop view v1;
drop table t1, t2;
create table t1 (i1 int, i2 int, i3 int);
create table t2 (id int, c1 varchar(20), c2 varchar(20));
insert into t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
insert into t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
select * from t1 order by i1;
i1 i2 i3
1 5 10
2 2 2
3 7 12
4 5 2
9 10 15
select * from t2;
id c1 c2
9 abc def
5 opq lmn
2 test t t test
update t1,t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
select * from t1 order by i1;
i1 i2 i3
1 5 10
2 15 2
3 7 12
4 5 2
9 15 15
select * from t2 order by id;
id c1 c2
2 test t ppc
5 opq lmn
9 abc ppc
delete t1.*,t2.* from t1,t2 where t1.i2=t2.id;
select * from t1 order by i1;
i1 i2 i3
2 15 2
3 7 12
9 15 15
select * from t2 order by id;
id c1 c2
2 test t ppc
9 abc ppc
drop table t1, t2;
create table t1 (i1 int auto_increment not null, i2 int, i3 int, primary key (i1));
create table t2 (id int auto_increment not null, c1 varchar(20), c2 varchar(20), primary key(id));
insert into t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
insert into t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
select * from t1 order by i1;
i1 i2 i3
1 5 10
2 2 2
3 7 12
4 5 2
9 10 15
select * from t2 order by id;
id c1 c2
2 test t t test
5 opq lmn
9 abc def
update t1,t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
select * from t1 order by i1;
i1 i2 i3
1 5 10
2 15 2
3 7 12
4 5 2
9 15 15
select * from t2 order by id;
id c1 c2
2 test t ppc
5 opq lmn
9 abc ppc
delete t1.*,t2.* from t1,t2 where t1.i2=t2.id;
select * from t1 order by i1;
i1 i2 i3
2 15 2
3 7 12
9 15 15
select * from t2 order by id;
id c1 c2
2 test t ppc
9 abc ppc
drop table t1, t2;

View File

@ -1,3 +1,4 @@
drop database if exists client_test_db;
DROP SCHEMA test;
CREATE SCHEMA test;
cluster.binlog_index OK

View File

@ -144,7 +144,7 @@ b int unsigned not null,
c int unsigned,
UNIQUE (b, c) USING HASH
) engine=ndbcluster;
ERROR 42000: Column 'c' is used with UNIQUE or INDEX but is not defined as NOT NULL
ERROR 42000: Table handler doesn't support NULL in given index. Please change column 'c' to be NOT NULL or use another handler
CREATE TABLE t3 (
a int unsigned NOT NULL,
b int unsigned not null,

View File

@ -30,4 +30,4 @@ REPLACE INTO t1 (i,j) VALUES (17,2);
SELECT * from t1 ORDER BY i;
i j k
3 1 42
17 2 24
17 2 NULL

View File

@ -3,6 +3,23 @@ create table t1 (a int)
partition by key(a)
(partition p0 engine = MEMORY);
drop table t1;
create table t1 (a int)
partition by range (a)
subpartition by key (a)
(partition p0 values less than (1));
alter table t1 add partition (partition p1 values less than (2));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) (PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (2) ENGINE = MyISAM)
alter table t1 reorganize partition p1 into (partition p1 values less than (3));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY KEY (a) (PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (3) ENGINE = MyISAM)
drop table t1;
CREATE TABLE t1 (
a int not null,
b int not null,
@ -574,7 +591,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION p0 VALUES LESS THAN (100) )
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION p0 VALUES LESS THAN (100) ENGINE = MyISAM)
alter table t1 add partition (partition p1 values less than (200)
(subpartition subpart21));
show create table t1;

View File

@ -996,7 +996,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL,
`f2` char(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (100) , PARTITION part2 VALUES LESS THAN (2147483647) )
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION part2 VALUES LESS THAN (2147483647) ENGINE = MyISAM)
SELECT COUNT(*) = 0 AS my_value FROM t1;
my_value
1
@ -1098,7 +1098,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL,
`f2` char(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) SUBPARTITIONS 1 (PARTITION part1 VALUES LESS THAN (100) , PARTITION part2 VALUES LESS THAN (2147483647) )
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (f1) SUBPARTITION BY HASH (f1) SUBPARTITIONS 1 (PARTITION part1 VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION part2 VALUES LESS THAN (2147483647) ENGINE = MyISAM)
SELECT COUNT(*) = 0 AS my_value FROM t1;
my_value
1

View File

@ -160,11 +160,11 @@ Key_reads 0
load index into cache t3 key (b), t2 key (c) ;
Table Op Msg_type Msg_text
test.t3 preload_keys error Table 'test.t3' doesn't exist
test.t2 preload_keys error Key column 'c' doesn't exist in table
test.t2 preload_keys error Key 'c' doesn't exist in table 't2'
test.t2 preload_keys status Operation failed
Warnings:
Error 1146 Table 'test.t3' doesn't exist
Error 1072 Key column 'c' doesn't exist in table
Error 1176 Key 'c' doesn't exist in table 't2'
show status like "key_read%";
Variable_name Value
Key_read_requests 0

View File

@ -1157,3 +1157,4 @@ test.t1 analyze status Table is already up to date
Warnings:
Error 1146 Table 'test.t4' doesn't exist
deallocate prepare stmt;
drop table t1, t2, t3;

View File

@ -359,8 +359,6 @@ MAX(f1)
-------- switch to master -------
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT MAX(f1) FROM t1;
MAX(f1)
5
@ -579,8 +577,6 @@ MAX(f1)
-------- switch to master -------
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT MAX(f1) FROM t1;
MAX(f1)
8

View File

@ -27,7 +27,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Show table on slave ---
SHOW CREATE TABLE t1;
Table Create Table
@ -100,7 +100,7 @@ t1 CREATE TABLE `t1` (
`y` year(4) DEFAULT NULL,
`t` date DEFAULT NULL,
PRIMARY KEY (`id`,`total`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
--- Make sure that our tables on slave are still same engine ---
--- and that the alter statements replicated correctly ---
SHOW CREATE TABLE t1;

View File

@ -144,9 +144,9 @@ explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
explain select fld3 from t2 ignore index (fld3,not_used);
ERROR 42000: Key column 'not_used' doesn't exist in table
ERROR 42000: Key 'not_used' doesn't exist in table 't2'
explain select fld3 from t2 use index (not_used);
ERROR 42000: Key column 'not_used' doesn't exist in table
ERROR 42000: Key 'not_used' doesn't exist in table 't2'
select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
fld3
honeysuckle

View File

@ -145,9 +145,9 @@ explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
explain select fld3 from t2 ignore index (fld3,not_used);
ERROR 42000: Key column 'not_used' doesn't exist in table
ERROR 42000: Key 'not_used' doesn't exist in table 't2'
explain select fld3 from t2 use index (not_used);
ERROR 42000: Key column 'not_used' doesn't exist in table
ERROR 42000: Key 'not_used' doesn't exist in table 't2'
select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
fld3
honeysuckle

View File

@ -148,9 +148,9 @@ explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
explain select fld3 from t2 ignore index (fld3,not_used);
ERROR 42000: Key column 'not_used' doesn't exist in table
ERROR 42000: Key 'not_used' doesn't exist in table 't2'
explain select fld3 from t2 use index (not_used);
ERROR 42000: Key column 'not_used' doesn't exist in table
ERROR 42000: Key 'not_used' doesn't exist in table 't2'
select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
fld3
honeysuckle

View File

@ -614,7 +614,7 @@ drop table t1;
create table t1 (a int, b int);
create view v1 as select a, sum(b) from t1 group by a;
select b from v1 use index (some_index) where b=1;
ERROR 42000: Key column 'some_index' doesn't exist in table
ERROR 42000: Key 'some_index' doesn't exist in table 'v1'
drop view v1;
drop table t1;
create table t1 (col1 char(5),col2 char(5));

View File

@ -1,5 +1,5 @@
drop database if exists mysqltest;
drop view if exists v1;
drop view if exists v1,v2,v3;
grant create view on test.* to test@localhost;
show grants for test@localhost;
Grants for test@localhost

View File

@ -61,6 +61,7 @@ prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()";
execute stmt1;
execute stmt1;
deallocate prepare stmt1;
drop table t1;
#
# bug#15225 (ANALYZE temporary has no effect)

View File

@ -226,6 +226,7 @@ drop table t1;
# Test create table if not exists with duplicate key error
#
flush status;
create table t1 (a int not null, b int, primary key (a));
insert into t1 values (1,1);
create table if not exists t1 select 2;
@ -233,6 +234,8 @@ select * from t1;
create table if not exists t1 select 3 as 'a',4 as 'b';
--error 1062
create table if not exists t1 select 3 as 'a',3 as 'b';
show warnings;
show status like "Opened_tables";
select * from t1;
drop table t1;
@ -676,3 +679,37 @@ insert into t1 values('aaa');
drop table t1;
# End of 5.0 tests
#
# Test of behaviour with CREATE ... SELECT
#
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
--error 1062
CREATE TABLE t2 (primary key (a)) select * from t1;
# This should give warning
drop table if exists t2;
--error 1062
CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
# This should give warning
drop table if exists t2;
CREATE TABLE t2 (a int, b int, primary key (a));
--error 1062
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
TRUNCATE table t2;
--error 1062
INSERT INTO t2 select * from t1;
SELECT * from t2;
drop table t2;
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
--error 1062
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
TRUNCATE table t2;
--error 1062
INSERT INTO t2 select * from t1;
SELECT * from t2;
drop table t1,t2;

View File

@ -13,6 +13,8 @@
#events_stress : BUG#17619 2006-02-21 andrey Race conditions
#events : BUG#17619 2006-02-21 andrey Race conditions
#events_scheduling : BUG#19170 2006-04-26 andrey Test case of 19170 fails on some platforms. Has to be checked.
im_instance_conf : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly
im_options : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly
ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
#ndb_binlog_discover : BUG#19395 2006-04-28 tomas/knielsen mysqld does not always detect cluster shutdown
@ -22,7 +24,7 @@ ndb_load : BUG#17233 2006-05-04 tomas failed load data from infi
partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
ps_7ndb : BUG#18950 2006-02-16 jmiller create table like does not obtain LOCK_open
rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
rpl_ndb_2myisam : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
rpl_ndb_2myisam : BUG#19227 Seems to pass currently
rpl_ndb_auto_inc : BUG#17086 2006-02-16 jmiller CR: auto_increment_increment and auto_increment_offset produce duplicate key er
#rpl_ndb_commit_afterflush : BUG#19328 2006-05-04 tomas Slave timeout with COM_REGISTER_SLAVE error causing stop
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD

View File

@ -6,7 +6,9 @@ CREATE TABLE table_3(a int);
CREATE TABLE table_4(a int);
CREATE TABLE T19170(s1 TIMESTAMP);
SET GLOBAL event_scheduler=1;
CREATE EVENT E19170 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO T19170 VALUES(CURRENT_TIMESTAMP);
# We need to have 2 to make it safe with valgrind. This is probably because
# of when we calculate the timestamp value
CREATE EVENT E19170 ON SCHEDULE EVERY 2 SECOND DO INSERT INTO T19170 VALUES(CURRENT_TIMESTAMP);
CREATE EVENT two_sec ON SCHEDULE EVERY 2 SECOND DO INSERT INTO table_1 VALUES(1);
CREATE EVENT start_n_end
ON SCHEDULE EVERY 1 SECOND

View File

@ -15,9 +15,9 @@ explain select * from t1 ignore key (str) where str="foo";
explain select * from t1 use key (str,str) where str="foo";
#The following should give errors
--error 1072
--error 1176
explain select * from t1 use key (str,str,foo) where str="foo";
--error 1072
--error 1176
explain select * from t1 ignore key (str,str,foo) where str="foo";
drop table t1;

View File

@ -1,6 +1,6 @@
# should work with embedded server after mysqltest is fixed
--source include/not_embedded.inc
source include/federated.inc;
--source include/federated.inc
connection slave;
DROP TABLE IF EXISTS federated.t1;
@ -1310,6 +1310,57 @@ select * from federated.t1 where fld_parentid=0 and fld_delt=0;
DROP TABLE federated.t1;
connection slave;
DROP TABLE federated.bug_17377_table;
DROP TABLE federated.t1;
#
# Test multi updates and deletes without keys
#
source include/federated_cleanup.inc;
# The following can be enabled when bug #19773 has been fixed
--disable_parsing
connection slave;
create table federated.t1 (i1 int, i2 int, i3 int);
create table federated.t2 (id int, c1 varchar(20), c2 varchar(20));
connection master;
eval create table federated.t1 (i1 int, i2 int, i3 int) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
eval create table federated.t2 (id int, c1 varchar(20), c2 varchar(20)) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t2';
insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
insert into federated.t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
select * from federated.t1 order by i1;
select * from federated.t2;
update federated.t1,federated.t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
select * from federated.t1 order by i1;
select * from federated.t2 order by id;
delete t1.*,t2.* from federated.t1,federated.t2 where t1.i2=t2.id;
select * from federated.t1 order by i1;
select * from federated.t2 order by id;
drop table federated.t1, federated.t2;
connection slave;
drop table federated.t1, federated.t2;
connection master;
# Test multi updates and deletes with keys
connection slave;
create table federated.t1 (i1 int, i2 int, i3 int, primary key (i1));
create table federated.t2 (id int, c1 varchar(20), c2 varchar(20), primary key (id));
connection master;
eval create table federated.t1 (i1 int auto_increment not null, i2 int, i3 int, primary key (i1)) ENGINE=FEDERATED ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
eval create table federated.t2 (id int auto_increment not null, c1 varchar(20), c2 varchar(20), primary key(id)) ENGINE=FEDERATED ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t2';
insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
insert into federated.t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
select * from federated.t1 order by i1;
select * from federated.t2 order by id;
update federated.t1,federated.t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
select * from federated.t1 order by i1;
select * from federated.t2 order by id;
delete t1.*,t2.* from federated.t1,federated.t2 where t1.i2=t2.id;
select * from federated.t1 order by i1;
select * from federated.t2 order by id;
drop table federated.t1, federated.t2;
connection slave;
drop table federated.t1, federated.t2;
connection master;
--enable_parsing
--source include/federated_cleanup.inc

View File

@ -176,8 +176,8 @@ select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5)
select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1 group by 1;
# The following returns random results as we are sorting on blob addresses
# select group_concat(c order by (select group_concat(c order by a) from t2 where t2.a=t1.a)) as grp from t1;
# select group_concat(c order by (select group_concat(c) from t2 where a=t1.a)) as grp from t1;
select group_concat(c order by (select concat(5-t1.c,group_concat(c order by a)) from t2 where t2.a=t1.a)) as grp from t1;
select group_concat(c order by (select concat(t1.c,group_concat(c)) from t2 where a=t1.a)) as grp from t1;
select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp;
drop table t1,t2;

View File

@ -385,6 +385,7 @@ select time_format('100:00:00', '%H %k %h %I %l');
create table t1 (a timestamp default '2005-05-05 01:01:01',
b timestamp default '2005-05-05 01:01:01');
delimiter //;
drop function if exists t_slow_sysdate;
create function t_slow_sysdate() returns timestamp
begin
do sleep(2);

View File

@ -490,6 +490,7 @@ insert into tables_priv values ('','test_db','mysqltest_1','test_table','test_gr
flush privileges;
delete from tables_priv where host = '' and user = 'mysqltest_1';
flush privileges;
use test;
#
# Bug #10892 user variables not auto cast for comparisons
@ -518,7 +519,6 @@ create user mysqltest_7@;
set password for mysqltest_7@ = password('systpass');
show grants for mysqltest_7@;
drop user mysqltest_7@;
flush privileges; # BUG#16297(flush should be removed when that bug is fixed)
--error 1141
show grants for mysqltest_7@;
@ -539,3 +539,145 @@ flush privileges;
drop database mysqltest;
# End of 4.1 tests
#
# Bug #16297 In memory grant tables not flushed when users's hostname is ""
#
use test;
create table t1 (a int);
# Backup anonymous users and remove them. (They get in the way of
# the one we test with here otherwise.)
create table t2 as select * from mysql.user where user='';
delete from mysql.user where user='';
flush privileges;
# Create some users with different hostnames
create user mysqltest_8@'';
create user mysqltest_8;
create user mysqltest_8@host8;
# Try to create them again
--error 1396
create user mysqltest_8@'';
--error 1396
create user mysqltest_8;
--error 1396
create user mysqltest_8@host8;
select user, QUOTE(host) from mysql.user where user="mysqltest_8";
--echo Schema privileges
grant select on mysqltest.* to mysqltest_8@'';
show grants for mysqltest_8@'';
grant select on mysqltest.* to mysqltest_8@;
show grants for mysqltest_8@;
grant select on mysqltest.* to mysqltest_8;
show grants for mysqltest_8;
select * from information_schema.schema_privileges
where grantee like "'mysqltest_8'%";
connect (conn3,localhost,mysqltest_8,,);
select * from t1;
disconnect conn3;
connection master;
revoke select on mysqltest.* from mysqltest_8@'';
revoke select on mysqltest.* from mysqltest_8;
show grants for mysqltest_8@'';
show grants for mysqltest_8;
select * from information_schema.schema_privileges
where grantee like "'mysqltest_8'%";
flush privileges;
show grants for mysqltest_8@'';
show grants for mysqltest_8@;
grant select on mysqltest.* to mysqltest_8@'';
flush privileges;
show grants for mysqltest_8@;
revoke select on mysqltest.* from mysqltest_8@'';
flush privileges;
--echo Column privileges
grant update (a) on t1 to mysqltest_8@'';
grant update (a) on t1 to mysqltest_8;
show grants for mysqltest_8@'';
show grants for mysqltest_8;
flush privileges;
show grants for mysqltest_8@'';
show grants for mysqltest_8;
select * from information_schema.column_privileges;
connect (conn4,localhost,mysqltest_8,,);
select * from t1;
disconnect conn4;
connection master;
revoke update (a) on t1 from mysqltest_8@'';
revoke update (a) on t1 from mysqltest_8;
show grants for mysqltest_8@'';
show grants for mysqltest_8;
select * from information_schema.column_privileges;
flush privileges;
show grants for mysqltest_8@'';
show grants for mysqltest_8;
--echo Table privileges
grant update on t1 to mysqltest_8@'';
grant update on t1 to mysqltest_8;
show grants for mysqltest_8@'';
show grants for mysqltest_8;
flush privileges;
show grants for mysqltest_8@'';
show grants for mysqltest_8;
select * from information_schema.table_privileges;
connect (conn5,localhost,mysqltest_8,,);
select * from t1;
disconnect conn5;
connection master;
revoke update on t1 from mysqltest_8@'';
revoke update on t1 from mysqltest_8;
show grants for mysqltest_8@'';
show grants for mysqltest_8;
select * from information_schema.table_privileges;
flush privileges;
show grants for mysqltest_8@'';
show grants for mysqltest_8;
--echo "DROP USER" should clear privileges
grant all privileges on mysqltest.* to mysqltest_8@'';
grant select on mysqltest.* to mysqltest_8@'';
grant update on t1 to mysqltest_8@'';
grant update (a) on t1 to mysqltest_8@'';
grant all privileges on mysqltest.* to mysqltest_8;
show grants for mysqltest_8@'';
show grants for mysqltest_8;
select * from information_schema.user_privileges
where grantee like "'mysqltest_8'%";
connect (conn5,localhost,mysqltest_8,,);
select * from t1;
disconnect conn5;
connection master;
flush privileges;
show grants for mysqltest_8@'';
show grants for mysqltest_8;
drop user mysqltest_8@'';
--error 1141
show grants for mysqltest_8@'';
show grants for mysqltest_8;
select * from information_schema.user_privileges
where grantee like "'mysqltest_8'%";
drop user mysqltest_8;
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
connect (conn6,localhost,mysqltest_8,,);
connection master;
--error 1141
show grants for mysqltest_8;
drop user mysqltest_8@host8;
--error 1141
show grants for mysqltest_8@host8;
# Restore the anonymous users.
insert into mysql.user select * from t2;
flush privileges;
drop table t2;
drop table t1;

View File

@ -1,7 +1,7 @@
-- source include/have_innodb.inc
--disable_warnings
drop table if exists t1,t2;
drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4;
--enable_warnings
# BUG#16798: Uninitialized row buffer reads in ref-or-null optimizer
@ -223,3 +223,52 @@ explain select distinct f1 a, f1 b from t1;
explain select distinct f1, f2 from t1;
drop table t1;
#
# Test of behaviour with CREATE ... SELECT
#
set storage_engine=innodb;
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
--error 1062
CREATE TABLE t2 (primary key (a)) select * from t1;
# This should give warning
drop table if exists t2;
--error 1062
CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
# This should give warning
drop table if exists t2;
CREATE TABLE t2 (a int, b int, primary key (a));
BEGIN;
INSERT INTO t2 values(100,100);
--error 1062
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
ROLLBACK;
SELECT * from t2;
TRUNCATE table t2;
--error 1062
INSERT INTO t2 select * from t1;
SELECT * from t2;
drop table t2;
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
BEGIN;
INSERT INTO t2 values(100,100);
--error 1062
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
COMMIT;
BEGIN;
INSERT INTO t2 values(101,101);
--error 1062
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
ROLLBACK;
SELECT * from t2;
TRUNCATE table t2;
--error 1062
INSERT INTO t2 select * from t1;
SELECT * from t2;
drop table t1,t2;

View File

@ -9,8 +9,8 @@ drop table if exists t1,t2,t3;
create table t1 (a int not null);
insert into t1 values (1);
insert into t1 values (a+2);
insert into t1 values (a+3);
insert into t1 values (4),(a+5);
insert into t1 values (a+3),(a+4);
insert into t1 values (5),(a+6);
select * from t1;
drop table t1;
@ -176,3 +176,28 @@ insert into t2 select t1.* from t1, t2 t, t3 where t1.id1 = t.id2 and t.id2 =
select count(*) from t2;
drop table t1,t2,t3;
#
# Test different cases of duplicate fields
#
create table t1 (a int, b int);
insert into t1 (a,b) values (a,b);
insert into t1 SET a=1, b=a+1;
insert into t1 (a,b) select 1,2;
INSERT INTO t1 ( a ) SELECT 0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
prepare stmt1 from ' replace into t1 (a,a) select 100, ''hundred'' ';
--error 1110
execute stmt1;
--error 1110
insert into t1 (a,b,b) values (1,1,1);
--error 1136
insert into t1 (a,a) values (1,1,1);
--error 1110
insert into t1 (a,a) values (1,1);
--error 1110
insert into t1 SET a=1,b=2,a=1;
--error 1110
insert into t1 (b,b) select 1,2;
--error 1110
INSERT INTO t1 (b,b) SELECT 0,0 ON DUPLICATE KEY UPDATE a = a + VALUES (a);
drop table t1;

View File

@ -92,6 +92,10 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@a, @b);
select * from t1;
select @a, @b;
truncate table t1;
# Reading of all columns with set
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 set c=b;
select * from t1;
truncate table t1;
# now going to test fixed field-row file format
load data infile '../std_data_ln/loaddata5.dat' into table t1 fields terminated by '' enclosed by '' (a, b) set c="Wow";
select * from t1;

View File

@ -532,3 +532,33 @@ select * from t1;
select * from t2;
drop view v1;
drop table t1, t2;
#
# Test multi updates and deletes using primary key and without.
#
create table t1 (i1 int, i2 int, i3 int);
create table t2 (id int, c1 varchar(20), c2 varchar(20));
insert into t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
insert into t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
select * from t1 order by i1;
select * from t2;
update t1,t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
select * from t1 order by i1;
select * from t2 order by id;
delete t1.*,t2.* from t1,t2 where t1.i2=t2.id;
select * from t1 order by i1;
select * from t2 order by id;
drop table t1, t2;
create table t1 (i1 int auto_increment not null, i2 int, i3 int, primary key (i1));
create table t2 (id int auto_increment not null, c1 varchar(20), c2 varchar(20), primary key(id));
insert into t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
insert into t2 values (9,"abc","def"),(5,"opq","lmn"),(2,"test t","t test");
select * from t1 order by i1;
select * from t2 order by id;
update t1,t2 set t1.i2=15, t2.c2="ppc" where t1.i1=t2.id;
select * from t1 order by i1;
select * from t2 order by id;
delete t1.*,t2.* from t1,t2 where t1.i2=t2.id;
select * from t1 order by i1;
select * from t2 order by id;
drop table t1, t2;

View File

@ -5,6 +5,10 @@
# depends on the presence of the log tables (which are CSV-based).
--source include/have_csv.inc
--disable_warnings
drop database if exists client_test_db;
--enable_warnings
DROP SCHEMA test;
CREATE SCHEMA test;
#

View File

@ -610,7 +610,7 @@ drop database db1;
# BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
#
--exec $MYSQL_MY_PRINT_DEFAULTS --defaults-extra-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
--exec $MYSQL_MY_PRINT_DEFAULTS --defaults-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
#

View File

@ -14,6 +14,19 @@ partition by key(a)
(partition p0 engine = MEMORY);
drop table t1;
#
# BUG 19067 ALTER TABLE .. ADD PARTITION for subpartitioned table crashes
#
create table t1 (a int)
partition by range (a)
subpartition by key (a)
(partition p0 values less than (1));
alter table t1 add partition (partition p1 values less than (2));
show create table t1;
alter table t1 reorganize partition p1 into (partition p1 values less than (3));
show create table t1;
drop table t1;
#
# Partition by key no partition defined => OK
#

View File

@ -1145,5 +1145,5 @@ prepare stmt from "analyze table t4, t1";
execute stmt;
execute stmt;
deallocate prepare stmt;
drop table t1, t2, t3;
# End of 5.0 tests

View File

@ -321,13 +321,15 @@ execute stmt4;
prepare stmt4 from ' show variables like ''sql_mode'' ';
execute stmt4;
prepare stmt4 from ' show engine bdb logs ';
# The output depends on the history (actions of the bdb engine).
# The output depends on the bdb being enabled and on the history
# history (actions of the bdb engine).
# That is the reason why, we switch the output here off.
# (The real output will be tested in ps_6bdb.test)
# --replace_result $MYSQL_TEST_DIR TEST_DIR
--disable_warnings
--disable_result_log
execute stmt4;
--enable_result_log
--enable_warnings
prepare stmt4 from ' show grants for user ';
--error 1295
prepare stmt4 from ' show create table t2 ';

View File

@ -1 +1 @@
--default-storage-engine=ndb --binlog-format=row
--default-storage-engine=ndbcluster

View File

@ -1 +1 @@
--innodb --default-storage-engine=innodb --binlog-format=row
--innodb --default-storage-engine=innodb

View File

@ -1 +1 @@
--default-storage-engine=ndb --binlog-format=row
--default-storage-engine=ndbcluster

View File

@ -1 +1 @@
--default-storage-engine=myisam --binlog-format=row
--default-storage-engine=myisam

View File

@ -1 +1 @@
--innodb --binlog-format=row
--innodb

View File

@ -1 +1 @@
--binlog-format=row --default-storage-engine=ndbcluster
--default-storage-engine=ndbcluster

View File

@ -1 +1 @@
--default-storage-engine=ndbcluster --binlog-format=row
--default-storage-engine=ndbcluster

View File

@ -1296,9 +1296,9 @@ explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
# The next should give an error
#
-- error 1072
--error 1176
explain select fld3 from t2 ignore index (fld3,not_used);
-- error 1072
--error 1176
explain select fld3 from t2 use index (not_used);
#

View File

@ -516,7 +516,7 @@ drop table t1;
#
create table t1 (a int, b int);
create view v1 as select a, sum(b) from t1 group by a;
-- error 1072
--error 1176
select b from v1 use index (some_index) where b=1;
drop view v1;
drop table t1;

View File

@ -3,7 +3,7 @@
--disable_warnings
drop database if exists mysqltest;
drop view if exists v1;
drop view if exists v1,v2,v3;
--enable_warnings

View File

@ -240,6 +240,7 @@
fun:kill_server_thread
}
# Red Hat AS 4 32 bit
{
dl_relocate_object
@ -405,3 +406,30 @@
futex(utime)
fun:__lll_mutex_unlock_wake
}
#
# Warning when printing stack trace (to suppress some not needed warnings)
#
{
vprintf on stacktrace
Memcheck:Cond
fun:vfprintf
fun:uffered_vfprintf
fun:vfprintf
fun:fprintf
fun:print_stacktrace
}
#
# Safe warnings, that may happen because of thread scheduling
#
{
dbug initialization
Memcheck:Leak
fun:malloc
fun:DbugMalloc
fun:ListAdd
fun:_db_set_
}

View File

@ -0,0 +1,189 @@
#
# Suppress some common (not fatal) errors in system libraries found by valgrind
#
#
# Pthread doesn't free all thread specific memory before program exists
#
{
pthread allocate_tls memory loss
Memcheck:Leak
fun:calloc
fun:_dl_allocate_tls
fun:allocate_stack
fun:pthread_create@@GLIBC_2.1
}
{
pthread allocate_dtv memory loss
Memcheck:Leak
fun:calloc
fun:allocate_dtv
fun:_dl_allocate_tls_storage
fun:__GI__dl_allocate_tls
fun:pthread_create
}
{
pthread allocate_dtv memory loss second
Memcheck:Leak
fun:calloc
fun:allocate_dtv
fun:_dl_allocate_tls
fun:pthread_create*
}
{
pthread allocate_dtv memory loss second
Memcheck:Leak
fun:calloc
fun:allocate_dtv
fun:_dl_allocate_tls
fun:pthread_create*
}
{
pthread memalign memory loss
Memcheck:Leak
fun:memalign
fun:_dl_allocate_tls_storage
fun:__GI__dl_allocate_tls
fun:pthread_create
}
{
pthread pthread_key_create
Memcheck:Leak
fun:malloc
fun:*
fun:*
fun:pthread_key_create
fun:my_thread_global_init
}
{
pthread strstr uninit
Memcheck:Cond
fun:strstr
obj:/lib/tls/libpthread.so.*
obj:/lib/tls/libpthread.so.*
fun:call_init
fun:_dl_init
obj:/lib/ld-*.so
}
{
pthread strstr uninit
Memcheck:Cond
fun:strstr
obj:/lib/tls/libpthread.so.*
obj:/lib/tls/libpthread.so.*
fun:call_init
fun:_dl_init
obj:/lib/ld-*.so
}
{
pthread errno
Memcheck:Leak
fun:calloc
fun:_dlerror_run
fun:dlsym
fun:__errno_location
}
#
# Warnings in libz becasue it works with aligned memory(?)
#
{
libz tr_flush_block
Memcheck:Cond
fun:_tr_flush_block
fun:deflate_slow
fun:deflate
fun:do_flush
fun:gzclose
}
{
libz tr_flush_block2
Memcheck:Cond
fun:_tr_flush_block
fun:deflate_slow
fun:deflate
fun:compress2
}
{
libz longest_match
Memcheck:Cond
fun:longest_match
fun:deflate_slow
fun:deflate
fun:do_flush
}
{
libz longest_match2
Memcheck:Cond
fun:longest_match
fun:deflate_slow
fun:deflate
fun:compress2
}
{
libz deflate
Memcheck:Cond
obj:*/libz.so.*
obj:*/libz.so.*
fun:deflate
fun:compress2
}
{
libz deflate2
Memcheck:Cond
obj:*/libz.so.*
obj:*/libz.so.*
fun:deflate
obj:*/libz.so.*
fun:gzflush
}
{
libz deflate3
Memcheck:Cond
obj:*/libz.so.*
obj:*/libz.so.*
fun:deflate
fun:do_flush
}
#
# Warning from my_thread_init becasue mysqld dies before kill thread exists
#
{
my_thread_init kill thread memory loss second
Memcheck:Leak
fun:calloc
fun:my_thread_init
fun:kill_server_thread
}
#
# Warning when printing stack trace (to suppress some not needed warnings)
#
{
vprintf on stacktrace
Memcheck:Cond
fun:vfprintf
fun:uffered_vfprintf
fun:vfprintf
fun:fprintf
fun:print_stacktrace
}

View File

@ -14,9 +14,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <base64.h>
#include <my_global.h>
#include <m_string.h> /* strchr() */
#include <m_ctype.h> /* my_isspace() */
#include <base64.h>
#ifndef MAIN

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