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

Merge mysql-5.5 -> mysql-5.5-innodb

This commit is contained in:
Vasil Dimov
2011-01-24 09:42:07 +02:00
285 changed files with 4663 additions and 6185 deletions

View File

@@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=9
MYSQL_VERSION_PATCH=10
MYSQL_VERSION_EXTRA=

View File

@@ -85,6 +85,7 @@ enum options_client
OPT_WRITE_BINLOG, OPT_DUMP_DATE,
OPT_INIT_COMMAND,
OPT_PLUGIN_DIR,
OPT_DEFAULT_AUTH,
OPT_DEFAULT_PLUGIN,
OPT_MAX_CLIENT_OPTION
};

View File

@@ -162,7 +162,7 @@ static int wait_time = 5;
static STATUS status;
static ulong select_limit,max_join_size,opt_connect_timeout=0;
static char mysql_charsets_dir[FN_REFLEN+1];
static char *opt_plugin_dir= 0, *opt_default_auth;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static const char *xmlmeta[] = {
"&", "&",
"<", "&lt;",
@@ -1564,7 +1564,7 @@ static struct my_option my_long_options[] =
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_PLUGIN_DIR,
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},

View File

@@ -45,6 +45,8 @@ static DYNAMIC_STRING ds_args;
static DYNAMIC_STRING conn_args;
static char *opt_password= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static my_bool tty_password= 0;
static char opt_tmpdir[FN_REFLEN] = "";
@@ -88,6 +90,10 @@ static struct my_option my_long_options[]=
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", 0,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade "
"has already been executed for the current version of MySQL.",
&opt_force, &opt_force, 0,
@@ -102,6 +108,9 @@ static struct my_option my_long_options[]=
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@@ -283,6 +292,8 @@ get_one_option(int optid, const struct my_option *opt,
case 'S': /* --socket */
case OPT_MYSQL_PROTOCOL: /* --protocol */
case OPT_SHARED_MEMORY_BASE_NAME: /* --shared-memory-base-name */
case OPT_PLUGIN_DIR: /* --plugin-dir */
case OPT_DEFAULT_AUTH: /* --default-auth */
add_one_option(&conn_args, opt, argument);
break;
}

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,9 +17,7 @@
#include "client_priv.h"
#include <signal.h>
#ifdef THREAD
#include <my_pthread.h> /* because of signal() */
#endif
#include <sys/stat.h>
#include <mysql.h>
#include <sql_common.h>
@@ -44,7 +42,7 @@ static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations;
static uint opt_count_iterations= 0, my_end_arg;
static ulong opt_connect_timeout, opt_shutdown_timeout;
static char * unix_port=0;
static char *opt_plugin_dir= 0, *opt_default_auth;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
@@ -210,7 +208,7 @@ static struct my_option my_long_options[] =
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_PLUGIN_DIR,
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -415,6 +413,9 @@ int main(int argc,char *argv[])
if (interval) /* --sleep=interval given */
{
if (opt_count_iterations && --nr_iterations == 0)
break;
/*
If connection was dropped (unintentionally, or due to SHUTDOWN),
re-establish it if --wait ("retry-connect") was given and user

View File

@@ -79,6 +79,8 @@ static char* host = 0;
static int port= 0;
static uint my_end_arg;
static const char* sock= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
#ifdef HAVE_SMEM
static char *shared_memory_base_name= 0;
#endif
@@ -1039,6 +1041,10 @@ static struct my_option my_long_options[] =
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
&debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"disable-log-bin", 'D', "Disable binary log. This is useful, if you "
"enabled --to-last-log and are sending the output to the same MySQL server. "
"This way you could avoid an endless loop. You would also like to use it "
@@ -1064,6 +1070,9 @@ static struct my_option my_long_options[] =
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p', "Password to connect to remote server.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@@ -1381,6 +1390,12 @@ static Exit_status safe_connect()
return ERROR_STOP;
}
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (opt_protocol)
mysql_options(mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
#ifdef HAVE_SMEM

View File

@@ -40,6 +40,7 @@ static int my_end_arg;
static char * opt_mysql_unix_port = 0;
static char *opt_password = 0, *current_user = 0,
*default_charset= 0, *current_host= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static int first_error = 0;
DYNAMIC_ARRAY tables4repair;
#ifdef HAVE_SMEM
@@ -99,6 +100,10 @@ static struct my_option my_long_options[] =
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", &default_charset,
&default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fast",'F', "Check only tables that haven't been closed properly.",
&opt_fast, &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
@@ -136,6 +141,9 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@@ -796,6 +804,13 @@ static int dbConnect(char *host, char *user, char *passwd)
if (shared_memory_base_name)
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(&mysql_connection, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth);
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd,
NULL, opt_mysql_port, opt_mysql_unix_port, 0)))

View File

@@ -137,7 +137,7 @@ FILE *stderror_file=0;
static char *shared_memory_base_name=0;
#endif
static uint opt_protocol= 0;
static char *opt_plugin_dir= 0, *opt_default_auth;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
/*
Dynamic_string wrapper functions. In this file use these
@@ -503,7 +503,7 @@ static struct my_option my_long_options[] =
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_PLUGIN_DIR,
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -2237,6 +2237,15 @@ static uint get_table_structure(char *table, char *db, char *table_type,
const char *insert_option;
char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3];
char table_buff2[NAME_LEN*2+3], query_buff[QUERY_LENGTH];
const char *show_fields_stmt= "SELECT `COLUMN_NAME` AS `Field`, "
"`COLUMN_TYPE` AS `Type`, "
"`IS_NULLABLE` AS `Null`, "
"`COLUMN_KEY` AS `Key`, "
"`COLUMN_DEFAULT` AS `Default`, "
"`EXTRA` AS `Extra`, "
"`COLUMN_COMMENT` AS `Comment` "
"FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE "
"TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'";
FILE *sql_file= md_result_file;
int len;
MYSQL_RES *result;
@@ -2504,8 +2513,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
verbose_msg("%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n",
my_progname, mysql_error(mysql));
my_snprintf(query_buff, sizeof(query_buff), "show fields from %s",
result_table);
my_snprintf(query_buff, sizeof(query_buff), show_fields_stmt, db, table);
if (mysql_query_with_error_report(mysql, &result, query_buff))
DBUG_RETURN(0);

View File

@@ -60,6 +60,7 @@ static char *opt_password=0, *current_user=0,
*default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
static uint opt_mysql_port= 0, opt_protocol= 0;
static char * opt_mysql_unix_port=0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static longlong opt_ignore_lines= -1;
#include <sslopt-vars.h>
@@ -90,6 +91,10 @@ static struct my_option my_long_options[] =
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
&debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delete", 'd', "First delete all rows from table.", &opt_delete,
&opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB,
@@ -139,6 +144,9 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@@ -429,6 +437,13 @@ static MYSQL *db_connect(char *host, char *database,
if (shared_memory_base_name)
mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(mysql_real_connect(mysql,host,user,passwd,
database,opt_mysql_port,opt_mysql_unix_port,

View File

@@ -34,6 +34,7 @@ static my_bool debug_info_flag= 0, debug_check_flag= 0;
static uint my_end_arg= 0;
static uint opt_verbose=0;
static char *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
@@ -124,6 +125,12 @@ int main(int argc, char **argv)
#endif
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (!(mysql_real_connect(&mysql,host,user,opt_password,
(first_argument_uses_wildcards) ? "" :
argv[0],opt_mysql_port,opt_mysql_unix_port,
@@ -182,6 +189,10 @@ static struct my_option my_long_options[] =
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
&debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
@@ -195,6 +206,9 @@ static struct my_option my_long_options[] =
"Password to use when connecting to server. If password is not given, it's "
"solicited on the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0

View File

@@ -122,6 +122,7 @@ static char *host= NULL, *opt_password= NULL, *user= NULL,
*pre_system= NULL,
*post_system= NULL,
*opt_mysql_unix_port= NULL;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
const char *delimiter= "\n";
@@ -338,6 +339,12 @@ int main(int argc, char **argv)
#endif
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (!opt_only_print)
{
if (!(mysql_real_connect(&mysql, host, user, opt_password,
@@ -581,6 +588,10 @@ static struct my_option my_long_options[] =
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
&debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delimiter", 'F',
"Delimiter to use in SQL statements supplied in file or command line.",
&delimiter, &delimiter, 0, GET_STR, REQUIRED_ARG,
@@ -620,6 +631,9 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection.", &opt_mysql_port,
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
0},
@@ -1507,7 +1521,12 @@ generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt)
exit(1);
}
result= mysql_store_result(mysql);
if (!(result= mysql_store_result(mysql)))
{
fprintf(stderr, "%s: Error when storing result: %d %s\n",
my_progname, mysql_errno(mysql), mysql_error(mysql));
exit(1);
}
primary_keys_number_of= mysql_num_rows(result);
/* So why check this? Blackhole :) */
@@ -1879,11 +1898,16 @@ limit_not_met:
{
if (mysql_field_count(mysql))
{
result= mysql_store_result(mysql);
if (!(result= mysql_store_result(mysql)))
fprintf(stderr, "%s: Error when storing result: %d %s\n",
my_progname, mysql_errno(mysql), mysql_error(mysql));
else
{
while ((row= mysql_fetch_row(result)))
counter++;
mysql_free_result(result);
}
}
} while(mysql_next_result(mysql) == 0);
queries++;

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
mysqltest
@@ -468,6 +468,8 @@ TYPELIB command_typelib= {array_elements(command_names),"",
command_names, 0};
DYNAMIC_STRING ds_res;
/* Points to ds_warning in run_query, so it can be freed */
DYNAMIC_STRING *ds_warn= 0;
char builtin_echo[FN_REFLEN];
@@ -488,7 +490,7 @@ VAR* var_init(VAR* v, const char *name, int name_len, const char *val,
VAR* var_get(const char *var_name, const char** var_name_end,
my_bool raw, my_bool ignore_not_existing);
void eval_expr(VAR* v, const char *p, const char** p_end,
bool open_end=false, bool backtick=true);
bool open_end=false, bool do_eval=true);
my_bool match_delimiter(int c, const char *delim, uint length);
void dump_result_to_reject_file(char *buf, int size);
void dump_warning_messages();
@@ -1275,6 +1277,8 @@ void free_used_memory()
my_free(embedded_server_args[--embedded_server_arg_count]);
delete_dynamic(&q_lines);
dynstr_free(&ds_res);
if (ds_warn)
dynstr_free(ds_warn);
free_all_replace();
my_free(opt_pass);
free_defaults(default_argv);
@@ -1318,6 +1322,17 @@ static void cleanup_and_exit(int exit_code)
exit(exit_code);
}
void print_file_stack()
{
for (struct st_test_file* err_file= cur_file;
err_file != file_stack;
err_file--)
{
fprintf(stderr, "included from %s at line %d:\n",
err_file->file_name, err_file->lineno);
}
}
void die(const char *fmt, ...)
{
static int dying= 0;
@@ -1337,8 +1352,12 @@ void die(const char *fmt, ...)
/* Print the error message */
fprintf(stderr, "mysqltest: ");
if (cur_file && cur_file != file_stack)
fprintf(stderr, "In included file \"%s\": ",
{
fprintf(stderr, "In included file \"%s\": \n",
cur_file->file_name);
print_file_stack();
}
if (start_lineno > 0)
fprintf(stderr, "At line %u: ", start_lineno);
if (fmt)
@@ -1368,20 +1387,14 @@ void die(const char *fmt, ...)
void abort_not_supported_test(const char *fmt, ...)
{
va_list args;
struct st_test_file* err_file= cur_file;
DBUG_ENTER("abort_not_supported_test");
/* Print include filestack */
fprintf(stderr, "The test '%s' is not supported by this installation\n",
file_stack->file_name);
fprintf(stderr, "Detected in file %s at line %d\n",
err_file->file_name, err_file->lineno);
while (err_file != file_stack)
{
err_file--;
fprintf(stderr, "included from %s at line %d\n",
err_file->file_name, err_file->lineno);
}
cur_file->file_name, cur_file->lineno);
print_file_stack();
/* Print error message */
va_start(args, fmt);
@@ -2519,7 +2532,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
break;
}
}
eval_expr(var, value, 0);
eval_expr(var, value, 0, false, false);
}
dynstr_free(&ds_query);
mysql_free_result(res);
@@ -2551,12 +2564,16 @@ void var_copy(VAR *dest, VAR *src)
void eval_expr(VAR *v, const char *p, const char **p_end,
bool open_end, bool backtick)
bool open_end, bool do_eval)
{
DBUG_ENTER("eval_expr");
DBUG_PRINT("enter", ("p: '%s'", p));
/* Skip to treat as pure string if no evaluation */
if (! do_eval)
goto NO_EVAL;
if (*p == '$')
{
VAR *vp;
@@ -2576,7 +2593,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end,
DBUG_VOID_RETURN;
}
if (*p == '`' && backtick)
if (*p == '`')
{
var_query_set(v, p, p_end);
DBUG_VOID_RETURN;
@@ -2599,6 +2616,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end,
}
}
NO_EVAL:
{
int new_val_len = (p_end && *p_end) ?
(int) (*p_end - p) : (int) strlen(p);
@@ -7679,6 +7697,8 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
die ("Cannot reap on a connection without pending send");
init_dynamic_string(&ds_warnings, NULL, 0, 256);
ds_warn= &ds_warnings;
/*
Evaluate query if this is an eval command
*/
@@ -7836,6 +7856,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
ds, &ds_warnings);
dynstr_free(&ds_warnings);
ds_warn= 0;
if (command->type == Q_EVAL || command->type == Q_SEND_EVAL)
dynstr_free(&eval_query);

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2009 Sun Microsystems, Inc
# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,12 +18,14 @@ IF(NOT DEFAULT_CHARSET)
SET(DEFAULT_CHARSET "latin1")
ENDIF()
IF(NOT DEFAULT_COLLATIONS)
IF(NOT DEFAULT_COLLATION)
SET(DEFAULT_COLLATION "latin1_swedish_ci")
ENDIF()
SET(CHARSETS ${DEFAULT_CHARSET} latin1 utf8 utf8mb4)
SET(CHARSETS_COMPLEX big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)
SET(CHARSETS_COMPLEX
big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2
sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)
SET(CHARSETS_AVAILABLE
binary armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257

View File

@@ -16,7 +16,7 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/cmd-line-utils)
ADD_DEFINITIONS(-DHAVE_CONFIG_H -DNO_KILL_INTR -DMYSQL_CLIENT_NO_THREADS)
ADD_DEFINITIONS(-DHAVE_CONFIG_H -DNO_KILL_INTR)
INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH})

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2009 Sun Microsystems, Inc
/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -470,9 +470,6 @@
#cmakedefine STACK_DIRECTION @STACK_DIRECTION@
#define THREAD 1
#define THREAD_SAFE_CLIENT 1
#define SYSTEM_TYPE "@SYSTEM_TYPE@"
#define MACHINE_TYPE "@CMAKE_SYSTEM_PROCESSOR@"
#cmakedefine HAVE_DTRACE 1
@@ -518,8 +515,8 @@
#cmakedefine CYBOZU 1
/* Character sets and collations */
#cmakedefine MYSQL_DEFAULT_CHARSET_NAME "latin1"
#cmakedefine MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
#cmakedefine MYSQL_DEFAULT_CHARSET_NAME "@MYSQL_DEFAULT_CHARSET_NAME@"
#cmakedefine MYSQL_DEFAULT_COLLATION_NAME "@MYSQL_DEFAULT_COLLATION_NAME@"
#cmakedefine USE_MB 1
#cmakedefine USE_MB_IDENT 1

View File

@@ -319,15 +319,6 @@ static void DbugExit(const char *why);
static const char *DbugStrTok(const char *s);
static void DbugVfprintf(FILE *stream, const char* format, va_list args);
#ifndef THREAD
/* Open profile output stream */
static FILE *OpenProfile(CODE_STATE *cs, const char *name);
/* Profile if asked for it */
static BOOLEAN DoProfile(CODE_STATE *);
/* Return current user time (ms) */
static unsigned long Clock(void);
#endif
/*
* Miscellaneous printf format strings.
*/
@@ -355,7 +346,6 @@ static unsigned long Clock(void);
** Macros to allow dbugging with threads
*/
#ifdef THREAD
#include <my_pthread.h>
static pthread_mutex_t THR_LOCK_dbug;
@@ -394,30 +384,6 @@ static CODE_STATE *code_state(void)
return cs;
}
#else /* !THREAD */
static CODE_STATE static_code_state=
{
"dbug", "?func", "?file", NULL, &init_settings,
NullS, NullS, 0,0,0,0,0,NullS
};
static CODE_STATE *code_state(void)
{
if (!init_done)
{
bzero(&init_settings, sizeof(init_settings));
init_settings.out_file=stderr;
init_settings.flags=OPEN_APPEND;
init_done=TRUE;
}
return &static_code_state;
}
#define pthread_mutex_lock(A) {}
#define pthread_mutex_unlock(A) {}
#endif
/*
* Translate some calls among different systems.
*/
@@ -601,15 +567,6 @@ int DbugParse(CODE_STATE *cs, const char *control)
else
stack->flags |= PID_ON;
break;
#ifndef THREAD
case 'g':
if (OpenProfile(cs, PROF_FILE))
{
stack->flags |= PROFILE_ON;
stack->p_functions= ListAdd(stack->p_functions, control, end);
}
break;
#endif
case 'L':
if (sign < 0)
stack->flags &= ~LINE_ON;
@@ -1154,23 +1111,7 @@ void _db_enter_(const char *_func_, const char *_file_,
_stack_frame_->prev= cs->framep;
_stack_frame_->level= ++cs->level | framep_trace_flag(cs, cs->framep);
cs->framep= _stack_frame_;
#ifndef THREAD
if (DoProfile(cs))
{
long stackused;
if (cs->framep->prev == NULL)
stackused= 0;
else
{
stackused= (char*)(cs->framep->prev) - (char*)(cs->framep);
stackused= stackused > 0 ? stackused : -stackused;
}
(void) fprintf(cs->stack->prof_file, PROF_EFMT , Clock(), cs->func);
(void) fprintf(cs->stack->prof_file, PROF_SFMT, (ulong) cs->framep, stackused,
AUTOS_REVERSE ? _stack_frame_->func : cs->func);
(void) fflush(cs->stack->prof_file);
}
#endif
switch (DoTrace(cs)) {
case ENABLE_TRACE:
cs->framep->level|= TRACE_ON;
@@ -1229,10 +1170,7 @@ void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_)
my_snprintf(buf, sizeof(buf), ERR_MISSING_RETURN, cs->func);
DbugExit(buf);
}
#ifndef THREAD
if (DoProfile(cs))
(void) fprintf(cs->stack->prof_file, PROF_XFMT, Clock(), cs->func);
#endif
if (DoTrace(cs) & DO_TRACE)
{
if (TRACING)
@@ -1744,36 +1682,6 @@ static int DoTrace(CODE_STATE *cs)
return DONT_TRACE;
}
/*
* FUNCTION
*
* DoProfile check to see if profiling is current enabled
*
* SYNOPSIS
*
* static BOOLEAN DoProfile()
*
* DESCRIPTION
*
* Checks to see if profiling is enabled based on whether the
* user has specified profiling, the maximum trace depth has
* not yet been reached, the current function is selected,
* and the current process is selected. Returns TRUE if
* profiling is enabled, FALSE otherwise.
*
*/
#ifndef THREAD
static BOOLEAN DoProfile(CODE_STATE *cs)
{
return PROFILING &&
cs->level <= cs->stack->maxdepth &&
InList(cs->stack->p_functions, cs->func) & (INCLUDE|MATCHED) &&
InList(cs->stack->processes, cs->process) & (INCLUDE|MATCHED);
}
#endif
FILE *_db_fp_(void)
{
CODE_STATE *cs;
@@ -1900,11 +1808,7 @@ static void DoPrefix(CODE_STATE *cs, uint _line_)
cs->lineno++;
if (cs->stack->flags & PID_ON)
{
#ifdef THREAD
(void) fprintf(cs->stack->out_file, "%-7s: ", my_thread_name());
#else
(void) fprintf(cs->stack->out_file, "%5d: ", (int) getpid());
#endif
}
if (cs->stack->flags & NUMBER_ON)
(void) fprintf(cs->stack->out_file, "%5d: ", cs->lineno);
@@ -2014,63 +1918,6 @@ static void DBUGOpenFile(CODE_STATE *cs,
}
}
/*
* FUNCTION
*
* OpenProfile open new output stream for profiler output
*
* SYNOPSIS
*
* static FILE *OpenProfile(name)
* char *name;
*
* DESCRIPTION
*
* Given name of a new file, opens the file
* and sets the profiler output stream to the new file.
*
* It is currently unclear whether the prefered behavior is
* to truncate any existing file, or simply append to it.
* The latter behavior would be desirable for collecting
* accumulated runtime history over a number of separate
* runs. It might take some changes to the analyzer program
* though, and the notes that Binayak sent with the profiling
* diffs indicated that append was the normal mode, but this
* does not appear to agree with the actual code. I haven't
* investigated at this time [fnf; 24-Jul-87].
*/
#ifndef THREAD
static FILE *OpenProfile(CODE_STATE *cs, const char *name)
{
REGISTER FILE *fp;
REGISTER BOOLEAN newfile;
fp=0;
if (!Writable(name))
{
(void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name);
perror("");
(void) Delay(cs->stack->delay);
}
else
{
newfile= !EXISTS(name);
if (!(fp= fopen(name, "w")))
{
(void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name);
perror("");
}
else
{
cs->stack->prof_file= fp;
}
}
return fp;
}
#endif
/*
* FUNCTION
*
@@ -2419,80 +2266,6 @@ const char* _db_get_func_(void)
return cs->func;
}
/*
* Here we need the definitions of the clock routine. Add your
* own for whatever system that you have.
*/
#ifndef THREAD
#if defined(HAVE_GETRUSAGE)
#include <sys/param.h>
#include <sys/resource.h>
/* extern int getrusage(int, struct rusage *); */
/*
* Returns the user time in milliseconds used by this process so
* far.
*/
static unsigned long Clock()
{
struct rusage ru;
(void) getrusage(RUSAGE_SELF, &ru);
return ru.ru_utime.tv_sec*1000 + ru.ru_utime.tv_usec/1000;
}
#elif defined(__WIN__)
static ulong Clock()
{
return clock()*(1000/CLOCKS_PER_SEC);
}
#elif defined(amiga)
struct DateStamp { /* Yes, this is a hack, but doing it right */
long ds_Days; /* is incredibly ugly without splitting this */
long ds_Minute; /* off into a separate file */
long ds_Tick;
};
static int first_clock= TRUE;
static struct DateStamp begin;
static struct DateStamp elapsed;
static unsigned long Clock()
{
register struct DateStamp *now;
register unsigned long millisec= 0;
extern VOID *AllocMem();
now= (struct DateStamp *) AllocMem((long) sizeof(struct DateStamp), 0L);
if (now != NULL)
{
if (first_clock == TRUE)
{
first_clock= FALSE;
(void) DateStamp(now);
begin= *now;
}
(void) DateStamp(now);
millisec= 24 * 3600 * (1000 / HZ) * (now->ds_Days - begin.ds_Days);
millisec += 60 * (1000 / HZ) * (now->ds_Minute - begin.ds_Minute);
millisec += (1000 / HZ) * (now->ds_Tick - begin.ds_Tick);
(void) FreeMem(now, (long) sizeof(struct DateStamp));
}
return millisec;
}
#else
static unsigned long Clock()
{
return 0;
}
#endif /* RUSAGE */
#endif /* THREADS */
#else

View File

@@ -571,12 +571,10 @@ int main (int argc, char **argv)
FILE *infile;
FILE *outfile = {stdout};
#ifdef THREAD
#if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */
#endif
my_thread_global_init();
#endif /* THREAD */
{
DBUG_ENTER ("main");
DBUG_PROCESS (argv[0]);

View File

@@ -16,12 +16,11 @@ char *argv[];
{
register int result, ix;
extern int factorial(int);
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
#if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */
#endif
#ifdef THREAD
my_thread_global_init();
#endif
{
DBUG_ENTER ("main");
DBUG_PROCESS (argv[0]);

View File

@@ -44,12 +44,11 @@ int main (int argc, char *argv[])
if (argc == 1)
return 0;
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
#if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */
#endif
#ifdef THREAD
my_thread_global_init();
#endif
dup2(1, 2);
for (i = 1; i < argc; i++)
{

View File

@@ -193,7 +193,7 @@ int main(int argc, char **argv)
}
for (argument= arguments+1 ; *argument ; argument++)
if (*argument != args_separator) /* skip arguments separator */
if (!my_getopt_is_args_separator(*argument)) /* skip arguments separator */
puts(*argument);
my_free(load_default_groups);
free_defaults(arguments);

View File

@@ -40,7 +40,6 @@ SET(HEADERS
my_xml.h
mysql_embed.h
my_pthread.h
my_no_pthread.h
decimal.h
errmsg.h
my_global.h

View File

@@ -1,4 +1,5 @@
/* Copyright (C) 2000-2004 MySQL AB, 2009 Sun Microsystems, Inc
/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
reserved
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,10 +26,9 @@ extern "C" {
#ifndef _my_base_h
#include <my_base.h>
#endif
#ifdef THREAD
#include <my_pthread.h>
#include <thr_lock.h>
#endif
#include "my_handler.h"
#include "my_tree.h"
@@ -146,10 +146,8 @@ typedef struct st_heap_share
uint open_count;
uchar *del_link; /* Link to next block with del. rec */
char * name; /* Name of "memory-file" */
#ifdef THREAD
THR_LOCK lock;
mysql_mutex_t intern_lock; /* Locking for use with _locking */
#endif
my_bool delete_on_close;
LIST open_list;
uint auto_key;
@@ -175,9 +173,7 @@ typedef struct st_heap_info
TREE_ELEMENT **last_pos;
uint lastkey_len;
my_bool implicit_emptied;
#ifdef THREAD
THR_LOCK_DATA lock;
#endif
LIST open_list;
} HP_INFO;

View File

@@ -1,4 +1,5 @@
/* Copyright (C) 2000 MySQL AB
/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
reserved
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,9 +31,6 @@
#define EOVERFLOW 84
#endif
#if !defined(USE_MY_FUNC) && !defined(THREAD)
#include <my_nosys.h> /* For faster code, after test */
#endif /* USE_MY_FUNC */
#endif /* stdin */
#include <my_list.h>

View File

@@ -33,9 +33,7 @@ typedef struct st_bitmap
thread_safe flag in bitmap_init was set. Otherwise, we optimize by not
acquiring the mutex
*/
#ifdef THREAD
mysql_mutex_t *mutex;
#endif
} MY_BITMAP;
#ifdef __cplusplus

View File

@@ -212,13 +212,6 @@
#include <sys/types.h>
#endif
/* The client defines this to avoid all thread code */
#if defined(MYSQL_CLIENT_NO_THREADS) || defined(UNDEF_THREADS_HACK)
#undef THREAD
#undef HAVE_LINUXTHREADS
#undef HAVE_NPTL
#endif
#ifdef HAVE_THREADS_WITHOUT_SOCKETS
/* MIT pthreads does not work with unix sockets */
#undef HAVE_SYS_UN_H
@@ -261,7 +254,7 @@
#endif
#endif
#if defined(THREAD) && !defined(__WIN__)
#if !defined(__WIN__)
#ifndef _POSIX_PTHREAD_SEMANTICS
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
#endif
@@ -282,7 +275,7 @@ C_MODE_END
#if !defined(SCO) && !defined(_REENTRANT)
#define _REENTRANT 1 /* Threads requires reentrant code */
#endif
#endif /* THREAD */
#endif /* !defined(__WIN__) */
/* Go around some bugs in different OS and compilers */
#ifdef _AIX /* By soren@t.dk */
@@ -415,7 +408,7 @@ C_MODE_END
#include <sys/stream.h> /* HPUX 10.20 defines ulong here. UGLY !!! */
#define HAVE_ULONG
#endif
#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD)
#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE)
/* Fix bug in setrlimit */
#undef setrlimit
#define setrlimit cma_setrlimit64
@@ -1342,17 +1335,6 @@ do { doubleget_union _tmp; \
#endif /* WORDS_BIGENDIAN */
#ifndef THREAD
#define thread_safe_increment(V,L) (V)++
#define thread_safe_decrement(V,L) (V)--
#define thread_safe_add(V,C,L) (V)+=(C)
#define thread_safe_sub(V,C,L) (V)-=(C)
#define statistic_increment(V,L) (V)++
#define statistic_decrement(V,L) (V)--
#define statistic_add(V,C,L) (V)+=(C)
#define statistic_sub(V,C,L) (V)-=(C)
#endif
#ifdef HAVE_CHARSET_utf8
#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8"
#else

View File

@@ -1,72 +0,0 @@
#ifndef MY_NO_PTHREAD_INCLUDED
#define MY_NO_PTHREAD_INCLUDED
/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef THREAD
/*
This block is to access some thread-related type definitions
even in builds which do not need thread functions,
as some variables (based on these types) are declared
even in non-threaded builds.
Case in point: 'mf_keycache.c'
*/
#if defined(__WIN__)
#else /* Normal threads */
#include <pthread.h>
#endif /* defined(__WIN__) */
/*
This undefs some pthread mutex locks when one isn't using threads
to make thread safe code, that should also work in single thread
environment, easier to use.
*/
#define pthread_mutex_init(A,B)
#define pthread_mutex_lock(A)
#define pthread_mutex_unlock(A)
#define pthread_mutex_destroy(A)
#define my_rwlock_init(A,B)
#define rw_rdlock(A)
#define rw_wrlock(A)
#define rw_unlock(A)
#define rwlock_destroy(A)
#define safe_mutex_assert_owner(mp)
#define mysql_mutex_init(A, B, C) do {} while (0)
#define mysql_mutex_lock(A) do {} while (0)
#define mysql_mutex_unlock(A) do {} while (0)
#define mysql_mutex_destroy(A) do {} while (0)
#define mysql_rwlock_init(A, B, C) do {} while (0)
#define mysql_rwlock_rdlock(A) do {} while (0)
#define mysql_rwlock_wrlock(A) do {} while (0)
#define mysql_rwlock_unlock(A) do {} while (0)
#define mysql_rwlock_destroy(A) do {} while (0)
typedef int my_pthread_once_t;
#define MY_PTHREAD_ONCE_INIT 0
#define MY_PTHREAD_ONCE_DONE 1
#define my_pthread_once(C,F) do { \
if (*(C) != MY_PTHREAD_ONCE_DONE) { F(); *(C)= MY_PTHREAD_ONCE_DONE; } \
} while(0)
#endif
#endif /* MY_NO_PTHREAD_INCLUDED */

View File

@@ -881,12 +881,6 @@ extern uint thd_lib_detected;
to use my_atomic operations instead.
*/
/*
Warning:
When compiling without threads, this file is not included.
See the *other* declarations of thread_safe_xxx in include/my_global.h
*/
#ifdef THREAD
#ifndef thread_safe_increment
#ifdef _WIN32
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
@@ -910,7 +904,7 @@ extern uint thd_lib_detected;
(mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L)))
#endif
#endif
#endif
/*
statistics_xxx functions are for non critical statistic,

View File

@@ -41,11 +41,7 @@ typedef struct my_aio_result {
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
#endif /* HAVE_VALGRIND */
#ifndef THREAD
extern int my_errno; /* Last error in mysys */
#else
#include <my_pthread.h>
#endif
#include <m_ctype.h> /* for CHARSET_INFO */
#include <stdarg.h>
@@ -314,7 +310,7 @@ struct st_my_file_info
int oflag; /* open flags, e.g O_APPEND */
#endif
enum file_type type;
#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
#if !defined(HAVE_PREAD) && !defined(_WIN32)
mysql_mutex_t mutex;
#endif
};
@@ -334,9 +330,7 @@ typedef struct st_my_tmpdir
DYNAMIC_ARRAY full_list;
char **list;
uint cur, max;
#ifdef THREAD
mysql_mutex_t mutex;
#endif
} MY_TMPDIR;
typedef struct st_dynamic_string
@@ -348,7 +342,6 @@ typedef struct st_dynamic_string
struct st_io_cache;
typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*);
#ifdef THREAD
typedef struct st_io_cache_share
{
mysql_mutex_t mutex; /* To sync on reads into buffer. */
@@ -368,7 +361,6 @@ typedef struct st_io_cache_share
my_bool alloced;
#endif
} IO_CACHE_SHARE;
#endif
typedef struct st_io_cache /* Used when cacheing files */
{
@@ -409,7 +401,7 @@ typedef struct st_io_cache /* Used when cacheing files */
WRITE_CACHE, and &read_pos and &read_end respectively otherwise
*/
uchar **current_pos, **current_end;
#ifdef THREAD
/*
The lock is for append buffer used in SEQ_READ_APPEND cache
need mutex copying from append buffer to read buffer.
@@ -423,7 +415,7 @@ typedef struct st_io_cache /* Used when cacheing files */
READ_CACHE mode is supported.
*/
IO_CACHE_SHARE *share;
#endif
/*
A caller will use my_b_read() macro to read from the cache
if the data is already in cache, it will be simply copied with
@@ -631,6 +623,7 @@ extern const char** get_global_errmsgs();
extern void wait_for_free_space(const char *filename, int errors);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
extern FILE *my_freopen(const char *path, const char *mode, FILE *stream);
extern int my_fclose(FILE *fd,myf MyFlags);
extern File my_fileno(FILE *fd);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
@@ -655,14 +648,6 @@ extern int my_redel(const char *from, const char *to, int MyFlags);
extern int my_copystat(const char *from, const char *to, int MyFlags);
extern char * my_filename(File fd);
#ifndef THREAD
extern void dont_break(void);
extern void allow_break(void);
#else
#define dont_break()
#define allow_break()
#endif
#ifdef EXTRA_DEBUG
void my_print_open_files(void);
#else
@@ -735,12 +720,10 @@ extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
pbool clear_cache);
extern void setup_io_cache(IO_CACHE* info);
extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count);
#ifdef THREAD
extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count);
extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
IO_CACHE *write_cache, uint num_threads);
extern void remove_io_thread(IO_CACHE *info);
#endif
extern int _my_b_seq_read(IO_CACHE *info,uchar *Buffer,size_t Count);
extern int _my_b_net_read(IO_CACHE *info,uchar *Buffer,size_t Count);
extern int _my_b_get(IO_CACHE *info);
@@ -834,7 +817,8 @@ extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
extern int get_defaults_options(int argc, char **argv,
char **defaults, char **extra_defaults,
char **group_suffix);
extern const char *args_separator;
extern my_bool my_getopt_use_args_separator;
extern my_bool my_getopt_is_args_separator(const char* arg);
extern int my_load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv, const char ***);
extern int load_defaults(const char *conf_file, const char **groups,

View File

@@ -433,10 +433,8 @@ typedef struct st_mi_check_param
const char *db_name, *table_name;
const char *op_name;
enum_mi_stats_method stats_method;
#ifdef THREAD
mysql_mutex_t print_msg_mutex;
my_bool need_print_msg_lock;
#endif
} MI_CHECK;
typedef struct st_sort_ft_buf
@@ -460,10 +458,8 @@ typedef struct st_sort_info
SORT_FT_BUF *ft_buf;
/* sync things */
uint got_error, threads_running;
#ifdef THREAD
mysql_mutex_t mutex;
mysql_cond_t cond;
#endif
} SORT_INFO;
/* functions in mi_check */

View File

@@ -41,7 +41,7 @@ typedef struct st_alarm_info
void thr_alarm_info(ALARM_INFO *info);
#if defined(DONT_USE_THR_ALARM) || !defined(THREAD)
#if defined(DONT_USE_THR_ALARM)
#define USE_ALARM_THREAD
#undef USE_ONE_SIGNAL_HAND

View File

@@ -35,21 +35,6 @@ sig_handler my_pipe_sig_handler(int sig);
void read_user_name(char *name);
my_bool handle_local_infile(MYSQL *mysql, const char *net_filename);
/*
Let the user specify that we don't want SIGPIPE; This doesn't however work
with threaded applications as we can have multiple read in progress.
*/
#if !defined(__WIN__) && defined(SIGPIPE) && !defined(THREAD)
#define init_sigpipe_variables sig_return old_signal_handler=(sig_return) 0;
#define set_sigpipe(mysql) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) old_signal_handler=signal(SIGPIPE, my_pipe_sig_handler)
#define reset_sigpipe(mysql) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) signal(SIGPIPE,old_signal_handler);
#else
#define init_sigpipe_variables
#define set_sigpipe(mysql)
#define reset_sigpipe(mysql)
#endif
void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group);
void mysql_detach_stmt_list(LIST **stmt_list, const char *func_name);

View File

@@ -51,7 +51,7 @@
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
#if defined(THREAD) && !defined(__WIN__)
#if !defined(__WIN__)
#include <my_pthread.h> /* because of signal() */
#endif
#ifndef INADDR_NONE
@@ -172,10 +172,8 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
result= init_embedded_server(argc, argv, groups);
#endif
}
#ifdef THREAD
else
result= (int)my_thread_init(); /* Init if new thread */
#endif
return result;
}
@@ -229,18 +227,12 @@ MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void)
my_bool STDCALL mysql_thread_init()
{
#ifdef THREAD
return my_thread_init();
#else
return 0;
#endif
}
void STDCALL mysql_thread_end()
{
#ifdef THREAD
my_thread_end();
#endif
}
@@ -1092,11 +1084,7 @@ void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo)
uint STDCALL mysql_thread_safe(void)
{
#ifdef THREAD
return 1;
#else
return 0;
#endif
}

View File

@@ -15,9 +15,13 @@ The syntax is as follows:
and any subsequent characters are ignored.
4) The full test case name including the suite and execution mode
must be specified, for example:
may be specified, for example:
main.alias 'row' # bug#00000
4b) Now, combinations will also be covered if only the test name is
specified, for example:
rpl.rpl_ps # Covers 'row', 'mix' and 'stmt'
5) As an exception to item 4, the last character of the test case
specification may be an asterisk (*). In that case, all test cases that
start with the same characters up to the last letter before the asterisk

View File

@@ -10,12 +10,8 @@ innodb.innodb_information_schema # Bug#48883 2010-05-11 alik Test "innod
main.func_math @freebsd # Bug#43020 2010-05-04 alik main.func_math fails on FreeBSD in PB2
main.gis # Bug#52208 2010-11-24 alik gis fails on some platforms (Solaris, HP-UX, Linux)
main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server
main.information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
main.lock_multi_bug38691 @solaris # Bug#47792 2009-10-02 alik main.lock_multi_bug38691 times out sporadically on Solaris 10
main.lowercase_table2 @darwin # Bug#55509 2010-07-26 alik main.lowercase_table2 fails on Mac OSX (again)
main.outfile_loaddata @solaris # Bug#46895 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
main.show_check # Bug#58414 2010-11-24 alik Race condition in show_check.test
main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server
@@ -23,7 +19,7 @@ main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeou
rpl.rpl_heartbeat_basic # BUG#54820 2010-06-26 alik rpl.rpl_heartbeat_basic fails sporadically again
rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically
rpl.rpl_innodb_bug28430* # Bug#46029
rpl.rpl_innodb_bug28430 # Bug#46029
sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
sys_vars.plugin_dir_basic # Bug#52223 2010-11-24 alik Test "plugin_dir_basic" does not support RPM build (test) directory structure

View File

@@ -0,0 +1,17 @@
# Include file for rpl_show_relaylog_events.inc
--let $log_type= BINLOG
if ($is_relay_log) {
--let $log_type= RELAYLOG
}
--let $args=
if ($binlog_file != '') {
--let $args= IN <FILE>
}
if ($binlog_limit) {
--let $args= $args LIMIT $binlog_limit
}
--echo ******** [$CURRENT_CONNECTION] SHOW $log_type EVENTS $args ********
--source include/show_events.inc

View File

@@ -0,0 +1,11 @@
# Include file for rpl_show_log_events.inc
--let $binlog_limit=
--source extra/rpl_tests/rpl_show_binlog_events.inc
--let $binlog_limit= 1
--source extra/rpl_tests/rpl_show_binlog_events.inc
--let $binlog_limit= 1,3
--source extra/rpl_tests/rpl_show_binlog_events.inc
--let $binlog_limit=
--let $binlog_file=
--source extra/rpl_tests/rpl_show_binlog_events.inc

View File

@@ -1,103 +1,62 @@
-- connection master
-- source include/rpl_reset.inc
-- connection master
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (6);
-- echo [MASTER] ********* SOW BINLOG EVENTS IN ... *********
-- source include/show_binlog_events.inc
# PART I
#
# SHOWs contents of binary logs on the master and both, binary and
# relay logs, on the slave.
#
-- echo [MASTER] ********* SOW BINLOG EVENTS *********
let $binlog_file= ;
-- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows *********
let $binlog_limit= 3;
-- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
let $binlog_limit= 1,4;
-- source include/show_binlog_events.inc
# clear show_binlog_event/show_relaylog_events parameters
let $binlog_limit= ;
--let $is_relay_log= 0
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
--sync_slave_with_master
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... *********
-- source include/show_binlog_events.inc
--let $is_relay_log= 1
--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS *********
let $binlog_file= ;
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows *********
let $binlog_limit= 3;
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
let $binlog_limit= 1,4;
-- source include/show_binlog_events.inc
# clear show_binlog_event/show_relaylog_events parameters
let $binlog_limit= ;
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
-- source include/show_relaylog_events.inc
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS *********
let $binlog_file= ;
-- source include/show_relaylog_events.inc
-- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows *********
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
let $binlog_limit= 3;
-- source include/show_relaylog_events.inc
-- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows *********
let $binlog_limit= 1,3;
-- source include/show_relaylog_events.inc
#
# PART II
#
# Although this second part of the test may seem redudant it is
# actually needed to assert that SHOW RELAYLOG EVENTS works properly
# with respect to the ordering of the relay log in relay-log.index.
#
# If no file is specified with "IN" then first relay log file in
# relay-log.index (ie, the oldest one) should be picked and its
# contents displayed. The same happens for SHOW BINLOG EVENTS, so we
# show them both. All in all, this is the reason for re-assert after
# MASTER and SLAVE's FLUSH LOGS operations.
#
FLUSH LOGS;
let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
-- connection master
FLUSH LOGS;
DROP TABLE t1;
# clear show_binlog_event/show_relaylog_events parameters
let $binlog_file= ;
let $binlog_limit= ;
-- echo [MASTER] ********* SOW BINLOG EVENTS IN ... *********
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-- source include/show_binlog_events.inc
-- echo [MASTER] ********* SOW BINLOG EVENTS *********
let $binlog_file= ;
-- source include/show_binlog_events.inc
--let $is_relay_log= 0
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
--sync_slave_with_master
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... *********
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-- source include/show_binlog_events.inc
--let $is_relay_log= 1
--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
-- echo [SLAVE] ********* SOW BINLOG EVENTS *********
let $binlog_file= ;
-- source include/show_binlog_events.inc
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
-- source include/show_relaylog_events.inc
-- echo [SLAVE] ********* SOW RELAYLOG EVENTS *********
let $binlog_file= ;
-- source include/show_relaylog_events.inc
# clear show_binlog_event/show_relaylog_events parameters
let $binlog_file= ;

View File

@@ -0,0 +1,41 @@
# Definition file for plugins.
#
# <lib name> <directory> <variable> [<plugin name>,...]
#
# The following variables will be set for a plugin, where PLUGVAR
# represents the variable name given as the 3rd item
#
# PLUGVAR: name of plugin file including extension .so or .dll
# PLUGVAR_DIR: name of directory where plugin was found
# PLUGVAR_OPT: mysqld option --plugin_dir=....
# PLUGVAR_LOAD: option --plugin_load=.... if the 4th element is present
#
# If a listed plugin is not found, the corresponding variables will be
# set to empty, they will not be unset.
#
# The PLUGVAR variable is not quoted, so you must remember to quote it
# when using it in an INSTALL PLUGIN command.
#
# The envorinment variables can be used in tests. If adding a new plugin,
# you are free to pick your variable name, but please keep it upper
# case for consistency.
#
# The _LOAD variable will have a form
#
# --plugin_load=<name1>=<lib_name>;<name2>=<lib_name>.....
#
# with name1, name2 etc from the comma separated list of plugin names
# in the optional 4th argument.
auth_test_plugin plugin/auth PLUGIN_AUTH test_plugin_server
qa_auth_interface plugin/auth PLUGIN_AUTH_INTERFACE qa_auth_interface
qa_auth_server plugin/auth PLUGIN_AUTH_SERVER qa_auth_server
qa_auth_client plugin/auth PLUGIN_AUTH_CLIENT qa_auth_client
udf_example sql UDF_EXAMPLE_LIB
ha_example storage/example EXAMPLE_PLUGIN EXAMPLE
semisync_master plugin/semisync SEMISYNC_MASTER_PLUGIN
semisync_slave plugin/semisync SEMISYNC_SLAVE_PLUGIN
ha_archive storage/archive ARCHIVE_PLUGIN
ha_blackhole storage/blackhole BLACKHOLE_PLUGIN
ha_federated storage/federated FEDERATED_PLUGIN
mypluglib plugin/fulltext SIMPLE_PARSER

View File

@@ -0,0 +1,43 @@
# ==== Purpose ====
#
# Provide a earier way to restart SQL thread when you want to stop sql thread
# and then start it immediately.
#
# Sources stop_slave_sql.inc to stop SQL thread on the current connection.
# Then issues START SLAVE SQL_THREAD and then waits until
# the SQL threads have started, or until a timeout is reached.
#
# Please use this instead of 'STOP|START SLAVE SQL_THREAD', to reduce the risk of
# test case bugs.
#
#
# ==== Usage ====
#
# [--let $slave_timeout= NUMBER]
# [--let $rpl_debug= 1]
# --source include/restart_slave_sql.inc
#
# Parameters:
# $slave_timeout
# See include/wait_for_slave_param.inc
#
# $rpl_debug
# See include/rpl_init.inc
--let $include_filename= restart_slave.inc
--source include/begin_include_file.inc
if (!$rpl_debug)
{
--disable_query_log
}
source include/stop_slave_sql.inc;
START SLAVE SQL_THREAD;
source include/wait_for_slave_sql_to_start.inc;
--let $include_filename= restart_slave.inc
--source include/end_include_file.inc

View File

@@ -0,0 +1,2 @@
let $rpl_connection_name= master;
source include/rpl_connection.inc;

View File

@@ -0,0 +1,2 @@
let $rpl_connection_name= slave;
source include/rpl_connection.inc;

View File

@@ -0,0 +1,2 @@
let $rpl_connection_name= slave1;
source include/rpl_connection.inc;

View File

@@ -74,6 +74,7 @@ let $_fake_relay_index= $_fake_datadir/$_fake_filename.index;
let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`;
RESET SLAVE;
let $_orphan_relay_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
# Create relay log file.
--copy_file $fake_relay_log $_fake_relay_log
@@ -102,6 +103,8 @@ RESET SLAVE;
# Setup replication from existing relay log.
eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4;
# remove the orphan log file (became spurious)
-- remove_file $_fake_datadir/$_orphan_relay_file
--let $include_filename= setup_fake_relay_log.inc
--source include/end_include_file.inc

View File

@@ -50,8 +50,23 @@ if (!$_status_var_comparsion)
let $_status_var_comparsion= =;
}
# Get type of variable
let $_is_number= 0;
if (`SELECT '$status_var_value' REGEXP '^[\+\-]*[0-9]+(\.[0-9]+)*\$'`)
{
let $_is_number= 1;
}
let $_show_status_value= query_get_value("SHOW $status_type STATUS LIKE '$status_var'", Value, 1);
while (`SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_value')`)
# Set way of comparing
let $_query= SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_value');
if ($is_number)
{
let $_query= SELECT NOT($_show_status_value $_status_var_comparsion $status_var_value);
}
while (`$_query`)
{
if (!$_status_timeout_counter)
{
@@ -65,4 +80,9 @@ while (`SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_va
dec $_status_timeout_counter;
sleep 0.1;
let $_show_status_value= query_get_value("SHOW $status_type STATUS LIKE '$status_var'", Value, 1);
let $_query= SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_value');
if ($is_number)
{
let $_query= SELECT NOT($_show_status_value $_status_var_comparsion $status_var_value);
}
}

View File

@@ -1,4 +1,20 @@
# -*- cperl -*-
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; version 2
# of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
package My::ConfigFactory;
use strict;

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,4 +1,19 @@
# -*- cperl -*-
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
package My::File::Path;
use strict;

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,14 +1,15 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; version 2
# of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2004 MySQL AB
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2008 MySQL AB
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2004 MySQL AB
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,4 +1,18 @@
# -*- cperl -*-
# Copyright (C) 2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -229,8 +229,11 @@ sub collect_test_cases ($$$$) {
sub split_testname {
my ($test_name)= @_;
# Get rid of directory part and split name on .'s
my @parts= split(/\./, basename($test_name));
# If .test file name is used, get rid of directory part
$test_name= basename($test_name) if $test_name =~ /\.test$/;
# Now split name on .'s
my @parts= split(/\./, $test_name);
if (@parts == 1){
# Only testname given, ex: alias

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004, 2006 MySQL AB
# Copyright (C) 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004 MySQL AB
# Copyright (C) 2004 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2004-2007 MySQL AB, 2008 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (C) 2004-2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,14 +1,15 @@
# -*- cperl -*-
# Copyright (C) 2004-2006 MySQL AB
# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; version 2
# of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc.
# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -129,7 +129,8 @@ sub mtr_report_test ($) {
# Find out if this test case is an experimental one, so we can treat
# the failure as an expected failure instead of a regression.
for my $exp ( @$::experimental_test_cases ) {
if ( $exp ne $test_name ) {
# Include pattern match for combinations
if ( $exp ne $test_name && $test_name !~ /^$exp / ) {
# if the expression is not the name of this test case, but has
# an asterisk at the end, determine if the characters up to
# but excluding the asterisk are the same
@@ -395,7 +396,7 @@ sub mtr_report_stats ($$;$) {
##############################################################################
sub mtr_print_line () {
print '-' x 60 . "\n";
print '-' x 74 . "\n";
}
@@ -405,13 +406,18 @@ sub mtr_print_thick_line {
}
sub mtr_print_header () {
sub mtr_print_header ($) {
my ($wid) = @_;
print "\n";
printf "TEST";
if ($wid) {
print " " x 34 . "WORKER ";
} else {
print " " x 38;
}
print "RESULT ";
print "TIME (ms)" if $timer;
print "\n";
print "TIME (ms) or " if $timer;
print "COMMENT\n";
mtr_print_line();
print "\n";
}

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2006 MySQL AB
# Copyright (C) 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
# -*- cperl -*-
# Copyright (C) 2006 MySQL AB
# Copyright (C) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,6 +1,6 @@
#!/usr/bin/perl
# Copyright (C) 2005, 2006 MySQL AB
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -12,10 +12,9 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# ======================================================================
# MySQL server stress test system

View File

@@ -1,7 +1,7 @@
#!/usr/bin/perl
# -*- cperl -*-
# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
##############################################################################
@@ -131,10 +131,6 @@ my $opt_start_dirty;
my $opt_start_exit;
my $start_only;
my $auth_interface_fn; # the name of qa_auth_interface plugin
my $auth_server_fn; # the name of qa_auth_server plugin
my $auth_client_fn; # the name of qa_auth_client plugin
my $auth_filename; # the name of the authentication test plugin
my $auth_plugin; # the path to the authentication test plugin
END {
@@ -295,8 +291,10 @@ our $opt_include_ndbcluster= 0;
our $opt_skip_ndbcluster= 1;
my $exe_ndbd;
my $exe_ndbmtd;
my $exe_ndb_mgmd;
my $exe_ndb_waiter;
my $exe_ndb_mgm;
our $debug_compiled_binaries;
@@ -442,7 +440,7 @@ sub main {
mtr_report();
mtr_print_thick_line();
mtr_print_header();
mtr_print_header($opt_parallel > 1);
mark_time_used('init');
@@ -509,8 +507,8 @@ sub run_test_server ($$$) {
my $num_failed_test= 0; # Number of tests failed so far
# Scheduler variables
my $max_ndb= $childs / 2;
$max_ndb = 4 if $max_ndb > 4;
my $max_ndb= $ENV{MTR_MAX_NDB} || $childs / 2;
$max_ndb = $childs if $max_ndb > $childs;
$max_ndb = 1 if $max_ndb < 1;
my $num_ndb_tests= 0;
@@ -1124,27 +1122,7 @@ sub command_line_setup {
"$basedir/sql/share/charsets",
"$basedir/share/charsets");
# Look for auth test plugins
if (IS_WINDOWS)
{
$auth_filename = "auth_test_plugin.dll";
$auth_interface_fn = "qa_auth_interface.dll";
$auth_server_fn = "qa_auth_server.dll";
$auth_client_fn = "qa_auth_client.dll";
}
else
{
$auth_filename = "auth_test_plugin.so";
$auth_interface_fn = "qa_auth_interface.so";
$auth_server_fn = "qa_auth_server.so";
$auth_client_fn = "qa_auth_client.so";
}
$auth_plugin=
mtr_file_exists(vs_config_dirs('plugin/auth/',$auth_filename),
"$basedir/plugin/auth/.libs/" . $auth_filename,
"$basedir/lib/mysql/plugin/" . $auth_filename,
"$basedir/lib/plugin/" . $auth_filename);
($auth_plugin)= find_plugin("auth_test_plugin", "plugin/auth");
if (using_extern())
{
@@ -1831,16 +1809,42 @@ sub executable_setup () {
if ( ! $opt_skip_ndbcluster )
{
# Look for single threaded NDB
$exe_ndbd=
my_find_bin($bindir,
["storage/ndb/src/kernel", "libexec", "sbin", "bin"],
"ndbd");
# Look for multi threaded NDB
$exe_ndbmtd=
my_find_bin($bindir,
["storage/ndb/src/kernel", "libexec", "sbin", "bin"],
"ndbmtd", NOT_REQUIRED);
if ($exe_ndbmtd)
{
my $mtr_ndbmtd = $ENV{MTR_NDBMTD};
if ($mtr_ndbmtd)
{
mtr_report(" - multi threaded ndbd found, will be used always");
$exe_ndbd = $exe_ndbmtd;
}
else
{
mtr_report(" - multi threaded ndbd found, will be ".
"used \"round robin\"");
}
}
$exe_ndb_mgmd=
my_find_bin($bindir,
["storage/ndb/src/mgmsrv", "libexec", "sbin", "bin"],
"ndb_mgmd");
$exe_ndb_mgm=
my_find_bin($bindir,
["storage/ndb/src/mgmclient", "bin"],
"ndb_mgm");
$exe_ndb_waiter=
my_find_bin($bindir,
["storage/ndb/tools/", "bin"],
@@ -1983,6 +1987,53 @@ sub find_plugin($$)
return $lib_example_plugin;
}
#
# Read plugin defintions file
#
sub read_plugin_defs($)
{
my ($defs_file)= @_;
open(PLUGDEF, '<', $defs_file)
or mtr_error("Can't read plugin defintions file $defs_file");
while (<PLUGDEF>) {
next if /^#/;
my ($plug_file, $plug_loc, $plug_var, $plug_names)= split;
# Allow empty lines
next unless $plug_file;
mtr_error("Lines in $defs_file must have 3 or 4 items") unless $plug_var;
my ($plugin)= find_plugin($plug_file, $plug_loc);
# Set env. variables that tests may use, set to empty if plugin
# listed in def. file but not found.
if ($plugin) {
$ENV{$plug_var}= basename($plugin);
$ENV{$plug_var.'_DIR'}= dirname($plugin);
$ENV{$plug_var.'_OPT'}= "--plugin-dir=".dirname($plugin);
if ($plug_names) {
my $lib_name= basename($plugin);
my $load_var= "--plugin_load=";
my $semi= '';
foreach my $plug_name (split (',', $plug_names)) {
$load_var .= $semi . "$plug_name=$lib_name";
$semi= ';';
}
$ENV{$plug_var.'_LOAD'}= $load_var;
}
} else {
$ENV{$plug_var}= "";
$ENV{$plug_var.'_DIR'}= "";
$ENV{$plug_var.'_OPT'}= "";
$ENV{$plug_var.'_LOAD'}= "" if $plug_names;
}
}
close PLUGDEF;
}
sub environment_setup {
umask(022);
@@ -2019,127 +2070,16 @@ sub environment_setup {
}
# --------------------------------------------------------------------------
# Add the path where mysqld will find udf_example.so
# Read definitions from include/plugin.defs
#
# Plugin settings should no longer be added here, instead
# place definitions in include/plugin.defs.
# See comment in that file for details.
# --------------------------------------------------------------------------
my $udf_example_filename;
if (IS_WINDOWS)
{
$udf_example_filename = "udf_example.dll";
}
else
{
$udf_example_filename = "udf_example.so";
}
my $lib_udf_example=
mtr_file_exists(vs_config_dirs('sql', $udf_example_filename),
"$basedir/sql/.libs/$udf_example_filename",);
read_plugin_defs("include/plugin.defs");
if ( $lib_udf_example )
{
push(@ld_library_paths, dirname($lib_udf_example));
}
$ENV{'UDF_EXAMPLE_LIB'}=
($lib_udf_example ? basename($lib_udf_example) : "");
$ENV{'UDF_EXAMPLE_LIB_OPT'}= "--plugin-dir=".
($lib_udf_example ? dirname($lib_udf_example) : "");
# --------------------------------------------------------------------------
# Add the path where mysqld will find the auth test plugin (dialog.so/dll)
# --------------------------------------------------------------------------
if ($auth_plugin)
{
$ENV{'PLUGIN_AUTH'}= basename($auth_plugin);
$ENV{'PLUGIN_AUTH_OPT'}= "--plugin-dir=".dirname($auth_plugin);
$ENV{'PLUGIN_AUTH_LOAD'}="--plugin_load=test_plugin_server=".$auth_filename;
$ENV{'PLUGIN_AUTH_INTERFACE'}="--plugin_load=qa_auth_interface=".$auth_interface_fn;
$ENV{'PLUGIN_AUTH_SERVER'}="--plugin_load=qa_auth_server=".$auth_server_fn;
$ENV{'PLUGIN_AUTH_CLIENT'}="--plugin_load=qa_auth_client=".$auth_client_fn;
}
else
{
$ENV{'PLUGIN_AUTH'}= "";
$ENV{'PLUGIN_AUTH_OPT'}="--plugin-dir=";
$ENV{'PLUGIN_AUTH_LOAD'}="";
$ENV{'PLUGIN_AUTH_INTERFACE'}="";
$ENV{'PLUGIN_AUTH_SERVER'}="";
$ENV{'PLUGIN_AUTH_CLIENT'}="";
}
# --------------------------------------------------------------------------
# Add the path where mysqld will find ha_example.so
# --------------------------------------------------------------------------
if ($mysql_version_id >= 50100) {
my ($lib_example_plugin) = find_plugin("ha_example", "storage/example");
if($lib_example_plugin)
{
$ENV{'EXAMPLE_PLUGIN'}=
($lib_example_plugin ? basename($lib_example_plugin) : "");
$ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
($lib_example_plugin ? dirname($lib_example_plugin) : "");
$ENV{'HA_EXAMPLE_SO'}="'".basename($lib_example_plugin)."'";
$ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=EXAMPLE=".basename($lib_example_plugin);
}
else
{
# Some ".opt" files use some of these variables, so they must be defined
$ENV{'EXAMPLE_PLUGIN'}= "";
$ENV{'EXAMPLE_PLUGIN_OPT'}= "";
$ENV{'HA_EXAMPLE_SO'}= "";
$ENV{'EXAMPLE_PLUGIN_LOAD'}= "";
}
}
# --------------------------------------------------------------------------
# Add the path where mysqld will find semisync plugins
# --------------------------------------------------------------------------
if (!$opt_embedded_server) {
my ($lib_semisync_master_plugin) = find_plugin("semisync_master", "plugin/semisync");
my ($lib_semisync_slave_plugin) = find_plugin("semisync_slave", "plugin/semisync");
if ($lib_semisync_master_plugin && $lib_semisync_slave_plugin)
{
$ENV{'SEMISYNC_MASTER_PLUGIN'}= basename($lib_semisync_master_plugin);
$ENV{'SEMISYNC_SLAVE_PLUGIN'}= basename($lib_semisync_slave_plugin);
$ENV{'SEMISYNC_PLUGIN_OPT'}= "--plugin-dir=".dirname($lib_semisync_master_plugin);
}
else
{
$ENV{'SEMISYNC_MASTER_PLUGIN'}= "";
$ENV{'SEMISYNC_SLAVE_PLUGIN'}= "";
$ENV{'SEMISYNC_PLUGIN_OPT'}="--plugin-dir=";
}
}
# ----------------------------------------------------
# Add the paths where mysqld will find archive/blackhole/federated plugins.
# ----------------------------------------------------
$ENV{'ARCHIVE_PLUGIN_DIR'} =
dirname(find_plugin("ha_archive", "storage/archive"));
$ENV{'BLACKHOLE_PLUGIN_DIR'} =
dirname(find_plugin("ha_blackhole", "storage/blackhole"));
$ENV{'FEDERATED_PLUGIN_DIR'} =
dirname(find_plugin("ha_federated", "storage/federated"));
# ----------------------------------------------------
# Add the path where mysqld will find mypluglib.so
# ----------------------------------------------------
my ($lib_simple_parser) = find_plugin("mypluglib", "plugin/fulltext");
$ENV{'MYPLUGLIB_SO'}="'".basename($lib_simple_parser)."'";
$ENV{'SIMPLE_PARSER'}=
($lib_simple_parser ? basename($lib_simple_parser) : "");
$ENV{'SIMPLE_PARSER_OPT'}= "--plugin-dir=".
($lib_simple_parser ? dirname($lib_simple_parser) : "");
# Simplify reference to semisync plugins
$ENV{'SEMISYNC_PLUGIN_OPT'}= $ENV{'SEMISYNC_MASTER_PLUGIN_OPT'};
# --------------------------------------------------------------------------
# Valgrind need to be run with debug libraries otherwise it's almost
@@ -2710,6 +2650,27 @@ sub ndb_mgmd_wait_started($) {
return 1;
}
sub ndb_mgmd_stop{
my $ndb_mgmd= shift or die "usage: ndb_mgmd_stop(<ndb_mgmd>)";
my $host=$ndb_mgmd->value('HostName');
my $port=$ndb_mgmd->value('PortNumber');
mtr_verbose("Stopping cluster '$host:$port'");
my $args;
mtr_init_args(\$args);
mtr_add_arg($args, "--ndb-connectstring=%s:%s", $host,$port);
mtr_add_arg($args, "-e");
mtr_add_arg($args, "shutdown");
My::SafeProcess->run
(
name => "ndb_mgm shutdown $host:$port",
path => $exe_ndb_mgm,
args => \$args,
output => "/dev/null",
);
}
sub ndb_mgmd_start ($$) {
my ($cluster, $ndb_mgmd)= @_;
@@ -2737,6 +2698,7 @@ sub ndb_mgmd_start ($$) {
error => $path_ndb_mgmd_log,
append => 1,
verbose => $opt_verbose,
shutdown => sub { ndb_mgmd_stop($ndb_mgmd) },
);
mtr_verbose("Started $ndb_mgmd->{proc}");
@@ -2752,6 +2714,12 @@ sub ndb_mgmd_start ($$) {
return 0;
}
sub ndbd_stop {
# Intentionally left empty, ndbd nodes will be shutdown
# by sending "shutdown" to ndb_mgmd
}
my $exe_ndbmtd_counter= 0;
sub ndbd_start {
my ($cluster, $ndbd)= @_;
@@ -2769,17 +2737,24 @@ sub ndbd_start {
# > 5.0 { 'character-sets-dir' => \&fix_charset_dir },
my $exe= $exe_ndbd;
if ($exe_ndbmtd and ($exe_ndbmtd_counter++ % 2) == 0)
{
# Use ndbmtd every other time
$exe= $exe_ndbmtd;
}
my $path_ndbd_log= "$dir/ndbd.log";
my $proc= My::SafeProcess->new
(
name => $ndbd->after('cluster_config.'),
path => $exe_ndbd,
path => $exe,
args => \$args,
output => $path_ndbd_log,
error => $path_ndbd_log,
append => 1,
verbose => $opt_verbose,
shutdown => sub { ndbd_stop($ndbd) },
);
mtr_verbose("Started $proc");

View File

@@ -21,9 +21,9 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a&amp;b" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a&lt;b" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a&gt;b" Type="text" Null="YES" Key="" Extra="" />
<field Field="a&amp;b" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
<field Field="a&lt;b" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
<field Field="a&gt;b" Type="text" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>

View File

@@ -1684,6 +1684,21 @@ ARMENIAN CAPIT ECH 2
ARMENIAN CAPIT ZA 2
DROP TABLE t1;
#
# Start of 5.1 tests
#
#
# Bug#58371 Assertion failed: !s.uses_buffer_owned_by(this) with format string function
#
SET NAMES latin1;
DO CONVERT(CAST(SUBSTRING_INDEX(FORMAT(1,'1111'), FORMAT('','Zpq'),1)
AS BINARY(0)) USING utf8);
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'Zpq'
Warning 1292 Truncated incorrect BINARY(0) value: '1.'
#
# End of 5.1 tests
#
#
# Start of 5.5 tests
#
#

View File

@@ -182,4 +182,9 @@ INSERT INTO t2 VALUES (1), (2), (3);
SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a;
1
DROP TABLE t1, t2;
#
# Bug#59149 valgrind warnings with "like .. escape .." function
#
SELECT '' LIKE '1' ESCAPE COUNT(1);
ERROR HY000: Incorrect arguments to ESCAPE
End of 5.1 tests

View File

@@ -641,3 +641,18 @@ INSERT INTO t1 (SELECT -pi());
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
DROP TABLE t1;
#
# Bug #59241 invalid memory read
# in do_div_mod with doubly assigned variables
#
SELECT ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa')));
((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa')))
NULL
Warnings:
Warning 1366 Incorrect decimal value: '' for column '' at row -1
#
# Bug #59498 div function broken in mysql-trunk
#
SELECT 1 div null;
1 div null
NULL

View File

@@ -2615,6 +2615,22 @@ CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3))
1
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: ''
#
# Bug#58165: "my_empty_string" gets modified and causes LOAD DATA to fail
# and other crashes
#
CREATE TABLE t1 ( a TEXT );
SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'bug58165.txt';
SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' );
insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' )
x
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'b'
LOAD DATA INFILE 'bug58165.txt' INTO TABLE t1;
SELECT * FROM t1;
a
aaaaaaaaaaaaaa
DROP TABLE t1;
End of 5.1 tests
Start of 5.4 tests
SELECT format(12345678901234567890.123, 3);

View File

@@ -1014,6 +1014,14 @@ SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000
SET @a=POLYFROMWKB(@a);
SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440;
SET @a=POLYFROMWKB(@a);
create table t1(a polygon NOT NULL)engine=myisam;
insert into t1 values (geomfromtext("point(0 1)"));
insert into t1 values (geomfromtext("point(1 0)"));
select * from (select polygon(t1.a) as p from t1 order by t1.a) d;
p
NULL
NULL
drop table t1;
End of 5.1 tests
CREATE TABLE t1(
col0 BINARY NOT NULL,

View File

@@ -66,3 +66,27 @@ SELECT ((@id := id) - id) FROM t2;
KILL @id;
SET DEBUG_SYNC= "now SIGNAL killed";
DROP TABLE t1, t2;
SET DEBUG_SYNC= "RESET";
#
# Bug#58933 Assertion `thd- >is_error()' fails on shutdown with ongoing
# OPTIMIZE TABLE
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2);
# Connection con1
SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL waiting WAIT_FOR killed';
# Sending:
OPTIMIZE TABLE t1;
# Connection default
SET DEBUG_SYNC= 'now WAIT_FOR waiting';
KILL QUERY ID;
SET DEBUG_SYNC= 'now SIGNAL killed';
# Connection con1
# Reaping: OPTIMIZE TABLE t1
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status Operation failed
# Connection default
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';

View File

@@ -1432,4 +1432,74 @@ WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
GROUP BY t2.f1, t2.f2;
f1 f1 f2
DROP TABLE t1,t2;
#
# Bug#57034 incorrect OUTER JOIN result when joined on unique key
#
CREATE TABLE t1 (pk INT PRIMARY KEY,
col_int INT,
col_int_unique INT UNIQUE KEY);
INSERT INTO t1 VALUES (1,NULL,2), (2,0,0);
CREATE TABLE t2 (pk INT PRIMARY KEY,
col_int INT,
col_int_unique INT UNIQUE KEY);
INSERT INTO t2 VALUES (1,0,1), (2,0,2);
EXPLAIN
SELECT * FROM t1 LEFT JOIN t2
ON t1.col_int_unique = t2.col_int_unique AND t1.col_int = t2.col_int
WHERE t1.pk=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 const col_int_unique col_int_unique 5 const 1
SELECT * FROM t1 LEFT JOIN t2
ON t1.col_int_unique = t2.col_int_unique AND t1.col_int = t2.col_int
WHERE t1.pk=1;
pk col_int col_int_unique pk col_int col_int_unique
1 NULL 2 NULL NULL NULL
DROP TABLE t1,t2;
#
# Bug#48046 Server incorrectly processing JOINs on NULL values
#
CREATE TABLE `BB` (
`pk` int(11) NOT NULL AUTO_INCREMENT,
`time_key` time DEFAULT NULL,
`varchar_key` varchar(1) DEFAULT NULL,
`varchar_nokey` varchar(1) DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `time_key` (`time_key`),
KEY `varchar_key` (`varchar_key`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
INSERT INTO `BB` VALUES (10,'18:27:58',NULL,NULL);
SELECT table1.time_key AS field1, table2.pk
FROM BB table1 LEFT JOIN BB table2
ON table2.varchar_nokey = table1.varchar_key
HAVING field1;
field1 pk
18:27:58 NULL
DROP TABLE BB;
#
# Bug#49600 Server incorrectly processing RIGHT JOIN with
# constant WHERE clause and no index
#
CREATE TABLE `BB` (
`col_datetime_key` datetime DEFAULT NULL,
`col_varchar_key` varchar(1) DEFAULT NULL,
`col_varchar_nokey` varchar(1) DEFAULT NULL,
KEY `col_datetime_key` (`col_datetime_key`),
KEY `col_varchar_key` (`col_varchar_key`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `BB` VALUES ('1900-01-01 00:00:00',NULL,NULL);
SELECT table1.col_datetime_key
FROM BB table1 RIGHT JOIN BB table2
ON table2 .col_varchar_nokey = table1.col_varchar_key
WHERE 7;
col_datetime_key
NULL
ALTER TABLE BB DISABLE KEYS;
SELECT table1.col_datetime_key
FROM BB table1 RIGHT JOIN BB table2
ON table2 .col_varchar_nokey = table1.col_varchar_key
WHERE 7;
col_datetime_key
NULL
DROP TABLE BB;
End of 5.1 tests

View File

@@ -2,3 +2,11 @@ mysqld is alive
mysqladmin: unknown variable 'database=db1'
Warning: mysqladmin: unknown variable 'loose-database=db2'
mysqld is alive
#
# Bug#58221 : mysqladmin --sleep=x --count=x keeps looping
#
# Executing mysqladmin with --sleep=1 and --count=2.
# Done.
# Displaying the output :
mysqld is alive
mysqld is alive

View File

@@ -36,8 +36,8 @@ c1 LONGTEXT
#
# Insert some big rows.
#
256MB
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 16777216));
64MB
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 4194304));
affected rows: 1
32MB
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152));
@@ -53,7 +53,7 @@ affected rows: 1
# Do not display the column value itself, just its length.
#
SELECT LENGTH(c1) FROM t1;
LENGTH(c1) 268435456
LENGTH(c1) 67108864
LENGTH(c1) 33554432
LENGTH(c1) 4194304
LENGTH(c1) 524288
@@ -69,7 +69,7 @@ info: Rows matched: 4 Changed: 4 Warnings: 0
# Do not display the column value itself, just its length.
#
SELECT LENGTH(c1) FROM t1;
LENGTH(c1) 536870912
LENGTH(c1) 134217728
LENGTH(c1) 1048576
LENGTH(c1) 67108864
LENGTH(c1) 8388608

View File

@@ -20,6 +20,7 @@ The following options may be given as the first argument:
Offset added to Auto-increment columns. Used when
auto-increment-increment != 1
--autocommit Set default value for autocommit (0 or 1)
(Defaults to on; use --skip-autocommit to disable.)
--automatic-sp-privileges
Creating and dropping stored procedures alters ACLs
(Defaults to on; use --skip-automatic-sp-privileges to disable.)
@@ -732,6 +733,7 @@ abort-slave-event-count 0
allow-suspicious-udfs FALSE
auto-increment-increment 1
auto-increment-offset 1
autocommit TRUE
automatic-sp-privileges TRUE
back-log 50
big-tables FALSE

View File

@@ -20,6 +20,7 @@ The following options may be given as the first argument:
Offset added to Auto-increment columns. Used when
auto-increment-increment != 1
--autocommit Set default value for autocommit (0 or 1)
(Defaults to on; use --skip-autocommit to disable.)
--automatic-sp-privileges
Creating and dropping stored procedures alters ACLs
(Defaults to on; use --skip-automatic-sp-privileges to disable.)
@@ -736,6 +737,7 @@ abort-slave-event-count 0
allow-suspicious-udfs FALSE
auto-increment-increment 1
auto-increment-offset 1
autocommit TRUE
automatic-sp-privileges TRUE
back-log 50
big-tables FALSE

View File

@@ -14,7 +14,7 @@ INSERT INTO t1 VALUES (1), (2);
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="MUL" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="MUL" Extra="" Comment="" />
<key Table="t1" Non_unique="1" Key_name="a" Seq_in_index="1" Column_name="a" Collation="A" Null="YES" Index_type="BTREE" Comment="" Index_comment="" />
</table_structure>
<table_data name="t1">
@@ -150,9 +150,9 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="b" Type="text" Null="YES" Key="" Extra="" />
<field Field="c" Type="varchar(3)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
<field Field="b" Type="text" Null="YES" Key="" Extra="" Comment="" />
<field Field="c" Type="varchar(3)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>
@@ -178,7 +178,7 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a&quot;b&quot;" Type="char(2)" Null="YES" Key="" Extra="" />
<field Field="a&quot;b&quot;" Type="char(2)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>
@@ -1612,10 +1612,10 @@ CREATE TABLE `t2` (
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="mysqldump_test_db">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_structure name="t2">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
</database>
</mysqldump>
@@ -1623,10 +1623,10 @@ CREATE TABLE `t2` (
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="mysqldump_test_db">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_structure name="t2">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
</database>
</mysqldump>
@@ -3644,8 +3644,8 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="f1" Type="int(10)" Null="YES" Key="" Extra="" />
<field Field="data" Type="mediumblob" Null="YES" Key="" Extra="" />
<field Field="f1" Type="int(10)" Null="YES" Key="" Extra="" Comment="" />
<field Field="data" Type="mediumblob" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>
@@ -4576,5 +4576,20 @@ LENGTH(a)
800
DROP TABLE t1, t2;
#
# Bug #13618 : mysqldump --xml ommit comment on table field
#
CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT';
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="comment_table">
<field Field="i" Type="int(11)" Null="YES" Key="" Extra="" Comment="FIELD COMMENT" />
</table_structure>
<table_data name="comment_table">
</table_data>
</database>
</mysqldump>
DROP TABLE `comment_table`;
#
# End of 5.1 tests
#

View File

@@ -311,12 +311,33 @@ failing query in let
create table t1 (a varchar(100));
insert into t1 values ('`select 42`');
`select 42`
insert into t1 values ('$dollar');
$dollar
`select 42`
drop table t1;
mysqltest: At line 1: Error running query 'failing query': 1064 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 'failing query' at line 1
mysqltest: At line 1: Missing required argument 'filename' to command 'source'
mysqltest: At line 1: Could not open './non_existingFile' for reading, errno: 2
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: 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 'garbage' at line 1
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql":
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
At line 1: Source directives are nesting too deep
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql":
included from MYSQLTEST_VARDIR/tmp/error.sql at line 1:
At line 1: query 'garbage ' failed: 1064: 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 'garbage' at line 1
2 = outer loop variable after while
here is the sourced script
@@ -444,7 +465,9 @@ counter is 6
counter is 7
1
Testing while with not
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc": At line 64: Nesting too deeply
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc":
included from MYSQLTEST_VARDIR/tmp/mysqltest_while.inc at line 65:
At line 64: Nesting too deeply
mysqltest: At line 1: missing '(' in while
mysqltest: At line 1: missing ')' in while
mysqltest: At line 1: Missing '{' after while. Found "dec $i"
@@ -493,8 +516,12 @@ mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1
mysqltest: At line 1: Illegal argument for port: 'illegal_port'
mysqltest: At line 1: Illegal option to connect: SMTP
200 connects succeeded
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 3: connection 'test_con1' not found in connection pool
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 2: Connection test_con1 already exists
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql":
included from MYSQLTEST_VARDIR/tmp/mysqltest.sql at line 3:
At line 3: connection 'test_con1' not found in connection pool
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql":
included from MYSQLTEST_VARDIR/tmp/mysqltest.sql at line 2:
At line 2: Connection test_con1 already exists
show tables;
ERROR 3D000: No database selected
connect con1,localhost,root,,;

View File

@@ -7,13 +7,13 @@ slave_skip_errors OFF
#
# FLUSH PRIVILEGES should not implicitly unlock locked tables.
#
drop table if exists t1;
create table t1 (c1 int);
lock tables t1 read;
flush privileges;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT);
LOCK TABLES t1 READ;
FLUSH PRIVILEGES;
ERROR HY000: Table 'host' was not locked with LOCK TABLES
unlock tables;
drop table t1;
UNLOCK TABLES;
DROP TABLE t1;
#
# Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN
#
@@ -28,7 +28,7 @@ CREATE FUNCTION f() RETURNS INT RETURN 1;
GRANT FILE ON *.* TO 'nopriv_user'@'localhost';
FLUSH PRIVILEGES;
connection: con1
SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE 'mytest';
SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE '<outfile>';
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1;
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'

View File

@@ -1901,7 +1901,7 @@ c1 bigint,
c2 set('sweet'),
key (c2,c1,c0),
key(c0)
) engine=myisam partition by hash (month(c0)) partitions 5;
) engine=myisam partition by hash (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);

View File

@@ -1,5 +1,655 @@
drop table if exists t1, t2;
#
# Bug#54483: valgrind errors when making warnings for multiline inserts
# into partition
#
CREATE TABLE t1 (a VARBINARY(10))
PARTITION BY RANGE (DAYOFWEEK(a))
(PARTITION a1 VALUES LESS THAN (60));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a CHAR(10))
PARTITION BY RANGE (DAYOFWEEK(a))
(PARTITION a1 VALUES LESS THAN (60));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY RANGE (DAYOFWEEK(a))
(PARTITION a1 VALUES LESS THAN (60));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIMESTAMP)
PARTITION BY RANGE (DAYOFWEEK(a))
(PARTITION a1 VALUES LESS THAN (60));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY RANGE (DAYOFWEEK(a))
(PARTITION a1 VALUES LESS THAN (60));
INSERT INTO t1 VALUES ('test'),('a'),('5');
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'a' at row 2
Warning 1265 Data truncated for column 'a' at row 3
SHOW WARNINGS;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'a' at row 2
Warning 1265 Data truncated for column 'a' at row 3
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY RANGE (DAYOFWEEK(a))
(PARTITION a1 VALUES LESS THAN (60));
INSERT INTO t1 VALUES ('test'),('a'),('5');
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
Warning 1264 Out of range value for column 'a' at row 2
Warning 1264 Out of range value for column 'a' at row 3
SHOW WARNINGS;
Level Code Message
Warning 1264 Out of range value for column 'a' at row 1
Warning 1264 Out of range value for column 'a' at row 2
Warning 1264 Out of range value for column 'a' at row 3
DROP TABLE t1;
CREATE TABLE t1 (a TIME)
PARTITION BY RANGE (DAYOFWEEK(a))
(PARTITION a1 VALUES LESS THAN (60));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
SHOW WARNINGS;
Level Code Message
Error 1486 Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (TO_DAYS(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (TO_DAYS(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (TO_DAYS(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (TO_DAYS(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (TO_DAYS(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (DAYOFMONTH(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (DAYOFMONTH(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (DAYOFMONTH(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (DAYOFMONTH(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (DAYOFMONTH(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (MONTH(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (MONTH(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (MONTH(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (MONTH(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (MONTH(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (DAYOFYEAR(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (DAYOFYEAR(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (DAYOFYEAR(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (DAYOFYEAR(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (DAYOFYEAR(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (HOUR(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (HOUR(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (HOUR(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (HOUR(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (HOUR(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (MINUTE(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (MINUTE(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (MINUTE(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (MINUTE(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (MINUTE(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (QUARTER(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (QUARTER(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (QUARTER(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (QUARTER(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (QUARTER(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (SECOND(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (SECOND(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (SECOND(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (SECOND(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (SECOND(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (YEARWEEK(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (YEARWEEK(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (YEARWEEK(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (YEARWEEK(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (YEARWEEK(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (WEEKDAY(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (WEEKDAY(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (WEEKDAY(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (WEEKDAY(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (WEEKDAY(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
# TO_SECONDS() is added in 5.5.
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (TO_SECONDS(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (TO_SECONDS(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (TO_SECONDS(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (TO_SECONDS(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (TO_SECONDS(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (TIME_TO_SEC(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (TIME_TO_SEC(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (TIME_TO_SEC(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (TIME_TO_SEC(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (TIME_TO_SEC(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (FROM_DAYS(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (FROM_DAYS(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (FROM_DAYS(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (TO_DAYS(FROM_DAYS(a)));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (FROM_DAYS(a));
ERROR HY000: The PARTITION function returns the wrong type
CREATE TABLE t1 (a INT)
PARTITION BY HASH (TO_DAYS(FROM_DAYS(a)));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (FROM_DAYS(a));
ERROR HY000: The PARTITION function returns the wrong type
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (MICROSECOND(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (MICROSECOND(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (MICROSECOND(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (MICROSECOND(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (MICROSECOND(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
# Bug#57071
CREATE TABLE t1
(`date` date,
`extracted_week` int,
`yearweek` int,
`week` int,
`default_week_format` int)
PARTITION BY LIST (EXTRACT(WEEK FROM date) % 3)
(PARTITION p0 VALUES IN (0),
PARTITION p1 VALUES IN (1),
PARTITION p2 VALUES IN (2));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1
(`date` date,
`extracted_week` int,
`yearweek` int,
`week` int,
`default_week_format` int);
SET @old_default_week_format := @@default_week_format;
SET default_week_format = 0;
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
SET default_week_format = 1;
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
SET default_week_format = 2;
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
SET default_week_format = 3;
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
SET default_week_format = 4;
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
SET default_week_format = 5;
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
SET default_week_format = 6;
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
SET default_week_format = 7;
INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
SELECT * FROM t1;
date extracted_week yearweek week default_week_format
2000-01-01 0 199952 0 0
2000-01-01 0 199952 0 1
2000-01-01 52 199952 52 2
2000-01-01 52 199952 52 3
2000-01-01 0 199952 0 4
2000-01-01 0 199952 0 5
2000-01-01 52 199952 52 6
2000-01-01 52 199952 52 7
SET default_week_format = @old_default_week_format;
DROP TABLE t1;
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(YEAR FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(YEAR FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(YEAR FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(YEAR FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(YEAR FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(QUARTER FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(QUARTER FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(QUARTER FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(QUARTER FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(QUARTER FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(MONTH FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(MONTH FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(MONTH FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(MONTH FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(MONTH FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
# EXTRACT(WEEK...) is disallowed, see bug#57071.
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(WEEK FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(WEEK FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(WEEK FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(WEEK FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(WEEK FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(DAY FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(DAY FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(DAY FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(DAY FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(DAY FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(HOUR FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(HOUR FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(HOUR FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(HOUR FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(HOUR FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(MINUTE FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(MINUTE FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(MINUTE FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(MINUTE FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(MINUTE FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(SECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(SECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(SECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME, b DATE)
PARTITION BY HASH (DATEDIFF(a, b));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATE, b DATETIME)
PARTITION BY HASH (DATEDIFF(a, b));
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME, b DATE)
PARTITION BY HASH (DATEDIFF(a, b));
DROP TABLE t1;
CREATE TABLE t1 (a DATE, b VARCHAR(10))
PARTITION BY HASH (DATEDIFF(a, b));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT, b DATETIME)
PARTITION BY HASH (DATEDIFF(a, b));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a TIME)
PARTITION BY HASH (TIME_TO_SEC(a));
DROP TABLE t1;
CREATE TABLE t1 (a DATE)
PARTITION BY HASH (TIME_TO_SEC(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a DATETIME)
PARTITION BY HASH (TIME_TO_SEC(a));
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10))
PARTITION BY HASH (TIME_TO_SEC(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
CREATE TABLE t1 (a INT)
PARTITION BY HASH (TIME_TO_SEC(a));
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
#
# Bug#50036: Inconsistent errors when using TIMESTAMP
# columns/expressions
# 1. correct and appropriate errors in light of

View File

@@ -13,16 +13,16 @@ EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100, 3) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index
DROP TABLE t1;
create table t1 (a int)
partition by range (a)
create table t1 (a DATETIME)
partition by range (TO_DAYS(a))
subpartition by hash(to_seconds(a))
(partition p0 values less than (1));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
`a` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50500 PARTITION BY RANGE (a)
/*!50500 PARTITION BY RANGE (TO_DAYS(a))
SUBPARTITION BY HASH (to_seconds(a))
(PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM) */
drop table t1;

View File

@@ -319,7 +319,7 @@ Proxied_user
With_grant 1
FLUSH PRIVILEGES;
#
# Bug#58139 : default-auth option not recognized in MySQL standardi
# Bug#58139 : default-auth option not recognized in MySQL standard
# command line clients
#
# Executing 'mysql'
@@ -328,4 +328,6 @@ FLUSH PRIVILEGES;
# Executing 'mysqladmin'
mysqld is alive
# Executing 'mysqldump'
# Executing 'mysql_upgrade'
The --upgrade-system-tables option was used, databases won't be touched.
End of 5.5 tests

View File

@@ -4867,6 +4867,70 @@ SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
1
1
DROP TABLE t1;
#
# Bug #58422: Incorrect result when OUTER JOIN'ing
# with an empty table
#
CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM;
CREATE TABLE t1(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM;
INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM;
INSERT INTO t2 VALUES (1,1), (2,2), (3,3);
EXPLAIN
SELECT *
FROM
t1
LEFT OUTER JOIN
(t2 INNER JOIN t_empty ON TRUE)
ON t1.pk=t2.pk
WHERE t2.pk <> 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
SELECT *
FROM
t1
LEFT OUTER JOIN
(t2 INNER JOIN t_empty ON TRUE)
ON t1.pk=t2.pk
WHERE t2.pk <> 2;
pk i pk i pk i
EXPLAIN
SELECT *
FROM
t1
LEFT OUTER JOIN
(t2 CROSS JOIN t_empty)
ON t1.pk=t2.pk
WHERE t2.pk <> 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
SELECT *
FROM
t1
LEFT OUTER JOIN
(t2 CROSS JOIN t_empty)
ON t1.pk=t2.pk
WHERE t2.pk <> 2;
pk i pk i pk i
EXPLAIN
SELECT *
FROM
t1
LEFT OUTER JOIN
(t2 INNER JOIN t_empty ON t_empty.i=t2.i)
ON t1.pk=t2.pk
WHERE t2.pk <> 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
SELECT *
FROM
t1
LEFT OUTER JOIN
(t2 INNER JOIN t_empty ON t_empty.i=t2.i)
ON t1.pk=t2.pk
WHERE t2.pk <> 2;
pk i pk i pk i
DROP TABLE t1,t2,t_empty;
End of 5.1 tests
#
# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on

View File

@@ -1325,6 +1325,17 @@ Tables_in_test Table_type
été BASE TABLE
drop table `été`;
set names latin1;
#
# Bug#4374 SHOW TABLE STATUS FROM ignores collation_connection
# Character set: Latin-1 (ISO-8859-1)
#
SET NAMES latin1;
CREATE DATABASE `<60>`;
CREATE TABLE `<60>`.`<60>` (a int) ENGINE=Memory;
SHOW TABLE STATUS FROM `<60>` LIKE '<27>';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
<EFBFBD> MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
DROP DATABASE `<60>`;
show columns from `#mysql50#????????`;
Got one of the listed errors
DROP TABLE IF EXISTS t1;

View File

@@ -5004,6 +5004,58 @@ ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
SELECT * FROM t2 UNION SELECT * FROM t2
ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
DROP TABLE t1,t2;
#
# Bug #58818: Incorrect result for IN/ANY subquery
# with HAVING condition
#
CREATE TABLE t1(i INT);
INSERT INTO t1 VALUES (1), (2), (3);
CREATE TABLE t1s(i INT);
INSERT INTO t1s VALUES (10), (20), (30);
CREATE TABLE t2s(i INT);
INSERT INTO t2s VALUES (100), (200), (300);
SELECT * FROM t1
WHERE t1.i NOT IN
(
SELECT STRAIGHT_JOIN t2s.i
FROM
t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
HAVING t2s.i = 999
);
i
1
2
3
SELECT * FROM t1
WHERE t1.I IN
(
SELECT STRAIGHT_JOIN t2s.i
FROM
t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
HAVING t2s.i = 999
) IS UNKNOWN;
i
SELECT * FROM t1
WHERE NOT t1.I = ANY
(
SELECT STRAIGHT_JOIN t2s.i
FROM
t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
HAVING t2s.i = 999
);
i
1
2
3
SELECT * FROM t1
WHERE t1.i = ANY (
SELECT STRAIGHT_JOIN t2s.i
FROM
t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
HAVING t2s.i = 999
) IS UNKNOWN;
i
DROP TABLE t1,t1s,t2s;
End of 5.1 tests
#
# Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool):

View File

@@ -164,6 +164,17 @@ a b
2 NULL
DROP TABLE t1, t2, t3, t4, t5;
#
# Bug#58207: invalid memory reads when using default column value and
# tmptable needed
#
CREATE TABLE t(a VARCHAR(245) DEFAULT
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
INSERT INTO t VALUES (''),(''),(''),(''),(''),(''),(''),(''),(''),(''),('');
SELECT * FROM (SELECT default(a) FROM t GROUP BY a) d;
default(a)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t;
#
# End of 5.1 tests.
#
#

View File

@@ -637,6 +637,17 @@ CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7))
20080729104251.1234560
Warnings:
Warning 1292 Truncated incorrect datetime value: '2008-07-29T10:42:51.1234567'
#
# Bug#59173: Failure to handle DATE(TIME) values where Year, Month or
# Day is ZERO
#
CREATE TABLE t1 (dt1 DATETIME);
INSERT INTO t1 (dt1) VALUES ('0000-00-01 00:00:01');
DELETE FROM t1 WHERE dt1 = '0000-00-01 00:00:01';
# Should be empty
SELECT * FROM t1;
dt1
DROP TABLE t1;
End of 5.1 tests
#
# Start of 5.5 tests

View File

@@ -540,3 +540,32 @@ a
2010-03-05 11:08:02
DROP TABLE t1;
End of Bug#50888
#
# Bug59330: Incorrect result when comparing an aggregate
# function with TIMESTAMP
#
CREATE TABLE t1 (dt DATETIME, ts TIMESTAMP);
INSERT INTO t1 VALUES('2011-01-06 12:34:30', '2011-01-06 12:34:30');
SELECT MAX(dt), MAX(ts) FROM t1;
MAX(dt) MAX(ts)
2011-01-06 12:34:30 2011-01-06 12:34:30
SELECT MAX(ts) < '2010-01-01 00:00:00' FROM t1;
MAX(ts) < '2010-01-01 00:00:00'
0
SELECT MAX(dt) < '2010-01-01 00:00:00' FROM t1;
MAX(dt) < '2010-01-01 00:00:00'
0
SELECT MAX(ts) > '2010-01-01 00:00:00' FROM t1;
MAX(ts) > '2010-01-01 00:00:00'
1
SELECT MAX(dt) > '2010-01-01 00:00:00' FROM t1;
MAX(dt) > '2010-01-01 00:00:00'
1
SELECT MAX(ts) = '2011-01-06 12:34:30' FROM t1;
MAX(ts) = '2011-01-06 12:34:30'
1
SELECT MAX(dt) = '2011-01-06 12:34:30' FROM t1;
MAX(dt) = '2011-01-06 12:34:30'
1
DROP TABLE t1;
End of 5.5 tests

View File

@@ -1644,3 +1644,128 @@ b
2
DROP TABLE t1,t2;
End of 5.1 tests
#
# Bug#57986 ORDER BY clause is not used after a UNION,
# if embedded in a SELECT
#
CREATE TABLE t1 (c1 VARCHAR(10) NOT NULL, c2 INT NOT NULL);
CREATE TABLE t2 (c1 VARCHAR(10) NOT NULL, c2 INT NOT NULL);
INSERT INTO t1 (c1, c2) VALUES ('t1a', 1), ('t1a', 2), ('t1a', 3), ('t1b', 2), ('t1b', 1);
INSERT INTO t2 (c1, c2) VALUES ('t2a', 1), ('t2a', 2), ('t2a', 3), ('t2b', 2), ('t2b', 1);
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY c2, c1;
c1 c2
t1a 1
t1b 1
t2a 1
t2b 1
t1a 2
t1b 2
t2a 2
t2b 2
t1a 3
t2a 3
SELECT * FROM t1 UNION (SELECT * FROM t2) ORDER BY c2, c1;
c1 c2
t1a 1
t1b 1
t2a 1
t2b 1
t1a 2
t1b 2
t2a 2
t2b 2
t1a 3
t2a 3
SELECT * FROM t1 UNION (SELECT * FROM t2 ORDER BY c2, c1);
c1 c2
t1a 1
t1a 2
t1a 3
t1b 2
t1b 1
t2a 1
t2a 2
t2a 3
t2b 2
t2b 1
SELECT c1, c2 FROM (
SELECT c1, c2 FROM t1
UNION
(SELECT c1, c2 FROM t2)
ORDER BY c2, c1
) AS res;
c1 c2
t1a 1
t1b 1
t2a 1
t2b 1
t1a 2
t1b 2
t2a 2
t2b 2
t1a 3
t2a 3
SELECT c1, c2 FROM (
SELECT c1, c2 FROM t1
UNION
(SELECT c1, c2 FROM t2)
ORDER BY c2 DESC, c1 LIMIT 1
) AS res;
c1 c2
t1a 3
SELECT c1, c2 FROM (
SELECT c1, c2 FROM t1
UNION
(SELECT c1, c2 FROM t2 ORDER BY c2 DESC, c1 LIMIT 1)
) AS res;
c1 c2
t1a 1
t1a 2
t1a 3
t1b 2
t1b 1
t2a 3
SELECT c1, c2 FROM (
SELECT c1, c2 FROM t1
UNION
SELECT c1, c2 FROM t2
ORDER BY c2 DESC, c1 DESC LIMIT 1
) AS res;
c1 c2
t2a 3
SELECT c1, c2 FROM (
(
(SELECT c1, c2 FROM t1)
UNION
(SELECT c1, c2 FROM t2)
)
ORDER BY c2 DESC, c1 ASC LIMIT 1
) AS res;
c1 c2
t1a 3
DROP TABLE t1, t2;
#
# Bug #58970 Problem Subquery (without referencing a table)
# and Order By
#
SELECT(SELECT 0 AS a UNION SELECT 1 AS a ORDER BY a ASC LIMIT 1) AS dev;
dev
0
SELECT(SELECT 0 AS a UNION SELECT 1 AS a ORDER BY a DESC LIMIT 1) AS dev;
dev
1
SELECT(SELECT 0 AS a FROM dual UNION SELECT 1 AS a FROM dual ORDER BY a ASC LIMIT 1) AS dev;
dev
0
SELECT(SELECT 0 AS a FROM dual UNION SELECT 1 AS a FROM dual ORDER BY a DESC LIMIT 1) AS dev;
dev
1
SELECT(SELECT 1 AS a ORDER BY a) AS dev;
dev
1
SELECT(SELECT 1 AS a LIMIT 1) AS dev;
dev
1
SELECT(SELECT 1 AS a FROM dual ORDER BY a DESC LIMIT 1) AS dev;
dev
1

View File

@@ -1248,3 +1248,129 @@ Note 1449 The user specified as a definer ('unknown'@'unknown') does not exist
LOCK TABLES v1 READ;
ERROR HY000: The user specified as a definer ('unknown'@'unknown') does not exist
DROP VIEW v1;
#
# Bug #58499 "DEFINER-security view selecting from INVOKER-security view
# access check wrong".
#
# Check that we correctly handle privileges for various combinations
# of INVOKER and DEFINER-security views using each other.
DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
USE mysqltest1;
CREATE TABLE t1 (i INT);
CREATE TABLE t2 (j INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (2);
#
# 1) DEFINER-security view uses INVOKER-security view (covers
# scenario originally described in the bug report).
CREATE SQL SECURITY INVOKER VIEW v1_uses_t1 AS SELECT * FROM t1;
CREATE SQL SECURITY INVOKER VIEW v1_uses_t2 AS SELECT * FROM t2;
CREATE USER 'mysqluser1'@'%';
GRANT CREATE VIEW ON mysqltest1.* TO 'mysqluser1'@'%';
GRANT SELECT ON t1 TO 'mysqluser1'@'%';
# To be able create 'v2_uses_t2' we also need select on t2.
GRANT SELECT ON t2 TO 'mysqluser1'@'%';
GRANT SELECT ON v1_uses_t1 TO 'mysqluser1'@'%';
GRANT SELECT ON v1_uses_t2 TO 'mysqluser1'@'%';
#
# Connection 'mysqluser1'.
CREATE SQL SECURITY DEFINER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
CREATE SQL SECURITY DEFINER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
#
# Connection 'default'.
CREATE USER 'mysqluser2'@'%';
GRANT SELECT ON v2_uses_t1 TO 'mysqluser2'@'%';
GRANT SELECT ON v2_uses_t2 TO 'mysqluser2'@'%';
GRANT SELECT ON t2 TO 'mysqluser2'@'%';
GRANT CREATE VIEW ON mysqltest1.* TO 'mysqluser2'@'%';
# Make 'mysqluser1' unable to access t2.
REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
#
# Connection 'mysqluser2'.
# The below statement should succeed thanks to suid nature of v2_uses_t1.
SELECT * FROM v2_uses_t1;
i
1
# The below statement should fail due to suid nature of v2_uses_t2.
SELECT * FROM v2_uses_t2;
ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
#
# 2) INVOKER-security view uses INVOKER-security view.
#
# Connection 'default'.
DROP VIEW v2_uses_t1, v2_uses_t2;
CREATE SQL SECURITY INVOKER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
CREATE SQL SECURITY INVOKER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
GRANT SELECT ON v2_uses_t1 TO 'mysqluser1'@'%';
GRANT SELECT ON v2_uses_t2 TO 'mysqluser1'@'%';
GRANT SELECT ON v1_uses_t1 TO 'mysqluser2'@'%';
GRANT SELECT ON v1_uses_t2 TO 'mysqluser2'@'%';
#
# Connection 'mysqluser1'.
# For both versions of 'v2' 'mysqluser1' privileges should be used.
SELECT * FROM v2_uses_t1;
i
1
SELECT * FROM v2_uses_t2;
ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
#
# Connection 'mysqluser2'.
# And now for both versions of 'v2' 'mysqluser2' privileges should
# be used.
SELECT * FROM v2_uses_t1;
ERROR HY000: View 'mysqltest1.v2_uses_t1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM v2_uses_t2;
j
2
#
# 3) INVOKER-security view uses DEFINER-security view.
#
# Connection 'default'.
DROP VIEW v1_uses_t1, v1_uses_t2;
# To be able create 'v1_uses_t2' we also need select on t2.
GRANT SELECT ON t2 TO 'mysqluser1'@'%';
#
# Connection 'mysqluser1'.
CREATE SQL SECURITY DEFINER VIEW v1_uses_t1 AS SELECT * FROM t1;
CREATE SQL SECURITY DEFINER VIEW v1_uses_t2 AS SELECT * FROM t2;
#
# Connection 'default'.
# Make 'mysqluser1' unable to access t2.
REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
#
# Connection 'mysqluser2'.
# Due to suid nature of v1_uses_t1 and v1_uses_t2 the first
# select should succeed and the second select should fail.
SELECT * FROM v2_uses_t1;
i
1
SELECT * FROM v2_uses_t2;
ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
#
# 4) DEFINER-security view uses DEFINER-security view.
#
# Connection 'default'.
DROP VIEW v2_uses_t1, v2_uses_t2;
# To be able create 'v2_uses_t2' we also need select on t2.
GRANT SELECT ON t2 TO 'mysqluser1'@'%';
#
# Connection 'mysqluser2'.
CREATE SQL SECURITY DEFINER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
CREATE SQL SECURITY DEFINER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
#
# Connection 'default'.
# Make 'mysqluser1' unable to access t2.
REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
#
# Connection 'mysqluser2'.
# Again privileges of creator of innermost views should apply.
SELECT * FROM v2_uses_t1;
i
1
SELECT * FROM v2_uses_t2;
ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
USE test;
DROP DATABASE mysqltest1;
DROP USER 'mysqluser1'@'%';
DROP USER 'mysqluser2'@'%';

View File

@@ -1113,6 +1113,17 @@ SELECT UPDATEXML(NULL, (LPAD(0.1111E-15, '2011', 1)), 1);
ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing
SELECT EXTRACTVALUE('', LPAD(0.1111E-15, '2011', 1));
ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing
#
# Bug #44332 my_xml_scan reads behind the end of buffer
#
SELECT UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1');
UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1')
NULL
Warnings:
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 2: END-OF-INPUT unexpected (ident or '/' wanted)'
SELECT UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1');
UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1')
NULL
End of 5.1 tests
#
# Start of 5.5 tests

View File

@@ -5,7 +5,7 @@
# switched directory after starting the server and am using a relative
# --defaults-file.
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN';
--query_vertical SELECT @@global.connect_timeout AS connect_timeout, @@global.local_infile AS local_infile

View File

@@ -13,13 +13,14 @@ set global innodb_lock_wait_timeout=347;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
42
set innodb_lock_wait_timeout=1;
set innodb_lock_wait_timeout=10;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
10
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
347
SET @connection_b_id = <connection_b_id>;
create table t1(a int primary key)engine=innodb;
begin;
insert into t1 values(1),(2),(3);
@@ -31,8 +32,9 @@ a
3
begin;
insert into t1 values(4);
set innodb_lock_wait_timeout=3;
select * from t1 for update;
commit;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
drop table t1;
set global innodb_lock_wait_timeout=50;
set global innodb_lock_wait_timeout=<initial_timeout>;

View File

@@ -1,6 +1,6 @@
-- source include/have_innodb.inc
let $timeout=`select @@innodb_lock_wait_timeout`;
let $initial_timeout=`select @@innodb_lock_wait_timeout`;
set global innodb_lock_wait_timeout=42;
connect (a,localhost,root,,);
@@ -12,19 +12,24 @@ set innodb_lock_wait_timeout=1;
select @@innodb_lock_wait_timeout;
connection b;
let $connection_b_id=`SELECT CONNECTION_ID()`;
select @@innodb_lock_wait_timeout;
set global innodb_lock_wait_timeout=347;
select @@innodb_lock_wait_timeout;
set innodb_lock_wait_timeout=1;
set innodb_lock_wait_timeout=10;
select @@innodb_lock_wait_timeout;
connect (c,localhost,root,,);
connection c;
select @@innodb_lock_wait_timeout;
connection default;
disconnect c;
--source include/wait_until_disconnected.inc
connection a;
--replace_result $connection_b_id <connection_b_id>
eval SET @connection_b_id = $connection_b_id;
create table t1(a int primary key)engine=innodb;
begin;
insert into t1 values(1),(2),(3);
@@ -33,7 +38,37 @@ connection b;
--send
select * from t1 for update;
# Observation on information_schema.processlist (2010-12 mysql-5.5)
# -----------------------------------------------------------------
# As soon as the server started the execution of the
# connection a: --send select ... for update
# High parallel load could delay this up to two seconds.
# and before either
# - the innodb_lock_wait_timeout was exceeded
# -> connection b reap gets ER_LOCK_WAIT_TIMEOUT
# or
# - connection a commits, the lock disappears and the statement
# of connection b finishes
# -> connection b reap gets success + result set
# we see within information_schema.processlist for connection b a row
# command state info
# Query Sending data select * from t1 for update
# The highest time value seen was @@innodb_lock_wait_timeout + 1.
# Please note that there is unfortunately nothing which says
# that we are just waiting for a lock.
connection a;
# In order to ensure that the execution of
# connection b: select * from t1 for update
# has really started and is most probably waiting for the lock now we poll on
# information_schema.processlist.
# Also our current session innodb_lock_wait_timeout of 10 seconds should big
# enough to prevent that connection b ends up with getting ER_LOCK_WAIT_TIMEOUT.
#
let $wait_timeout= 10;
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist
WHERE id = @connection_b_id AND INFO = 'select * from t1 for update';
--source include/wait_condition.inc
commit;
connection b;
@@ -44,21 +79,39 @@ begin;
insert into t1 values(4);
connection b;
set innodb_lock_wait_timeout=3;
# 3 seconds should be big enough that the wait routine of connection a will
# hit the time span where our next statement is visible within the
# information_schema.processlist.
--send
select * from t1 for update;
connection a;
sleep 2;
# Wait till the execution of the connection b statement was started.
let $wait_timeout= 10;
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist
WHERE id = @connection_b_id AND INFO = 'select * from t1 for update';
--source include/wait_condition.inc
# Wait till the execution of the connection b statement has ended.
let $wait_timeout= 10;
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist
WHERE id = @connection_b_id AND INFO IS NULL;
--source include/wait_condition.inc
# Give "commit" though this must be too late for the statement of connection b.
commit;
connection b;
--error ER_LOCK_WAIT_TIMEOUT
reap;
drop table t1;
disconnect b;
--source include/wait_until_disconnected.inc
connection a;
disconnect a;
--source include/wait_until_disconnected.inc
connection default;
disconnect a;
disconnect b;
eval set global innodb_lock_wait_timeout=$timeout;
drop table t1;
--replace_result $initial_timeout <initial_timeout>
eval set global innodb_lock_wait_timeout=$initial_timeout;

View File

@@ -88,8 +88,9 @@ let $val2 = '2006-01-17';
let $val3 = '2006-02-25';
let $val4 = '2006-02-05';
--source suite/parts/inc/partition_supported_sql_funcs.inc
let $coltype = char(30);
--source suite/parts/inc/partition_supported_sql_funcs.inc
# Disabled after fixing bug#54483.
#let $coltype = char(30);
#--source suite/parts/inc/partition_supported_sql_funcs.inc
let $sqlfunc = extract(month from col1);
let $valsqlfunc = extract(year from '1998-11-23');
@@ -139,8 +140,9 @@ let $val2 = '14:30:20';
let $val3 = '21:59:22';
let $val4 = '10:22:33';
--source suite/parts/inc/partition_supported_sql_funcs.inc
let $coltype = char(30);
--source suite/parts/inc/partition_supported_sql_funcs.inc
# second(non_time_col) is disabled after bug#54483.
#let $coltype = char(30);
#--source suite/parts/inc/partition_supported_sql_funcs.inc
let $sqlfunc = month(col1);
let $valsqlfunc = month('2006-10-14');
@@ -172,26 +174,28 @@ let $val3 = '21:59:22';
let $val4 = '10:33:11';
--source suite/parts/inc/partition_supported_sql_funcs.inc
let $sqlfunc = to_days(col1)-to_days('2006-01-01');
let $valsqlfunc = to_days('2006-02-02')-to_days('2006-01-01');
let $coltype = date;
let $infile = part_supported_sql_funcs_int_date.inc;
let $val1 = '2006-02-03';
let $val2 = '2006-01-17';
let $val3 = '2006-01-25';
let $val4 = '2006-02-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
# to_days(non_date_col) is disabled after bug#54483.
#let $sqlfunc = to_days(col1)-to_days('2006-01-01');
#let $valsqlfunc = to_days('2006-02-02')-to_days('2006-01-01');
#let $coltype = date;
#let $infile = part_supported_sql_funcs_int_date.inc;
#let $val1 = '2006-02-03';
#let $val2 = '2006-01-17';
#let $val3 = '2006-01-25';
#let $val4 = '2006-02-06';
#--source suite/parts/inc/partition_supported_sql_funcs.inc
# to_days(non_date_col) is disabled after bug#54483.
# DATEDIFF() is implemented as (TO_DAYS(d1) - TO_DAYS(d2))
let $sqlfunc = datediff(col1, '2006-01-01');
let $valsqlfunc = datediff('2006-02-02', '2006-01-01');
let $coltype = date;
let $infile = part_supported_sql_funcs_int_date.inc;
let $val1 = '2006-02-03';
let $val2 = '2006-01-17';
let $val3 = '2006-01-25';
let $val4 = '2006-02-06';
--source suite/parts/inc/partition_supported_sql_funcs.inc
#let $sqlfunc = datediff(col1, '2006-01-01');
#let $valsqlfunc = datediff('2006-02-02', '2006-01-01');
#let $coltype = date;
#let $infile = part_supported_sql_funcs_int_date.inc;
#let $val1 = '2006-02-03';
#let $val2 = '2006-01-17';
#let $val3 = '2006-01-25';
#let $val4 = '2006-02-06';
#--source suite/parts/inc/partition_supported_sql_funcs.inc
let $sqlfunc = weekday(col1);
let $valsqlfunc = weekday('2006-10-14');

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