mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/push-5.1
This commit is contained in:
@@ -3009,5 +3009,6 @@ vio/viotest.cpp
|
||||
win/configure.data
|
||||
win/vs71cache.txt
|
||||
win/vs8cache.txt
|
||||
ylwrap
|
||||
zlib/*.ds?
|
||||
zlib/*.vcproj
|
||||
|
||||
@@ -605,6 +605,10 @@ static struct my_option my_long_options[] =
|
||||
{"column-type-info", OPT_COLUMN_TYPES, "Display column type information.",
|
||||
(uchar**) &column_types_flag, (uchar**) &column_types_flag,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"comments", 'c', "Preserve comments. Send comments to the server."
|
||||
" The default is --skip-comments (discard comments), enable with --comments",
|
||||
(uchar**) &preserve_comments, (uchar**) &preserve_comments,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"compress", 'C', "Use compression in server/client protocol.",
|
||||
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
@@ -755,9 +759,9 @@ static struct my_option my_long_options[] =
|
||||
0, 0},
|
||||
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
|
||||
"Max packet length to send to, or receive from server",
|
||||
(uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0, GET_ULONG,
|
||||
REQUIRED_ARG, 16 *1024L*1024L, 4096, (longlong) 2*1024L*1024L*1024L,
|
||||
MALLOC_OVERHEAD, 1024, 0},
|
||||
(uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0,
|
||||
GET_ULONG, REQUIRED_ARG, 16 *1024L*1024L, 4096,
|
||||
(longlong) 2*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
|
||||
{"net_buffer_length", OPT_NET_BUFFER_LENGTH,
|
||||
"Buffer for TCP/IP and socket communication",
|
||||
(uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0, GET_ULONG,
|
||||
@@ -765,12 +769,13 @@ static struct my_option my_long_options[] =
|
||||
{"select_limit", OPT_SELECT_LIMIT,
|
||||
"Automatic limit for SELECT when using --safe-updates",
|
||||
(uchar**) &select_limit,
|
||||
(uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0L, 0, 1, 0},
|
||||
(uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ULONG_MAX,
|
||||
0, 1, 0},
|
||||
{"max_join_size", OPT_MAX_JOIN_SIZE,
|
||||
"Automatic limit for rows in a join when using --safe-updates",
|
||||
(uchar**) &max_join_size,
|
||||
(uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ~0L, 0, 1,
|
||||
0},
|
||||
(uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ULONG_MAX,
|
||||
0, 1, 0},
|
||||
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
|
||||
" uses old (pre-4.1.1) protocol", (uchar**) &opt_secure_auth,
|
||||
(uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@@ -779,10 +784,6 @@ static struct my_option my_long_options[] =
|
||||
{"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
|
||||
(uchar**) &show_warnings, (uchar**) &show_warnings, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"comments", 'c', "Preserve comments. Send comments to the server."
|
||||
" Comments are discarded by default, enable with --enable-comments",
|
||||
(uchar**) &preserve_comments, (uchar**) &preserve_comments,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
||||
@@ -5050,7 +5050,7 @@ static struct my_option my_long_options[] =
|
||||
"Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"sleep", 'T', "Sleep always this many seconds on sleep commands.",
|
||||
(uchar**) &opt_sleep, (uchar**) &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, 0, 0,
|
||||
(uchar**) &opt_sleep, (uchar**) &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0,
|
||||
0, 0, 0},
|
||||
{"socket", 'S', "Socket file to use for connection.",
|
||||
(uchar**) &unix_sock, (uchar**) &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
|
||||
@@ -8018,7 +8018,6 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
|
||||
if (!len)
|
||||
{
|
||||
errno=EINVAL;
|
||||
my_message(0,"No to-string for last from-string",MYF(ME_BELL));
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
states+=len+1;
|
||||
|
||||
@@ -200,6 +200,7 @@ double my_strtod(const char *str, char **end, int *error);
|
||||
double my_atof(const char *nptr);
|
||||
|
||||
extern char *llstr(longlong value,char *buff);
|
||||
extern char *ullstr(longlong value,char *buff);
|
||||
#ifndef HAVE_STRTOUL
|
||||
extern long strtol(const char *str, char **ptr, int base);
|
||||
extern ulong strtoul(const char *str, char **ptr, int base);
|
||||
|
||||
@@ -74,7 +74,9 @@ extern void my_print_variables(const struct my_option *options);
|
||||
extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint,
|
||||
const struct my_option *));
|
||||
|
||||
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp);
|
||||
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
|
||||
bool *fix);
|
||||
longlong getopt_ll_limit_value(longlong, const struct my_option *,bool *fix);
|
||||
my_bool getopt_compare_strings(const char *s, const char *t, uint length);
|
||||
|
||||
C_MODE_END
|
||||
|
||||
@@ -203,14 +203,10 @@ typedef struct st_net {
|
||||
unsigned int *return_status;
|
||||
unsigned char reading_or_writing;
|
||||
char save_char;
|
||||
my_bool no_send_ok; /* For SPs and other things that do multiple stmts */
|
||||
my_bool unused0; /* Please remove with the next incompatible ABI change. */
|
||||
my_bool unused; /* Please remove with the next incompatible ABI change */
|
||||
my_bool compress;
|
||||
/*
|
||||
Set if OK packet is already sent, and we do not need to send error
|
||||
messages
|
||||
*/
|
||||
my_bool no_send_error;
|
||||
my_bool unused1; /* Please remove with the next incompatible ABI change. */
|
||||
/*
|
||||
Pointer to query object in query cache, do not equal NULL (0) for
|
||||
queries in cache that have not stored its results yet
|
||||
@@ -221,11 +217,14 @@ typedef struct st_net {
|
||||
functions and methods to maintain proper locking.
|
||||
*/
|
||||
unsigned char *query_cache_query;
|
||||
unsigned int last_errno;
|
||||
unsigned char error;
|
||||
my_bool report_error; /* We should report error (we have unreported error) */
|
||||
unsigned int client_last_errno;
|
||||
unsigned char error;
|
||||
my_bool unused2; /* Please remove with the next incompatible ABI change. */
|
||||
my_bool return_errno;
|
||||
char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
|
||||
/** Client library error message buffer. Actually belongs to struct MYSQL. */
|
||||
char client_last_error[MYSQL_ERRMSG_SIZE];
|
||||
/** Client library sqlstate buffer. Set along with the error message. */
|
||||
char sqlstate[SQLSTATE_LENGTH+1];
|
||||
void *extension;
|
||||
} NET;
|
||||
|
||||
@@ -397,14 +396,17 @@ typedef struct st_udf_args
|
||||
|
||||
typedef struct st_udf_init
|
||||
{
|
||||
my_bool maybe_null; /* 1 if function can return NULL */
|
||||
unsigned int decimals; /* for real functions */
|
||||
unsigned long max_length; /* For string functions */
|
||||
char *ptr; /* free pointer for function data */
|
||||
/* 0 if result is independent of arguments */
|
||||
my_bool const_item;
|
||||
my_bool maybe_null; /* 1 if function can return NULL */
|
||||
unsigned int decimals; /* for real functions */
|
||||
unsigned long max_length; /* For string functions */
|
||||
char *ptr; /* free pointer for function data */
|
||||
my_bool const_item; /* 1 if function always returns the same value */
|
||||
void *extension;
|
||||
} UDF_INIT;
|
||||
/*
|
||||
TODO: add a notion for determinism of the UDF.
|
||||
See Item_udf_func::update_used_tables ()
|
||||
*/
|
||||
|
||||
/* Constants when using compression */
|
||||
#define NET_HEADER_SIZE 4 /* standard header size */
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
|
||||
|
||||
#undef HAVE_PSTACK /* No stacktrace */
|
||||
#undef HAVE_DLOPEN /* No udf functions */
|
||||
#undef HAVE_OPENSSL
|
||||
#undef HAVE_SMEM /* No shared memory */
|
||||
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
|
||||
|
||||
@@ -537,16 +537,16 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
|
||||
unsigned int * return_status;
|
||||
unsigned char reading_or_writing;
|
||||
char save_char;
|
||||
my_bool no_send_ok;
|
||||
my_bool unused0;
|
||||
my_bool unused;
|
||||
my_bool compress;
|
||||
my_bool no_send_error;
|
||||
my_bool unused1;
|
||||
unsigned char * query_cache_query;
|
||||
unsigned int last_errno;
|
||||
unsigned int client_last_errno;
|
||||
unsigned char error;
|
||||
my_bool report_error;
|
||||
my_bool unused2;
|
||||
my_bool return_errno;
|
||||
char last_error[512];
|
||||
char client_last_error[512];
|
||||
char sqlstate[(5 + 1)];
|
||||
void * extension;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,8 @@ typedef struct st_queue {
|
||||
void *first_cmp_arg;
|
||||
uint elements;
|
||||
uint max_elements;
|
||||
uint offset_to_key; /* compare is done on element+offset */
|
||||
int max_at_top; /* Set if queue_top gives max */
|
||||
uint offset_to_key; /* compare is done on element+offset */
|
||||
int max_at_top; /* Normally 1, set to -1 if queue_top gives max */
|
||||
int (*compare)(void *, uchar *,uchar *);
|
||||
uint auto_extent;
|
||||
} QUEUE;
|
||||
@@ -43,7 +43,7 @@ typedef struct st_queue {
|
||||
#define queue_replaced(queue) _downheap(queue,1)
|
||||
#define queue_set_cmp_arg(queue, set_arg) (queue)->first_cmp_arg= set_arg
|
||||
#define queue_set_max_at_top(queue, set_arg) \
|
||||
(queue)->max_at_top= set_arg ? (-1 ^ 1) : 0
|
||||
(queue)->max_at_top= set_arg ? -1 : 1
|
||||
typedef int (*queue_compare)(void *,uchar *, uchar *);
|
||||
|
||||
int init_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
|
||||
|
||||
@@ -126,9 +126,6 @@ ENDIF(WIN32)
|
||||
ADD_DEPENDENCIES(libmysql GenError)
|
||||
TARGET_LINK_LIBRARIES(libmysql wsock32)
|
||||
|
||||
ADD_EXECUTABLE(myTest mytest.c)
|
||||
TARGET_LINK_LIBRARIES(myTest libmysql)
|
||||
|
||||
IF(EMBED_MANIFESTS)
|
||||
MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
|
||||
ENDIF(EMBED_MANIFESTS)
|
||||
|
||||
@@ -31,7 +31,7 @@ include $(srcdir)/Makefile.shared
|
||||
libmysqlclient_la_SOURCES = $(target_sources)
|
||||
libmysqlclient_la_LIBADD = $(target_libadd) $(yassl_las)
|
||||
libmysqlclient_la_LDFLAGS = $(target_ldflags)
|
||||
EXTRA_DIST = Makefile.shared libmysql.def dll.c mytest.c CMakeLists.txt
|
||||
EXTRA_DIST = Makefile.shared libmysql.def dll.c CMakeLists.txt
|
||||
noinst_HEADERS = client_settings.h
|
||||
|
||||
link_sources:
|
||||
|
||||
@@ -440,11 +440,11 @@ static void expand_error(MYSQL* mysql, int error)
|
||||
char tmp[MYSQL_ERRMSG_SIZE];
|
||||
char *p;
|
||||
uint err_length;
|
||||
strmake(tmp, mysql->net.last_error, MYSQL_ERRMSG_SIZE-1);
|
||||
p = strmake(mysql->net.last_error, ER(error), MYSQL_ERRMSG_SIZE-1);
|
||||
err_length= (uint) (p - mysql->net.last_error);
|
||||
strmake(tmp, mysql->net.client_last_error, MYSQL_ERRMSG_SIZE-1);
|
||||
p = strmake(mysql->net.client_last_error, ER(error), MYSQL_ERRMSG_SIZE-1);
|
||||
err_length= (uint) (p - mysql->net.client_last_error);
|
||||
strmake(p, tmp, MYSQL_ERRMSG_SIZE-1 - err_length);
|
||||
mysql->net.last_errno = error;
|
||||
mysql->net.client_last_errno = error;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -870,9 +870,10 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
|
||||
VOID(my_net_write(net,(const uchar*) "",0)); /* Server needs one packet */
|
||||
net_flush(net);
|
||||
strmov(net->sqlstate, unknown_sqlstate);
|
||||
net->last_errno= (*options->local_infile_error)(li_ptr,
|
||||
net->last_error,
|
||||
sizeof(net->last_error)-1);
|
||||
net->client_last_errno=
|
||||
(*options->local_infile_error)(li_ptr,
|
||||
net->client_last_error,
|
||||
sizeof(net->client_last_error)-1);
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -899,9 +900,10 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
|
||||
|
||||
if (readcount < 0)
|
||||
{
|
||||
net->last_errno= (*options->local_infile_error)(li_ptr,
|
||||
net->last_error,
|
||||
sizeof(net->last_error)-1);
|
||||
net->client_last_errno=
|
||||
(*options->local_infile_error)(li_ptr,
|
||||
net->client_last_error,
|
||||
sizeof(net->client_last_error)-1);
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -1395,7 +1397,7 @@ const char *cli_read_statistics(MYSQL *mysql)
|
||||
if (!mysql->net.read_pos[0])
|
||||
{
|
||||
set_mysql_error(mysql, CR_WRONG_HOST_INFO, unknown_sqlstate);
|
||||
return mysql->net.last_error;
|
||||
return mysql->net.client_last_error;
|
||||
}
|
||||
return (char*) mysql->net.read_pos;
|
||||
}
|
||||
@@ -1406,7 +1408,7 @@ mysql_stat(MYSQL *mysql)
|
||||
{
|
||||
DBUG_ENTER("mysql_stat");
|
||||
if (simple_command(mysql,COM_STATISTICS,0,0,0))
|
||||
DBUG_RETURN(mysql->net.last_error);
|
||||
DBUG_RETURN(mysql->net.client_last_error);
|
||||
DBUG_RETURN((*mysql->methods->read_statistics)(mysql));
|
||||
}
|
||||
|
||||
@@ -1771,7 +1773,7 @@ static my_bool my_realloc_str(NET *net, ulong length)
|
||||
if (res)
|
||||
{
|
||||
strmov(net->sqlstate, unknown_sqlstate);
|
||||
strmov(net->last_error, ER(net->last_errno));
|
||||
strmov(net->client_last_error, ER(net->client_last_errno));
|
||||
}
|
||||
net->write_pos= net->buff+ buf_length;
|
||||
}
|
||||
@@ -1822,13 +1824,15 @@ void set_stmt_error(MYSQL_STMT * stmt, int errcode,
|
||||
void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net)
|
||||
{
|
||||
DBUG_ENTER("set_stmt_errmsg");
|
||||
DBUG_PRINT("enter", ("error: %d/%s '%s'", net->last_errno, net->sqlstate,
|
||||
net->last_error));
|
||||
DBUG_PRINT("enter", ("error: %d/%s '%s'",
|
||||
net->client_last_errno,
|
||||
net->sqlstate,
|
||||
net->client_last_error));
|
||||
DBUG_ASSERT(stmt != 0);
|
||||
|
||||
stmt->last_errno= net->last_errno;
|
||||
if (net->last_error && net->last_error[0])
|
||||
strmov(stmt->last_error, net->last_error);
|
||||
stmt->last_errno= net->client_last_errno;
|
||||
if (net->client_last_error && net->client_last_error[0])
|
||||
strmov(stmt->last_error, net->client_last_error);
|
||||
strmov(stmt->sqlstate, net->sqlstate);
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
|
||||
@@ -160,7 +160,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
|
||||
msg_len=strlen(msg_buf);
|
||||
if (my_net_write(&con->net,(uchar*) msg_buf,msg_len) || net_flush(&con->net))
|
||||
{
|
||||
con->last_errno=con->net.last_errno;
|
||||
con->last_errno=con->net.client_last_errno;
|
||||
strmov(con->last_error,"Write error on socket");
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
/*C4*/
|
||||
/****************************************************************/
|
||||
/* Author: Jethro Wright, III TS : 3/ 4/1998 9:15 */
|
||||
/* Date: 02/18/1998 */
|
||||
/* mytest.c : do some testing of the libmySQL.DLL.... */
|
||||
/* */
|
||||
/* History: */
|
||||
/* 02/18/1998 jw3 also sprach zarathustra.... */
|
||||
/****************************************************************/
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <mysql.h>
|
||||
|
||||
#define DEFALT_SQL_STMT "SELECT * FROM db"
|
||||
#ifndef offsetof
|
||||
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
||||
#endif
|
||||
|
||||
|
||||
/********************************************************
|
||||
**
|
||||
** main :-
|
||||
**
|
||||
********************************************************/
|
||||
|
||||
int
|
||||
main( int argc, char * argv[] )
|
||||
{
|
||||
|
||||
char szSQL[ 200 ], aszFlds[ 25 ][ 25 ], szDB[ 50 ] ;
|
||||
const char *pszT;
|
||||
int i, j, k, l, x ;
|
||||
MYSQL * myData ;
|
||||
MYSQL_RES * res ;
|
||||
MYSQL_FIELD * fd ;
|
||||
MYSQL_ROW row ;
|
||||
|
||||
//....just curious....
|
||||
printf( "sizeof( MYSQL ) == %d\n", (int) sizeof( MYSQL ) ) ;
|
||||
if ( argc == 2 )
|
||||
{
|
||||
strcpy( szDB, argv[ 1 ] ) ;
|
||||
strcpy( szSQL, DEFALT_SQL_STMT ) ;
|
||||
if (!strcmp(szDB,"--debug"))
|
||||
{
|
||||
strcpy( szDB, "mysql" ) ;
|
||||
printf("Some mysql struct information (size and offset):\n");
|
||||
printf("net:\t%3d %3d\n",(int) sizeof(myData->net),
|
||||
(int) offsetof(MYSQL,net));
|
||||
printf("host:\t%3d %3d\n",(int) sizeof(myData->host),
|
||||
(int) offsetof(MYSQL,host));
|
||||
printf("port:\t%3d %3d\n", (int) sizeof(myData->port),
|
||||
(int) offsetof(MYSQL,port));
|
||||
printf("protocol_version:\t%3d %3d\n",
|
||||
(int) sizeof(myData->protocol_version),
|
||||
(int) offsetof(MYSQL,protocol_version));
|
||||
printf("thread_id:\t%3d %3d\n",(int) sizeof(myData->thread_id),
|
||||
(int) offsetof(MYSQL,thread_id));
|
||||
printf("affected_rows:\t%3d %3d\n",(int) sizeof(myData->affected_rows),
|
||||
(int) offsetof(MYSQL,affected_rows));
|
||||
printf("packet_length:\t%3d %3d\n",(int) sizeof(myData->packet_length),
|
||||
(int) offsetof(MYSQL,packet_length));
|
||||
printf("status:\t%3d %3d\n",(int) sizeof(myData->status),
|
||||
(int) offsetof(MYSQL,status));
|
||||
printf("fields:\t%3d %3d\n",(int) sizeof(myData->fields),
|
||||
(int) offsetof(MYSQL,fields));
|
||||
printf("field_alloc:\t%3d %3d\n",(int) sizeof(myData->field_alloc),
|
||||
(int) offsetof(MYSQL,field_alloc));
|
||||
printf("free_me:\t%3d %3d\n",(int) sizeof(myData->free_me),
|
||||
(int) offsetof(MYSQL,free_me));
|
||||
printf("options:\t%3d %3d\n",(int) sizeof(myData->options),
|
||||
(int) offsetof(MYSQL,options));
|
||||
puts("");
|
||||
}
|
||||
}
|
||||
else if ( argc > 2 ) {
|
||||
strcpy( szDB, argv[ 1 ] ) ;
|
||||
strcpy( szSQL, argv[ 2 ] ) ;
|
||||
}
|
||||
else {
|
||||
strcpy( szDB, "mysql" ) ;
|
||||
strcpy( szSQL, DEFALT_SQL_STMT ) ;
|
||||
}
|
||||
//....
|
||||
|
||||
if ( (myData = mysql_init((MYSQL*) 0)) &&
|
||||
mysql_real_connect( myData, NULL, NULL, NULL, NULL, MYSQL_PORT,
|
||||
NULL, 0 ) )
|
||||
{
|
||||
myData->reconnect= 1;
|
||||
if ( mysql_select_db( myData, szDB ) < 0 ) {
|
||||
printf( "Can't select the %s database !\n", szDB ) ;
|
||||
mysql_close( myData ) ;
|
||||
return 2 ;
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf( "Can't connect to the mysql server on port %d !\n",
|
||||
MYSQL_PORT ) ;
|
||||
mysql_close( myData ) ;
|
||||
return 1 ;
|
||||
}
|
||||
//....
|
||||
if ( ! mysql_query( myData, szSQL ) ) {
|
||||
res = mysql_store_result( myData ) ;
|
||||
i = (int) mysql_num_rows( res ) ; l = 1 ;
|
||||
printf( "Query: %s\nNumber of records found: %ld\n", szSQL, i ) ;
|
||||
//....we can get the field-specific characteristics here....
|
||||
for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
|
||||
strcpy( aszFlds[ x ], fd->name ) ;
|
||||
//....
|
||||
while ( row = mysql_fetch_row( res ) ) {
|
||||
j = mysql_num_fields( res ) ;
|
||||
printf( "Record #%ld:-\n", l++ ) ;
|
||||
for ( k = 0 ; k < j ; k++ )
|
||||
printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
|
||||
(((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
|
||||
puts( "==============================\n" ) ;
|
||||
}
|
||||
mysql_free_result( res ) ;
|
||||
}
|
||||
else printf( "Couldn't execute %s on the server !\n", szSQL ) ;
|
||||
//....
|
||||
puts( "==== Diagnostic info ====" ) ;
|
||||
pszT = mysql_get_client_info() ;
|
||||
printf( "Client info: %s\n", pszT ) ;
|
||||
//....
|
||||
pszT = mysql_get_host_info( myData ) ;
|
||||
printf( "Host info: %s\n", pszT ) ;
|
||||
//....
|
||||
pszT = mysql_get_server_info( myData ) ;
|
||||
printf( "Server info: %s\n", pszT ) ;
|
||||
//....
|
||||
res = mysql_list_processes( myData ) ; l = 1 ;
|
||||
if (res)
|
||||
{
|
||||
for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
|
||||
strcpy( aszFlds[ x ], fd->name ) ;
|
||||
while ( row = mysql_fetch_row( res ) ) {
|
||||
j = mysql_num_fields( res ) ;
|
||||
printf( "Process #%ld:-\n", l++ ) ;
|
||||
for ( k = 0 ; k < j ; k++ )
|
||||
printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
|
||||
(((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
|
||||
puts( "==============================\n" ) ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Got error %s when retreiving processlist\n",mysql_error(myData));
|
||||
}
|
||||
//....
|
||||
res = mysql_list_tables( myData, "%" ) ; l = 1 ;
|
||||
for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
|
||||
strcpy( aszFlds[ x ], fd->name ) ;
|
||||
while ( row = mysql_fetch_row( res ) ) {
|
||||
j = mysql_num_fields( res ) ;
|
||||
printf( "Table #%ld:-\n", l++ ) ;
|
||||
for ( k = 0 ; k < j ; k++ )
|
||||
printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
|
||||
(((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
|
||||
puts( "==============================\n" ) ;
|
||||
}
|
||||
//....
|
||||
pszT = mysql_stat( myData ) ;
|
||||
puts( pszT ) ;
|
||||
//....
|
||||
mysql_close( myData ) ;
|
||||
return 0 ;
|
||||
|
||||
}
|
||||
@@ -22,7 +22,7 @@ IF(WIN32)
|
||||
ADD_DEFINITIONS(-DUSE_TLS)
|
||||
ENDIF(WIN32)
|
||||
|
||||
ADD_DEFINITIONS(-DMYSQL_SERVER -DEMBEDDED_LIBRARY)
|
||||
ADD_DEFINITIONS(-DMYSQL_SERVER -DEMBEDDED_LIBRARY -DHAVE_DLOPEN)
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
||||
${CMAKE_SOURCE_DIR}/libmysqld
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "emb_qcache.h"
|
||||
#include "embedded_priv.h"
|
||||
|
||||
void Querycache_stream::store_char(char c)
|
||||
void Querycache_stream::store_uchar(uchar c)
|
||||
{
|
||||
if (data_end == cur_data)
|
||||
use_next_block(TRUE);
|
||||
@@ -142,7 +142,7 @@ void Querycache_stream::store_safe_str(const char *str, uint str_len)
|
||||
store_int(0);
|
||||
}
|
||||
|
||||
char Querycache_stream::load_char()
|
||||
uchar Querycache_stream::load_uchar()
|
||||
{
|
||||
if (cur_data == data_end)
|
||||
use_next_block(FALSE);
|
||||
@@ -301,8 +301,8 @@ uint emb_count_querycache_size(THD *thd)
|
||||
*data->embedded_info->prev_ptr= NULL; // this marks the last record
|
||||
cur_row= data->data;
|
||||
n_rows= data->rows;
|
||||
/* n_fields + n_rows + (field_info + strlen * n_rows) * n_fields */
|
||||
result+= (uint) (4+8 + (42 + 4*n_rows)*data->fields);
|
||||
/* n_fields + n_rows + field_info * n_fields */
|
||||
result+= (uint) (4+8 + 42*data->fields);
|
||||
|
||||
for(; field < field_end; field++)
|
||||
{
|
||||
@@ -313,13 +313,23 @@ uint emb_count_querycache_size(THD *thd)
|
||||
result+= field->def_length;
|
||||
}
|
||||
|
||||
for (; cur_row; cur_row=cur_row->next)
|
||||
if (thd->protocol == &thd->protocol_binary)
|
||||
{
|
||||
MYSQL_ROW col= cur_row->data;
|
||||
MYSQL_ROW col_end= col + data->fields;
|
||||
for (; col < col_end; col++)
|
||||
if (*col)
|
||||
result+= *(uint *)((*col) - sizeof(uint));
|
||||
result+= (uint) (4*n_rows);
|
||||
for (; cur_row; cur_row=cur_row->next)
|
||||
result+= cur_row->length;
|
||||
}
|
||||
else
|
||||
{
|
||||
result+= (uint) (4*n_rows*data->fields);
|
||||
for (; cur_row; cur_row=cur_row->next)
|
||||
{
|
||||
MYSQL_ROW col= cur_row->data;
|
||||
MYSQL_ROW col_end= col + data->fields;
|
||||
for (; col < col_end; col++)
|
||||
if (*col)
|
||||
result+= *(uint *)((*col) - sizeof(uint));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -353,10 +363,10 @@ void emb_store_querycache_result(Querycache_stream *dst, THD *thd)
|
||||
{
|
||||
dst->store_int((uint)field->length);
|
||||
dst->store_int((uint)field->max_length);
|
||||
dst->store_char((char)field->type);
|
||||
dst->store_uchar((uchar)field->type);
|
||||
dst->store_short((ushort)field->flags);
|
||||
dst->store_short((ushort)field->charsetnr);
|
||||
dst->store_char((char)field->decimals);
|
||||
dst->store_uchar((uchar)field->decimals);
|
||||
dst->store_str(field->name, field->name_length);
|
||||
dst->store_str(field->table, field->table_length);
|
||||
dst->store_str(field->org_name, field->org_name_length);
|
||||
@@ -366,14 +376,22 @@ void emb_store_querycache_result(Querycache_stream *dst, THD *thd)
|
||||
dst->store_safe_str(field->def, field->def_length);
|
||||
}
|
||||
|
||||
for (; cur_row; cur_row=cur_row->next)
|
||||
if (thd->protocol == &thd->protocol_binary)
|
||||
{
|
||||
MYSQL_ROW col= cur_row->data;
|
||||
MYSQL_ROW col_end= col + data->fields;
|
||||
for (; col < col_end; col++)
|
||||
for (; cur_row; cur_row=cur_row->next)
|
||||
dst->store_str((char *) cur_row->data, cur_row->length);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (; cur_row; cur_row=cur_row->next)
|
||||
{
|
||||
uint len= *col ? *(uint *)((*col) - sizeof(uint)) : 0;
|
||||
dst->store_safe_str(*col, len);
|
||||
MYSQL_ROW col= cur_row->data;
|
||||
MYSQL_ROW col_end= col + data->fields;
|
||||
for (; col < col_end; col++)
|
||||
{
|
||||
uint len= *col ? *(uint *)((*col) - sizeof(uint)) : 0;
|
||||
dst->store_safe_str(*col, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
DBUG_ASSERT(emb_count_querycache_size(thd) == dst->stored_size);
|
||||
@@ -408,10 +426,10 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
|
||||
{
|
||||
field->length= src->load_int();
|
||||
field->max_length= (unsigned int)src->load_int();
|
||||
field->type= (enum enum_field_types)src->load_char();
|
||||
field->type= (enum enum_field_types)src->load_uchar();
|
||||
field->flags= (unsigned int)src->load_short();
|
||||
field->charsetnr= (unsigned int)src->load_short();
|
||||
field->decimals= (unsigned int)src->load_char();
|
||||
field->decimals= src->load_uchar();
|
||||
|
||||
if (!(field->name= src->load_str(f_alloc, &field->name_length)) ||
|
||||
!(field->table= src->load_str(f_alloc,&field->table_length)) ||
|
||||
@@ -423,31 +441,48 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
|
||||
goto err;
|
||||
}
|
||||
|
||||
row= (MYSQL_ROWS *)alloc_root(&data->alloc,
|
||||
(uint) (rows * sizeof(MYSQL_ROWS) +
|
||||
rows*(data->fields+1)*sizeof(char*)));
|
||||
end_row= row + rows;
|
||||
columns= (MYSQL_ROW)end_row;
|
||||
|
||||
data->rows= rows;
|
||||
data->data= row;
|
||||
if (!rows)
|
||||
goto return_ok;
|
||||
|
||||
for (prev_row= &row->next; row < end_row; prev_row= &row->next, row++)
|
||||
if (thd->protocol == &thd->protocol_binary)
|
||||
{
|
||||
*prev_row= row;
|
||||
row->data= columns;
|
||||
MYSQL_ROW col_end= columns + data->fields;
|
||||
for (; columns < col_end; columns++)
|
||||
src->load_column(&data->alloc, columns);
|
||||
uint length;
|
||||
row= (MYSQL_ROWS *)alloc_root(&data->alloc, rows * sizeof(MYSQL_ROWS));
|
||||
end_row= row + rows;
|
||||
data->data= row;
|
||||
|
||||
*(columns++)= NULL;
|
||||
for (prev_row= &row->next; row < end_row; prev_row= &row->next, row++)
|
||||
{
|
||||
*prev_row= row;
|
||||
row->data= (MYSQL_ROW) src->load_str(&data->alloc, &length);
|
||||
row->length= length;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
row= (MYSQL_ROWS *)alloc_root(&data->alloc,
|
||||
(uint) (rows * sizeof(MYSQL_ROWS) +
|
||||
rows*(data->fields+1)*sizeof(char*)));
|
||||
end_row= row + rows;
|
||||
columns= (MYSQL_ROW)end_row;
|
||||
|
||||
data->data= row;
|
||||
|
||||
for (prev_row= &row->next; row < end_row; prev_row= &row->next, row++)
|
||||
{
|
||||
*prev_row= row;
|
||||
row->data= columns;
|
||||
MYSQL_ROW col_end= columns + data->fields;
|
||||
for (; columns < col_end; columns++)
|
||||
src->load_column(&data->alloc, columns);
|
||||
|
||||
*(columns++)= NULL;
|
||||
}
|
||||
}
|
||||
*prev_row= NULL;
|
||||
data->embedded_info->prev_ptr= prev_row;
|
||||
return_ok:
|
||||
send_eof(thd);
|
||||
net_send_eof(thd, thd->server_status, thd->total_warn_count);
|
||||
DBUG_RETURN(0);
|
||||
err:
|
||||
DBUG_RETURN(1);
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
data_end= cur_data + (block->used-headers_len);
|
||||
}
|
||||
|
||||
void store_char(char c);
|
||||
void store_uchar(uchar c);
|
||||
void store_short(ushort s);
|
||||
void store_int(uint i);
|
||||
void store_ll(ulonglong ll);
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
void store_str(const char *str, uint str_len);
|
||||
void store_safe_str(const char *str, uint str_len);
|
||||
|
||||
char load_char();
|
||||
uchar load_uchar();
|
||||
ushort load_short();
|
||||
uint load_int();
|
||||
ulonglong load_ll();
|
||||
@@ -79,3 +79,4 @@ public:
|
||||
uint emb_count_querycache_size(THD *thd);
|
||||
int emb_load_querycache_result(THD *thd, Querycache_stream *src);
|
||||
void emb_store_querycache_result(Querycache_stream *dst, THD* thd);
|
||||
void net_send_eof(THD *thd, uint server_status, uint total_warn_count);
|
||||
|
||||
@@ -61,9 +61,10 @@ void embedded_get_error(MYSQL *mysql, MYSQL_DATA *data)
|
||||
{
|
||||
NET *net= &mysql->net;
|
||||
struct embedded_query_result *ei= data->embedded_info;
|
||||
net->last_errno= ei->last_errno;
|
||||
strmake(net->last_error, ei->info, sizeof(net->last_error));
|
||||
net->client_last_errno= ei->last_errno;
|
||||
strmake(net->client_last_error, ei->info, sizeof(net->client_last_error)-1);
|
||||
memcpy(net->sqlstate, ei->sqlstate, sizeof(net->sqlstate));
|
||||
mysql->server_status= ei->server_status;
|
||||
my_free(data, MYF(0));
|
||||
}
|
||||
|
||||
@@ -87,6 +88,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
||||
|
||||
/* Clear result variables */
|
||||
thd->clear_error();
|
||||
thd->main_da.reset_diagnostics_area();
|
||||
mysql->affected_rows= ~(my_ulonglong) 0;
|
||||
mysql->field_count= 0;
|
||||
net_clear_error(net);
|
||||
@@ -110,12 +112,11 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
||||
arg_length= header_length;
|
||||
}
|
||||
|
||||
thd->net.no_send_error= 0;
|
||||
result= dispatch_command(command, thd, (char *) arg, arg_length);
|
||||
thd->cur_data= 0;
|
||||
|
||||
if (!skip_check)
|
||||
result= thd->net.last_errno ? -1 : 0;
|
||||
result= thd->is_error() ? -1 : 0;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -242,9 +243,11 @@ static my_bool emb_read_query_result(MYSQL *mysql)
|
||||
mysql->warning_count= res->embedded_info->warning_count;
|
||||
mysql->server_status= res->embedded_info->server_status;
|
||||
mysql->field_count= res->fields;
|
||||
mysql->fields= res->embedded_info->fields_list;
|
||||
mysql->affected_rows= res->embedded_info->affected_rows;
|
||||
mysql->insert_id= res->embedded_info->insert_id;
|
||||
if (!(mysql->fields= res->embedded_info->fields_list))
|
||||
{
|
||||
mysql->affected_rows= res->embedded_info->affected_rows;
|
||||
mysql->insert_id= res->embedded_info->insert_id;
|
||||
}
|
||||
net_clear_error(&mysql->net);
|
||||
mysql->info= 0;
|
||||
|
||||
@@ -370,7 +373,7 @@ static void emb_free_embedded_thd(MYSQL *mysql)
|
||||
static const char * emb_read_statistics(MYSQL *mysql)
|
||||
{
|
||||
THD *thd= (THD*)mysql->thd;
|
||||
return thd->net.last_error;
|
||||
return thd->is_error() ? thd->main_da.message() : "";
|
||||
}
|
||||
|
||||
|
||||
@@ -546,7 +549,6 @@ void end_embedded_server()
|
||||
{
|
||||
my_free((char*) copy_arguments_ptr, MYF(MY_ALLOW_ZERO_PTR));
|
||||
copy_arguments_ptr=0;
|
||||
release_ddl_log();
|
||||
clean_up(0);
|
||||
}
|
||||
|
||||
@@ -626,6 +628,7 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
|
||||
strmake(sctx->priv_host, (char*) my_localhost, MAX_HOSTNAME-1);
|
||||
sctx->priv_user= sctx->user= my_strdup(mysql->user, MYF(0));
|
||||
result= check_user(thd, COM_CONNECT, NULL, 0, db, true);
|
||||
net_end_statement(thd);
|
||||
emb_read_query_result(mysql);
|
||||
return result;
|
||||
}
|
||||
@@ -675,8 +678,10 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
|
||||
err:
|
||||
{
|
||||
NET *net= &mysql->net;
|
||||
memcpy(net->last_error, thd->net.last_error, sizeof(net->last_error));
|
||||
memcpy(net->sqlstate, thd->net.sqlstate, sizeof(net->sqlstate));
|
||||
strmake(net->client_last_error, thd->main_da.message(), sizeof(net->client_last_error)-1);
|
||||
memcpy(net->sqlstate,
|
||||
mysql_errno_to_sqlstate(thd->main_da.sql_errno()),
|
||||
sizeof(net->sqlstate)-1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -699,9 +704,8 @@ void THD::clear_data_list()
|
||||
|
||||
void THD::clear_error()
|
||||
{
|
||||
net.last_error[0]= 0;
|
||||
net.last_errno= 0;
|
||||
net.report_error= 0;
|
||||
if (main_da.is_error())
|
||||
main_da.reset_diagnostics_area();
|
||||
}
|
||||
|
||||
static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length,
|
||||
@@ -764,20 +768,18 @@ MYSQL_DATA *THD::alloc_new_dataset()
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
stores server_status and warning_count in the current
|
||||
query result structures
|
||||
/**
|
||||
Stores server_status and warning_count in the current
|
||||
query result structures.
|
||||
|
||||
SYNOPSIS
|
||||
write_eof_packet()
|
||||
thd current thread
|
||||
|
||||
NOTES
|
||||
should be called to after we get the recordset-result
|
||||
@param thd current thread
|
||||
|
||||
@note Should be called after we get the recordset-result.
|
||||
*/
|
||||
|
||||
static void write_eof_packet(THD *thd)
|
||||
static
|
||||
void
|
||||
write_eof_packet(THD *thd, uint server_status, uint total_warn_count)
|
||||
{
|
||||
if (!thd->mysql) // bootstrap file handling
|
||||
return;
|
||||
@@ -788,13 +790,13 @@ static void write_eof_packet(THD *thd)
|
||||
*/
|
||||
if (thd->is_fatal_error)
|
||||
thd->server_status&= ~SERVER_MORE_RESULTS_EXISTS;
|
||||
thd->cur_data->embedded_info->server_status= thd->server_status;
|
||||
thd->cur_data->embedded_info->server_status= server_status;
|
||||
/*
|
||||
Don't send warn count during SP execution, as the warn_list
|
||||
is cleared between substatements, and mysqltest gets confused
|
||||
*/
|
||||
thd->cur_data->embedded_info->warning_count=
|
||||
(thd->spcont ? 0 : min(thd->total_warn_count, 65535));
|
||||
(thd->spcont ? 0 : min(total_warn_count, 65535));
|
||||
}
|
||||
|
||||
|
||||
@@ -950,7 +952,7 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
|
||||
}
|
||||
|
||||
if (flags & SEND_EOF)
|
||||
write_eof_packet(thd);
|
||||
write_eof_packet(thd, thd->server_status, thd->total_warn_count);
|
||||
|
||||
DBUG_RETURN(prepare_for_send(list));
|
||||
err:
|
||||
@@ -990,17 +992,35 @@ bool Protocol_binary::write()
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Embedded library implementation of OK response.
|
||||
|
||||
This function is used by the server to write 'OK' packet to
|
||||
the "network" when the server is compiled as an embedded library.
|
||||
Since there is no network in the embedded configuration,
|
||||
a different implementation is necessary.
|
||||
Instead of marshalling response parameters to a network representation
|
||||
and then writing it to the socket, here we simply copy the data to the
|
||||
corresponding client-side connection structures.
|
||||
|
||||
@sa Server implementation of net_send_ok in protocol.cc for
|
||||
description of the arguments.
|
||||
|
||||
@return The function does not return errors.
|
||||
*/
|
||||
|
||||
void
|
||||
send_ok(THD *thd,ha_rows affected_rows,ulonglong id,const char *message)
|
||||
net_send_ok(THD *thd,
|
||||
uint server_status, uint total_warn_count,
|
||||
ha_rows affected_rows, ulonglong id, const char *message)
|
||||
{
|
||||
DBUG_ENTER("send_ok");
|
||||
DBUG_ENTER("emb_net_send_ok");
|
||||
MYSQL_DATA *data;
|
||||
MYSQL *mysql= thd->mysql;
|
||||
|
||||
|
||||
if (!mysql) // bootstrap file handling
|
||||
DBUG_VOID_RETURN;
|
||||
if (thd->net.no_send_ok) // hack for re-parsing queries
|
||||
DBUG_VOID_RETURN;
|
||||
if (!(data= thd->alloc_new_dataset()))
|
||||
return;
|
||||
data->embedded_info->affected_rows= affected_rows;
|
||||
@@ -1009,15 +1029,24 @@ send_ok(THD *thd,ha_rows affected_rows,ulonglong id,const char *message)
|
||||
strmake(data->embedded_info->info, message,
|
||||
sizeof(data->embedded_info->info)-1);
|
||||
|
||||
write_eof_packet(thd);
|
||||
write_eof_packet(thd, server_status, total_warn_count);
|
||||
thd->cur_data= 0;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Embedded library implementation of EOF response.
|
||||
|
||||
@sa net_send_ok
|
||||
|
||||
@return This function does not return errors.
|
||||
*/
|
||||
|
||||
void
|
||||
send_eof(THD *thd)
|
||||
net_send_eof(THD *thd, uint server_status, uint total_warn_count)
|
||||
{
|
||||
write_eof_packet(thd);
|
||||
write_eof_packet(thd, server_status, total_warn_count);
|
||||
thd->cur_data= 0;
|
||||
}
|
||||
|
||||
@@ -1030,6 +1059,7 @@ void net_send_error_packet(THD *thd, uint sql_errno, const char *err)
|
||||
ei->last_errno= sql_errno;
|
||||
strmake(ei->info, err, sizeof(ei->info)-1);
|
||||
strmov(ei->sqlstate, mysql_errno_to_sqlstate(sql_errno));
|
||||
ei->server_status= thd->server_status;
|
||||
thd->cur_data= 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -209,8 +209,9 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
||||
DBUG_RETURN(mysql);
|
||||
|
||||
error:
|
||||
DBUG_PRINT("error",("message: %u (%s)", mysql->net.last_errno,
|
||||
mysql->net.last_error));
|
||||
DBUG_PRINT("error",("message: %u (%s)",
|
||||
mysql->net.client_last_errno,
|
||||
mysql->net.client_last_error));
|
||||
{
|
||||
/* Free alloced memory */
|
||||
my_bool free_me=mysql->free_me;
|
||||
|
||||
@@ -973,14 +973,7 @@ SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
|
||||
--echo
|
||||
--echo ** update from master **
|
||||
connection master;
|
||||
#######################################
|
||||
# This test should be uncommented
|
||||
# once bug30674 is patched
|
||||
#######################################
|
||||
|
||||
#***************************
|
||||
#UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
|
||||
#***************************
|
||||
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
|
||||
|
||||
--replace_column 5 CURRENT_TIMESTAMP
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
|
||||
|
||||
@@ -5,10 +5,6 @@ connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT1,);
|
||||
# Check that server1 has NDB support
|
||||
connection server1;
|
||||
disable_query_log;
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
flush tables;
|
||||
--require r/true.require
|
||||
select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
|
||||
--source include/ndb_not_readonly.inc
|
||||
@@ -17,14 +13,32 @@ enable_query_log;
|
||||
# Check that server2 has NDB support
|
||||
connection server2;
|
||||
disable_query_log;
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
flush tables;
|
||||
--require r/true.require
|
||||
select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
|
||||
--source include/ndb_not_readonly.inc
|
||||
enable_query_log;
|
||||
|
||||
# Set the default connection to 'server1'
|
||||
# cleanup
|
||||
|
||||
connection server1;
|
||||
disable_query_log;
|
||||
disable_warnings;
|
||||
--error 0,1051
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
|
||||
flush tables;
|
||||
flush status;
|
||||
enable_warnings;
|
||||
enable_query_log;
|
||||
|
||||
connection server2;
|
||||
disable_query_log;
|
||||
disable_warnings;
|
||||
--error 0,1051
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
|
||||
flush tables;
|
||||
flush status;
|
||||
enable_warnings;
|
||||
enable_query_log;
|
||||
|
||||
# Set the default connection
|
||||
connection server1;
|
||||
|
||||
@@ -724,6 +724,19 @@ set @@sort_buffer_size=default;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# Bug #32815: query with ORDER BY and a possible ref_or_null access
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (id int, type char(6), d int, INDEX idx(id,d)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES
|
||||
(191, 'member', 1), (NULL, 'member', 3), (NULL, 'member', 4), (201, 'member', 2);
|
||||
|
||||
EXPLAIN SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
|
||||
SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
# Test of behaviour with CREATE ... SELECT
|
||||
#
|
||||
|
||||
|
||||
@@ -434,8 +434,8 @@ execute stmt1 ;
|
||||
let $1= 3 ;
|
||||
while ($1)
|
||||
{
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
deallocate prepare stmt1 ;
|
||||
dec $1 ;
|
||||
|
||||
@@ -304,6 +304,7 @@ sub mtr_report_stats ($) {
|
||||
/Slave: Error .*Unknown table/ or
|
||||
/Slave: Error in Write_rows event: / or
|
||||
/Slave: Field .* of table .* has no default value/ or
|
||||
/Slave: Field .* doesn't have a default value/ or
|
||||
/Slave: Query caused different errors on master and slave/ or
|
||||
/Slave: Table .* doesn't exist/ or
|
||||
/Slave: Table width mismatch/ or
|
||||
@@ -353,6 +354,9 @@ sub mtr_report_stats ($) {
|
||||
# BUG#29839 - lowercase_table3.test: Cannot find table test/T1
|
||||
# from the internal data dictiona
|
||||
/Cannot find table test\/BUG29839 from the internal data dictionary/ or
|
||||
# BUG#32080 - Excessive warnings on Solaris: setrlimit could not
|
||||
# change the size of core files
|
||||
/setrlimit could not change the size of core files to 'infinity'/ or
|
||||
|
||||
# rpl_extrColmaster_*.test, the slave thread produces warnings
|
||||
# when it get updates to a table that has more columns on the
|
||||
@@ -360,7 +364,6 @@ sub mtr_report_stats ($) {
|
||||
/Slave: Unknown column 'c7' in 't15' Error_code: 1054/ or
|
||||
/Slave: Can't DROP 'c7'.* 1091/ or
|
||||
/Slave: Key column 'c6'.* 1072/
|
||||
|
||||
)
|
||||
{
|
||||
next; # Skip these lines
|
||||
|
||||
@@ -129,7 +129,15 @@ our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
|
||||
our $default_vardir;
|
||||
|
||||
our $opt_usage;
|
||||
our $opt_suites= "main,binlog,rpl,rpl_ndb,ndb"; # Default suites to run
|
||||
our $opt_suites;
|
||||
our $opt_suites_default= "main,binlog,rpl,rpl_ndb,ndb"; # Default suites to run
|
||||
our @extra_suites=
|
||||
(
|
||||
["mysql-5.1-new-ndb", "ndb_team"],
|
||||
["mysql-5.1-telco-6.2", "ndb_team"],
|
||||
["mysql-5.1-telco-6.3", "ndb_team"],
|
||||
);
|
||||
|
||||
|
||||
our $opt_script_debug= 0; # Script debugging, enable with --script-debug
|
||||
our $opt_verbose= 0; # Verbose output, enable with --verbose
|
||||
@@ -397,6 +405,20 @@ sub main () {
|
||||
else
|
||||
{
|
||||
# Figure out which tests we are going to run
|
||||
if (!$opt_suites)
|
||||
{
|
||||
# use default and add any extra_suites as defined
|
||||
$opt_suites= $opt_suites_default;
|
||||
my $ddd= basename(dirname($glob_mysql_test_dir));
|
||||
foreach my $extra_suite (@extra_suites)
|
||||
{
|
||||
if ($extra_suite->[0] eq "$ddd")
|
||||
{
|
||||
$opt_suites= "$extra_suite->[1],$opt_suites";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $tests= collect_test_cases($opt_suites);
|
||||
|
||||
# Turn off NDB and other similar options if no tests use it
|
||||
@@ -5195,7 +5217,7 @@ Options to control what test suites or cases to run
|
||||
start-from=PREFIX Run test cases starting from test prefixed with PREFIX
|
||||
suite[s]=NAME1,..,NAMEN Collect tests in suites from the comma separated
|
||||
list of suite names.
|
||||
The default is: "$opt_suites"
|
||||
The default is: "$opt_suites_default"
|
||||
skip-rpl Skip the replication test cases.
|
||||
skip-im Don't start IM, and skip the IM test cases
|
||||
big-test Set the environment variable BIG_TEST, which can be
|
||||
|
||||
@@ -12665,7 +12665,7 @@ t6 CREATE TABLE `t6` (
|
||||
`b` tinyblob,
|
||||
`c` int(11) DEFAULT NULL,
|
||||
KEY `a` (`a`)
|
||||
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
|
||||
) ENGINE=ARCHIVE AUTO_INCREMENT=36 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1, t2, t4, t5, t6;
|
||||
create table t1 (i int) engine=archive;
|
||||
insert into t1 values (1);
|
||||
|
||||
@@ -4,14 +4,14 @@ SELECT @@session.sql_big_selects;
|
||||
1
|
||||
SELECT @@global.max_join_size;
|
||||
@@global.max_join_size
|
||||
-1
|
||||
18446744073709551615
|
||||
change_user
|
||||
SELECT @@session.sql_big_selects;
|
||||
@@session.sql_big_selects
|
||||
1
|
||||
SELECT @@global.max_join_size;
|
||||
@@global.max_join_size
|
||||
-1
|
||||
18446744073709551615
|
||||
SET @@global.max_join_size = 10000;
|
||||
SET @@session.max_join_size = default;
|
||||
change_user
|
||||
|
||||
@@ -1705,4 +1705,42 @@ create table t1 as select 1;
|
||||
create table t2 as select f1() from t1;
|
||||
drop table t1,t2;
|
||||
drop function f1;
|
||||
create table t1 like information_schema.processlist;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`ID` bigint(4) NOT NULL DEFAULT '0',
|
||||
`USER` varchar(16) NOT NULL DEFAULT '',
|
||||
`HOST` varchar(64) NOT NULL DEFAULT '',
|
||||
`DB` varchar(64) DEFAULT NULL,
|
||||
`COMMAND` varchar(16) NOT NULL DEFAULT '',
|
||||
`TIME` bigint(7) NOT NULL DEFAULT '0',
|
||||
`STATE` varchar(64) DEFAULT NULL,
|
||||
`INFO` longtext
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||
drop table t1;
|
||||
create temporary table t1 like information_schema.processlist;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TEMPORARY TABLE `t1` (
|
||||
`ID` bigint(4) NOT NULL DEFAULT '0',
|
||||
`USER` varchar(16) NOT NULL DEFAULT '',
|
||||
`HOST` varchar(64) NOT NULL DEFAULT '',
|
||||
`DB` varchar(64) DEFAULT NULL,
|
||||
`COMMAND` varchar(16) NOT NULL DEFAULT '',
|
||||
`TIME` bigint(7) NOT NULL DEFAULT '0',
|
||||
`STATE` varchar(64) DEFAULT NULL,
|
||||
`INFO` longtext
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||
drop table t1;
|
||||
create table t1 like information_schema.character_sets;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
|
||||
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL DEFAULT '',
|
||||
`DESCRIPTION` varchar(60) NOT NULL DEFAULT '',
|
||||
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
|
||||
@@ -85,3 +85,10 @@ select 1;
|
||||
1
|
||||
unlock tables;
|
||||
End of 5.0 tests
|
||||
create database mysql_test;
|
||||
create table mysql_test.t1(f1 int);
|
||||
create table mysql_test.`#sql-347f_7` (f1 int);
|
||||
create table mysql_test.`#sql-347f_8` (f1 int);
|
||||
drop table mysql_test.`#sql-347f_8`;
|
||||
drop database mysql_test;
|
||||
End of 5.1 tests
|
||||
|
||||
@@ -403,9 +403,10 @@ ERROR 42S02: Table 'mysql.event' doesn't exist
|
||||
DROP DATABASE IF EXISTS mysqltest_no_such_database;
|
||||
Warnings:
|
||||
Note 1008 Can't drop database 'mysqltest_no_such_database'; database doesn't exist
|
||||
Error 1146 Table 'mysql.event' doesn't exist
|
||||
CREATE DATABASE mysqltest_db2;
|
||||
DROP DATABASE mysqltest_db2;
|
||||
Warnings:
|
||||
Error 1146 Table 'mysql.event' doesn't exist
|
||||
OK, there is an unnecessary warning about the non-existent table
|
||||
but it's not easy to fix and no one complained about it.
|
||||
A similar warning is printed if mysql.proc is missing.
|
||||
|
||||
@@ -87,3 +87,23 @@ Warnings:
|
||||
Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` having 1
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
CREATE TABLE t1(c INT);
|
||||
INSERT INTO t1 VALUES (),();
|
||||
CREATE TABLE t2 (b INT,
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
|
||||
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b));
|
||||
INSERT INTO t2 VALUES (),(),();
|
||||
EXPLAIN SELECT 1 FROM
|
||||
(SELECT 1 FROM t2,t1 WHERE b < c GROUP BY 1 LIMIT 1) AS d2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
X X X X X X X X X const row not found
|
||||
X X X X X X X X X
|
||||
X X X X X X X X X Range checked for each record (index map: 0xFFFFFFFFFF)
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
@@ -1955,6 +1955,117 @@ a
|
||||
2
|
||||
DROP TABLE federated.t1;
|
||||
DROP TABLE federated.t1;
|
||||
create table t1 (a varchar(256));
|
||||
drop view if exists v1;
|
||||
create view v1 as select a from t1;
|
||||
create table t1
|
||||
(a varchar(256)) engine=federated
|
||||
connection='mysql://root@127.0.0.1:SLAVE_PORT/test/v1';
|
||||
select 1 from t1 order by a;
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
drop table t1;
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
End of 5.1 tests
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.55555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2);
|
||||
format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.55555,3) format(123456.5555,4) format(1234567.5555,5) format("12345.2399",2)
|
||||
2 123.6 1,234.56 12,345.556 123,456.5555 1,234,567.55550 12,345.24
|
||||
@@ -212,6 +212,11 @@ test
|
||||
SELECT NAME_CONST('test', 'test');
|
||||
test
|
||||
test
|
||||
CREATE TABLE t1 (a int);
|
||||
INSERT INTO t1 VALUES (5), (2);
|
||||
SELECT NAME_CONST(x,2) FROM (SELECT a x FROM t1) t;
|
||||
ERROR HY000: Incorrect arguments to NAME_CONST
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (), (), ();
|
||||
SELECT NAME_CONST(a, '1') FROM t1;
|
||||
|
||||
@@ -1246,6 +1246,18 @@ select concat(a,ifnull(min(date_format(now(), '%Y-%m-%d')),' ull')) from t1;
|
||||
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation 'concat'
|
||||
set lc_time_names=en_US;
|
||||
drop table t1;
|
||||
select DATE_ADD('20071108181000', INTERVAL 1 DAY);
|
||||
DATE_ADD('20071108181000', INTERVAL 1 DAY)
|
||||
2007-11-09 18:10:00
|
||||
select DATE_ADD(20071108181000, INTERVAL 1 DAY);
|
||||
DATE_ADD(20071108181000, INTERVAL 1 DAY)
|
||||
2007-11-09 18:10:00
|
||||
select DATE_ADD('20071108', INTERVAL 1 DAY);
|
||||
DATE_ADD('20071108', INTERVAL 1 DAY)
|
||||
2007-11-09
|
||||
select DATE_ADD(20071108, INTERVAL 1 DAY);
|
||||
DATE_ADD(20071108, INTERVAL 1 DAY)
|
||||
2007-11-09
|
||||
End of 5.0 tests
|
||||
select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND);
|
||||
date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND)
|
||||
|
||||
@@ -680,7 +680,7 @@ def test t1 t1 g g 255 4294967295 0 Y 144 0 63
|
||||
g
|
||||
select asbinary(g) from t1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def asbinary(g) 252 16777216 0 Y 128 0 63
|
||||
def asbinary(g) 252 4294967295 0 Y 128 0 63
|
||||
asbinary(g)
|
||||
drop table t1;
|
||||
create table t1 (a TEXT, b GEOMETRY NOT NULL, SPATIAL KEY(b));
|
||||
@@ -742,6 +742,38 @@ select geomfromtext(col9,col89) as a from t1;
|
||||
a
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
geomdata polygon NOT NULL,
|
||||
SPATIAL KEY index_geom (geomdata)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin2 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED;
|
||||
CREATE TABLE t2 (
|
||||
geomdata polygon NOT NULL,
|
||||
SPATIAL KEY index_geom (geomdata)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin2 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED;
|
||||
CREATE TABLE t3
|
||||
select
|
||||
aswkb(ws.geomdata) AS geomdatawkb
|
||||
from
|
||||
t1 ws
|
||||
union
|
||||
select
|
||||
aswkb(ws.geomdata) AS geomdatawkb
|
||||
from
|
||||
t2 ws;
|
||||
describe t3;
|
||||
Field Type Null Key Default Extra
|
||||
geomdatawkb longblob YES NULL
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
create table t1(col1 geometry default null,col15 geometrycollection not
|
||||
null,spatial index(col15),index(col1(15)))engine=myisam;
|
||||
insert into t1 set col15 = GeomFromText('POINT(6 5)');
|
||||
insert into t1 set col15 = GeomFromText('POINT(6 5)');
|
||||
check table t1 extended;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
drop table t1;
|
||||
End of 4.1 tests
|
||||
create table t1 (s1 geometry not null,s2 char(100));
|
||||
create trigger t1_bu before update on t1 for each row set new.s1 = null;
|
||||
@@ -934,6 +966,12 @@ COUNT(*)
|
||||
2
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
create table `t1` (`col002` point)engine=myisam;
|
||||
insert into t1 values (),(),();
|
||||
select min(`col002`) from t1 union select `col002` from t1;
|
||||
min(`col002`)
|
||||
NULL
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
|
||||
create view v1 as select * from t1;
|
||||
|
||||
@@ -1269,9 +1269,7 @@ use test;
|
||||
FLUSH PRIVILEGES without procs_priv table.
|
||||
RENAME TABLE mysql.procs_priv TO mysql.procs_gone;
|
||||
FLUSH PRIVILEGES;
|
||||
Warnings:
|
||||
Error 1146 Table 'mysql.procs_priv' doesn't exist
|
||||
Error 1548 Cannot load from mysql.mysql.procs_priv. The table is probably corrupted
|
||||
ERROR 42S02: Table 'mysql.procs_priv' doesn't exist
|
||||
Assigning privileges without procs_priv table.
|
||||
CREATE DATABASE mysqltest1;
|
||||
CREATE PROCEDURE mysqltest1.test() SQL SECURITY DEFINER
|
||||
|
||||
@@ -2326,3 +2326,49 @@ a
|
||||
2
|
||||
4
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3);
|
||||
INSERT INTO t1 SELECT a + 1, b FROM t1;
|
||||
INSERT INTO t1 SELECT a + 2, b FROM t1;
|
||||
EXPLAIN
|
||||
SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 12 Using temporary; Using filesort
|
||||
SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC;
|
||||
a MIN(b) MAX(b)
|
||||
4 1 3
|
||||
3 1 3
|
||||
2 1 3
|
||||
1 1 3
|
||||
CREATE INDEX break_it ON t1 (a, b);
|
||||
EXPLAIN
|
||||
SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL break_it 10 NULL 7 Using index for group-by
|
||||
SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a;
|
||||
a MIN(b) MAX(b)
|
||||
1 1 3
|
||||
2 1 3
|
||||
3 1 3
|
||||
4 1 3
|
||||
EXPLAIN
|
||||
SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL break_it 10 NULL 7 Using index for group-by; Using temporary; Using filesort
|
||||
SELECT a, MIN(b), MAX(b) FROM t1 GROUP BY a ORDER BY a DESC;
|
||||
a MIN(b) MAX(b)
|
||||
4 1 3
|
||||
3 1 3
|
||||
2 1 3
|
||||
1 1 3
|
||||
EXPLAIN
|
||||
SELECT a, MIN(b), MAX(b), AVG(b) FROM t1 GROUP BY a ORDER BY a DESC;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL break_it 10 NULL 12 Using index
|
||||
SELECT a, MIN(b), MAX(b), AVG(b) FROM t1 GROUP BY a ORDER BY a DESC;
|
||||
a MIN(b) MAX(b) AVG(b)
|
||||
4 1 3 2.0000
|
||||
3 1 3 2.0000
|
||||
2 1 3 2.0000
|
||||
1 1 3 2.0000
|
||||
DROP TABLE t1;
|
||||
|
||||
@@ -342,6 +342,8 @@ create table t4 (a int);
|
||||
insert into t4 values (1),(4),(3);
|
||||
set @save_join_buffer_size=@@join_buffer_size;
|
||||
set join_buffer_size= 4000;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect join_buffer_size value: '4000'
|
||||
explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
|
||||
from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
|
||||
where (A.key1 < 500000 or A.key2 < 3)
|
||||
|
||||
@@ -1611,4 +1611,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE tables ALL NULL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases
|
||||
Warnings:
|
||||
Note 1003 select 1 AS `1` from `information_schema`.`tables`
|
||||
use information_schema;
|
||||
show events;
|
||||
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
|
||||
show events from information_schema;
|
||||
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
|
||||
show events where Db= 'information_schema';
|
||||
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
|
||||
use test;
|
||||
End of 5.1 tests.
|
||||
|
||||
@@ -1768,6 +1768,8 @@ show variables like "innodb_thread_concurrency";
|
||||
Variable_name Value
|
||||
innodb_thread_concurrency 8
|
||||
set global innodb_thread_concurrency=1001;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect thread_concurrency value: '1001'
|
||||
show variables like "innodb_thread_concurrency";
|
||||
Variable_name Value
|
||||
innodb_thread_concurrency 1000
|
||||
@@ -1787,6 +1789,8 @@ show variables like "innodb_concurrency_tickets";
|
||||
Variable_name Value
|
||||
innodb_concurrency_tickets 1000
|
||||
set global innodb_concurrency_tickets=0;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect concurrency_tickets value: '0'
|
||||
show variables like "innodb_concurrency_tickets";
|
||||
Variable_name Value
|
||||
innodb_concurrency_tickets 1
|
||||
|
||||
@@ -677,6 +677,8 @@ INSERT INTO t1(b,c) SELECT b,c FROM t2;
|
||||
UPDATE t2 SET c='2007-01-03';
|
||||
INSERT INTO t1(b,c) SELECT b,c FROM t2;
|
||||
set @@sort_buffer_size=8192;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect sort_buffer_size value: '8192'
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
3072
|
||||
@@ -1342,6 +1344,18 @@ t1 CREATE TABLE `t1` (
|
||||
UNIQUE KEY `aa` (`a`(1))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (id int, type char(6), d int, INDEX idx(id,d)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES
|
||||
(191, 'member', 1), (NULL, 'member', 3), (NULL, 'member', 4), (201, 'member', 2);
|
||||
EXPLAIN SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL idx NULL NULL NULL 3 Using where; Using filesort
|
||||
SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
|
||||
id type d
|
||||
191 member 1
|
||||
NULL member 3
|
||||
NULL member 4
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
CREATE TABLE `t2` (
|
||||
`k` int(11) NOT NULL auto_increment,
|
||||
|
||||
@@ -276,6 +276,8 @@ Variable_name Value
|
||||
Key_blocks_unused KEY_BLOCKS_UNUSED
|
||||
set global keycache2.key_buffer_size=0;
|
||||
set global keycache3.key_buffer_size=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect key_buffer_size value: '100'
|
||||
set global keycache3.key_buffer_size=0;
|
||||
create table t1 (mytext text, FULLTEXT (mytext));
|
||||
insert t1 values ('aaabbb');
|
||||
|
||||
@@ -113,4 +113,34 @@ handler t1 open;
|
||||
ERROR HY000: Table storage engine for 't1' doesn't have this option
|
||||
--> client 1
|
||||
drop table t1;
|
||||
drop table if exists t1;
|
||||
create table t1 (i int);
|
||||
connection: default
|
||||
lock tables t1 write;
|
||||
connection: flush
|
||||
flush tables with read lock;;
|
||||
connection: default
|
||||
alter table t1 add column j int;
|
||||
connection: insert
|
||||
insert into t1 values (1,2);;
|
||||
connection: default
|
||||
unlock tables;
|
||||
connection: flush
|
||||
select * from t1;
|
||||
i j
|
||||
unlock tables;
|
||||
select * from t1;
|
||||
i j
|
||||
1 2
|
||||
drop table t1;
|
||||
drop table if exists t1;
|
||||
create table t1 (i int);
|
||||
connection: default
|
||||
lock tables t1 write;
|
||||
connection: flush
|
||||
flush tables with read lock;;
|
||||
connection: default
|
||||
flush tables;
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
|
||||
@@ -927,6 +927,43 @@ CREATE TABLE t2 (c1 INT) ENGINE=MERGE UNION=(t1) INSERT_METHOD=FIRST;
|
||||
CREATE TABLE IF NOT EXISTS t1 SELECT * FROM t2;
|
||||
ERROR HY000: You can't specify target table 't1' for update in FROM clause
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (id INT NOT NULL, ref INT NOT NULL, INDEX (id)) ENGINE=MyISAM;
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
INSERT INTO t2 (id, ref) VALUES (1,3), (2,1), (3,2), (4,5), (4,4);
|
||||
INSERT INTO t1 SELECT * FROM t2;
|
||||
INSERT INTO t1 SELECT * FROM t2;
|
||||
CREATE TABLE t3 (id INT NOT NULL, ref INT NOT NULL, INDEX (id)) ENGINE=MERGE
|
||||
UNION(t1);
|
||||
SELECT * FROM t3 AS a INNER JOIN t3 AS b USING (id) WHERE a.ref < b.ref;
|
||||
id ref ref
|
||||
4 4 5
|
||||
4 4 5
|
||||
4 4 5
|
||||
4 4 5
|
||||
SELECT * FROM t3;
|
||||
id ref
|
||||
1 3
|
||||
2 1
|
||||
3 2
|
||||
4 5
|
||||
4 4
|
||||
1 3
|
||||
2 1
|
||||
3 2
|
||||
4 5
|
||||
4 4
|
||||
DELETE FROM a USING t3 AS a INNER JOIN t3 AS b USING (id) WHERE a.ref < b.ref;
|
||||
SELECT * FROM t3;
|
||||
id ref
|
||||
1 3
|
||||
2 1
|
||||
3 2
|
||||
4 5
|
||||
1 3
|
||||
2 1
|
||||
3 2
|
||||
4 5
|
||||
DROP TABLE t1, t2, t3;
|
||||
End of 5.0 tests
|
||||
create table t1 (c1 int, index(c1));
|
||||
create table t2 (c1 int, index(c1)) engine=merge union=(t1);
|
||||
|
||||
@@ -1809,6 +1809,28 @@ CHECK TABLE t1 EXTENDED;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id)) ENGINE=MyISAM;
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
INSERT INTO t2 (id, ref) VALUES (1,3), (2,1), (3,2), (4,5), (4,4);
|
||||
INSERT INTO t1 SELECT * FROM t2;
|
||||
SELECT * FROM t1 AS a INNER JOIN t1 AS b USING (id) WHERE a.ref < b.ref;
|
||||
id ref ref
|
||||
4 4 5
|
||||
SELECT * FROM t1;
|
||||
id ref
|
||||
1 3
|
||||
2 1
|
||||
3 2
|
||||
4 5
|
||||
4 4
|
||||
DELETE FROM a USING t1 AS a INNER JOIN t1 AS b USING (id) WHERE a.ref < b.ref;
|
||||
SELECT * FROM t1;
|
||||
id ref
|
||||
1 3
|
||||
2 1
|
||||
3 2
|
||||
4 5
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
create table t1 (a int not null, key `a` (a) key_block_size=1024);
|
||||
show create table t1;
|
||||
|
||||
@@ -7,3 +7,7 @@ select 1+2;
|
||||
SHOW GLOBAL VARIABLES LIKE 'thread_handling';
|
||||
Variable_name Value
|
||||
thread_handling no-threads
|
||||
select @@session.thread_handling;
|
||||
ERROR HY000: Variable 'thread_handling' is a GLOBAL variable
|
||||
set GLOBAL thread_handling='one-thread';
|
||||
ERROR HY000: Variable 'thread_handling' is a read only variable
|
||||
|
||||
@@ -82,4 +82,22 @@ c1 c2
|
||||
-r- =raker=
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#32533: SELECT INTO OUTFILE never escapes multibyte character
|
||||
#
|
||||
CREATE TABLE t1 (c1 VARCHAR(256));
|
||||
INSERT INTO t1 VALUES (0xC3);
|
||||
SELECT HEX(c1) FROM t1;
|
||||
HEX(c1)
|
||||
C3
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug32533.txt' FIELDS ENCLOSED BY 0xC3 FROM t1;
|
||||
TRUNCATE t1;
|
||||
SELECT HEX(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug32533.txt'));
|
||||
HEX(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug32533.txt'))
|
||||
C35CC3C30A
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug32533.txt' INTO TABLE t1 FIELDS ENCLOSED BY 0xC3;
|
||||
SELECT HEX(c1) FROM t1;
|
||||
HEX(c1)
|
||||
C3
|
||||
DROP TABLE t1;
|
||||
# End of 5.0 tests.
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
set global max_allowed_packet=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_allowed_packet value: '100'
|
||||
set max_allowed_packet=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_allowed_packet value: '100'
|
||||
set global net_buffer_length=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '100'
|
||||
set net_buffer_length=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '100'
|
||||
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
|
||||
len
|
||||
1024
|
||||
|
||||
@@ -1297,6 +1297,19 @@ create table t1
|
||||
partition by key(s1) partitions 3;
|
||||
insert into t1 values (null,null);
|
||||
drop table t1;
|
||||
create table t1 (
|
||||
c0 int,
|
||||
c1 bigint,
|
||||
c2 set('sweet'),
|
||||
key (c2,c1,c0),
|
||||
key(c0)
|
||||
) engine=myisam partition by hash (month(c0)) partitions 5;
|
||||
insert ignore into t1 set c0 = -6502262, c1 = 3992917, c2 = 35019;
|
||||
insert ignore into t1 set c0 = 241221, c1 = -6862346, c2 = 56644;
|
||||
select c1 from t1 group by (select c0 from t1 limit 1);
|
||||
c1
|
||||
-6862346
|
||||
drop table t1;
|
||||
CREATE TABLE t1(a int)
|
||||
PARTITION BY RANGE (a) (
|
||||
PARTITION p1 VALUES LESS THAN (10),
|
||||
@@ -1354,4 +1367,54 @@ PARTITION p2 VALUES LESS THAN (18446744073709551615),
|
||||
PARTITION p3 VALUES LESS THAN MAXVALUE
|
||||
);
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1
|
||||
(int_column INT, char_column CHAR(5),
|
||||
PRIMARY KEY(char_column,int_column))
|
||||
PARTITION BY KEY(char_column,int_column)
|
||||
PARTITIONS 101;
|
||||
INSERT INTO t1 (int_column, char_column) VALUES
|
||||
( 39868 ,'zZZRW'),
|
||||
( 545592 ,'zZzSD'),
|
||||
( 4936 ,'zzzsT'),
|
||||
( 9274 ,'ZzZSX'),
|
||||
( 970185 ,'ZZzTN'),
|
||||
( 786036 ,'zZzTO'),
|
||||
( 37240 ,'zZzTv'),
|
||||
( 313801 ,'zzzUM'),
|
||||
( 782427 ,'ZZZva'),
|
||||
( 907955 ,'zZZvP'),
|
||||
( 453491 ,'zzZWV'),
|
||||
( 756594 ,'ZZZXU'),
|
||||
( 718061 ,'ZZzZH');
|
||||
SELECT * FROM t1 ORDER BY char_column DESC;
|
||||
int_column char_column
|
||||
718061 ZZzZH
|
||||
756594 ZZZXU
|
||||
453491 zzZWV
|
||||
907955 zZZvP
|
||||
782427 ZZZva
|
||||
313801 zzzUM
|
||||
37240 zZzTv
|
||||
786036 zZzTO
|
||||
970185 ZZzTN
|
||||
9274 ZzZSX
|
||||
4936 zzzsT
|
||||
545592 zZzSD
|
||||
39868 zZZRW
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
|
||||
user CHAR(25), PRIMARY KEY(id))
|
||||
PARTITION BY RANGE(id)
|
||||
SUBPARTITION BY hash(id) subpartitions 2
|
||||
(PARTITION pa1 values less than (10),
|
||||
PARTITION pa2 values less than (20),
|
||||
PARTITION pa11 values less than MAXVALUE);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
|
||||
`user` char(25) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
drop database if exists db99;
|
||||
drop table if exists t1;
|
||||
create database db99;
|
||||
use db99;
|
||||
create table t1 (a int not null)
|
||||
@@ -11,3 +12,80 @@ alter table t1 add partition (partition p2 values in (3));
|
||||
alter table t1 drop partition p2;
|
||||
use test;
|
||||
drop database db99;
|
||||
create table t1 (f1 integer) engine= ARCHIVE partition by list(f1)
|
||||
(
|
||||
partition p1 values in (1),
|
||||
partition p2 values in (NULL),
|
||||
partition p3 values in (2),
|
||||
partition p4 values in (3),
|
||||
partition p5 values in (4)
|
||||
);
|
||||
insert into t1 values (1),(2),(3),(4),(null);
|
||||
select * from t1;
|
||||
f1
|
||||
1
|
||||
NULL
|
||||
2
|
||||
3
|
||||
4
|
||||
select * from t1 where f1 < 3;
|
||||
f1
|
||||
1
|
||||
2
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
c int not null) engine=ARCHIVE
|
||||
partition by hash (a + 2)
|
||||
partitions 3
|
||||
(partition x1 tablespace ts1,
|
||||
partition x2 tablespace ts2,
|
||||
partition x3 tablespace ts3);
|
||||
insert into t1 values (1,1,1);
|
||||
insert into t1 values (2,1,1);
|
||||
insert into t1 values (3,1,1);
|
||||
insert into t1 values (4,1,1);
|
||||
insert into t1 values (5,1,1);
|
||||
select * from t1;
|
||||
a b c
|
||||
1 1 1
|
||||
4 1 1
|
||||
2 1 1
|
||||
5 1 1
|
||||
3 1 1
|
||||
drop table t1;
|
||||
create table t1 (a int) engine=archive partition by hash(a);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) */
|
||||
drop table t1;
|
||||
CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
|
||||
f1 VARCHAR(25),
|
||||
PRIMARY KEY(id)) ENGINE=ARCHIVE
|
||||
PARTITION BY RANGE(id)
|
||||
SUBPARTITION BY hash(id) subpartitions 2
|
||||
(PARTITION pa1 values less than (10),
|
||||
PARTITION pa2 values less than (20),
|
||||
PARTITION pa3 values less than (30),
|
||||
PARTITION pa4 values less than (40),
|
||||
PARTITION pa5 values less than (50),
|
||||
PARTITION pa6 values less than (60),
|
||||
PARTITION pa7 values less than (70),
|
||||
PARTITION pa8 values less than (80),
|
||||
PARTITION pa9 values less than (90),
|
||||
PARTITION pa10 values less than (100),
|
||||
PARTITION pa11 values less than MAXVALUE);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
|
||||
`f1` varchar(25) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ARCHIVE AUTO_INCREMENT=101 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION pa2 VALUES LESS THAN (20) ENGINE = ARCHIVE, PARTITION pa3 VALUES LESS THAN (30) ENGINE = ARCHIVE, PARTITION pa4 VALUES LESS THAN (40) ENGINE = ARCHIVE, PARTITION pa5 VALUES LESS THAN (50) ENGINE = ARCHIVE, PARTITION pa6 VALUES LESS THAN (60) ENGINE = ARCHIVE, PARTITION pa7 VALUES LESS THAN (70) ENGINE = ARCHIVE, PARTITION pa8 VALUES LESS THAN (80) ENGINE = ARCHIVE, PARTITION pa9 VALUES LESS THAN (90) ENGINE = ARCHIVE, PARTITION pa10 VALUES LESS THAN (100) ENGINE = ARCHIVE, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
100
|
||||
drop table t1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
drop table if exists t1;
|
||||
drop table if exists t1, t2;
|
||||
create table t1 (a int unsigned)
|
||||
partition by range (a)
|
||||
(partition pnull values less than (0),
|
||||
|
||||
@@ -807,6 +807,8 @@ select @@max_prepared_stmt_count;
|
||||
@@max_prepared_stmt_count
|
||||
0
|
||||
set global max_prepared_stmt_count=10000000000000000;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '10000000000000000'
|
||||
select @@max_prepared_stmt_count;
|
||||
@@max_prepared_stmt_count
|
||||
1048576
|
||||
|
||||
@@ -783,20 +783,20 @@ a b
|
||||
2 two
|
||||
3 three
|
||||
4 four
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
deallocate prepare stmt1 ;
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
deallocate prepare stmt1 ;
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
|
||||
@@ -783,20 +783,20 @@ a b
|
||||
2 two
|
||||
3 three
|
||||
4 four
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
deallocate prepare stmt1 ;
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
deallocate prepare stmt1 ;
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
|
||||
@@ -784,20 +784,20 @@ a b
|
||||
2 two
|
||||
3 three
|
||||
4 four
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
deallocate prepare stmt1 ;
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
deallocate prepare stmt1 ;
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
|
||||
@@ -826,20 +826,20 @@ a b
|
||||
2 two
|
||||
3 three
|
||||
4 four
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
deallocate prepare stmt1 ;
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
deallocate prepare stmt1 ;
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
@@ -3848,20 +3848,20 @@ a b
|
||||
2 two
|
||||
3 three
|
||||
4 four
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
deallocate prepare stmt1 ;
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
deallocate prepare stmt1 ;
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
|
||||
2329
mysql-test/r/ps_ddl.result
Normal file
2329
mysql-test/r/ps_ddl.result
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1135,6 +1135,24 @@ item started price
|
||||
A1 2005-11-01 08:00:00 1000.000
|
||||
A1 2005-11-15 00:00:00 2000.000
|
||||
DROP TABLE t1;
|
||||
|
||||
BUG#32198 "Comparison of DATE with DATETIME still not using indexes correctly"
|
||||
|
||||
CREATE TABLE t1 (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
dateval date default NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY dateval (dateval)
|
||||
) AUTO_INCREMENT=173;
|
||||
INSERT INTO t1 VALUES
|
||||
(1,'2007-01-01'),(2,'2007-01-02'),(3,'2007-01-03'),(4,'2007-01-04'),
|
||||
(5,'2007-01-05'),(6,'2007-01-06'),(7,'2007-01-07'),(8,'2007-01-08'),
|
||||
(9,'2007-01-09'),(10,'2007-01-10'),(11,'2007-01-11');
|
||||
This must use range access:
|
||||
explain select * from t1 where dateval >= '2007-01-01 00:00:00' and dateval <= '2007-01-02 23:59:59';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range dateval dateval 4 NULL 2 Using where
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t2 (a int, b int, filler char(100));
|
||||
|
||||
@@ -97,3 +97,31 @@ Note 1051 Unknown table 'ttt'
|
||||
set global read_only=0;
|
||||
drop table t1,t2;
|
||||
drop user test@localhost;
|
||||
#
|
||||
# Bug #27440 read_only allows create and drop database
|
||||
#
|
||||
set global read_only= 1;
|
||||
drop database if exists mysqltest_db1;
|
||||
drop database if exists mysqltest_db2;
|
||||
delete from mysql.user where User like 'mysqltest_%';
|
||||
delete from mysql.db where User like 'mysqltest_%';
|
||||
delete from mysql.tables_priv where User like 'mysqltest_%';
|
||||
delete from mysql.columns_priv where User like 'mysqltest_%';
|
||||
flush privileges;
|
||||
grant all on mysqltest_db2.* to `mysqltest_u1`@`%`;
|
||||
create database mysqltest_db1;
|
||||
grant all on mysqltest_db1.* to `mysqltest_u1`@`%`;
|
||||
flush privileges;
|
||||
create database mysqltest_db2;
|
||||
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||
show databases like '%mysqltest_db2%';
|
||||
Database (%mysqltest_db2%)
|
||||
drop database mysqltest_db1;
|
||||
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||
delete from mysql.user where User like 'mysqltest_%';
|
||||
delete from mysql.db where User like 'mysqltest_%';
|
||||
delete from mysql.tables_priv where User like 'mysqltest_%';
|
||||
delete from mysql.columns_priv where User like 'mysqltest_%';
|
||||
flush privileges;
|
||||
drop database mysqltest_db1;
|
||||
set global read_only=0;
|
||||
|
||||
@@ -4307,6 +4307,12 @@ c3
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
CREATE TABLE t1 (c1 BIGINT NOT NULL);
|
||||
INSERT INTO t1 (c1) VALUES (1);
|
||||
SELECT * FROM t1 WHERE c1 > NULL + 1;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
|
||||
End of 5.0 tests
|
||||
create table t1(a INT, KEY (a));
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
|
||||
|
||||
@@ -77,10 +77,9 @@ ERROR HY000: Incorrect usage of PROCEDURE and subquery
|
||||
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
|
||||
ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
|
||||
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
|
||||
a
|
||||
ERROR 42S22: Unknown column 'a' in 'field list'
|
||||
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL;
|
||||
a
|
||||
1
|
||||
ERROR 42S22: Unknown column 'a' in 'field list'
|
||||
SELECT (SELECT 1,2,3) = ROW(1,2,3);
|
||||
(SELECT 1,2,3) = ROW(1,2,3)
|
||||
1
|
||||
@@ -1307,7 +1306,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<primary_index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on PRIMARY where (`test`.`t1`.`b` <> 30))))
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<primary_index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on PRIMARY where ((`test`.`t1`.`b` <> 30) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))))
|
||||
select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
|
||||
a
|
||||
2
|
||||
@@ -1315,8 +1314,8 @@ a
|
||||
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using where
|
||||
2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 func 1 100.00
|
||||
2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
|
||||
drop table t1, t2, t3;
|
||||
@@ -1334,9 +1333,9 @@ a
|
||||
explain extended select * from t2 where t2.a in (select a from t1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index
|
||||
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a)))
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
|
||||
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
|
||||
a
|
||||
2
|
||||
@@ -1346,7 +1345,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where (`test`.`t1`.`b` <> 30))))
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where ((`test`.`t1`.`b` <> 30) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))))
|
||||
select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
|
||||
a
|
||||
2
|
||||
@@ -1373,7 +1372,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
|
||||
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where (`test`.`t1`.`b` <> 30))))
|
||||
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where ((`test`.`t1`.`b` <> 30) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))))
|
||||
drop table t1, t2, t3;
|
||||
create table t1 (a int, b int);
|
||||
create table t2 (a int, b int);
|
||||
@@ -1737,7 +1736,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where
|
||||
2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where (not(<in_optimizer>(`test`.`t1`.`id`,<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`id`) in t1 on PRIMARY where (`test`.`t1`.`id` < 8))))))
|
||||
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where (not(<in_optimizer>(`test`.`t1`.`id`,<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`id`) in t1 on PRIMARY where ((`test`.`t1`.`id` < 8) and (<cache>(`test`.`t1`.`id`) = `test`.`t1`.`id`)))))))
|
||||
explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where
|
||||
@@ -2304,24 +2303,27 @@ drop table t1,t2;
|
||||
CREATE TABLE t1 ( a int, b int );
|
||||
CREATE TABLE t2 ( c int, d int );
|
||||
INSERT INTO t1 VALUES (1,2), (2,3), (3,4);
|
||||
SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);
|
||||
SELECT a AS abc, b FROM t1 outr WHERE b =
|
||||
(SELECT MIN(b) FROM t1 WHERE a=outr.a);
|
||||
abc b
|
||||
1 2
|
||||
2 3
|
||||
3 4
|
||||
INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);
|
||||
INSERT INTO t2 SELECT a AS abc, b FROM t1 outr WHERE b =
|
||||
(SELECT MIN(b) FROM t1 WHERE a=outr.a);
|
||||
select * from t2;
|
||||
c d
|
||||
1 2
|
||||
2 3
|
||||
3 4
|
||||
CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);
|
||||
CREATE TABLE t3 SELECT a AS abc, b FROM t1 outr WHERE b =
|
||||
(SELECT MIN(b) FROM t1 WHERE a=outr.a);
|
||||
select * from t3;
|
||||
abc b
|
||||
1 2
|
||||
2 3
|
||||
3 4
|
||||
prepare stmt1 from "INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);";
|
||||
prepare stmt1 from "INSERT INTO t2 SELECT a AS abc, b FROM t1 outr WHERE b = (SELECT MIN(b) FROM t1 WHERE a=outr.a);";
|
||||
execute stmt1;
|
||||
deallocate prepare stmt1;
|
||||
select * from t2;
|
||||
@@ -2333,7 +2335,7 @@ c d
|
||||
2 3
|
||||
3 4
|
||||
drop table t3;
|
||||
prepare stmt1 from "CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);";
|
||||
prepare stmt1 from "CREATE TABLE t3 SELECT a AS abc, b FROM t1 outr WHERE b = (SELECT MIN(b) FROM t1 WHERE a=outr.a);";
|
||||
execute stmt1;
|
||||
select * from t3;
|
||||
abc b
|
||||
@@ -2515,7 +2517,9 @@ INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,680
|
||||
INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF');
|
||||
INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM');
|
||||
/*!40000 ALTER TABLE t1 ENABLE KEYS */;
|
||||
SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200);
|
||||
SELECT DISTINCT Continent AS c FROM t1 outr WHERE
|
||||
Code <> SOME ( SELECT Code FROM t1 WHERE Continent = outr.Continent AND
|
||||
Population < 200);
|
||||
c
|
||||
Oceania
|
||||
drop table t1;
|
||||
@@ -3558,22 +3562,19 @@ SELECT sql_no_cache * FROM t1 WHERE NOT EXISTS
|
||||
(SELECT i FROM t1) UNION
|
||||
(SELECT i FROM t1)
|
||||
);
|
||||
i
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION
|
||||
(SELECT i FROM t1)
|
||||
)' at line 3
|
||||
SELECT * FROM t1
|
||||
WHERE NOT EXISTS (((SELECT i FROM t1) UNION (SELECT i FROM t1)));
|
||||
i
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION (SELECT i FROM t1)))' at line 2
|
||||
explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12))
|
||||
from t1;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union (select t12.i from t1 t12))
|
||||
from t1' at line 1
|
||||
explain select * from t1 where not exists
|
||||
((select t11.i from t1 t11) union (select t12.i from t1 t12));
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
|
||||
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
|
||||
4 UNION t12 system NULL NULL NULL NULL 0 const row not found
|
||||
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union (select t12.i from t1 t12))' at line 2
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b));
|
||||
insert into t1 (a) values (FLOOR(rand() * 100));
|
||||
@@ -3666,6 +3667,8 @@ CREATE TABLE t1 (a int, b int auto_increment, PRIMARY KEY (b));
|
||||
CREATE TABLE t2 (x int auto_increment, y int, z int,
|
||||
PRIMARY KEY (x), FOREIGN KEY (y) REFERENCES t1 (b));
|
||||
SET SESSION sort_buffer_size = 32 * 1024;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect sort_buffer_size value: '32768'
|
||||
SELECT SQL_NO_CACHE COUNT(*)
|
||||
FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c
|
||||
FROM t1) t;
|
||||
@@ -4101,6 +4104,8 @@ INSERT INTO `t1` VALUES ('asdf','2007-02-08 01:11:26');
|
||||
INSERT INTO `t2` VALUES ('abcdefghijk');
|
||||
INSERT INTO `t2` VALUES ('asdf');
|
||||
SET session sort_buffer_size=8192;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect sort_buffer_size value: '8192'
|
||||
SELECT (SELECT 1 FROM t1 WHERE t1.a=t2.a ORDER BY t1.b LIMIT 1) AS d1 FROM t2;
|
||||
d1
|
||||
1
|
||||
@@ -4199,6 +4204,84 @@ LEFT(t1.a1,1)
|
||||
SELECT a2 FROM t2 WHERE t2.a2 IN (SELECT t1.a1 FROM t1,t3 WHERE t1.b1=t3.a3);
|
||||
a2
|
||||
DROP TABLE t1, t2, t3;
|
||||
CREATE TABLE t1 (a CHAR(1), b VARCHAR(10));
|
||||
INSERT INTO t1 VALUES ('a', 'aa');
|
||||
INSERT INTO t1 VALUES ('a', 'aaa');
|
||||
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
|
||||
a b
|
||||
CREATE INDEX I1 ON t1 (a);
|
||||
CREATE INDEX I2 ON t1 (b);
|
||||
EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
|
||||
2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 2 Using index; Using where
|
||||
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
|
||||
a b
|
||||
CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10));
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
CREATE INDEX I1 ON t2 (a);
|
||||
CREATE INDEX I2 ON t2 (b);
|
||||
EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||
2 DEPENDENT SUBQUERY t2 index_subquery I1 I1 4 func 2 Using index; Using where
|
||||
SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
|
||||
a b
|
||||
EXPLAIN
|
||||
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
|
||||
2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 2 Using index; Using where
|
||||
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
|
||||
a b
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1(a INT, b INT);
|
||||
INSERT INTO t1 VALUES (1,1), (1,2), (2,3), (2,4);
|
||||
EXPLAIN
|
||||
SELECT a AS out_a, MIN(b) FROM t1
|
||||
WHERE b > (SELECT MIN(b) FROM t1 WHERE a = out_a)
|
||||
GROUP BY a;
|
||||
ERROR 42S22: Unknown column 'out_a' in 'where clause'
|
||||
SELECT a AS out_a, MIN(b) FROM t1
|
||||
WHERE b > (SELECT MIN(b) FROM t1 WHERE a = out_a)
|
||||
GROUP BY a;
|
||||
ERROR 42S22: Unknown column 'out_a' in 'where clause'
|
||||
EXPLAIN
|
||||
SELECT a AS out_a, MIN(b) FROM t1 t1_outer
|
||||
WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a)
|
||||
GROUP BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1_outer ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort
|
||||
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
SELECT a AS out_a, MIN(b) FROM t1 t1_outer
|
||||
WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a)
|
||||
GROUP BY a;
|
||||
out_a MIN(b)
|
||||
1 2
|
||||
2 4
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
INSERT INTO t2 VALUES (1),(2);
|
||||
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
|
||||
2
|
||||
2
|
||||
2
|
||||
EXPLAIN EXTENDED
|
||||
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select 2 AS `2` from `test`.`t1` where exists(select 1 AS `1` from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`))
|
||||
EXPLAIN EXTENDED
|
||||
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
|
||||
(SELECT 1 FROM t2 WHERE t1.a = t2.a));
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION
|
||||
(SELECT 1 FROM t2 WHERE t1.a = t2.a))' at line 2
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.0 tests.
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
|
||||
|
||||
@@ -757,6 +757,6 @@ a
|
||||
EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY PRIMARY 4 func 1 Using index
|
||||
2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
||||
@@ -1,3 +1,104 @@
|
||||
purge master logs before (select adddate(current_timestamp(), interval -4 day));
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select adddate(current_timestamp(), interval -4 day))' at line 1
|
||||
purge master logs before adddate(current_timestamp(), interval -4 day);
|
||||
create table t1(a int,b int,key(a),key(b));
|
||||
insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5),
|
||||
(6,7),(7,4),(5,3);
|
||||
select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
sum(a) a
|
||||
select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
ERROR HY000: Thread stack overrun detected
|
||||
explain select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 index a a 5 NULL 9 Using where; Using index
|
||||
2 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
3 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
4 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
5 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
6 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
7 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
8 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
9 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
10 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
11 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
12 SUBQUERY t1 range a a 5 NULL 1 Using where; Using temporary; Using filesort
|
||||
13 SUBQUERY t1 index NULL a 5 NULL 9 Using index
|
||||
explain select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
ERROR HY000: Thread stack overrun detected
|
||||
drop table t1;
|
||||
|
||||
@@ -448,4 +448,18 @@ DROP TABLE t1;
|
||||
DROP DATABASE mysqltest_db1;
|
||||
USE test;
|
||||
End of 5.0 tests.
|
||||
drop table if exists t1;
|
||||
create table t1 (i int);
|
||||
connection: default
|
||||
lock tables t1 write;
|
||||
connection: flush
|
||||
flush tables with read lock;;
|
||||
connection: default
|
||||
create trigger t1_bi before insert on t1 for each row begin end;
|
||||
unlock tables;
|
||||
connection: flush
|
||||
unlock tables;
|
||||
select * from t1;
|
||||
i
|
||||
drop table t1;
|
||||
End of 5.1 tests.
|
||||
|
||||
@@ -269,6 +269,8 @@ a+0 b+0
|
||||
56 379
|
||||
68 454
|
||||
set @@max_length_for_sort_data=0;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_length_for_sort_data value: '0'
|
||||
select a+0, b+0 from t1 where a > 40 and a < 70 order by 2;
|
||||
a+0 b+0
|
||||
57 135
|
||||
@@ -672,6 +674,16 @@ COUNT(DISTINCT b,c)
|
||||
2
|
||||
2
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t1(a BIT(13), KEY(a));
|
||||
INSERT INTO t1(a) VALUES
|
||||
(65535),(65525),(65535),(65535),(65535),(65535),(65535),(65535),(65535),(65535);
|
||||
EXPLAIN SELECT 1 FROM t1 GROUP BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL a 3 NULL 6 Using index for group-by
|
||||
SELECT 1 FROM t1 GROUP BY a;
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
create table t1(a bit(7));
|
||||
insert into t1 values(0x40);
|
||||
|
||||
@@ -269,6 +269,8 @@ a+0 b+0
|
||||
56 379
|
||||
68 454
|
||||
set @@max_length_for_sort_data=0;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_length_for_sort_data value: '0'
|
||||
select a+0, b+0 from t1 where a > 40 and a < 70 order by 2;
|
||||
a+0 b+0
|
||||
57 135
|
||||
|
||||
@@ -807,4 +807,18 @@ set @@sql_mode='TRADITIONAL';
|
||||
create table t1 (a text default '');
|
||||
ERROR 42000: BLOB/TEXT column 'a' can't have a default value
|
||||
set @@sql_mode='';
|
||||
CREATE TABLE t (c TEXT CHARSET ASCII);
|
||||
INSERT INTO t (c) VALUES (REPEAT('1',65537));
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
INSERT INTO t (c) VALUES (REPEAT('2',65536));
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
INSERT INTO t (c) VALUES (REPEAT('3',65535));
|
||||
SELECT LENGTH(c), CHAR_LENGTH(c) FROM t;
|
||||
LENGTH(c) CHAR_LENGTH(c)
|
||||
65535 65535
|
||||
65535 65535
|
||||
65535 65535
|
||||
DROP TABLE t;
|
||||
End of 5.0 tests
|
||||
|
||||
@@ -211,7 +211,6 @@ a
|
||||
Warnings:
|
||||
Warning 1292 Incorrect date value: '0000-00-00' for column 'a' at row 1
|
||||
Warning 1292 Incorrect date value: '0000-00-00' for column 'a' at row 1
|
||||
Warning 1292 Incorrect date value: '0000-00-00' for column 'a' at row 1
|
||||
SELECT * FROM t2 WHERE a = '0000-00-00';
|
||||
a
|
||||
0000-00-00
|
||||
@@ -223,6 +222,44 @@ INSERT INTO t1 VALUES ('0000-00-00');
|
||||
ERROR 22007: Incorrect date value: '0000-00-00' for column 'a' at row 1
|
||||
SET SQL_MODE=DEFAULT;
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a DATE);
|
||||
CREATE TABLE t2 (a DATE);
|
||||
CREATE INDEX i ON t1 (a);
|
||||
INSERT INTO t1 VALUES ('1000-00-00'),('1000-00-00');
|
||||
INSERT INTO t2 VALUES ('1000-00-00'),('1000-00-00');
|
||||
SELECT * FROM t1 WHERE a = '1000-00-00';
|
||||
a
|
||||
1000-00-00
|
||||
1000-00-00
|
||||
SELECT * FROM t2 WHERE a = '1000-00-00';
|
||||
a
|
||||
1000-00-00
|
||||
1000-00-00
|
||||
SET SQL_MODE=TRADITIONAL;
|
||||
EXPLAIN SELECT * FROM t1 WHERE a = '1000-00-00';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref i i 4 const 1 Using where; Using index
|
||||
Warnings:
|
||||
Warning 1292 Incorrect date value: '1000-00-00' for column 'a' at row 1
|
||||
Warning 1292 Incorrect date value: '1000-00-00' for column 'a' at row 1
|
||||
SELECT * FROM t1 WHERE a = '1000-00-00';
|
||||
a
|
||||
1000-00-00
|
||||
1000-00-00
|
||||
Warnings:
|
||||
Warning 1292 Incorrect date value: '1000-00-00' for column 'a' at row 1
|
||||
Warning 1292 Incorrect date value: '1000-00-00' for column 'a' at row 1
|
||||
SELECT * FROM t2 WHERE a = '1000-00-00';
|
||||
a
|
||||
1000-00-00
|
||||
1000-00-00
|
||||
Warnings:
|
||||
Warning 1292 Incorrect date value: '1000-00-00' for column 'a' at row 1
|
||||
Warning 1292 Incorrect date value: '1000-00-00' for column 'a' at row 1
|
||||
INSERT INTO t1 VALUES ('1000-00-00');
|
||||
ERROR 22007: Incorrect date value: '1000-00-00' for column 'a' at row 1
|
||||
SET SQL_MODE=DEFAULT;
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.0 tests
|
||||
create table t1 (a date, primary key (a))engine=memory;
|
||||
insert into t1 values ('0000-01-01'), ('0000-00-01'), ('0001-01-01');
|
||||
|
||||
@@ -505,6 +505,61 @@ select sum(a) from t1 group by convert(a, datetime);
|
||||
sum(a)
|
||||
NULL
|
||||
drop table t1;
|
||||
create table t1 (id int(10) not null, cur_date datetime not null);
|
||||
create table t2 (id int(10) not null, cur_date date not null);
|
||||
insert into t1 (id, cur_date) values (1, '2007-04-25 18:30:22');
|
||||
insert into t2 (id, cur_date) values (1, '2007-04-25');
|
||||
explain extended
|
||||
select * from t1
|
||||
where id in (select id from t1 as x1 where (t1.cur_date is null));
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select '1' AS `id`,'2007-04-25 18:30:22' AS `cur_date` from `test`.`t1` where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t1` `x1` where 0))
|
||||
select * from t1
|
||||
where id in (select id from t1 as x1 where (t1.cur_date is null));
|
||||
id cur_date
|
||||
explain extended
|
||||
select * from t2
|
||||
where id in (select id from t2 as x1 where (t2.cur_date is null));
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select '1' AS `id`,'2007-04-25' AS `cur_date` from `test`.`t2` where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t2` `x1` where 0))
|
||||
select * from t2
|
||||
where id in (select id from t2 as x1 where (t2.cur_date is null));
|
||||
id cur_date
|
||||
insert into t1 (id, cur_date) values (2, '2007-04-26 18:30:22');
|
||||
insert into t2 (id, cur_date) values (2, '2007-04-26');
|
||||
explain extended
|
||||
select * from t1
|
||||
where id in (select id from t1 as x1 where (t1.cur_date is null));
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
2 DEPENDENT SUBQUERY x1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` where <in_optimizer>(`test`.`t1`.`id`,<exists>(select 1 AS `Not_used` from `test`.`t1` `x1` where ((`test`.`t1`.`cur_date` = 0) and (<cache>(`test`.`t1`.`id`) = `test`.`x1`.`id`))))
|
||||
select * from t1
|
||||
where id in (select id from t1 as x1 where (t1.cur_date is null));
|
||||
id cur_date
|
||||
explain extended
|
||||
select * from t2
|
||||
where id in (select id from t2 as x1 where (t2.cur_date is null));
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
2 DEPENDENT SUBQUERY x1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`id`,<exists>(select 1 AS `Not_used` from `test`.`t2` `x1` where ((`test`.`t2`.`cur_date` = 0) and (<cache>(`test`.`t2`.`id`) = `test`.`x1`.`id`))))
|
||||
select * from t2
|
||||
where id in (select id from t2 as x1 where (t2.cur_date is null));
|
||||
id cur_date
|
||||
drop table t1,t2;
|
||||
End of 5.0 tests
|
||||
set @org_mode=@@sql_mode;
|
||||
create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03');
|
||||
|
||||
@@ -365,4 +365,31 @@ DROP FUNCTION check_const_len;
|
||||
DROP PROCEDURE check_const_len_sp;
|
||||
DROP TRIGGER check_const_len_trigger;
|
||||
DROP TABLE const_len_bug;
|
||||
CREATE FUNCTION sequence RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a INT PRIMARY KEY);
|
||||
INSERT INTO t1 VALUES (4),(3),(2),(1);
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT sequence() AS seq, a FROM t1 ORDER BY seq ASC;
|
||||
seq a
|
||||
1 4
|
||||
2 3
|
||||
3 2
|
||||
4 1
|
||||
SELECT sequence() AS seq, a FROM t1 ORDER BY seq DESC;
|
||||
seq a
|
||||
4 1
|
||||
3 2
|
||||
2 3
|
||||
1 4
|
||||
SELECT * FROM t1 WHERE a = sequence();
|
||||
a
|
||||
SELECT * FROM t2 WHERE a = sequence();
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
DROP FUNCTION sequence;
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.0 tests.
|
||||
|
||||
@@ -353,6 +353,13 @@ select @a:=f4, count(f4) from t1 group by 1 desc;
|
||||
2.6 1
|
||||
1.6 4
|
||||
drop table t1;
|
||||
create table t1 (f1 int);
|
||||
insert into t1 values (2), (1);
|
||||
select @i := f1 as j from t1 order by 1;
|
||||
j
|
||||
1
|
||||
2
|
||||
drop table t1;
|
||||
create table t1(a int);
|
||||
insert into t1 values(5),(4),(4),(3),(2),(2),(2),(1);
|
||||
set @rownum := 0;
|
||||
|
||||
@@ -279,6 +279,8 @@ NET_READ_TIMEOUT 600
|
||||
NET_RETRY_COUNT 10
|
||||
NET_WRITE_TIMEOUT 500
|
||||
set net_buffer_length=1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '1'
|
||||
show variables like 'net_buffer_length';
|
||||
Variable_name Value
|
||||
net_buffer_length 1024
|
||||
@@ -312,14 +314,14 @@ show variables like '%alloc%';
|
||||
Variable_name Value
|
||||
query_alloc_block_size 8192
|
||||
query_prealloc_size 8192
|
||||
range_alloc_block_size 2048
|
||||
range_alloc_block_size 4096
|
||||
transaction_alloc_block_size 8192
|
||||
transaction_prealloc_size 4096
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
QUERY_ALLOC_BLOCK_SIZE 8192
|
||||
QUERY_PREALLOC_SIZE 8192
|
||||
RANGE_ALLOC_BLOCK_SIZE 2048
|
||||
RANGE_ALLOC_BLOCK_SIZE 4096
|
||||
TRANSACTION_ALLOC_BLOCK_SIZE 8192
|
||||
TRANSACTION_PREALLOC_SIZE 4096
|
||||
set @@range_alloc_block_size=1024*16;
|
||||
@@ -351,14 +353,14 @@ show variables like '%alloc%';
|
||||
Variable_name Value
|
||||
query_alloc_block_size 8192
|
||||
query_prealloc_size 8192
|
||||
range_alloc_block_size 2048
|
||||
range_alloc_block_size 4096
|
||||
transaction_alloc_block_size 8192
|
||||
transaction_prealloc_size 4096
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
QUERY_ALLOC_BLOCK_SIZE 8192
|
||||
QUERY_PREALLOC_SIZE 8192
|
||||
RANGE_ALLOC_BLOCK_SIZE 2048
|
||||
RANGE_ALLOC_BLOCK_SIZE 4096
|
||||
TRANSACTION_ALLOC_BLOCK_SIZE 8192
|
||||
TRANSACTION_PREALLOC_SIZE 4096
|
||||
SELECT @@version LIKE 'non-existent';
|
||||
@@ -416,6 +418,8 @@ select @@autocommit, @@big_tables;
|
||||
@@autocommit @@big_tables
|
||||
1 1
|
||||
set global binlog_cache_size=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect binlog_cache_size value: '100'
|
||||
set bulk_insert_buffer_size=100;
|
||||
set character set cp1251_koi8;
|
||||
set character set default;
|
||||
@@ -444,6 +448,8 @@ set global flush_time=100;
|
||||
set insert_id=1;
|
||||
set interactive_timeout=100;
|
||||
set join_buffer_size=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect join_buffer_size value: '100'
|
||||
set last_insert_id=1;
|
||||
set global local_infile=1;
|
||||
set long_query_time=0.000001;
|
||||
@@ -456,12 +462,20 @@ select @@long_query_time;
|
||||
100.000001
|
||||
set low_priority_updates=1;
|
||||
set max_allowed_packet=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_allowed_packet value: '100'
|
||||
set global max_binlog_cache_size=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_binlog_cache_size value: '100'
|
||||
set global max_binlog_size=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_binlog_size value: '100'
|
||||
set global max_connect_errors=100;
|
||||
set global max_connections=100;
|
||||
set global max_delayed_threads=100;
|
||||
set max_heap_table_size=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_heap_table_size value: '100'
|
||||
set max_join_size=100;
|
||||
set max_sort_length=100;
|
||||
set max_tmp_tables=100;
|
||||
@@ -472,17 +486,25 @@ select @@max_user_connections;
|
||||
set global max_write_lock_count=100;
|
||||
set myisam_sort_buffer_size=100;
|
||||
set net_buffer_length=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect net_buffer_length value: '100'
|
||||
set net_read_timeout=100;
|
||||
set net_write_timeout=100;
|
||||
set global query_cache_limit=100;
|
||||
set global query_cache_size=100;
|
||||
set global query_cache_type=demand;
|
||||
set read_buffer_size=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect read_buffer_size value: '100'
|
||||
set read_rnd_buffer_size=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '100'
|
||||
set global rpl_recovery_rank=100;
|
||||
set global server_id=100;
|
||||
set global slow_launch_time=100;
|
||||
set sort_buffer_size=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect sort_buffer_size value: '100'
|
||||
set @@max_sp_recursion_depth=10;
|
||||
select @@max_sp_recursion_depth;
|
||||
@@max_sp_recursion_depth
|
||||
@@ -522,6 +544,8 @@ set storage_engine=myisam;
|
||||
set global thread_cache_size=100;
|
||||
set timestamp=1, timestamp=default;
|
||||
set tmp_table_size=100;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect tmp_table_size value: '100'
|
||||
set tx_isolation="READ-COMMITTED";
|
||||
set wait_timeout=100;
|
||||
set log_warnings=1;
|
||||
@@ -691,6 +715,8 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'MYI
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
MYISAM_DATA_POINTER_SIZE 7
|
||||
SET GLOBAL table_open_cache=-1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect table_open_cache value: '0'
|
||||
SHOW VARIABLES LIKE 'table_open_cache';
|
||||
Variable_name Value
|
||||
table_open_cache 1
|
||||
|
||||
@@ -19,6 +19,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
End of 5.0 tests.
|
||||
drop procedure if exists proc_1;
|
||||
create procedure proc_1() install plugin my_plug soname '\\root\\some_plugin.dll';
|
||||
call proc_1();
|
||||
ERROR HY000: No paths allowed for shared library
|
||||
|
||||
445
mysql-test/suite/ndb/r/ndb_auto_increment.result
Normal file
445
mysql-test/suite/ndb/r/ndb_auto_increment.result
Normal file
@@ -0,0 +1,445 @@
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
set @old_auto_increment_offset = @@session.auto_increment_offset;
|
||||
set @old_auto_increment_increment = @@session.auto_increment_increment;
|
||||
set @old_ndb_autoincrement_prefetch_sz = @@session.ndb_autoincrement_prefetch_sz;
|
||||
flush status;
|
||||
create table t1 (a int not null auto_increment primary key) engine ndb;
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
1
|
||||
update t1 set a = 5 where a = 1;
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
5
|
||||
6
|
||||
insert into t1 values (7);
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
insert into t1 values (2);
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
2
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
update t1 set a = 4 where a = 2;
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
delete from t1 where a = 10;
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
11
|
||||
replace t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
11
|
||||
12
|
||||
replace t1 values (15);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
11
|
||||
12
|
||||
15
|
||||
replace into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
11
|
||||
12
|
||||
15
|
||||
16
|
||||
replace t1 values (15);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
11
|
||||
12
|
||||
15
|
||||
16
|
||||
insert ignore into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
11
|
||||
12
|
||||
15
|
||||
16
|
||||
17
|
||||
insert ignore into t1 values (15), (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
11
|
||||
12
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
insert into t1 values (15)
|
||||
on duplicate key update a = 20;
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
11
|
||||
12
|
||||
16
|
||||
17
|
||||
18
|
||||
20
|
||||
21
|
||||
insert into t1 values (NULL) on duplicate key update a = 30;
|
||||
select * from t1 order by a;
|
||||
a
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
11
|
||||
12
|
||||
16
|
||||
17
|
||||
18
|
||||
20
|
||||
21
|
||||
22
|
||||
insert into t1 values (30) on duplicate key update a = 40;
|
||||
select * from t1 order by a;
|
||||
a
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
11
|
||||
12
|
||||
16
|
||||
17
|
||||
18
|
||||
20
|
||||
21
|
||||
22
|
||||
30
|
||||
insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
11
|
||||
12
|
||||
16
|
||||
17
|
||||
18
|
||||
20
|
||||
21
|
||||
22
|
||||
30
|
||||
600
|
||||
601
|
||||
602
|
||||
610
|
||||
611
|
||||
drop table t1;
|
||||
create table t1 (a int not null primary key,
|
||||
b int not null unique auto_increment) engine ndb;
|
||||
insert into t1 values (1, NULL);
|
||||
insert into t1 values (3, NULL);
|
||||
update t1 set b = 3 where a = 3;
|
||||
insert into t1 values (4, NULL);
|
||||
select * from t1 order by a;
|
||||
a b
|
||||
1 1
|
||||
3 3
|
||||
4 4
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER;
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
1 1 0
|
||||
11 2 1
|
||||
21 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
TRUNCATE t1;
|
||||
TRUNCATE t2;
|
||||
SET @@session.auto_increment_offset=5;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t1 (pk,b,c) VALUES (27,4,3),(NULL,5,4),(99,6,5),(NULL,7,6);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (pk,b,c) VALUES (27,4,3),(NULL,5,4),(99,6,5),(NULL,7,6);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
5 1 0
|
||||
15 2 1
|
||||
25 3 2
|
||||
27 4 3
|
||||
35 5 4
|
||||
99 6 5
|
||||
105 7 6
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
7
|
||||
TRUNCATE t1;
|
||||
TRUNCATE t2;
|
||||
SET @@session.auto_increment_increment=2;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
1 1 0
|
||||
3 2 1
|
||||
5 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 7;
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 7;
|
||||
SET @@session.auto_increment_offset=1;
|
||||
SET @@session.auto_increment_increment=1;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
7 1 0
|
||||
8 2 1
|
||||
9 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 3;
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 3;
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
5 1 0
|
||||
15 2 1
|
||||
25 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 7;
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 7;
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
15 1 0
|
||||
25 2 1
|
||||
35 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 5;
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 5;
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
5 1 0
|
||||
15 2 1
|
||||
25 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 100;
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 100;
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
105 1 0
|
||||
115 2 1
|
||||
125 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
SET @@session.auto_increment_offset=1;
|
||||
SET @@session.auto_increment_increment=1;
|
||||
set ndb_autoincrement_prefetch_sz = 32;
|
||||
drop table if exists t1;
|
||||
SET @@session.auto_increment_offset=1;
|
||||
SET @@session.auto_increment_increment=1;
|
||||
set ndb_autoincrement_prefetch_sz = 32;
|
||||
create table t1 (a int not null auto_increment primary key) engine ndb;
|
||||
insert into t1 values (NULL);
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
1
|
||||
33
|
||||
insert into t1 values (20);
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
1
|
||||
20
|
||||
33
|
||||
34
|
||||
insert into t1 values (35);
|
||||
insert into t1 values (NULL);
|
||||
insert into t1 values (NULL);
|
||||
ERROR 23000: Duplicate entry '35' for key 'PRIMARY'
|
||||
select * from t1 order by a;
|
||||
a
|
||||
1
|
||||
20
|
||||
21
|
||||
33
|
||||
34
|
||||
35
|
||||
insert into t1 values (100);
|
||||
insert into t1 values (NULL);
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
a
|
||||
1
|
||||
20
|
||||
21
|
||||
22
|
||||
33
|
||||
34
|
||||
35
|
||||
100
|
||||
101
|
||||
set auto_increment_offset = @old_auto_increment_offset;
|
||||
set auto_increment_increment = @old_auto_increment_increment;
|
||||
set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;
|
||||
drop table t1;
|
||||
@@ -869,6 +869,30 @@ a b
|
||||
3 30
|
||||
4 1
|
||||
drop table t1,t2;
|
||||
create table t1 (a varchar(100) primary key, b varchar(100)) engine = NDB;
|
||||
insert into t1 values
|
||||
('a', 'a'),('b','b'),('c', 'c'),('aa', 'aa'),('bb', 'bb'),('cc', 'cc');
|
||||
replace into t1 values ('a', '-a');
|
||||
replace into t1 values ('b', '-b');
|
||||
replace into t1 values ('c', '-c');
|
||||
replace into t1 values ('aa', '-aa');
|
||||
replace into t1 values ('bb', '-bb');
|
||||
replace into t1 values ('cc', '-cc');
|
||||
replace into t1 values ('aaa', '-aaa');
|
||||
replace into t1 values ('bbb', '-bbb');
|
||||
replace into t1 values ('ccc', '-ccc');
|
||||
select * from t1 order by 1,2;
|
||||
a b
|
||||
a -a
|
||||
aa -aa
|
||||
aaa -aaa
|
||||
b -b
|
||||
bb -bb
|
||||
bbb -bbb
|
||||
c -c
|
||||
cc -cc
|
||||
ccc -ccc
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
CREATE TABLE t1 (a VARCHAR(255) NOT NULL,
|
||||
CONSTRAINT pk_a PRIMARY KEY (a))engine=ndb;
|
||||
|
||||
@@ -568,3 +568,24 @@ select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
drop table t1;
|
||||
create table t1(
|
||||
a int,
|
||||
blob_nn blob not null,
|
||||
text_nn text not null,
|
||||
blob_nl blob,
|
||||
text_nl text,
|
||||
primary key(a)
|
||||
) engine=ndb;
|
||||
insert into t1(a) values (1);
|
||||
Warnings:
|
||||
Warning 1364 Field 'blob_nn' doesn't have a default value
|
||||
Warning 1364 Field 'text_nn' doesn't have a default value
|
||||
insert into t1(a, text_nl) values (2, 'MySQL Cluster NDB');
|
||||
Warnings:
|
||||
Warning 1364 Field 'blob_nn' doesn't have a default value
|
||||
Warning 1364 Field 'text_nn' doesn't have a default value
|
||||
select a, length(blob_nn), length(text_nn), blob_nl, text_nl from t1 order by a;
|
||||
a length(blob_nn) length(text_nn) blob_nl text_nl
|
||||
1 0 0 NULL NULL
|
||||
2 0 0 NULL MySQL Cluster NDB
|
||||
drop table t1;
|
||||
|
||||
@@ -112,9 +112,9 @@ unique key(a)
|
||||
) engine=ndb;
|
||||
insert into t1 values(1, 'aAa');
|
||||
insert into t1 values(2, 'aaa');
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry 'aaa' for key 'a'
|
||||
insert into t1 values(3, 'AAA');
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry 'AAA' for key 'a'
|
||||
select * from t1 order by p;
|
||||
p a
|
||||
1 aAa
|
||||
@@ -138,9 +138,9 @@ unique key(a)
|
||||
) engine=ndb;
|
||||
insert into t1 values (1,'A'),(2,'b '),(3,'C '),(4,'d '),(5,'E'),(6,'f');
|
||||
insert into t1 values(99,'b');
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry 'b' for key 'a'
|
||||
insert into t1 values(99,'a ');
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry 'a ' for key 'a'
|
||||
select a,length(a) from t1 order by a;
|
||||
a length(a)
|
||||
A 1
|
||||
|
||||
@@ -22,7 +22,7 @@ select * from t1 where b = 4 order by a;
|
||||
a b c
|
||||
3 4 6
|
||||
insert into t1 values(8, 2, 3);
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry '2' for key 'ib'
|
||||
select * from t1 order by a;
|
||||
a b c
|
||||
1 2 3
|
||||
@@ -93,7 +93,7 @@ a b c
|
||||
1 1 1
|
||||
4 4 NULL
|
||||
insert into t1 values(5,1,1);
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry '1-1' for key 'bc'
|
||||
drop table t1;
|
||||
CREATE TABLE t2 (
|
||||
a int unsigned NOT NULL PRIMARY KEY,
|
||||
@@ -116,7 +116,7 @@ select * from t2 where b = 4 order by a;
|
||||
a b c
|
||||
3 4 6
|
||||
insert into t2 values(8, 2, 3);
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry '2-3' for key 'b'
|
||||
select * from t2 order by a;
|
||||
a b c
|
||||
1 2 3
|
||||
@@ -139,7 +139,7 @@ a b c
|
||||
8 2 3
|
||||
create unique index bi using hash on t2(b);
|
||||
insert into t2 values(9, 3, 1);
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry '3' for key 'bi'
|
||||
alter table t2 drop index bi;
|
||||
insert into t2 values(9, 3, 1);
|
||||
select * from t2 order by a;
|
||||
@@ -229,7 +229,7 @@ pk a
|
||||
3 NULL
|
||||
4 4
|
||||
insert into t1 values (5,0);
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry '0' for key 'a'
|
||||
select * from t1 order by pk;
|
||||
pk a
|
||||
-1 NULL
|
||||
@@ -262,7 +262,7 @@ pk a b c
|
||||
0 NULL 18 NULL
|
||||
1 3 19 abc
|
||||
insert into t2 values(2,3,19,'abc');
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry '3-abc' for key 'si'
|
||||
select * from t2 order by pk;
|
||||
pk a b c
|
||||
-1 1 17 NULL
|
||||
@@ -682,7 +682,7 @@ create table t1 (a int primary key, b varchar(1000) not null, unique key (b))
|
||||
engine=ndb charset=utf8;
|
||||
insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200));
|
||||
insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200));
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry '∫dt∫dt∫dt∫dt∫dt∫dt∫dt∫dt∫dt∫dt∫dt∫dt∫d' for key 'b'
|
||||
select a, sha1(b) from t1;
|
||||
a sha1(b)
|
||||
1 08f5d02c8b8bc244f275bdfc22c42c5cab0d9d7d
|
||||
|
||||
@@ -657,172 +657,3 @@ a b
|
||||
2 NULL
|
||||
3 NULL
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER;
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
1 1 0
|
||||
11 2 1
|
||||
21 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
TRUNCATE t1;
|
||||
TRUNCATE t2;
|
||||
SET @@session.auto_increment_offset=5;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t1 (pk,b,c) VALUES (27,4,3),(NULL,5,4),(99,6,5),(NULL,7,6);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (pk,b,c) VALUES (27,4,3),(NULL,5,4),(99,6,5),(NULL,7,6);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
5 1 0
|
||||
15 2 1
|
||||
25 3 2
|
||||
27 4 3
|
||||
35 5 4
|
||||
99 6 5
|
||||
105 7 6
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
7
|
||||
TRUNCATE t1;
|
||||
TRUNCATE t2;
|
||||
SET @@session.auto_increment_increment=2;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
1 1 0
|
||||
3 2 1
|
||||
5 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 7;
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 7;
|
||||
SET @@session.auto_increment_offset=1;
|
||||
SET @@session.auto_increment_increment=1;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
7 1 0
|
||||
8 2 1
|
||||
9 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 3;
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 3;
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
5 1 0
|
||||
15 2 1
|
||||
25 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 7;
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 7;
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
15 1 0
|
||||
25 2 1
|
||||
35 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 5;
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 5;
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
5 1 0
|
||||
15 2 1
|
||||
25 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 100;
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 100;
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
pk b c
|
||||
105 1 0
|
||||
115 2 1
|
||||
125 3 2
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
COUNT(t1.pk)
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
create table t1 (a int) engine=ndbcluster;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
create table t1 (a int) engine=ndbcluster;
|
||||
|
||||
@@ -28,7 +28,7 @@ pk1 b c
|
||||
2 2 2
|
||||
4 1 1
|
||||
UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry '2' for key 'c'
|
||||
UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4;
|
||||
select * from t1 order by pk1;
|
||||
pk1 b c
|
||||
@@ -62,9 +62,9 @@ INSERT INTO t3 VALUES (2, 2);
|
||||
UPDATE t1 SET a = 1;
|
||||
UPDATE t1 SET a = 1 ORDER BY a;
|
||||
UPDATE t2 SET a = 1;
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry '1-2' for key 'a'
|
||||
UPDATE t2 SET a = 1 ORDER BY a;
|
||||
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
||||
ERROR 23000: Duplicate entry '1-2' for key 'a'
|
||||
UPDATE t3 SET a = 1;
|
||||
ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY'
|
||||
UPDATE t3 SET a = 1 ORDER BY a;
|
||||
|
||||
@@ -783,20 +783,20 @@ a b
|
||||
2 two
|
||||
3 three
|
||||
4 four
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
deallocate prepare stmt1 ;
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
deallocate prepare stmt1 ;
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 where a+1=
|
||||
(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) ';
|
||||
prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
|
||||
(SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
|
||||
execute stmt1 ;
|
||||
ccc
|
||||
1
|
||||
|
||||
@@ -12,10 +12,7 @@
|
||||
partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
|
||||
|
||||
ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms
|
||||
ndb_binlog_basic : Bug #32759 2007-11-27 mats ndb_binlog_basic assert failure 'thd->transaction.stmt.modified_non_trans_table'
|
||||
|
||||
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
|
||||
#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
|
||||
#ndb_binlog_discover : bug#21806 2006-08-24
|
||||
ndb_backup_print : Bug#32357: ndb_backup_print test fails sometimes in pushbuild
|
||||
ndb_dd_backuprestore : Bug#32659 ndb_dd_backuprestore.test fails randomly
|
||||
|
||||
293
mysql-test/suite/ndb/t/ndb_auto_increment.test
Normal file
293
mysql-test/suite/ndb/t/ndb_auto_increment.test
Normal file
@@ -0,0 +1,293 @@
|
||||
-- source include/have_multi_ndb.inc
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
connection server1;
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
connection server2;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
connection server1;
|
||||
--enable_warnings
|
||||
|
||||
set @old_auto_increment_offset = @@session.auto_increment_offset;
|
||||
set @old_auto_increment_increment = @@session.auto_increment_increment;
|
||||
set @old_ndb_autoincrement_prefetch_sz = @@session.ndb_autoincrement_prefetch_sz;
|
||||
|
||||
flush status;
|
||||
|
||||
create table t1 (a int not null auto_increment primary key) engine ndb;
|
||||
|
||||
# Step 1: Verify simple insert
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
|
||||
# Step 2: Verify simple update with higher than highest value causes
|
||||
# next insert to use updated_value + 1
|
||||
update t1 set a = 5 where a = 1;
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
|
||||
# Step 3: Verify insert that inserts higher than highest value causes
|
||||
# next insert to use inserted_value + 1
|
||||
insert into t1 values (7);
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
|
||||
# Step 4: Verify that insert into hole, lower than highest value doesn't
|
||||
# affect next insert
|
||||
insert into t1 values (2);
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
|
||||
# Step 5: Verify that update into hole, lower than highest value doesn't
|
||||
# affect next insert
|
||||
update t1 set a = 4 where a = 2;
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
|
||||
# Step 6: Verify that delete of highest value doesn't cause the next
|
||||
# insert to reuse this value
|
||||
delete from t1 where a = 10;
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
|
||||
# Step 7: Verify that REPLACE has the same effect as INSERT
|
||||
replace t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
replace t1 values (15);
|
||||
select * from t1 order by a;
|
||||
replace into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
|
||||
# Step 8: Verify that REPLACE has the same effect as UPDATE
|
||||
replace t1 values (15);
|
||||
select * from t1 order by a;
|
||||
|
||||
# Step 9: Verify that IGNORE doesn't affect auto_increment
|
||||
insert ignore into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
insert ignore into t1 values (15), (NULL);
|
||||
select * from t1 order by a;
|
||||
|
||||
# Step 10: Verify that on duplicate key as UPDATE behaves as an
|
||||
# UPDATE
|
||||
insert into t1 values (15)
|
||||
on duplicate key update a = 20;
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
|
||||
# Step 11: Verify that on duplicate key as INSERT behaves as INSERT
|
||||
insert into t1 values (NULL) on duplicate key update a = 30;
|
||||
select * from t1 order by a;
|
||||
insert into t1 values (30) on duplicate key update a = 40;
|
||||
select * from t1 order by a;
|
||||
|
||||
#Step 12: Vefify INSERT IGNORE (bug#32055)
|
||||
insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
|
||||
select * from t1 order by a;
|
||||
drop table t1;
|
||||
|
||||
#Step 13: Verify auto_increment of unique key
|
||||
create table t1 (a int not null primary key,
|
||||
b int not null unique auto_increment) engine ndb;
|
||||
insert into t1 values (1, NULL);
|
||||
insert into t1 values (3, NULL);
|
||||
update t1 set b = 3 where a = 3;
|
||||
insert into t1 values (4, NULL);
|
||||
select * from t1 order by a;
|
||||
drop table t1;
|
||||
|
||||
#Step 14: Verify that auto_increment_increment and auto_increment_offset
|
||||
# work as expected
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM;
|
||||
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
TRUNCATE t1;
|
||||
TRUNCATE t2;
|
||||
SET @@session.auto_increment_offset=5;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t1 (pk,b,c) VALUES (27,4,3),(NULL,5,4),(99,6,5),(NULL,7,6);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (pk,b,c) VALUES (27,4,3),(NULL,5,4),(99,6,5),(NULL,7,6);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
TRUNCATE t1;
|
||||
TRUNCATE t2;
|
||||
SET @@session.auto_increment_increment=2;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 7;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 7;
|
||||
|
||||
SET @@session.auto_increment_offset=1;
|
||||
SET @@session.auto_increment_increment=1;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 3;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 3;
|
||||
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 7;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 7;
|
||||
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 5;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 5;
|
||||
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 100;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 100;
|
||||
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#Step 15: Now verify that behaviour on multiple MySQL Servers behave
|
||||
# properly. Start by dropping table and recreating it to start
|
||||
# counters and id caches from zero again.
|
||||
--disable_warnings
|
||||
connection server2;
|
||||
SET @@session.auto_increment_offset=1;
|
||||
SET @@session.auto_increment_increment=1;
|
||||
set ndb_autoincrement_prefetch_sz = 32;
|
||||
drop table if exists t1;
|
||||
connection server1;
|
||||
SET @@session.auto_increment_offset=1;
|
||||
SET @@session.auto_increment_increment=1;
|
||||
set ndb_autoincrement_prefetch_sz = 32;
|
||||
--enable_warnings
|
||||
|
||||
|
||||
create table t1 (a int not null auto_increment primary key) engine ndb;
|
||||
# Basic test, ensure that the second server gets a new range.
|
||||
#Generate record with key = 1
|
||||
insert into t1 values (NULL);
|
||||
connection server2;
|
||||
#Generate record with key = 33
|
||||
insert into t1 values (NULL);
|
||||
connection server1;
|
||||
select * from t1 order by a;
|
||||
|
||||
#This insert should not affect the range of the second server
|
||||
insert into t1 values (20);
|
||||
connection server2;
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
|
||||
connection server1;
|
||||
#This insert should remove cached values but also skip values already
|
||||
#taken by server2, given that there is no method of communicating with
|
||||
#the other server it should also cause a conflict
|
||||
connection server1;
|
||||
|
||||
insert into t1 values (35);
|
||||
insert into t1 values (NULL);
|
||||
connection server2;
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
|
||||
insert into t1 values (100);
|
||||
insert into t1 values (NULL);
|
||||
connection server1;
|
||||
insert into t1 values (NULL);
|
||||
select * from t1 order by a;
|
||||
|
||||
set auto_increment_offset = @old_auto_increment_offset;
|
||||
set auto_increment_increment = @old_auto_increment_increment;
|
||||
set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;
|
||||
|
||||
drop table t1;
|
||||
@@ -800,9 +800,27 @@ update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3;
|
||||
select * from t1 order by a;
|
||||
drop table t1,t2;
|
||||
|
||||
# End of 5.0 tests
|
||||
--echo End of 5.0 tests
|
||||
#
|
||||
# Bug#31635
|
||||
#
|
||||
create table t1 (a varchar(100) primary key, b varchar(100)) engine = NDB;
|
||||
insert into t1 values
|
||||
('a', 'a'),('b','b'),('c', 'c'),('aa', 'aa'),('bb', 'bb'),('cc', 'cc');
|
||||
replace into t1 values ('a', '-a');
|
||||
replace into t1 values ('b', '-b');
|
||||
replace into t1 values ('c', '-c');
|
||||
|
||||
replace into t1 values ('aa', '-aa');
|
||||
replace into t1 values ('bb', '-bb');
|
||||
replace into t1 values ('cc', '-cc');
|
||||
|
||||
replace into t1 values ('aaa', '-aaa');
|
||||
replace into t1 values ('bbb', '-bbb');
|
||||
replace into t1 values ('ccc', '-ccc');
|
||||
select * from t1 order by 1,2;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
# Bug #18483 Cannot create table with FK constraint
|
||||
|
||||
@@ -497,3 +497,23 @@ select count(*) from t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
|
||||
# bug # 30674 :
|
||||
# NOT NULL Blobs should default to zero-length. Not NULL TEXT
|
||||
# should default to zero-chars
|
||||
create table t1(
|
||||
a int,
|
||||
blob_nn blob not null,
|
||||
text_nn text not null,
|
||||
blob_nl blob,
|
||||
text_nl text,
|
||||
primary key(a)
|
||||
) engine=ndb;
|
||||
|
||||
insert into t1(a) values (1);
|
||||
insert into t1(a, text_nl) values (2, 'MySQL Cluster NDB');
|
||||
|
||||
select a, length(blob_nn), length(text_nn), blob_nl, text_nl from t1 order by a;
|
||||
|
||||
drop table t1;
|
||||
|
||||
@@ -638,142 +638,4 @@ create table t1(a int primary key, b int, unique key(b)) engine=ndb;
|
||||
insert ignore into t1 values (1,0), (2,0), (2,null), (3,null);
|
||||
select * from t1 order by a;
|
||||
drop table t1;
|
||||
|
||||
# Bug#26342 auto_increment_increment AND auto_increment_offset REALLY REALLY anger NDB cluster
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM;
|
||||
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
TRUNCATE t1;
|
||||
TRUNCATE t2;
|
||||
SET @@session.auto_increment_offset=5;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t1 (pk,b,c) VALUES (27,4,3),(NULL,5,4),(99,6,5),(NULL,7,6);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (pk,b,c) VALUES (27,4,3),(NULL,5,4),(99,6,5),(NULL,7,6);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
TRUNCATE t1;
|
||||
TRUNCATE t2;
|
||||
SET @@session.auto_increment_increment=2;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 7;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 7;
|
||||
|
||||
SET @@session.auto_increment_offset=1;
|
||||
SET @@session.auto_increment_increment=1;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 3;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 3;
|
||||
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 7;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 7;
|
||||
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 5;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 5;
|
||||
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=NDBCLUSTER AUTO_INCREMENT = 100;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
pk INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
b INT NOT NULL,
|
||||
c INT NOT NULL UNIQUE
|
||||
) ENGINE=MYISAM AUTO_INCREMENT = 100;
|
||||
|
||||
SET @@session.auto_increment_offset=5;
|
||||
SET @@session.auto_increment_increment=10;
|
||||
INSERT INTO t1 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
INSERT INTO t2 (b,c) VALUES (1,0),(2,1),(3,2);
|
||||
SELECT * FROM t1 ORDER BY pk;
|
||||
SELECT COUNT(t1.pk) FROM t1, t2 WHERE t1.pk = t2.pk AND t1.b = t2.b AND t1.c = t1.c;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
--disable_warnings
|
||||
connection server2;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
connection server1;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
--enable_warnings
|
||||
|
||||
flush status;
|
||||
--enable_warnings
|
||||
|
||||
# Create test tables on server1
|
||||
create table t1 (a int) engine=ndbcluster;
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
--disable_warnings
|
||||
connection server2;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
connection server1;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
flush status;
|
||||
--enable_warnings
|
||||
|
||||
flush status;
|
||||
|
||||
# Create test tables on server1
|
||||
create table t1 (a int) engine=ndbcluster;
|
||||
|
||||
@@ -121,7 +121,7 @@ Create Table CREATE TABLE `t3` (
|
||||
`fkid` mediumint(9) DEFAULT NULL,
|
||||
`filler` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (30) ENGINE = MyISAM, PARTITION pa4 VALUES LESS THAN (40) ENGINE = MyISAM, PARTITION pa5 VALUES LESS THAN (50) ENGINE = MyISAM, PARTITION pa6 VALUES LESS THAN (60) ENGINE = MyISAM, PARTITION pa7 VALUES LESS THAN (70) ENGINE = MyISAM, PARTITION pa8 VALUES LESS THAN (80) ENGINE = MyISAM, PARTITION pa9 VALUES LESS THAN (90) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION pa3 VALUES LESS THAN (30) ENGINE = MyISAM, PARTITION pa4 VALUES LESS THAN (40) ENGINE = MyISAM, PARTITION pa5 VALUES LESS THAN (50) ENGINE = MyISAM, PARTITION pa6 VALUES LESS THAN (60) ENGINE = MyISAM, PARTITION pa7 VALUES LESS THAN (70) ENGINE = MyISAM, PARTITION pa8 VALUES LESS THAN (80) ENGINE = MyISAM, PARTITION pa9 VALUES LESS THAN (90) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
|
||||
show slave status;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
|
||||
@@ -1089,18 +1089,19 @@ c1 hex(c4) c5
|
||||
3 62316231623162316231623162316231 QA
|
||||
|
||||
** update from master **
|
||||
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
|
||||
c1 hex(c4) c5 c6 c7
|
||||
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
|
||||
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
|
||||
3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
|
||||
|
||||
** Check slave **
|
||||
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
|
||||
c1 hex(c4) c5
|
||||
1 62316231623162316231623162316231 Kyle
|
||||
2 62316231623162316231623162316231 JOE
|
||||
3 62316231623162316231623162316231 QA
|
||||
3 62316231623162316231623162316231 TEST
|
||||
DROP TABLE t18;
|
||||
|
||||
|
||||
@@ -2229,18 +2230,19 @@ c1 hex(c4) c5
|
||||
3 62316231623162316231623162316231 QA
|
||||
|
||||
** update from master **
|
||||
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
|
||||
c1 hex(c4) c5 c6 c7
|
||||
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
|
||||
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
|
||||
3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
|
||||
|
||||
** Check slave **
|
||||
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
|
||||
c1 hex(c4) c5
|
||||
1 62316231623162316231623162316231 Kyle
|
||||
2 62316231623162316231623162316231 JOE
|
||||
3 62316231623162316231623162316231 QA
|
||||
3 62316231623162316231623162316231 TEST
|
||||
DROP TABLE t18;
|
||||
|
||||
|
||||
@@ -3369,18 +3371,19 @@ c1 hex(c4) c5
|
||||
3 62316231623162316231623162316231 QA
|
||||
|
||||
** update from master **
|
||||
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
|
||||
c1 hex(c4) c5 c6 c7
|
||||
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
|
||||
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
|
||||
3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
|
||||
|
||||
** Check slave **
|
||||
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
|
||||
c1 hex(c4) c5
|
||||
1 62316231623162316231623162316231 Kyle
|
||||
2 62316231623162316231623162316231 JOE
|
||||
3 62316231623162316231623162316231 QA
|
||||
3 62316231623162316231623162316231 TEST
|
||||
DROP TABLE t18;
|
||||
|
||||
|
||||
|
||||
@@ -1089,18 +1089,19 @@ c1 hex(c4) c5
|
||||
3 62316231623162316231623162316231 QA
|
||||
|
||||
** update from master **
|
||||
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
|
||||
c1 hex(c4) c5 c6 c7
|
||||
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
|
||||
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
|
||||
3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
|
||||
|
||||
** Check slave **
|
||||
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
|
||||
c1 hex(c4) c5
|
||||
1 62316231623162316231623162316231 Kyle
|
||||
2 62316231623162316231623162316231 JOE
|
||||
3 62316231623162316231623162316231 QA
|
||||
3 62316231623162316231623162316231 TEST
|
||||
DROP TABLE t18;
|
||||
|
||||
|
||||
@@ -2229,18 +2230,19 @@ c1 hex(c4) c5
|
||||
3 62316231623162316231623162316231 QA
|
||||
|
||||
** update from master **
|
||||
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
|
||||
c1 hex(c4) c5 c6 c7
|
||||
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
|
||||
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
|
||||
3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
|
||||
|
||||
** Check slave **
|
||||
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
|
||||
c1 hex(c4) c5
|
||||
1 62316231623162316231623162316231 Kyle
|
||||
2 62316231623162316231623162316231 JOE
|
||||
3 62316231623162316231623162316231 QA
|
||||
3 62316231623162316231623162316231 TEST
|
||||
DROP TABLE t18;
|
||||
|
||||
|
||||
@@ -3369,18 +3371,19 @@ c1 hex(c4) c5
|
||||
3 62316231623162316231623162316231 QA
|
||||
|
||||
** update from master **
|
||||
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
|
||||
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
|
||||
c1 hex(c4) c5 c6 c7
|
||||
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
|
||||
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
|
||||
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
|
||||
3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
|
||||
|
||||
** Check slave **
|
||||
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
|
||||
c1 hex(c4) c5
|
||||
1 62316231623162316231623162316231 Kyle
|
||||
2 62316231623162316231623162316231 JOE
|
||||
3 62316231623162316231623162316231 QA
|
||||
3 62316231623162316231623162316231 TEST
|
||||
DROP TABLE t18;
|
||||
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ Create Table CREATE TABLE `byrange_tbl` (
|
||||
`fkid` mediumint(9) DEFAULT NULL,
|
||||
`filler` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION pa2 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION pa3 VALUES LESS THAN (30) ENGINE = InnoDB, PARTITION pa4 VALUES LESS THAN (40) ENGINE = InnoDB, PARTITION pa5 VALUES LESS THAN (50) ENGINE = InnoDB, PARTITION pa6 VALUES LESS THAN (60) ENGINE = InnoDB, PARTITION pa7 VALUES LESS THAN (70) ENGINE = InnoDB, PARTITION pa8 VALUES LESS THAN (80) ENGINE = InnoDB, PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION pa2 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION pa3 VALUES LESS THAN (30) ENGINE = InnoDB, PARTITION pa4 VALUES LESS THAN (40) ENGINE = InnoDB, PARTITION pa5 VALUES LESS THAN (50) ENGINE = InnoDB, PARTITION pa6 VALUES LESS THAN (60) ENGINE = InnoDB, PARTITION pa7 VALUES LESS THAN (70) ENGINE = InnoDB, PARTITION pa8 VALUES LESS THAN (80) ENGINE = InnoDB, PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
|
||||
@@ -123,7 +123,7 @@ Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1364
|
||||
Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
|
||||
Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Field 'x' doesn't have a default value
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
@@ -141,7 +141,7 @@ Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_SQL_Errno 1364
|
||||
Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
|
||||
Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Field 'x' doesn't have a default value
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
INSERT INTO t9 VALUES (2);
|
||||
|
||||
@@ -123,7 +123,7 @@ Replicate_Ignore_Table
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1364
|
||||
Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
|
||||
Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Field 'x' doesn't have a default value
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
@@ -141,7 +141,7 @@ Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_SQL_Errno 1364
|
||||
Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
|
||||
Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Field 'x' doesn't have a default value
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
INSERT INTO t9 VALUES (2);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user