mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
Auto-merged.
This commit is contained in:
commit
8fceaa387d
351 changed files with 15858 additions and 28053 deletions
|
@ -24,7 +24,7 @@ EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
|
||||||
|
|
||||||
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
|
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
|
||||||
@readline_topdir@ sql-common scripts \
|
@readline_topdir@ sql-common scripts \
|
||||||
@pstack_dir@ libservices \
|
libservices \
|
||||||
@sql_union_dirs@ unittest \
|
@sql_union_dirs@ unittest \
|
||||||
@sql_server@ @man_dirs@ tests \
|
@sql_server@ @man_dirs@ tests \
|
||||||
@libmysqld_dirs@ \
|
@libmysqld_dirs@ \
|
||||||
|
@ -34,7 +34,7 @@ SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
|
||||||
cmake
|
cmake
|
||||||
DIST_SUBDIRS = . include Docs zlib \
|
DIST_SUBDIRS = . include Docs zlib \
|
||||||
cmd-line-utils sql-common scripts \
|
cmd-line-utils sql-common scripts \
|
||||||
pstack libservices \
|
libservices \
|
||||||
strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \
|
strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \
|
||||||
vio sql man tests \
|
vio sql man tests \
|
||||||
libmysqld \
|
libmysqld \
|
||||||
|
@ -268,7 +268,9 @@ API_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin_audit.h \
|
||||||
$(top_srcdir)/include/mysql/plugin_ftparser.h \
|
$(top_srcdir)/include/mysql/plugin_ftparser.h \
|
||||||
$(top_srcdir)/include/mysql.h \
|
$(top_srcdir)/include/mysql.h \
|
||||||
$(top_srcdir)/include/mysql/psi/psi_abi_v1.h \
|
$(top_srcdir)/include/mysql/psi/psi_abi_v1.h \
|
||||||
$(top_srcdir)/include/mysql/psi/psi_abi_v2.h
|
$(top_srcdir)/include/mysql/psi/psi_abi_v2.h \
|
||||||
|
$(top_srcdir)/include/mysql/client_plugin.h \
|
||||||
|
$(top_srcdir)/include/mysql/plugin_auth.h
|
||||||
|
|
||||||
#
|
#
|
||||||
# Rules for checking that the abi/api has not changed.
|
# Rules for checking that the abi/api has not changed.
|
||||||
|
|
94
README
94
README
|
@ -2208,97 +2208,3 @@ library. If this is what you want to do, use the GNU Lesser General
|
||||||
Public License instead of this License.
|
Public License instead of this License.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
|
|
||||||
%%The following software may be included in this product:
|
|
||||||
pstack (part of GNU Binutils)
|
|
||||||
|
|
||||||
Use of any of this software is governed by the terms of the license below:
|
|
||||||
|
|
||||||
pstack is comprised of various .c and .h files; all begin like this:
|
|
||||||
|
|
||||||
/* bucomm.h -- binutils common include file.
|
|
||||||
Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is part of GNU Binutils.
|
|
||||||
|
|
||||||
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; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
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. */
|
|
||||||
|
|
||||||
***************************************************************************
|
|
||||||
|
|
||||||
%%The following software may be included in this product:
|
|
||||||
libiberty.h (part of pstack GNU Binutils)
|
|
||||||
|
|
||||||
Use of any of this software is governed by the terms of the license below:
|
|
||||||
|
|
||||||
See
|
|
||||||
http://www.koders.com/c/fid99F596804BBE22C076522B848D5575F142079064.aspx
|
|
||||||
|
|
||||||
/* Function declarations for libiberty.
|
|
||||||
Written by Cygnus Support, 1994.
|
|
||||||
|
|
||||||
The libiberty library provides a number of functions which are
|
|
||||||
missing on some operating systems. We do not declare those here,
|
|
||||||
to avoid conflicts with the system header files on operating
|
|
||||||
systems that do support those functions. In this file we only
|
|
||||||
declare those functions which are specific to libiberty. */
|
|
||||||
|
|
||||||
***************************************************************************
|
|
||||||
|
|
||||||
%%The following software may be included in this product:
|
|
||||||
ieee.h (part of pstack GNU Binutils)
|
|
||||||
|
|
||||||
Use of any of this software is governed by the terms of the license below:
|
|
||||||
|
|
||||||
See
|
|
||||||
http://src.opensolaris.org/source/xref//sfw/usr/src/cmd/gdb/gdb-6.3/include/ieee.h
|
|
||||||
|
|
||||||
|
|
||||||
/* IEEE Standard 695-1980 "Universal Format for Object Modules"
|
|
||||||
header file
|
|
||||||
Contributed by Cygnus Support. */
|
|
||||||
|
|
||||||
***************************************************************************
|
|
||||||
|
|
||||||
%%The following software may be included in this product:
|
|
||||||
pstack.c (part of pstack GNU Binutils)
|
|
||||||
|
|
||||||
Use of any of this software is governed by the terms of the license below:
|
|
||||||
|
|
||||||
/*
|
|
||||||
pstack.c -- asynchronous stack trace of a running process
|
|
||||||
Copyright (c) 1999 Ross Thompson
|
|
||||||
Author: Ross Thompson
|
|
||||||
Critical bug fix: Tim Waugh
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
This file is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
***************************************************************************
|
|
||||||
|
|
|
@ -72,3 +72,5 @@ ENDIF(WIN32)
|
||||||
SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap
|
SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap
|
||||||
PROPERTIES HAS_CXX TRUE)
|
PROPERTIES HAS_CXX TRUE)
|
||||||
|
|
||||||
|
ADD_DEFINITIONS(-DHAVE_DLOPEN)
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,8 @@ enum options_client
|
||||||
OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,
|
OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,
|
||||||
OPT_WRITE_BINLOG, OPT_DUMP_DATE,
|
OPT_WRITE_BINLOG, OPT_DUMP_DATE,
|
||||||
OPT_INIT_COMMAND,
|
OPT_INIT_COMMAND,
|
||||||
|
OPT_PLUGIN_DIR,
|
||||||
|
OPT_DEFAULT_PLUGIN,
|
||||||
OPT_MAX_CLIENT_OPTION
|
OPT_MAX_CLIENT_OPTION
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -13,11 +13,6 @@
|
||||||
along with this program; if not, write to the Free Software
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
#define COPYRIGHT_NOTICE "\
|
|
||||||
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.\n\
|
|
||||||
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
|
|
||||||
and you are welcome to modify and redistribute it under the GPL v2 license\n"
|
|
||||||
|
|
||||||
/* mysql command tool
|
/* mysql command tool
|
||||||
* Commands compatible with mSQL by David J. Hughes
|
* Commands compatible with mSQL by David J. Hughes
|
||||||
*
|
*
|
||||||
|
@ -110,6 +105,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "completion_hash.h"
|
#include "completion_hash.h"
|
||||||
|
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
|
||||||
|
|
||||||
#define PROMPT_CHAR '\\'
|
#define PROMPT_CHAR '\\'
|
||||||
#define DEFAULT_DELIMITER ";"
|
#define DEFAULT_DELIMITER ";"
|
||||||
|
@ -166,6 +162,7 @@ static int wait_time = 5;
|
||||||
static STATUS status;
|
static STATUS status;
|
||||||
static ulong select_limit,max_join_size,opt_connect_timeout=0;
|
static ulong select_limit,max_join_size,opt_connect_timeout=0;
|
||||||
static char mysql_charsets_dir[FN_REFLEN+1];
|
static char mysql_charsets_dir[FN_REFLEN+1];
|
||||||
|
static char *opt_plugin_dir= 0, *opt_default_auth;
|
||||||
static const char *xmlmeta[] = {
|
static const char *xmlmeta[] = {
|
||||||
"&", "&",
|
"&", "&",
|
||||||
"<", "<",
|
"<", "<",
|
||||||
|
@ -1176,7 +1173,7 @@ int main(int argc,char *argv[])
|
||||||
mysql_thread_id(&mysql), server_version_string(&mysql));
|
mysql_thread_id(&mysql), server_version_string(&mysql));
|
||||||
put_info((char*) glob_buffer.ptr(),INFO_INFO);
|
put_info((char*) glob_buffer.ptr(),INFO_INFO);
|
||||||
|
|
||||||
put_info(COPYRIGHT_NOTICE, INFO_INFO);
|
put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"), INFO_INFO);
|
||||||
|
|
||||||
#ifdef HAVE_READLINE
|
#ifdef HAVE_READLINE
|
||||||
initialize_readline((char*) my_progname);
|
initialize_readline((char*) my_progname);
|
||||||
|
@ -1564,6 +1561,13 @@ static struct my_option my_long_options[] =
|
||||||
{"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
|
{"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
|
||||||
&show_warnings, &show_warnings, 0, GET_BOOL, NO_ARG,
|
&show_warnings, &show_warnings, 0, GET_BOOL, NO_ARG,
|
||||||
0, 0, 0, 0, 0, 0},
|
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},
|
||||||
|
{"default_auth", OPT_PLUGIN_DIR,
|
||||||
|
"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},
|
||||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1587,7 +1591,7 @@ static void usage(int version)
|
||||||
|
|
||||||
if (version)
|
if (version)
|
||||||
return;
|
return;
|
||||||
printf("%s", COPYRIGHT_NOTICE);
|
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
|
||||||
printf("Usage: %s [OPTIONS] [database]\n", my_progname);
|
printf("Usage: %s [OPTIONS] [database]\n", my_progname);
|
||||||
my_print_help(my_long_options);
|
my_print_help(my_long_options);
|
||||||
print_defaults("my", load_default_groups);
|
print_defaults("my", load_default_groups);
|
||||||
|
@ -4295,9 +4299,15 @@ sql_real_connect(char *host,char *database,char *user,char *password,
|
||||||
|
|
||||||
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
|
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, password,
|
if (!mysql_real_connect(&mysql, host, user, password,
|
||||||
database, opt_mysql_port, opt_mysql_unix_port,
|
database, opt_mysql_port, opt_mysql_unix_port,
|
||||||
connect_flag | CLIENT_MULTI_STATEMENTS))
|
connect_flag | CLIENT_MULTI_STATEMENTS))
|
||||||
{
|
{
|
||||||
if (!silent ||
|
if (!silent ||
|
||||||
(mysql_errno(&mysql) != CR_CONN_HOST_ERROR &&
|
(mysql_errno(&mysql) != CR_CONN_HOST_ERROR &&
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2000 MySQL AB
|
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -17,6 +17,8 @@
|
||||||
#include <sslopt-vars.h>
|
#include <sslopt-vars.h>
|
||||||
#include "../scripts/mysql_fix_privilege_tables_sql.c"
|
#include "../scripts/mysql_fix_privilege_tables_sql.c"
|
||||||
|
|
||||||
|
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
|
||||||
|
|
||||||
#define VER "1.1"
|
#define VER "1.1"
|
||||||
|
|
||||||
#ifdef HAVE_SYS_WAIT_H
|
#ifdef HAVE_SYS_WAIT_H
|
||||||
|
@ -232,6 +234,7 @@ get_one_option(int optid, const struct my_option *opt,
|
||||||
case '?':
|
case '?':
|
||||||
printf("%s Ver %s Distrib %s, for %s (%s)\n",
|
printf("%s Ver %s Distrib %s, for %s (%s)\n",
|
||||||
my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
|
my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
|
||||||
|
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
|
||||||
puts("MySQL utility for upgrading databases to new MySQL versions.\n");
|
puts("MySQL utility for upgrading databases to new MySQL versions.\n");
|
||||||
my_print_help(my_long_options);
|
my_print_help(my_long_options);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2000-2006 MySQL AB
|
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -23,6 +23,7 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
#include <sql_common.h>
|
#include <sql_common.h>
|
||||||
|
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
|
||||||
|
|
||||||
#define ADMIN_VERSION "8.42"
|
#define ADMIN_VERSION "8.42"
|
||||||
#define MAX_MYSQL_VAR 512
|
#define MAX_MYSQL_VAR 512
|
||||||
|
@ -671,8 +672,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
||||||
case ADMIN_VER:
|
case ADMIN_VER:
|
||||||
new_line=1;
|
new_line=1;
|
||||||
print_version();
|
print_version();
|
||||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
|
||||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
|
||||||
printf("Server version\t\t%s\n", mysql_get_server_info(mysql));
|
printf("Server version\t\t%s\n", mysql_get_server_info(mysql));
|
||||||
printf("Protocol version\t%d\n", mysql_get_proto_info(mysql));
|
printf("Protocol version\t%d\n", mysql_get_proto_info(mysql));
|
||||||
printf("Connection\t\t%s\n",mysql_get_host_info(mysql));
|
printf("Connection\t\t%s\n",mysql_get_host_info(mysql));
|
||||||
|
@ -1070,8 +1070,7 @@ static void print_version(void)
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
print_version();
|
print_version();
|
||||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
|
||||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
|
||||||
puts("Administration program for the mysqld daemon.");
|
puts("Administration program for the mysqld daemon.");
|
||||||
printf("Usage: %s [OPTIONS] command command....\n", my_progname);
|
printf("Usage: %s [OPTIONS] command command....\n", my_progname);
|
||||||
my_print_help(my_long_options);
|
my_print_help(my_long_options);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2001-2004 MySQL AB
|
/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -34,6 +34,7 @@
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "log_event.h"
|
#include "log_event.h"
|
||||||
#include "sql_common.h"
|
#include "sql_common.h"
|
||||||
|
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
|
||||||
|
|
||||||
#define BIN_LOG_HEADER_SIZE 4
|
#define BIN_LOG_HEADER_SIZE 4
|
||||||
#define PROBE_HEADER_LEN (EVENT_LEN_OFFSET+4)
|
#define PROBE_HEADER_LEN (EVENT_LEN_OFFSET+4)
|
||||||
|
@ -1239,10 +1240,7 @@ static void print_version()
|
||||||
static void usage()
|
static void usage()
|
||||||
{
|
{
|
||||||
print_version();
|
print_version();
|
||||||
puts("By Monty and Sasha, for your professional use\n\
|
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2001, 2010"));
|
||||||
This software comes with NO WARRANTY: This is free software,\n\
|
|
||||||
and you are welcome to modify and redistribute it under the GPL license.\n");
|
|
||||||
|
|
||||||
printf("\
|
printf("\
|
||||||
Dumps a MySQL binary log in a format usable for viewing or for piping to\n\
|
Dumps a MySQL binary log in a format usable for viewing or for piping to\n\
|
||||||
the mysql command line client.\n\n");
|
the mysql command line client.\n\n");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2000 MySQL AB, 2009 Sun Microsystems, Inc
|
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -13,8 +13,6 @@
|
||||||
along with this program; if not, write to the Free Software
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
|
|
||||||
|
|
||||||
#define CHECK_VERSION "2.5.0"
|
#define CHECK_VERSION "2.5.0"
|
||||||
|
|
||||||
#include "client_priv.h"
|
#include "client_priv.h"
|
||||||
|
@ -22,6 +20,7 @@
|
||||||
#include <mysql_version.h>
|
#include <mysql_version.h>
|
||||||
#include <mysqld_error.h>
|
#include <mysqld_error.h>
|
||||||
#include <sslopt-vars.h>
|
#include <sslopt-vars.h>
|
||||||
|
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
|
||||||
|
|
||||||
/* Exit codes */
|
/* Exit codes */
|
||||||
|
|
||||||
|
@ -215,9 +214,7 @@ static void print_version(void)
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
print_version();
|
print_version();
|
||||||
puts("By Jani Tolonen, 2001-04-20, MySQL Development Team.\n");
|
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
|
||||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n");
|
|
||||||
puts("and you are welcome to modify and redistribute it under the GPL license.\n");
|
|
||||||
puts("This program can be used to CHECK (-c, -m, -C), REPAIR (-r), ANALYZE (-a),");
|
puts("This program can be used to CHECK (-c, -m, -C), REPAIR (-r), ANALYZE (-a),");
|
||||||
puts("or OPTIMIZE (-o) tables. Some of the options (like -e or -q) can be");
|
puts("or OPTIMIZE (-o) tables. Some of the options (like -e or -q) can be");
|
||||||
puts("used at the same time. Not all options are supported by all storage engines.");
|
puts("used at the same time. Not all options are supported by all storage engines.");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright 2000-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
|
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -51,6 +51,8 @@
|
||||||
#include "mysql_version.h"
|
#include "mysql_version.h"
|
||||||
#include "mysqld_error.h"
|
#include "mysqld_error.h"
|
||||||
|
|
||||||
|
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
|
||||||
|
|
||||||
/* Exit codes */
|
/* Exit codes */
|
||||||
|
|
||||||
#define EX_USAGE 1
|
#define EX_USAGE 1
|
||||||
|
@ -584,8 +586,7 @@ static void short_usage_sub(void)
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
print_version();
|
print_version();
|
||||||
puts("By Igor Romanenko, Monty, Jani & Sinisa.");
|
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
|
||||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
|
|
||||||
puts("Dumping structure and contents of MySQL databases and tables.");
|
puts("Dumping structure and contents of MySQL databases and tables.");
|
||||||
short_usage_sub();
|
short_usage_sub();
|
||||||
print_defaults("my",load_default_groups);
|
print_defaults("my",load_default_groups);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc.
|
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -32,6 +32,8 @@
|
||||||
#include <my_pthread.h>
|
#include <my_pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
|
||||||
|
|
||||||
|
|
||||||
/* Global Thread counter */
|
/* Global Thread counter */
|
||||||
uint counter;
|
uint counter;
|
||||||
|
@ -191,8 +193,7 @@ static void print_version(void)
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
print_version();
|
print_version();
|
||||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
|
||||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
|
|
||||||
printf("\
|
printf("\
|
||||||
Loads tables from text files in various formats. The base name of the\n\
|
Loads tables from text files in various formats. The base name of the\n\
|
||||||
text file must be the name of the table that should be used.\n\
|
text file must be the name of the table that should be used.\n\
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2000-2006 MySQL AB
|
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -25,6 +25,7 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <sslopt-vars.h>
|
#include <sslopt-vars.h>
|
||||||
|
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
|
||||||
|
|
||||||
static char * host=0, *opt_password=0, *user=0;
|
static char * host=0, *opt_password=0, *user=0;
|
||||||
static my_bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0;
|
static my_bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0;
|
||||||
|
@ -247,8 +248,7 @@ static void print_version(void)
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
print_version();
|
print_version();
|
||||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010)"));
|
||||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
|
|
||||||
puts("Shows the structure of a MySQL database (databases, tables, and columns).\n");
|
puts("Shows the structure of a MySQL database (databases, tables, and columns).\n");
|
||||||
printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname);
|
printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname);
|
||||||
puts("\n\
|
puts("\n\
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
|
/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -11,12 +11,7 @@
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
original idea: Brian Aker via playing with ab for too many years
|
|
||||||
coded by: Patrick Galbraith
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
MySQL Slap
|
MySQL Slap
|
||||||
|
@ -94,6 +89,7 @@ TODO:
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#endif
|
#endif
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
|
||||||
|
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
#define srandom srand
|
#define srandom srand
|
||||||
|
@ -686,8 +682,7 @@ static void print_version(void)
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
print_version();
|
print_version();
|
||||||
puts("Copyright (C) 2005 MySQL AB");
|
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2005, 2010"));
|
||||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
|
|
||||||
puts("Run a query multiple times against the server.\n");
|
puts("Run a query multiple times against the server.\n");
|
||||||
printf("Usage: %s [OPTIONS]\n",my_progname);
|
printf("Usage: %s [OPTIONS]\n",my_progname);
|
||||||
print_defaults("my",load_default_groups);
|
print_defaults("my",load_default_groups);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2000 MySQL AB
|
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -36,6 +36,7 @@
|
||||||
#include "client_priv.h"
|
#include "client_priv.h"
|
||||||
#include <mysql_version.h>
|
#include <mysql_version.h>
|
||||||
#include <mysqld_error.h>
|
#include <mysqld_error.h>
|
||||||
|
#include <sql_common.h>
|
||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
#include <my_dir.h>
|
#include <my_dir.h>
|
||||||
#include <hash.h>
|
#include <hash.h>
|
||||||
|
@ -51,6 +52,8 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <my_stacktrace.h>
|
#include <my_stacktrace.h>
|
||||||
|
|
||||||
|
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
|
||||||
|
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
#include <crtdbg.h>
|
#include <crtdbg.h>
|
||||||
#define SIGNAL_FMT "exception 0x%x"
|
#define SIGNAL_FMT "exception 0x%x"
|
||||||
|
@ -112,6 +115,7 @@ static my_bool parsing_disabled= 0;
|
||||||
static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
|
static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
|
||||||
display_metadata= FALSE, display_result_sorted= FALSE;
|
display_metadata= FALSE, display_result_sorted= FALSE;
|
||||||
static my_bool disable_query_log= 0, disable_result_log= 0;
|
static my_bool disable_query_log= 0, disable_result_log= 0;
|
||||||
|
static my_bool disable_connect_log= 1;
|
||||||
static my_bool disable_warnings= 0;
|
static my_bool disable_warnings= 0;
|
||||||
static my_bool disable_info= 1;
|
static my_bool disable_info= 1;
|
||||||
static my_bool abort_on_error= 1;
|
static my_bool abort_on_error= 1;
|
||||||
|
@ -190,6 +194,8 @@ static ulonglong timer_now(void);
|
||||||
|
|
||||||
static ulong connection_retry_sleep= 100000; /* Microseconds */
|
static ulong connection_retry_sleep= 100000; /* Microseconds */
|
||||||
|
|
||||||
|
static char *opt_plugin_dir= 0;
|
||||||
|
|
||||||
/* Precompiled re's */
|
/* Precompiled re's */
|
||||||
static my_regex_t ps_re; /* the query can be run using PS protocol */
|
static my_regex_t ps_re; /* the query can be run using PS protocol */
|
||||||
static my_regex_t sp_re; /* the query can be run as a SP */
|
static my_regex_t sp_re; /* the query can be run as a SP */
|
||||||
|
@ -227,8 +233,9 @@ typedef struct
|
||||||
int str_val_len;
|
int str_val_len;
|
||||||
int int_val;
|
int int_val;
|
||||||
int alloced_len;
|
int alloced_len;
|
||||||
int int_dirty; /* do not update string if int is updated until first read */
|
bool int_dirty; /* do not update string if int is updated until first read */
|
||||||
int alloced;
|
bool is_int;
|
||||||
|
bool alloced;
|
||||||
} VAR;
|
} VAR;
|
||||||
|
|
||||||
/*Perl/shell-like variable registers */
|
/*Perl/shell-like variable registers */
|
||||||
|
@ -257,6 +264,7 @@ struct st_connection
|
||||||
pthread_mutex_t result_mutex;
|
pthread_mutex_t result_mutex;
|
||||||
pthread_cond_t result_cond;
|
pthread_cond_t result_cond;
|
||||||
int query_done;
|
int query_done;
|
||||||
|
my_bool has_thread;
|
||||||
#endif /*EMBEDDED_LIBRARY*/
|
#endif /*EMBEDDED_LIBRARY*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -286,6 +294,7 @@ enum enum_commands {
|
||||||
Q_EVAL_RESULT,
|
Q_EVAL_RESULT,
|
||||||
Q_ENABLE_QUERY_LOG, Q_DISABLE_QUERY_LOG,
|
Q_ENABLE_QUERY_LOG, Q_DISABLE_QUERY_LOG,
|
||||||
Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG,
|
Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG,
|
||||||
|
Q_ENABLE_CONNECT_LOG, Q_DISABLE_CONNECT_LOG,
|
||||||
Q_WAIT_FOR_SLAVE_TO_STOP,
|
Q_WAIT_FOR_SLAVE_TO_STOP,
|
||||||
Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS,
|
Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS,
|
||||||
Q_ENABLE_INFO, Q_DISABLE_INFO,
|
Q_ENABLE_INFO, Q_DISABLE_INFO,
|
||||||
|
@ -351,6 +360,8 @@ const char *command_names[]=
|
||||||
/* Enable/disable that the _result_ from a query is logged to result file */
|
/* Enable/disable that the _result_ from a query is logged to result file */
|
||||||
"enable_result_log",
|
"enable_result_log",
|
||||||
"disable_result_log",
|
"disable_result_log",
|
||||||
|
"enable_connect_log",
|
||||||
|
"disable_connect_log",
|
||||||
"wait_for_slave_to_stop",
|
"wait_for_slave_to_stop",
|
||||||
"enable_warnings",
|
"enable_warnings",
|
||||||
"disable_warnings",
|
"disable_warnings",
|
||||||
|
@ -447,7 +458,7 @@ struct st_command
|
||||||
char *query, *query_buf,*first_argument,*last_argument,*end;
|
char *query, *query_buf,*first_argument,*last_argument,*end;
|
||||||
DYNAMIC_STRING content;
|
DYNAMIC_STRING content;
|
||||||
int first_word_len, query_len;
|
int first_word_len, query_len;
|
||||||
my_bool abort_on_error;
|
my_bool abort_on_error, used_replace;
|
||||||
struct st_expected_errors expected_errors;
|
struct st_expected_errors expected_errors;
|
||||||
char require_file[FN_REFLEN];
|
char require_file[FN_REFLEN];
|
||||||
enum enum_commands type;
|
enum enum_commands type;
|
||||||
|
@ -763,10 +774,9 @@ end_thread:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void wait_query_thread_done(struct st_connection *con)
|
static void wait_query_thread_done(struct st_connection *con)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(con->tid);
|
DBUG_ASSERT(con->has_thread);
|
||||||
if (!con->query_done)
|
if (!con->query_done)
|
||||||
{
|
{
|
||||||
pthread_mutex_lock(&con->result_mutex);
|
pthread_mutex_lock(&con->result_mutex);
|
||||||
|
@ -779,7 +789,7 @@ static void wait_query_thread_done(struct st_connection *con)
|
||||||
|
|
||||||
static void signal_connection_thd(struct st_connection *cn, int command)
|
static void signal_connection_thd(struct st_connection *cn, int command)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(cn->tid);
|
DBUG_ASSERT(cn->has_thread);
|
||||||
cn->query_done= 0;
|
cn->query_done= 0;
|
||||||
cn->command= command;
|
cn->command= command;
|
||||||
pthread_mutex_lock(&cn->query_mutex);
|
pthread_mutex_lock(&cn->query_mutex);
|
||||||
|
@ -791,13 +801,13 @@ static void signal_connection_thd(struct st_connection *cn, int command)
|
||||||
/*
|
/*
|
||||||
Sometimes we try to execute queries when the connection is closed.
|
Sometimes we try to execute queries when the connection is closed.
|
||||||
It's done to make sure it was closed completely.
|
It's done to make sure it was closed completely.
|
||||||
So that if our connection is closed (cn->tid == 0), we just return
|
So that if our connection is closed (cn->has_thread == 0), we just return
|
||||||
the mysql_send_query() result which is an error in this case.
|
the mysql_send_query() result which is an error in this case.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int do_send_query(struct st_connection *cn, const char *q, int q_len)
|
static int do_send_query(struct st_connection *cn, const char *q, int q_len)
|
||||||
{
|
{
|
||||||
if (!cn->tid)
|
if (!cn->has_thread)
|
||||||
return mysql_send_query(&cn->mysql, q, q_len);
|
return mysql_send_query(&cn->mysql, q, q_len);
|
||||||
cn->cur_query= q;
|
cn->cur_query= q;
|
||||||
cn->cur_query_len= q_len;
|
cn->cur_query_len= q_len;
|
||||||
|
@ -805,10 +815,9 @@ static int do_send_query(struct st_connection *cn, const char *q, int q_len)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int do_read_query_result(struct st_connection *cn)
|
static int do_read_query_result(struct st_connection *cn)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(cn->tid);
|
DBUG_ASSERT(cn->has_thread);
|
||||||
wait_query_thread_done(cn);
|
wait_query_thread_done(cn);
|
||||||
signal_connection_thd(cn, EMB_READ_QUERY_RESULT);
|
signal_connection_thd(cn, EMB_READ_QUERY_RESULT);
|
||||||
wait_query_thread_done(cn);
|
wait_query_thread_done(cn);
|
||||||
|
@ -819,12 +828,12 @@ static int do_read_query_result(struct st_connection *cn)
|
||||||
|
|
||||||
static void emb_close_connection(struct st_connection *cn)
|
static void emb_close_connection(struct st_connection *cn)
|
||||||
{
|
{
|
||||||
if (!cn->tid)
|
if (!cn->has_thread)
|
||||||
return;
|
return;
|
||||||
wait_query_thread_done(cn);
|
wait_query_thread_done(cn);
|
||||||
signal_connection_thd(cn, EMB_END_CONNECTION);
|
signal_connection_thd(cn, EMB_END_CONNECTION);
|
||||||
pthread_join(cn->tid, NULL);
|
pthread_join(cn->tid, NULL);
|
||||||
cn->tid= 0;
|
cn->has_thread= FALSE;
|
||||||
pthread_mutex_destroy(&cn->query_mutex);
|
pthread_mutex_destroy(&cn->query_mutex);
|
||||||
pthread_cond_destroy(&cn->query_cond);
|
pthread_cond_destroy(&cn->query_cond);
|
||||||
pthread_mutex_destroy(&cn->result_mutex);
|
pthread_mutex_destroy(&cn->result_mutex);
|
||||||
|
@ -842,9 +851,9 @@ static void init_connection_thd(struct st_connection *cn)
|
||||||
pthread_cond_init(&cn->result_cond, NULL) ||
|
pthread_cond_init(&cn->result_cond, NULL) ||
|
||||||
pthread_create(&cn->tid, &cn_thd_attrib, connection_thread, (void*)cn))
|
pthread_create(&cn->tid, &cn_thd_attrib, connection_thread, (void*)cn))
|
||||||
die("Error in the thread library");
|
die("Error in the thread library");
|
||||||
|
cn->has_thread=TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#else /*EMBEDDED_LIBRARY*/
|
#else /*EMBEDDED_LIBRARY*/
|
||||||
|
|
||||||
#define do_send_query(cn,q,q_len) mysql_send_query(&cn->mysql, q, q_len)
|
#define do_send_query(cn,q,q_len) mysql_send_query(&cn->mysql, q, q_len)
|
||||||
|
@ -2036,6 +2045,21 @@ static void var_free(void *v)
|
||||||
|
|
||||||
C_MODE_END
|
C_MODE_END
|
||||||
|
|
||||||
|
void var_set_int(VAR *v, const char *str)
|
||||||
|
{
|
||||||
|
char *endptr;
|
||||||
|
/* Initially assume not a number */
|
||||||
|
v->int_val= 0;
|
||||||
|
v->is_int= false;
|
||||||
|
v->int_dirty= false;
|
||||||
|
if (!str) return;
|
||||||
|
|
||||||
|
v->int_val = (int) strtol(str, &endptr, 10);
|
||||||
|
/* It is an int if strtol consumed something up to end/space/tab */
|
||||||
|
if (endptr > str && (!*endptr || *endptr == ' ' || *endptr == '\t'))
|
||||||
|
v->is_int= true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
|
VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
|
||||||
int val_len)
|
int val_len)
|
||||||
|
@ -2070,11 +2094,10 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
|
||||||
memcpy(tmp_var->str_val, val, val_len);
|
memcpy(tmp_var->str_val, val, val_len);
|
||||||
tmp_var->str_val[val_len]= 0;
|
tmp_var->str_val[val_len]= 0;
|
||||||
}
|
}
|
||||||
|
var_set_int(tmp_var, val);
|
||||||
tmp_var->name_len = name_len;
|
tmp_var->name_len = name_len;
|
||||||
tmp_var->str_val_len = val_len;
|
tmp_var->str_val_len = val_len;
|
||||||
tmp_var->alloced_len = val_alloc_len;
|
tmp_var->alloced_len = val_alloc_len;
|
||||||
tmp_var->int_val = (val) ? atoi(val) : 0;
|
|
||||||
tmp_var->int_dirty = 0;
|
|
||||||
return tmp_var;
|
return tmp_var;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2135,7 +2158,7 @@ VAR* var_get(const char *var_name, const char **var_name_end, my_bool raw,
|
||||||
if (!raw && v->int_dirty)
|
if (!raw && v->int_dirty)
|
||||||
{
|
{
|
||||||
sprintf(v->str_val, "%d", v->int_val);
|
sprintf(v->str_val, "%d", v->int_val);
|
||||||
v->int_dirty = 0;
|
v->int_dirty= false;
|
||||||
v->str_val_len = strlen(v->str_val);
|
v->str_val_len = strlen(v->str_val);
|
||||||
}
|
}
|
||||||
if (var_name_end)
|
if (var_name_end)
|
||||||
|
@ -2197,7 +2220,7 @@ void var_set(const char *var_name, const char *var_name_end,
|
||||||
if (v->int_dirty)
|
if (v->int_dirty)
|
||||||
{
|
{
|
||||||
sprintf(v->str_val, "%d", v->int_val);
|
sprintf(v->str_val, "%d", v->int_val);
|
||||||
v->int_dirty= 0;
|
v->int_dirty=false;
|
||||||
v->str_val_len= strlen(v->str_val);
|
v->str_val_len= strlen(v->str_val);
|
||||||
}
|
}
|
||||||
/* setenv() expects \0-terminated strings */
|
/* setenv() expects \0-terminated strings */
|
||||||
|
@ -2267,8 +2290,14 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
|
||||||
DBUG_ENTER("var_query_set");
|
DBUG_ENTER("var_query_set");
|
||||||
LINT_INIT(res);
|
LINT_INIT(res);
|
||||||
|
|
||||||
|
/* Only white space or ) allowed past ending ` */
|
||||||
while (end > query && *end != '`')
|
while (end > query && *end != '`')
|
||||||
|
{
|
||||||
|
if (*end && (*end != ' ' && *end != '\t' && *end != '\n' && *end != ')'))
|
||||||
|
die("Spurious text after `query` expression");
|
||||||
--end;
|
--end;
|
||||||
|
}
|
||||||
|
|
||||||
if (query == end)
|
if (query == end)
|
||||||
die("Syntax error in query, missing '`'");
|
die("Syntax error in query, missing '`'");
|
||||||
++query;
|
++query;
|
||||||
|
@ -2497,6 +2526,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
|
||||||
void var_copy(VAR *dest, VAR *src)
|
void var_copy(VAR *dest, VAR *src)
|
||||||
{
|
{
|
||||||
dest->int_val= src->int_val;
|
dest->int_val= src->int_val;
|
||||||
|
dest->is_int= src->is_int;
|
||||||
dest->int_dirty= src->int_dirty;
|
dest->int_dirty= src->int_dirty;
|
||||||
|
|
||||||
/* Alloc/realloc data for str_val in dest */
|
/* Alloc/realloc data for str_val in dest */
|
||||||
|
@ -2580,9 +2610,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
|
||||||
v->str_val_len = new_val_len;
|
v->str_val_len = new_val_len;
|
||||||
memcpy(v->str_val, p, new_val_len);
|
memcpy(v->str_val, p, new_val_len);
|
||||||
v->str_val[new_val_len] = 0;
|
v->str_val[new_val_len] = 0;
|
||||||
v->int_val=atoi(p);
|
var_set_int(v, p);
|
||||||
DBUG_PRINT("info", ("atoi on '%s', returns: %d", p, v->int_val));
|
|
||||||
v->int_dirty=0;
|
|
||||||
}
|
}
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
@ -2929,6 +2957,8 @@ int do_modify_var(struct st_command *command,
|
||||||
die("The argument to %.*s must be a variable (start with $)",
|
die("The argument to %.*s must be a variable (start with $)",
|
||||||
command->first_word_len, command->query);
|
command->first_word_len, command->query);
|
||||||
v= var_get(p, &p, 1, 0);
|
v= var_get(p, &p, 1, 0);
|
||||||
|
if (! v->is_int)
|
||||||
|
die("Cannot perform inc/dec on a non-numeric value");
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case DO_DEC:
|
case DO_DEC:
|
||||||
v->int_val--;
|
v->int_val--;
|
||||||
|
@ -2940,7 +2970,7 @@ int do_modify_var(struct st_command *command,
|
||||||
die("Invalid operator to do_modify_var");
|
die("Invalid operator to do_modify_var");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
v->int_dirty= 1;
|
v->int_dirty= true;
|
||||||
command->last_argument= (char*)++p;
|
command->last_argument= (char*)++p;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3414,7 +3444,7 @@ static int get_list_files(DYNAMIC_STRING *ds, const DYNAMIC_STRING *ds_dirname,
|
||||||
if (ds_wild && ds_wild->length &&
|
if (ds_wild && ds_wild->length &&
|
||||||
wild_compare(file->name, ds_wild->str, 0))
|
wild_compare(file->name, ds_wild->str, 0))
|
||||||
continue;
|
continue;
|
||||||
dynstr_append(ds, file->name);
|
replace_dynstr_append(ds, file->name);
|
||||||
dynstr_append(ds, "\n");
|
dynstr_append(ds, "\n");
|
||||||
}
|
}
|
||||||
set_wild_chars(0);
|
set_wild_chars(0);
|
||||||
|
@ -3444,6 +3474,7 @@ static void do_list_files(struct st_command *command)
|
||||||
{"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"}
|
{"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"}
|
||||||
};
|
};
|
||||||
DBUG_ENTER("do_list_files");
|
DBUG_ENTER("do_list_files");
|
||||||
|
command->used_replace= 1;
|
||||||
|
|
||||||
check_command_args(command, command->first_argument,
|
check_command_args(command, command->first_argument,
|
||||||
list_files_args,
|
list_files_args,
|
||||||
|
@ -3485,6 +3516,7 @@ static void do_list_files_write_file_command(struct st_command *command,
|
||||||
{"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"}
|
{"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"}
|
||||||
};
|
};
|
||||||
DBUG_ENTER("do_list_files_write_file");
|
DBUG_ENTER("do_list_files_write_file");
|
||||||
|
command->used_replace= 1;
|
||||||
|
|
||||||
check_command_args(command, command->first_argument,
|
check_command_args(command, command->first_argument,
|
||||||
list_files_args,
|
list_files_args,
|
||||||
|
@ -3870,13 +3902,15 @@ void do_change_user(struct st_command *command)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ds_user.length)
|
if (!ds_user.length)
|
||||||
|
{
|
||||||
dynstr_set(&ds_user, mysql->user);
|
dynstr_set(&ds_user, mysql->user);
|
||||||
|
|
||||||
if (!ds_passwd.length)
|
if (!ds_passwd.length)
|
||||||
dynstr_set(&ds_passwd, mysql->passwd);
|
dynstr_set(&ds_passwd, mysql->passwd);
|
||||||
|
|
||||||
if (!ds_db.length)
|
if (!ds_db.length)
|
||||||
dynstr_set(&ds_db, mysql->db);
|
dynstr_set(&ds_db, mysql->db);
|
||||||
|
}
|
||||||
|
|
||||||
DBUG_PRINT("info",("connection: '%s' user: '%s' password: '%s' database: '%s'",
|
DBUG_PRINT("info",("connection: '%s' user: '%s' password: '%s' database: '%s'",
|
||||||
cur_con->name, ds_user.str, ds_passwd.str, ds_db.str));
|
cur_con->name, ds_user.str, ds_passwd.str, ds_db.str));
|
||||||
|
@ -3982,7 +4016,18 @@ void do_perl(struct st_command *command)
|
||||||
if (!error)
|
if (!error)
|
||||||
my_delete(temp_file_path, MYF(0));
|
my_delete(temp_file_path, MYF(0));
|
||||||
|
|
||||||
handle_command_error(command, WEXITSTATUS(error));
|
/* Check for error code that indicates perl could not be started */
|
||||||
|
int exstat= WEXITSTATUS(error);
|
||||||
|
#ifdef __WIN__
|
||||||
|
if (exstat == 1)
|
||||||
|
/* Text must begin 'perl not found' as mtr looks for it */
|
||||||
|
abort_not_supported_test("perl not found in path or did not start");
|
||||||
|
#else
|
||||||
|
if (exstat == 127)
|
||||||
|
abort_not_supported_test("perl not found in path");
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
handle_command_error(command, exstat);
|
||||||
}
|
}
|
||||||
dynstr_free(&ds_delimiter);
|
dynstr_free(&ds_delimiter);
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
|
@ -4896,6 +4941,16 @@ void select_connection_name(const char *name)
|
||||||
|
|
||||||
set_current_connection(con);
|
set_current_connection(con);
|
||||||
|
|
||||||
|
/* Connection logging if enabled */
|
||||||
|
if (!disable_connect_log && !disable_query_log)
|
||||||
|
{
|
||||||
|
DYNAMIC_STRING *ds= &ds_res;
|
||||||
|
|
||||||
|
dynstr_append_mem(ds, "connection ", 11);
|
||||||
|
replace_dynstr_append(ds, name);
|
||||||
|
dynstr_append_mem(ds, ";\n", 2);
|
||||||
|
}
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4983,6 +5038,16 @@ void do_close_connection(struct st_command *command)
|
||||||
var_set_string("$CURRENT_CONNECTION", con->name);
|
var_set_string("$CURRENT_CONNECTION", con->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Connection logging if enabled */
|
||||||
|
if (!disable_connect_log && !disable_query_log)
|
||||||
|
{
|
||||||
|
DYNAMIC_STRING *ds= &ds_res;
|
||||||
|
|
||||||
|
dynstr_append_mem(ds, "disconnect ", 11);
|
||||||
|
replace_dynstr_append(ds, ds_connection.str);
|
||||||
|
dynstr_append_mem(ds, ";\n", 2);
|
||||||
|
}
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5117,6 +5182,13 @@ int connect_n_handle_errors(struct st_command *command,
|
||||||
dynstr_append_mem(ds, delimiter, delimiter_length);
|
dynstr_append_mem(ds, delimiter, delimiter_length);
|
||||||
dynstr_append_mem(ds, "\n", 1);
|
dynstr_append_mem(ds, "\n", 1);
|
||||||
}
|
}
|
||||||
|
/* Simlified logging if enabled */
|
||||||
|
if (!disable_connect_log && !disable_query_log)
|
||||||
|
{
|
||||||
|
replace_dynstr_append(ds, command->query);
|
||||||
|
dynstr_append_mem(ds, ";\n", 2);
|
||||||
|
}
|
||||||
|
|
||||||
while (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0,
|
while (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0,
|
||||||
CLIENT_MULTI_STATEMENTS))
|
CLIENT_MULTI_STATEMENTS))
|
||||||
{
|
{
|
||||||
|
@ -5207,6 +5279,7 @@ void do_connect(struct st_command *command)
|
||||||
static DYNAMIC_STRING ds_port;
|
static DYNAMIC_STRING ds_port;
|
||||||
static DYNAMIC_STRING ds_sock;
|
static DYNAMIC_STRING ds_sock;
|
||||||
static DYNAMIC_STRING ds_options;
|
static DYNAMIC_STRING ds_options;
|
||||||
|
static DYNAMIC_STRING ds_default_auth;
|
||||||
#ifdef HAVE_SMEM
|
#ifdef HAVE_SMEM
|
||||||
static DYNAMIC_STRING ds_shm;
|
static DYNAMIC_STRING ds_shm;
|
||||||
#endif
|
#endif
|
||||||
|
@ -5218,7 +5291,8 @@ void do_connect(struct st_command *command)
|
||||||
{ "database", ARG_STRING, FALSE, &ds_database, "Database to select after connect" },
|
{ "database", ARG_STRING, FALSE, &ds_database, "Database to select after connect" },
|
||||||
{ "port", ARG_STRING, FALSE, &ds_port, "Port to connect to" },
|
{ "port", ARG_STRING, FALSE, &ds_port, "Port to connect to" },
|
||||||
{ "socket", ARG_STRING, FALSE, &ds_sock, "Socket to connect with" },
|
{ "socket", ARG_STRING, FALSE, &ds_sock, "Socket to connect with" },
|
||||||
{ "options", ARG_STRING, FALSE, &ds_options, "Options to use while connecting" }
|
{ "options", ARG_STRING, FALSE, &ds_options, "Options to use while connecting" },
|
||||||
|
{ "default_auth", ARG_STRING, FALSE, &ds_default_auth, "Default authentication to use" }
|
||||||
};
|
};
|
||||||
|
|
||||||
DBUG_ENTER("do_connect");
|
DBUG_ENTER("do_connect");
|
||||||
|
@ -5368,6 +5442,12 @@ void do_connect(struct st_command *command)
|
||||||
if (ds_database.length == 0)
|
if (ds_database.length == 0)
|
||||||
dynstr_set(&ds_database, opt_db);
|
dynstr_set(&ds_database, opt_db);
|
||||||
|
|
||||||
|
if (opt_plugin_dir && *opt_plugin_dir)
|
||||||
|
mysql_options(&con_slot->mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
|
||||||
|
|
||||||
|
if (ds_default_auth.length)
|
||||||
|
mysql_options(&con_slot->mysql, MYSQL_DEFAULT_AUTH, ds_default_auth.str);
|
||||||
|
|
||||||
/* Special database to allow one to connect without a database name */
|
/* Special database to allow one to connect without a database name */
|
||||||
if (ds_database.length && !strcmp(ds_database.str,"*NO-ONE*"))
|
if (ds_database.length && !strcmp(ds_database.str,"*NO-ONE*"))
|
||||||
dynstr_set(&ds_database, "");
|
dynstr_set(&ds_database, "");
|
||||||
|
@ -6166,6 +6246,9 @@ static struct my_option my_long_options[] =
|
||||||
"Number of seconds before connection timeout.",
|
"Number of seconds before connection timeout.",
|
||||||
&opt_connect_timeout, &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
|
&opt_connect_timeout, &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
|
||||||
120, 0, 3600 * 12, 0, 0, 0},
|
120, 0, 3600 * 12, 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},
|
||||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6179,8 +6262,7 @@ void print_version(void)
|
||||||
void usage()
|
void usage()
|
||||||
{
|
{
|
||||||
print_version();
|
print_version();
|
||||||
printf("MySQL AB, by Sasha, Matt, Monty & Jani\n");
|
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
|
||||||
printf("This software comes with ABSOLUTELY NO WARRANTY\n\n");
|
|
||||||
printf("Runs a test against the mysql server and compares output with a results file.\n\n");
|
printf("Runs a test against the mysql server and compares output with a results file.\n\n");
|
||||||
printf("Usage: %s [OPTIONS] [database] < test_file\n", my_progname);
|
printf("Usage: %s [OPTIONS] [database] < test_file\n", my_progname);
|
||||||
my_print_help(my_long_options);
|
my_print_help(my_long_options);
|
||||||
|
@ -7434,11 +7516,13 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
||||||
(flags & QUERY_REAP_FLAG));
|
(flags & QUERY_REAP_FLAG));
|
||||||
DBUG_ENTER("run_query");
|
DBUG_ENTER("run_query");
|
||||||
|
|
||||||
init_dynamic_string(&ds_warnings, NULL, 0, 256);
|
|
||||||
|
|
||||||
if (cn->pending && (flags & QUERY_SEND_FLAG))
|
if (cn->pending && (flags & QUERY_SEND_FLAG))
|
||||||
die ("Cannot run query on connection between send and reap");
|
die ("Cannot run query on connection between send and reap");
|
||||||
|
|
||||||
|
if (!(flags & QUERY_SEND_FLAG) && !cn->pending)
|
||||||
|
die ("Cannot reap on a connection without pending send");
|
||||||
|
|
||||||
|
init_dynamic_string(&ds_warnings, NULL, 0, 256);
|
||||||
/*
|
/*
|
||||||
Evaluate query if this is an eval command
|
Evaluate query if this is an eval command
|
||||||
*/
|
*/
|
||||||
|
@ -8183,6 +8267,8 @@ int main(int argc, char **argv)
|
||||||
case Q_DISABLE_ABORT_ON_ERROR: abort_on_error=0; break;
|
case Q_DISABLE_ABORT_ON_ERROR: abort_on_error=0; break;
|
||||||
case Q_ENABLE_RESULT_LOG: disable_result_log=0; break;
|
case Q_ENABLE_RESULT_LOG: disable_result_log=0; break;
|
||||||
case Q_DISABLE_RESULT_LOG: disable_result_log=1; break;
|
case Q_DISABLE_RESULT_LOG: disable_result_log=1; break;
|
||||||
|
case Q_ENABLE_CONNECT_LOG: disable_connect_log=0; break;
|
||||||
|
case Q_DISABLE_CONNECT_LOG: disable_connect_log=1; break;
|
||||||
case Q_ENABLE_WARNINGS: disable_warnings=0; break;
|
case Q_ENABLE_WARNINGS: disable_warnings=0; break;
|
||||||
case Q_DISABLE_WARNINGS: disable_warnings=1; break;
|
case Q_DISABLE_WARNINGS: disable_warnings=1; break;
|
||||||
case Q_ENABLE_INFO: disable_info=0; break;
|
case Q_ENABLE_INFO: disable_info=0; break;
|
||||||
|
@ -8479,7 +8565,7 @@ int main(int argc, char **argv)
|
||||||
memset(&saved_expected_errors, 0, sizeof(saved_expected_errors));
|
memset(&saved_expected_errors, 0, sizeof(saved_expected_errors));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command_executed != last_command_executed)
|
if (command_executed != last_command_executed || command->used_replace)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
As soon as any command has been executed,
|
As soon as any command has been executed,
|
||||||
|
|
|
@ -131,6 +131,7 @@ SET(HAVE_PASE_ENVIRONMENT CACHE INTERNAL "")
|
||||||
SET(HAVE_PATHS_H CACHE INTERNAL "")
|
SET(HAVE_PATHS_H CACHE INTERNAL "")
|
||||||
SET(HAVE_PCLOSE CACHE INTERNAL "")
|
SET(HAVE_PCLOSE CACHE INTERNAL "")
|
||||||
SET(HAVE_PERROR 1 CACHE INTERNAL "")
|
SET(HAVE_PERROR 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PEERCRED CACHE INTERNAL "")
|
||||||
SET(HAVE_POLL_H CACHE INTERNAL "")
|
SET(HAVE_POLL_H CACHE INTERNAL "")
|
||||||
SET(HAVE_POPEN CACHE INTERNAL "")
|
SET(HAVE_POPEN CACHE INTERNAL "")
|
||||||
SET(HAVE_POLL CACHE INTERNAL "")
|
SET(HAVE_POLL CACHE INTERNAL "")
|
||||||
|
|
|
@ -602,6 +602,8 @@
|
||||||
#cmakedefine PLUGINDIR "@PLUGINDIR@"
|
#cmakedefine PLUGINDIR "@PLUGINDIR@"
|
||||||
#cmakedefine DEFAULT_SYSCONFDIR "@DEFAULT_SYSCONFDIR@"
|
#cmakedefine DEFAULT_SYSCONFDIR "@DEFAULT_SYSCONFDIR@"
|
||||||
|
|
||||||
|
#cmakedefine SO_EXT "@CMAKE_SHARED_MODULE_SUFFIX@"
|
||||||
|
|
||||||
#define PACKAGE "mysql"
|
#define PACKAGE "mysql"
|
||||||
#define PACKAGE_BUGREPORT ""
|
#define PACKAGE_BUGREPORT ""
|
||||||
#define PACKAGE_NAME "MySQL Server"
|
#define PACKAGE_NAME "MySQL Server"
|
||||||
|
|
47
configure.in
47
configure.in
|
@ -87,7 +87,6 @@ sinclude(config/ac-macros/character_sets.m4)
|
||||||
sinclude(config/ac-macros/compiler_flag.m4)
|
sinclude(config/ac-macros/compiler_flag.m4)
|
||||||
sinclude(config/ac-macros/plugins.m4)
|
sinclude(config/ac-macros/plugins.m4)
|
||||||
sinclude(config/ac-macros/dtrace.m4)
|
sinclude(config/ac-macros/dtrace.m4)
|
||||||
sinclude(config/ac-macros/ha_ndbcluster.m4)
|
|
||||||
sinclude(config/ac-macros/large_file.m4)
|
sinclude(config/ac-macros/large_file.m4)
|
||||||
sinclude(config/ac-macros/misc.m4)
|
sinclude(config/ac-macros/misc.m4)
|
||||||
sinclude(config/ac-macros/readline.m4)
|
sinclude(config/ac-macros/readline.m4)
|
||||||
|
@ -1069,46 +1068,6 @@ struct request_info *req;
|
||||||
])
|
])
|
||||||
AC_SUBST(WRAPLIBS)
|
AC_SUBST(WRAPLIBS)
|
||||||
|
|
||||||
if test "$TARGET_LINUX" = "true"; then
|
|
||||||
AC_ARG_WITH(pstack,
|
|
||||||
[ --with-pstack Use the pstack backtrace library],
|
|
||||||
[ USE_PSTACK=$withval ],
|
|
||||||
[ USE_PSTACK=no ])
|
|
||||||
pstack_libs=
|
|
||||||
pstack_dir=
|
|
||||||
if test "$USE_PSTACK" = yes -a "$TARGET_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386"
|
|
||||||
then
|
|
||||||
have_libiberty= have_libbfd=
|
|
||||||
my_save_LIBS="$LIBS"
|
|
||||||
dnl I have no idea if this is a good test - can not find docs for libiberty
|
|
||||||
AC_CHECK_LIB([iberty], [fdmatch],
|
|
||||||
[have_libiberty=yes
|
|
||||||
AC_CHECK_LIB([bfd], [bfd_openr], [have_libbfd=yes], , [-liberty])])
|
|
||||||
LIBS="$my_save_LIBS"
|
|
||||||
|
|
||||||
if test x"$have_libiberty" = xyes -a x"$have_libbfd" = xyes
|
|
||||||
then
|
|
||||||
pstack_dir="pstack"
|
|
||||||
pstack_libs="../pstack/libpstack.a -lbfd -liberty"
|
|
||||||
# We must link staticly when using pstack
|
|
||||||
with_mysqld_ldflags="-all-static"
|
|
||||||
AC_SUBST([pstack_dir])
|
|
||||||
AC_SUBST([pstack_libs])
|
|
||||||
AC_DEFINE([USE_PSTACK], [1], [the pstack backtrace library])
|
|
||||||
dnl This check isn't needed, but might be nice to give some feedback....
|
|
||||||
dnl AC_CHECK_HEADER(libiberty.h,
|
|
||||||
dnl have_libiberty_h=yes,
|
|
||||||
dnl have_libiberty_h=no)
|
|
||||||
else
|
|
||||||
USE_PSTACK="no"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
USE_PSTACK="no"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
AC_MSG_CHECKING([if we should use pstack])
|
|
||||||
AC_MSG_RESULT([$USE_PSTACK])
|
|
||||||
|
|
||||||
# Check for gtty if termio.h doesn't exists
|
# Check for gtty if termio.h doesn't exists
|
||||||
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
|
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
|
||||||
then
|
then
|
||||||
|
@ -1657,9 +1616,8 @@ case "$with_mysqld_ldflags " in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
# Check for dlopen, needed for user definable functions
|
# Check for dlopen, needed for user definable functions and plugins
|
||||||
# This must be checked after threads on AIX
|
# This must be checked after threads on AIX
|
||||||
# We only need this for mysqld, not for the clients.
|
|
||||||
|
|
||||||
my_save_LIBS="$LIBS"
|
my_save_LIBS="$LIBS"
|
||||||
LIBS=""
|
LIBS=""
|
||||||
|
@ -3004,9 +2962,6 @@ AC_SUBST([RDTSC_SPARC_ASSEMBLY])
|
||||||
# Output results
|
# Output results
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
if test -d "$srcdir/pstack" ; then
|
|
||||||
AC_CONFIG_FILES(pstack/Makefile pstack/aout/Makefile)
|
|
||||||
fi
|
|
||||||
if test -d "$srcdir/cmd-line-utils/readline" ; then
|
if test -d "$srcdir/cmd-line-utils/readline" ; then
|
||||||
AC_CONFIG_FILES(cmd-line-utils/readline/Makefile)
|
AC_CONFIG_FILES(cmd-line-utils/readline/Makefile)
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -496,6 +496,7 @@ int DbugParse(CODE_STATE *cs, const char *control)
|
||||||
rel= control[0] == '+' || control[0] == '-';
|
rel= control[0] == '+' || control[0] == '-';
|
||||||
if ((!rel || (!stack->out_file && !stack->next)))
|
if ((!rel || (!stack->out_file && !stack->next)))
|
||||||
{
|
{
|
||||||
|
/* Free memory associated with the state before resetting its members */
|
||||||
FreeState(cs, stack, 0);
|
FreeState(cs, stack, 0);
|
||||||
stack->flags= 0;
|
stack->flags= 0;
|
||||||
stack->delay= 0;
|
stack->delay= 0;
|
||||||
|
@ -1608,7 +1609,7 @@ static void PushState(CODE_STATE *cs)
|
||||||
struct settings *new_malloc;
|
struct settings *new_malloc;
|
||||||
|
|
||||||
new_malloc= (struct settings *) DbugMalloc(sizeof(struct settings));
|
new_malloc= (struct settings *) DbugMalloc(sizeof(struct settings));
|
||||||
bzero(new_malloc, sizeof(*new_malloc));
|
bzero(new_malloc, sizeof(struct settings));
|
||||||
new_malloc->next= cs->stack;
|
new_malloc->next= cs->stack;
|
||||||
cs->stack= new_malloc;
|
cs->stack= new_malloc;
|
||||||
}
|
}
|
||||||
|
@ -2088,7 +2089,7 @@ static FILE *OpenProfile(CODE_STATE *cs, const char *name)
|
||||||
|
|
||||||
static void DBUGCloseFile(CODE_STATE *cs, FILE *fp)
|
static void DBUGCloseFile(CODE_STATE *cs, FILE *fp)
|
||||||
{
|
{
|
||||||
if (fp && fp != stderr && fp != stdout && fclose(fp) == EOF)
|
if (fp != NULL && fp != stderr && fp != stdout && fclose(fp) == EOF)
|
||||||
{
|
{
|
||||||
pthread_mutex_lock(&THR_LOCK_dbug);
|
pthread_mutex_lock(&THR_LOCK_dbug);
|
||||||
(void) fprintf(cs->stack->out_file, ERR_CLOSE, cs->process);
|
(void) fprintf(cs->stack->out_file, ERR_CLOSE, cs->process);
|
||||||
|
|
|
@ -24,7 +24,9 @@ HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \
|
||||||
my_list.h my_alloc.h typelib.h mysql/plugin.h \
|
my_list.h my_alloc.h typelib.h mysql/plugin.h \
|
||||||
mysql/plugin_audit.h mysql/plugin_ftparser.h
|
mysql/plugin_audit.h mysql/plugin_ftparser.h
|
||||||
pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
|
pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
|
||||||
my_xml.h mysql_embed.h mysql/services.h \
|
my_xml.h mysql_embed.h mysql/plugin_auth.h \
|
||||||
|
mysql/client_plugin.h mysql/plugin_auth_common.h \
|
||||||
|
mysql/services.h \
|
||||||
mysql/service_my_snprintf.h mysql/service_thd_alloc.h \
|
mysql/service_my_snprintf.h mysql/service_thd_alloc.h \
|
||||||
mysql/service_thread_scheduler.h \
|
mysql/service_thread_scheduler.h \
|
||||||
mysql/service_thd_wait.h \
|
mysql/service_thd_wait.h \
|
||||||
|
@ -56,7 +58,8 @@ pkgpsiinclude_HEADERS = mysql/psi/psi.h mysql/psi/mysql_thread.h \
|
||||||
EXTRA_DIST = mysql.h.pp mysql/plugin.h.pp probes_mysql.d.base \
|
EXTRA_DIST = mysql.h.pp mysql/plugin.h.pp probes_mysql.d.base \
|
||||||
CMakeLists.txt \
|
CMakeLists.txt \
|
||||||
mysql/psi/psi_abi_v1.h.pp \
|
mysql/psi/psi_abi_v1.h.pp \
|
||||||
mysql/psi/psi_abi_v2.h.pp
|
mysql/psi/psi_abi_v2.h.pp \
|
||||||
|
mysql/plugin_auth.h.pp mysql/client_plugin.h.pp
|
||||||
|
|
||||||
# Remove built files and the symlinked directories
|
# Remove built files and the symlinked directories
|
||||||
CLEANFILES = $(BUILT_SOURCES) readline openssl probes_mysql.d probes_mysql_nodtrace.h
|
CLEANFILES = $(BUILT_SOURCES) readline openssl probes_mysql.d probes_mysql_nodtrace.h
|
||||||
|
|
|
@ -101,7 +101,8 @@ extern const char *client_errors[]; /* Error messages */
|
||||||
#define CR_STMT_CLOSED 2056
|
#define CR_STMT_CLOSED 2056
|
||||||
#define CR_NEW_STMT_METADATA 2057
|
#define CR_NEW_STMT_METADATA 2057
|
||||||
#define CR_ALREADY_CONNECTED 2058
|
#define CR_ALREADY_CONNECTED 2058
|
||||||
#define CR_ERROR_LAST /*Copy last error nr:*/ 2058
|
#define CR_AUTH_PLUGIN_CANNOT_LOAD 2059
|
||||||
|
#define CR_ERROR_LAST /*Copy last error nr:*/ 2059
|
||||||
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
|
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
|
||||||
|
|
||||||
#endif /* ERRMSG_INCLUDED */
|
#endif /* ERRMSG_INCLUDED */
|
||||||
|
|
|
@ -452,6 +452,16 @@ extern "C" int madvise(void *addr, size_t len, int behav);
|
||||||
#define LINT_INIT(var)
|
#define LINT_INIT(var)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef SO_EXT
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define SO_EXT ".dll"
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
#define SO_EXT ".dylib"
|
||||||
|
#else
|
||||||
|
#define SO_EXT ".so"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Suppress uninitialized variable warning without generating code.
|
Suppress uninitialized variable warning without generating code.
|
||||||
|
|
||||||
|
@ -1355,8 +1365,10 @@ do { doubleget_union _tmp; \
|
||||||
#define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name)
|
#define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name)
|
||||||
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
|
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
|
||||||
#define dlclose(lib) FreeLibrary((HMODULE)lib)
|
#define dlclose(lib) FreeLibrary((HMODULE)lib)
|
||||||
|
#ifndef HAVE_DLOPEN
|
||||||
#define HAVE_DLOPEN
|
#define HAVE_DLOPEN
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DLOPEN
|
#ifdef HAVE_DLOPEN
|
||||||
#if defined(HAVE_DLFCN_H)
|
#if defined(HAVE_DLFCN_H)
|
||||||
|
@ -1365,7 +1377,11 @@ do { doubleget_union _tmp; \
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_DLERROR
|
#ifndef HAVE_DLERROR
|
||||||
|
#ifdef _WIN32
|
||||||
#define dlerror() ""
|
#define dlerror() ""
|
||||||
|
#else
|
||||||
|
#define dlerror() "No support for dynamic loading (static build?)"
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -1474,7 +1490,6 @@ static inline double rint(double x)
|
||||||
/* Things we don't need in the embedded version of MySQL */
|
/* Things we don't need in the embedded version of MySQL */
|
||||||
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
|
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
|
||||||
|
|
||||||
#undef HAVE_PSTACK /* No stacktrace */
|
|
||||||
#undef HAVE_OPENSSL
|
#undef HAVE_OPENSSL
|
||||||
#undef HAVE_SMEM /* No shared memory */
|
#undef HAVE_SMEM /* No shared memory */
|
||||||
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
|
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
#define rw_wrlock(A)
|
#define rw_wrlock(A)
|
||||||
#define rw_unlock(A)
|
#define rw_unlock(A)
|
||||||
#define rwlock_destroy(A)
|
#define rwlock_destroy(A)
|
||||||
|
#define safe_mutex_assert_owner(mp)
|
||||||
|
|
||||||
#define mysql_mutex_init(A, B, C) do {} while (0)
|
#define mysql_mutex_init(A, B, C) do {} while (0)
|
||||||
#define mysql_mutex_lock(A) do {} while (0)
|
#define mysql_mutex_lock(A) do {} while (0)
|
||||||
|
|
|
@ -48,19 +48,30 @@ typedef struct st_pthread_link {
|
||||||
struct st_pthread_link *next;
|
struct st_pthread_link *next;
|
||||||
} pthread_link;
|
} pthread_link;
|
||||||
|
|
||||||
typedef struct {
|
/**
|
||||||
uint32 waiting;
|
Implementation of Windows condition variables.
|
||||||
CRITICAL_SECTION lock_waiting;
|
We use native conditions on Vista and later, and fallback to own
|
||||||
|
implementation on earlier OS version.
|
||||||
enum {
|
*/
|
||||||
SIGNAL= 0,
|
typedef union
|
||||||
BROADCAST= 1,
|
{
|
||||||
MAX_EVENTS= 2
|
/* Native condition (used on Vista and later) */
|
||||||
} EVENTS;
|
CONDITION_VARIABLE native_cond;
|
||||||
|
|
||||||
HANDLE events[MAX_EVENTS];
|
|
||||||
HANDLE broadcast_block_event;
|
|
||||||
|
|
||||||
|
/* Own implementation (used on XP) */
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint32 waiting;
|
||||||
|
CRITICAL_SECTION lock_waiting;
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
SIGNAL= 0,
|
||||||
|
BROADCAST= 1,
|
||||||
|
MAX_EVENTS= 2
|
||||||
|
} EVENTS;
|
||||||
|
HANDLE events[MAX_EVENTS];
|
||||||
|
HANDLE broadcast_block_event;
|
||||||
|
};
|
||||||
} pthread_cond_t;
|
} pthread_cond_t;
|
||||||
|
|
||||||
|
|
||||||
|
@ -679,6 +690,47 @@ extern int rw_pr_destroy(rw_pr_lock_t *);
|
||||||
|
|
||||||
|
|
||||||
#ifdef NEED_MY_RW_LOCK
|
#ifdef NEED_MY_RW_LOCK
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
/**
|
||||||
|
Implementation of Windows rwlock.
|
||||||
|
|
||||||
|
We use native (slim) rwlocks on Win7 and later, and fallback to portable
|
||||||
|
implementation on earlier Windows.
|
||||||
|
|
||||||
|
slim rwlock are also available on Vista/WS2008, but we do not use it
|
||||||
|
("trylock" APIs are missing on Vista)
|
||||||
|
*/
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
/* Native rwlock (is_srwlock == TRUE) */
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
SRWLOCK srwlock; /* native reader writer lock */
|
||||||
|
BOOL have_exclusive_srwlock; /* used for unlock */
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Portable implementation (is_srwlock == FALSE)
|
||||||
|
Fields are identical with Unix my_rw_lock_t fields.
|
||||||
|
*/
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
pthread_mutex_t lock; /* lock for structure */
|
||||||
|
pthread_cond_t readers; /* waiting readers */
|
||||||
|
pthread_cond_t writers; /* waiting writers */
|
||||||
|
int state; /* -1:writer,0:free,>0:readers */
|
||||||
|
int waiters; /* number of waiting writers */
|
||||||
|
#ifdef SAFE_MUTEX
|
||||||
|
pthread_t write_thread;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
} my_rw_lock_t;
|
||||||
|
|
||||||
|
|
||||||
|
#else /* _WIN32 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
On systems which don't support native read/write locks we have
|
On systems which don't support native read/write locks we have
|
||||||
to use own implementation.
|
to use own implementation.
|
||||||
|
@ -694,6 +746,8 @@ typedef struct st_my_rw_lock_t {
|
||||||
#endif
|
#endif
|
||||||
} my_rw_lock_t;
|
} my_rw_lock_t;
|
||||||
|
|
||||||
|
#endif /*! _WIN32 */
|
||||||
|
|
||||||
extern int my_rw_init(my_rw_lock_t *);
|
extern int my_rw_init(my_rw_lock_t *);
|
||||||
extern int my_rw_destroy(my_rw_lock_t *);
|
extern int my_rw_destroy(my_rw_lock_t *);
|
||||||
extern int my_rw_rdlock(my_rw_lock_t *);
|
extern int my_rw_rdlock(my_rw_lock_t *);
|
||||||
|
|
|
@ -197,7 +197,7 @@ extern void my_large_free(uchar *ptr);
|
||||||
#define my_alloca(SZ) alloca((size_t) (SZ))
|
#define my_alloca(SZ) alloca((size_t) (SZ))
|
||||||
#define my_afree(PTR) {}
|
#define my_afree(PTR) {}
|
||||||
#else
|
#else
|
||||||
#define my_alloca(SZ) my_malloc(SZ,MYF(0))
|
#define my_alloca(SZ) my_malloc(SZ,MYF(MY_FAE))
|
||||||
#define my_afree(PTR) my_free(PTR)
|
#define my_afree(PTR) my_free(PTR)
|
||||||
#endif /* HAVE_ALLOCA */
|
#endif /* HAVE_ALLOCA */
|
||||||
|
|
||||||
|
@ -824,6 +824,10 @@ extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
|
||||||
extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
|
extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
|
||||||
size_t prealloc_size);
|
size_t prealloc_size);
|
||||||
extern char *strdup_root(MEM_ROOT *root,const char *str);
|
extern char *strdup_root(MEM_ROOT *root,const char *str);
|
||||||
|
static inline char *safe_strdup_root(MEM_ROOT *root, const char *str)
|
||||||
|
{
|
||||||
|
return str ? strdup_root(root, str) : 0;
|
||||||
|
}
|
||||||
extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len);
|
extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len);
|
||||||
extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
|
extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
|
||||||
extern int get_defaults_options(int argc, char **argv,
|
extern int get_defaults_options(int argc, char **argv,
|
||||||
|
|
|
@ -167,9 +167,15 @@ enum mysql_option
|
||||||
MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
|
MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
|
||||||
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
|
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
|
||||||
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
|
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
|
||||||
MYSQL_OPT_SSL_VERIFY_SERVER_CERT
|
MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@todo remove the "extension", move st_mysql_options completely
|
||||||
|
out of mysql.h
|
||||||
|
*/
|
||||||
|
struct st_mysql_options_extention;
|
||||||
|
|
||||||
struct st_mysql_options {
|
struct st_mysql_options {
|
||||||
unsigned int connect_timeout, read_timeout, write_timeout;
|
unsigned int connect_timeout, read_timeout, write_timeout;
|
||||||
unsigned int port, protocol;
|
unsigned int port, protocol;
|
||||||
|
@ -203,7 +209,7 @@ struct st_mysql_options {
|
||||||
void (*local_infile_end)(void *);
|
void (*local_infile_end)(void *);
|
||||||
int (*local_infile_error)(void *, char *, unsigned int);
|
int (*local_infile_error)(void *, char *, unsigned int);
|
||||||
void *local_infile_userdata;
|
void *local_infile_userdata;
|
||||||
void *extension;
|
struct st_mysql_options_extention *extension;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum mysql_status
|
enum mysql_status
|
||||||
|
@ -639,38 +645,6 @@ enum enum_stmt_attr_type
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct st_mysql_methods
|
|
||||||
{
|
|
||||||
my_bool (*read_query_result)(MYSQL *mysql);
|
|
||||||
my_bool (*advanced_command)(MYSQL *mysql,
|
|
||||||
enum enum_server_command command,
|
|
||||||
const unsigned char *header,
|
|
||||||
unsigned long header_length,
|
|
||||||
const unsigned char *arg,
|
|
||||||
unsigned long arg_length,
|
|
||||||
my_bool skip_check,
|
|
||||||
MYSQL_STMT *stmt);
|
|
||||||
MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
|
|
||||||
unsigned int fields);
|
|
||||||
MYSQL_RES * (*use_result)(MYSQL *mysql);
|
|
||||||
void (*fetch_lengths)(unsigned long *to,
|
|
||||||
MYSQL_ROW column, unsigned int field_count);
|
|
||||||
void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results);
|
|
||||||
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
|
|
||||||
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
|
|
||||||
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
|
|
||||||
int (*stmt_execute)(MYSQL_STMT *stmt);
|
|
||||||
int (*read_binary_rows)(MYSQL_STMT *stmt);
|
|
||||||
int (*unbuffered_fetch)(MYSQL *mysql, char **row);
|
|
||||||
void (*free_embedded_thd)(MYSQL *mysql);
|
|
||||||
const char *(*read_statistics)(MYSQL *mysql);
|
|
||||||
my_bool (*next_result)(MYSQL *mysql);
|
|
||||||
int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd);
|
|
||||||
int (*read_rows_from_cursor)(MYSQL_STMT *stmt);
|
|
||||||
#endif
|
|
||||||
} MYSQL_METHODS;
|
|
||||||
|
|
||||||
|
|
||||||
MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql);
|
MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql);
|
||||||
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
|
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
|
||||||
unsigned long length);
|
unsigned long length);
|
||||||
|
@ -733,18 +707,6 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
|
||||||
#endif
|
#endif
|
||||||
#define HAVE_MYSQL_REAL_CONNECT
|
#define HAVE_MYSQL_REAL_CONNECT
|
||||||
|
|
||||||
/*
|
|
||||||
The following functions are mainly exported because of mysqlbinlog;
|
|
||||||
They are not for general usage
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define simple_command(mysql, command, arg, length, skip_check) \
|
|
||||||
(*(mysql)->methods->advanced_command)(mysql, command, 0, \
|
|
||||||
0, arg, length, skip_check, NULL)
|
|
||||||
#define stmt_command(mysql, command, arg, length, stmt) \
|
|
||||||
(*(mysql)->methods->advanced_command)(mysql, command, 0, \
|
|
||||||
0, arg, length, 1, stmt)
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -130,13 +130,13 @@ void create_random_string(char *to, unsigned int length, struct rand_struct *ran
|
||||||
void hash_password(unsigned long *to, const char *password, unsigned int password_len);
|
void hash_password(unsigned long *to, const char *password, unsigned int password_len);
|
||||||
void make_scrambled_password_323(char *to, const char *password);
|
void make_scrambled_password_323(char *to, const char *password);
|
||||||
void scramble_323(char *to, const char *message, const char *password);
|
void scramble_323(char *to, const char *message, const char *password);
|
||||||
my_bool check_scramble_323(const char *, const char *message,
|
my_bool check_scramble_323(const unsigned char *reply, const char *message,
|
||||||
unsigned long *salt);
|
unsigned long *salt);
|
||||||
void get_salt_from_password_323(unsigned long *res, const char *password);
|
void get_salt_from_password_323(unsigned long *res, const char *password);
|
||||||
void make_password_from_salt_323(char *to, const unsigned long *salt);
|
void make_password_from_salt_323(char *to, const unsigned long *salt);
|
||||||
void make_scrambled_password(char *to, const char *password);
|
void make_scrambled_password(char *to, const char *password);
|
||||||
void scramble(char *to, const char *message, const char *password);
|
void scramble(char *to, const char *message, const char *password);
|
||||||
my_bool check_scramble(const char *reply, const char *message,
|
my_bool check_scramble(const unsigned char *reply, const char *message,
|
||||||
const unsigned char *hash_stage2);
|
const unsigned char *hash_stage2);
|
||||||
void get_salt_from_password(unsigned char *res, const char *password);
|
void get_salt_from_password(unsigned char *res, const char *password);
|
||||||
void make_password_from_salt(char *to, const unsigned char *hash_stage2);
|
void make_password_from_salt(char *to, const unsigned char *hash_stage2);
|
||||||
|
@ -262,8 +262,9 @@ enum mysql_option
|
||||||
MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
|
MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
|
||||||
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
|
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
|
||||||
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
|
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
|
||||||
MYSQL_OPT_SSL_VERIFY_SERVER_CERT
|
MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH
|
||||||
};
|
};
|
||||||
|
struct st_mysql_options_extention;
|
||||||
struct st_mysql_options {
|
struct st_mysql_options {
|
||||||
unsigned int connect_timeout, read_timeout, write_timeout;
|
unsigned int connect_timeout, read_timeout, write_timeout;
|
||||||
unsigned int port, protocol;
|
unsigned int port, protocol;
|
||||||
|
@ -293,7 +294,7 @@ struct st_mysql_options {
|
||||||
void (*local_infile_end)(void *);
|
void (*local_infile_end)(void *);
|
||||||
int (*local_infile_error)(void *, char *, unsigned int);
|
int (*local_infile_error)(void *, char *, unsigned int);
|
||||||
void *local_infile_userdata;
|
void *local_infile_userdata;
|
||||||
void *extension;
|
struct st_mysql_options_extention *extension;
|
||||||
};
|
};
|
||||||
enum mysql_status
|
enum mysql_status
|
||||||
{
|
{
|
||||||
|
@ -548,34 +549,6 @@ enum enum_stmt_attr_type
|
||||||
STMT_ATTR_CURSOR_TYPE,
|
STMT_ATTR_CURSOR_TYPE,
|
||||||
STMT_ATTR_PREFETCH_ROWS
|
STMT_ATTR_PREFETCH_ROWS
|
||||||
};
|
};
|
||||||
typedef struct st_mysql_methods
|
|
||||||
{
|
|
||||||
my_bool (*read_query_result)(MYSQL *mysql);
|
|
||||||
my_bool (*advanced_command)(MYSQL *mysql,
|
|
||||||
enum enum_server_command command,
|
|
||||||
const unsigned char *header,
|
|
||||||
unsigned long header_length,
|
|
||||||
const unsigned char *arg,
|
|
||||||
unsigned long arg_length,
|
|
||||||
my_bool skip_check,
|
|
||||||
MYSQL_STMT *stmt);
|
|
||||||
MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
|
|
||||||
unsigned int fields);
|
|
||||||
MYSQL_RES * (*use_result)(MYSQL *mysql);
|
|
||||||
void (*fetch_lengths)(unsigned long *to,
|
|
||||||
MYSQL_ROW column, unsigned int field_count);
|
|
||||||
void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results);
|
|
||||||
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
|
|
||||||
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
|
|
||||||
int (*stmt_execute)(MYSQL_STMT *stmt);
|
|
||||||
int (*read_binary_rows)(MYSQL_STMT *stmt);
|
|
||||||
int (*unbuffered_fetch)(MYSQL *mysql, char **row);
|
|
||||||
void (*free_embedded_thd)(MYSQL *mysql);
|
|
||||||
const char *(*read_statistics)(MYSQL *mysql);
|
|
||||||
my_bool (*next_result)(MYSQL *mysql);
|
|
||||||
int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd);
|
|
||||||
int (*read_rows_from_cursor)(MYSQL_STMT *stmt);
|
|
||||||
} MYSQL_METHODS;
|
|
||||||
MYSQL_STMT * mysql_stmt_init(MYSQL *mysql);
|
MYSQL_STMT * mysql_stmt_init(MYSQL *mysql);
|
||||||
int mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
|
int mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
|
||||||
unsigned long length);
|
unsigned long length);
|
||||||
|
|
164
include/mysql/client_plugin.h
Normal file
164
include/mysql/client_plugin.h
Normal file
|
@ -0,0 +1,164 @@
|
||||||
|
#ifndef MYSQL_CLIENT_PLUGIN_INCLUDED
|
||||||
|
/* Copyright (C) 2010 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 */
|
||||||
|
|
||||||
|
/**
|
||||||
|
@file
|
||||||
|
|
||||||
|
MySQL Client Plugin API
|
||||||
|
|
||||||
|
This file defines the API for plugins that work on the client side
|
||||||
|
*/
|
||||||
|
#define MYSQL_CLIENT_PLUGIN_INCLUDED
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/* known plugin types */
|
||||||
|
#define MYSQL_CLIENT_reserved1 0
|
||||||
|
#define MYSQL_CLIENT_reserved2 1
|
||||||
|
#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN 2
|
||||||
|
|
||||||
|
#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION 0x0100
|
||||||
|
|
||||||
|
#define MYSQL_CLIENT_MAX_PLUGINS 3
|
||||||
|
|
||||||
|
#define mysql_declare_client_plugin(X) \
|
||||||
|
MYSQL_PLUGIN_EXPORT struct st_mysql_client_plugin_ ## X \
|
||||||
|
_mysql_client_plugin_declaration_ = { \
|
||||||
|
MYSQL_CLIENT_ ## X ## _PLUGIN, \
|
||||||
|
MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION,
|
||||||
|
#define mysql_end_client_plugin }
|
||||||
|
|
||||||
|
/* generic plugin header structure */
|
||||||
|
#define MYSQL_CLIENT_PLUGIN_HEADER \
|
||||||
|
int type; \
|
||||||
|
unsigned int interface_version; \
|
||||||
|
const char *name; \
|
||||||
|
const char *author; \
|
||||||
|
const char *desc; \
|
||||||
|
unsigned int version[3]; \
|
||||||
|
const char *license; \
|
||||||
|
void *mysql_api; \
|
||||||
|
int (*init)(char *, size_t, int, va_list); \
|
||||||
|
int (*deinit)(); \
|
||||||
|
int (*options)(const char *option, const void *);
|
||||||
|
|
||||||
|
struct st_mysql_client_plugin
|
||||||
|
{
|
||||||
|
MYSQL_CLIENT_PLUGIN_HEADER
|
||||||
|
};
|
||||||
|
|
||||||
|
struct st_mysql;
|
||||||
|
|
||||||
|
/******** authentication plugin specific declarations *********/
|
||||||
|
#include <mysql/plugin_auth_common.h>
|
||||||
|
|
||||||
|
struct st_mysql_client_plugin_AUTHENTICATION
|
||||||
|
{
|
||||||
|
MYSQL_CLIENT_PLUGIN_HEADER
|
||||||
|
int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
|
||||||
|
};
|
||||||
|
|
||||||
|
/******** using plugins ************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
loads a plugin and initializes it
|
||||||
|
|
||||||
|
@param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used,
|
||||||
|
and last_errno/last_error, for error reporting
|
||||||
|
@param name a name of the plugin to load
|
||||||
|
@param type type of plugin that should be loaded, -1 to disable type check
|
||||||
|
@param argc number of arguments to pass to the plugin initialization
|
||||||
|
function
|
||||||
|
@param ... arguments for the plugin initialization function
|
||||||
|
|
||||||
|
@retval
|
||||||
|
a pointer to the loaded plugin, or NULL in case of a failure
|
||||||
|
*/
|
||||||
|
struct st_mysql_client_plugin *
|
||||||
|
mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
|
||||||
|
int argc, ...);
|
||||||
|
|
||||||
|
/**
|
||||||
|
loads a plugin and initializes it, taking va_list as an argument
|
||||||
|
|
||||||
|
This is the same as mysql_load_plugin, but take va_list instead of
|
||||||
|
a list of arguments.
|
||||||
|
|
||||||
|
@param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used,
|
||||||
|
and last_errno/last_error, for error reporting
|
||||||
|
@param name a name of the plugin to load
|
||||||
|
@param type type of plugin that should be loaded, -1 to disable type check
|
||||||
|
@param argc number of arguments to pass to the plugin initialization
|
||||||
|
function
|
||||||
|
@param args arguments for the plugin initialization function
|
||||||
|
|
||||||
|
@retval
|
||||||
|
a pointer to the loaded plugin, or NULL in case of a failure
|
||||||
|
*/
|
||||||
|
struct st_mysql_client_plugin *
|
||||||
|
mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
|
||||||
|
int argc, va_list args);
|
||||||
|
|
||||||
|
/**
|
||||||
|
finds an already loaded plugin by name, or loads it, if necessary
|
||||||
|
|
||||||
|
@param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used,
|
||||||
|
and last_errno/last_error, for error reporting
|
||||||
|
@param name a name of the plugin to load
|
||||||
|
@param type type of plugin that should be loaded
|
||||||
|
|
||||||
|
@retval
|
||||||
|
a pointer to the plugin, or NULL in case of a failure
|
||||||
|
*/
|
||||||
|
struct st_mysql_client_plugin *
|
||||||
|
mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
adds a plugin structure to the list of loaded plugins
|
||||||
|
|
||||||
|
This is useful if an application has the necessary functionality
|
||||||
|
(for example, a special load data handler) statically linked into
|
||||||
|
the application binary. It can use this function to register the plugin
|
||||||
|
directly, avoiding the need to factor it out into a shared object.
|
||||||
|
|
||||||
|
@param mysql MYSQL structure. It is only used for error reporting
|
||||||
|
@param plugin an st_mysql_client_plugin structure to register
|
||||||
|
|
||||||
|
@retval
|
||||||
|
a pointer to the plugin, or NULL in case of a failure
|
||||||
|
*/
|
||||||
|
struct st_mysql_client_plugin *
|
||||||
|
mysql_client_register_plugin(struct st_mysql *mysql,
|
||||||
|
struct st_mysql_client_plugin *plugin);
|
||||||
|
|
||||||
|
/**
|
||||||
|
set plugin options
|
||||||
|
|
||||||
|
Can be used to set extra options and affect behavior for a plugin.
|
||||||
|
This function may be called multiple times to set several options
|
||||||
|
|
||||||
|
@param plugin an st_mysql_client_plugin structure
|
||||||
|
@param option a string which specifies the option to set
|
||||||
|
@param value value for the option.
|
||||||
|
|
||||||
|
@retval 0 on success, 1 in case of failure
|
||||||
|
**/
|
||||||
|
int STDCALL mysql_plugin_options(struct st_mysql_client_plugin *plugin,
|
||||||
|
const char *option,
|
||||||
|
const void *value);
|
||||||
|
#endif
|
||||||
|
|
42
include/mysql/client_plugin.h.pp
Normal file
42
include/mysql/client_plugin.h.pp
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
struct st_mysql_client_plugin
|
||||||
|
{
|
||||||
|
int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *);
|
||||||
|
};
|
||||||
|
struct st_mysql;
|
||||||
|
#include <mysql/plugin_auth_common.h>
|
||||||
|
typedef struct st_plugin_vio_info
|
||||||
|
{
|
||||||
|
enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,
|
||||||
|
MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol;
|
||||||
|
int socket;
|
||||||
|
} MYSQL_PLUGIN_VIO_INFO;
|
||||||
|
typedef struct st_plugin_vio
|
||||||
|
{
|
||||||
|
int (*read_packet)(struct st_plugin_vio *vio,
|
||||||
|
unsigned char **buf);
|
||||||
|
int (*write_packet)(struct st_plugin_vio *vio,
|
||||||
|
const unsigned char *packet,
|
||||||
|
int packet_len);
|
||||||
|
void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info);
|
||||||
|
} MYSQL_PLUGIN_VIO;
|
||||||
|
struct st_mysql_client_plugin_AUTHENTICATION
|
||||||
|
{
|
||||||
|
int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *);
|
||||||
|
int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
|
||||||
|
};
|
||||||
|
struct st_mysql_client_plugin *
|
||||||
|
mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
|
||||||
|
int argc, ...);
|
||||||
|
struct st_mysql_client_plugin *
|
||||||
|
mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
|
||||||
|
int argc, va_list args);
|
||||||
|
struct st_mysql_client_plugin *
|
||||||
|
mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);
|
||||||
|
struct st_mysql_client_plugin *
|
||||||
|
mysql_client_register_plugin(struct st_mysql *mysql,
|
||||||
|
struct st_mysql_client_plugin *plugin);
|
||||||
|
int STDCALL mysql_plugin_options(struct st_mysql_client_plugin *plugin,
|
||||||
|
const char *option,
|
||||||
|
const void *value);
|
|
@ -83,7 +83,8 @@ typedef struct st_mysql_xid MYSQL_XID;
|
||||||
#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */
|
#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */
|
||||||
#define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */
|
#define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */
|
||||||
#define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */
|
#define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */
|
||||||
#define MYSQL_MAX_PLUGIN_TYPE_NUM 7 /* The number of plugin types */
|
#define MYSQL_AUTHENTICATION_PLUGIN 7 /* The authentication plugin type */
|
||||||
|
#define MYSQL_MAX_PLUGIN_TYPE_NUM 8 /* The number of plugin types */
|
||||||
|
|
||||||
/* We use the following strings to define licenses for plugins */
|
/* We use the following strings to define licenses for plugins */
|
||||||
#define PLUGIN_LICENSE_PROPRIETARY 0
|
#define PLUGIN_LICENSE_PROPRIETARY 0
|
||||||
|
|
125
include/mysql/plugin_auth.h
Normal file
125
include/mysql/plugin_auth.h
Normal file
|
@ -0,0 +1,125 @@
|
||||||
|
#ifndef MYSQL_PLUGIN_AUTH_INCLUDED
|
||||||
|
/* Copyright (C) 2010 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 */
|
||||||
|
|
||||||
|
/**
|
||||||
|
@file
|
||||||
|
|
||||||
|
Authentication Plugin API.
|
||||||
|
|
||||||
|
This file defines the API for server authentication plugins.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define MYSQL_PLUGIN_AUTH_INCLUDED
|
||||||
|
|
||||||
|
#include <mysql/plugin.h>
|
||||||
|
|
||||||
|
#define MYSQL_AUTHENTICATION_INTERFACE_VERSION 0x0100
|
||||||
|
|
||||||
|
#include <mysql/plugin_auth_common.h>
|
||||||
|
|
||||||
|
/* defines for MYSQL_SERVER_AUTH_INFO.password_used */
|
||||||
|
|
||||||
|
#define PASSWORD_USED_NO 0
|
||||||
|
#define PASSWORD_USED_YES 1
|
||||||
|
#define PASSWORD_USED_NO_MENTION 2
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Provides server plugin access to authentication information
|
||||||
|
*/
|
||||||
|
typedef struct st_mysql_server_auth_info
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
User name as sent by the client and shown in USER().
|
||||||
|
NULL if the client packet with the user name was not received yet.
|
||||||
|
*/
|
||||||
|
char *user_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Length of user_name
|
||||||
|
*/
|
||||||
|
unsigned int user_name_length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
A corresponding column value from the mysql.user table for the
|
||||||
|
matching account name
|
||||||
|
*/
|
||||||
|
const char *auth_string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Length of auth_string
|
||||||
|
*/
|
||||||
|
unsigned long auth_string_length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Matching account name as found in the mysql.user table.
|
||||||
|
A plugin can override it with another name that will be
|
||||||
|
used by MySQL for authorization, and shown in CURRENT_USER()
|
||||||
|
*/
|
||||||
|
char authenticated_as[MYSQL_USERNAME_LENGTH+1];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
The unique user name that was used by the plugin to authenticate.
|
||||||
|
Plugins should put null-terminated UTF-8 here.
|
||||||
|
Available through the @@EXTERNAL_USER variable.
|
||||||
|
*/
|
||||||
|
char external_user[512];
|
||||||
|
|
||||||
|
/**
|
||||||
|
This only affects the "Authentication failed. Password used: %s"
|
||||||
|
error message. has the following values :
|
||||||
|
0 : %s will be NO.
|
||||||
|
1 : %s will be YES.
|
||||||
|
2 : there will be no %s.
|
||||||
|
Set it as appropriate or ignore at will.
|
||||||
|
*/
|
||||||
|
int password_used;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Set to the name of the connected client if it can be resolved, or to
|
||||||
|
the address otherwise
|
||||||
|
*/
|
||||||
|
const char *host_or_ip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Length of host_or_ip
|
||||||
|
*/
|
||||||
|
unsigned int host_or_ip_length;
|
||||||
|
|
||||||
|
} MYSQL_SERVER_AUTH_INFO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Server authentication plugin descriptor
|
||||||
|
*/
|
||||||
|
struct st_mysql_auth
|
||||||
|
{
|
||||||
|
int interface_version; /**< version plugin uses */
|
||||||
|
/**
|
||||||
|
A plugin that a client must use for authentication with this server
|
||||||
|
plugin. Can be NULL to mean "any plugin".
|
||||||
|
*/
|
||||||
|
const char *client_auth_plugin;
|
||||||
|
/**
|
||||||
|
Function provided by the plugin which should perform authentication (using
|
||||||
|
the vio functions if necessary) and return 0 if successful. The plugin can
|
||||||
|
also fill the info.authenticated_as field if a different username should be
|
||||||
|
used for authorization.
|
||||||
|
*/
|
||||||
|
int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info);
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
224
include/mysql/plugin_auth.h.pp
Normal file
224
include/mysql/plugin_auth.h.pp
Normal file
|
@ -0,0 +1,224 @@
|
||||||
|
#include <mysql/plugin.h>
|
||||||
|
#include <mysql/services.h>
|
||||||
|
#include <mysql/service_my_snprintf.h>
|
||||||
|
extern struct my_snprintf_service_st {
|
||||||
|
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
|
||||||
|
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
|
||||||
|
} *my_snprintf_service;
|
||||||
|
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
|
||||||
|
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
|
||||||
|
#include <mysql/service_thd_alloc.h>
|
||||||
|
struct st_mysql_lex_string
|
||||||
|
{
|
||||||
|
char *str;
|
||||||
|
size_t length;
|
||||||
|
};
|
||||||
|
typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
|
||||||
|
extern struct thd_alloc_service_st {
|
||||||
|
void *(*thd_alloc_func)(void*, unsigned int);
|
||||||
|
void *(*thd_calloc_func)(void*, unsigned int);
|
||||||
|
char *(*thd_strdup_func)(void*, const char *);
|
||||||
|
char *(*thd_strmake_func)(void*, const char *, unsigned int);
|
||||||
|
void *(*thd_memdup_func)(void*, const void*, unsigned int);
|
||||||
|
MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *,
|
||||||
|
const char *, unsigned int, int);
|
||||||
|
} *thd_alloc_service;
|
||||||
|
void *thd_alloc(void* thd, unsigned int size);
|
||||||
|
void *thd_calloc(void* thd, unsigned int size);
|
||||||
|
char *thd_strdup(void* thd, const char *str);
|
||||||
|
char *thd_strmake(void* thd, const char *str, unsigned int size);
|
||||||
|
void *thd_memdup(void* thd, const void* str, unsigned int size);
|
||||||
|
MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
|
||||||
|
const char *str, unsigned int size,
|
||||||
|
int allocate_lex_string);
|
||||||
|
#include <mysql/service_thd_wait.h>
|
||||||
|
typedef enum _thd_wait_type_e {
|
||||||
|
THD_WAIT_MUTEX= 1,
|
||||||
|
THD_WAIT_DISKIO= 2,
|
||||||
|
THD_WAIT_ROW_TABLE_LOCK= 3,
|
||||||
|
THD_WAIT_GLOBAL_LOCK= 4
|
||||||
|
} thd_wait_type;
|
||||||
|
extern struct thd_wait_service_st {
|
||||||
|
void (*thd_wait_begin_func)(void*, thd_wait_type);
|
||||||
|
void (*thd_wait_end_func)(void*);
|
||||||
|
} *thd_wait_service;
|
||||||
|
void thd_wait_begin(void* thd, thd_wait_type wait_type);
|
||||||
|
void thd_wait_end(void* thd);
|
||||||
|
#include <mysql/service_thread_scheduler.h>
|
||||||
|
struct scheduler_functions;
|
||||||
|
extern struct my_thread_scheduler_service {
|
||||||
|
int (*set)(struct scheduler_functions *scheduler);
|
||||||
|
int (*reset)();
|
||||||
|
} *my_thread_scheduler_service;
|
||||||
|
int my_thread_scheduler_set(struct scheduler_functions *scheduler);
|
||||||
|
int my_thread_scheduler_reset();
|
||||||
|
struct st_mysql_xid {
|
||||||
|
long formatID;
|
||||||
|
long gtrid_length;
|
||||||
|
long bqual_length;
|
||||||
|
char data[128];
|
||||||
|
};
|
||||||
|
typedef struct st_mysql_xid MYSQL_XID;
|
||||||
|
enum enum_mysql_show_type
|
||||||
|
{
|
||||||
|
SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
|
||||||
|
SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
|
||||||
|
SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE,
|
||||||
|
SHOW_always_last
|
||||||
|
};
|
||||||
|
struct st_mysql_show_var {
|
||||||
|
const char *name;
|
||||||
|
char *value;
|
||||||
|
enum enum_mysql_show_type type;
|
||||||
|
};
|
||||||
|
typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *);
|
||||||
|
struct st_mysql_sys_var;
|
||||||
|
struct st_mysql_value;
|
||||||
|
typedef int (*mysql_var_check_func)(void* thd,
|
||||||
|
struct st_mysql_sys_var *var,
|
||||||
|
void *save, struct st_mysql_value *value);
|
||||||
|
typedef void (*mysql_var_update_func)(void* thd,
|
||||||
|
struct st_mysql_sys_var *var,
|
||||||
|
void *var_ptr, const void *save);
|
||||||
|
struct st_mysql_plugin
|
||||||
|
{
|
||||||
|
int type;
|
||||||
|
void *info;
|
||||||
|
const char *name;
|
||||||
|
const char *author;
|
||||||
|
const char *descr;
|
||||||
|
int license;
|
||||||
|
int (*init)(void *);
|
||||||
|
int (*deinit)(void *);
|
||||||
|
unsigned int version;
|
||||||
|
struct st_mysql_show_var *status_vars;
|
||||||
|
struct st_mysql_sys_var **system_vars;
|
||||||
|
void * __reserved1;
|
||||||
|
};
|
||||||
|
#include "plugin_ftparser.h"
|
||||||
|
#include "plugin.h"
|
||||||
|
enum enum_ftparser_mode
|
||||||
|
{
|
||||||
|
MYSQL_FTPARSER_SIMPLE_MODE= 0,
|
||||||
|
MYSQL_FTPARSER_WITH_STOPWORDS= 1,
|
||||||
|
MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2
|
||||||
|
};
|
||||||
|
enum enum_ft_token_type
|
||||||
|
{
|
||||||
|
FT_TOKEN_EOF= 0,
|
||||||
|
FT_TOKEN_WORD= 1,
|
||||||
|
FT_TOKEN_LEFT_PAREN= 2,
|
||||||
|
FT_TOKEN_RIGHT_PAREN= 3,
|
||||||
|
FT_TOKEN_STOPWORD= 4
|
||||||
|
};
|
||||||
|
typedef struct st_mysql_ftparser_boolean_info
|
||||||
|
{
|
||||||
|
enum enum_ft_token_type type;
|
||||||
|
int yesno;
|
||||||
|
int weight_adjust;
|
||||||
|
char wasign;
|
||||||
|
char trunc;
|
||||||
|
char prev;
|
||||||
|
char *quot;
|
||||||
|
} MYSQL_FTPARSER_BOOLEAN_INFO;
|
||||||
|
typedef struct st_mysql_ftparser_param
|
||||||
|
{
|
||||||
|
int (*mysql_parse)(struct st_mysql_ftparser_param *,
|
||||||
|
char *doc, int doc_len);
|
||||||
|
int (*mysql_add_word)(struct st_mysql_ftparser_param *,
|
||||||
|
char *word, int word_len,
|
||||||
|
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
|
||||||
|
void *ftparser_state;
|
||||||
|
void *mysql_ftparam;
|
||||||
|
struct charset_info_st *cs;
|
||||||
|
char *doc;
|
||||||
|
int length;
|
||||||
|
int flags;
|
||||||
|
enum enum_ftparser_mode mode;
|
||||||
|
} MYSQL_FTPARSER_PARAM;
|
||||||
|
struct st_mysql_ftparser
|
||||||
|
{
|
||||||
|
int interface_version;
|
||||||
|
int (*parse)(MYSQL_FTPARSER_PARAM *param);
|
||||||
|
int (*init)(MYSQL_FTPARSER_PARAM *param);
|
||||||
|
int (*deinit)(MYSQL_FTPARSER_PARAM *param);
|
||||||
|
};
|
||||||
|
struct st_mysql_daemon
|
||||||
|
{
|
||||||
|
int interface_version;
|
||||||
|
};
|
||||||
|
struct st_mysql_information_schema
|
||||||
|
{
|
||||||
|
int interface_version;
|
||||||
|
};
|
||||||
|
struct st_mysql_storage_engine
|
||||||
|
{
|
||||||
|
int interface_version;
|
||||||
|
};
|
||||||
|
struct handlerton;
|
||||||
|
struct Mysql_replication {
|
||||||
|
int interface_version;
|
||||||
|
};
|
||||||
|
struct st_mysql_value
|
||||||
|
{
|
||||||
|
int (*value_type)(struct st_mysql_value *);
|
||||||
|
const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
|
||||||
|
int (*val_real)(struct st_mysql_value *, double *realbuf);
|
||||||
|
int (*val_int)(struct st_mysql_value *, long long *intbuf);
|
||||||
|
int (*is_unsigned)(struct st_mysql_value *);
|
||||||
|
};
|
||||||
|
int thd_in_lock_tables(const void* thd);
|
||||||
|
int thd_tablespace_op(const void* thd);
|
||||||
|
long long thd_test_options(const void* thd, long long test_options);
|
||||||
|
int thd_sql_command(const void* thd);
|
||||||
|
const char *thd_proc_info(void* thd, const char *info);
|
||||||
|
void **thd_ha_data(const void* thd, const struct handlerton *hton);
|
||||||
|
void thd_storage_lock_wait(void* thd, long long value);
|
||||||
|
int thd_tx_isolation(const void* thd);
|
||||||
|
char *thd_security_context(void* thd, char *buffer, unsigned int length,
|
||||||
|
unsigned int max_query_len);
|
||||||
|
void thd_inc_row_count(void* thd);
|
||||||
|
int mysql_tmpfile(const char *prefix);
|
||||||
|
int thd_killed(const void* thd);
|
||||||
|
unsigned long thd_get_thread_id(const void* thd);
|
||||||
|
void thd_get_xid(const void* thd, MYSQL_XID *xid);
|
||||||
|
void mysql_query_cache_invalidate4(void* thd,
|
||||||
|
const char *key, unsigned int key_length,
|
||||||
|
int using_trx);
|
||||||
|
void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
|
||||||
|
void thd_set_ha_data(void* thd, const struct handlerton *hton,
|
||||||
|
const void *ha_data);
|
||||||
|
#include <mysql/plugin_auth_common.h>
|
||||||
|
typedef struct st_plugin_vio_info
|
||||||
|
{
|
||||||
|
enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,
|
||||||
|
MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol;
|
||||||
|
int socket;
|
||||||
|
} MYSQL_PLUGIN_VIO_INFO;
|
||||||
|
typedef struct st_plugin_vio
|
||||||
|
{
|
||||||
|
int (*read_packet)(struct st_plugin_vio *vio,
|
||||||
|
unsigned char **buf);
|
||||||
|
int (*write_packet)(struct st_plugin_vio *vio,
|
||||||
|
const unsigned char *packet,
|
||||||
|
int packet_len);
|
||||||
|
void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info);
|
||||||
|
} MYSQL_PLUGIN_VIO;
|
||||||
|
typedef struct st_mysql_server_auth_info
|
||||||
|
{
|
||||||
|
char *user_name;
|
||||||
|
unsigned int user_name_length;
|
||||||
|
const char *auth_string;
|
||||||
|
unsigned long auth_string_length;
|
||||||
|
char authenticated_as[48 +1];
|
||||||
|
char external_user[512];
|
||||||
|
int password_used;
|
||||||
|
const char *host_or_ip;
|
||||||
|
unsigned int host_or_ip_length;
|
||||||
|
} MYSQL_SERVER_AUTH_INFO;
|
||||||
|
struct st_mysql_auth
|
||||||
|
{
|
||||||
|
int interface_version;
|
||||||
|
const char *client_auth_plugin;
|
||||||
|
int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info);
|
||||||
|
};
|
105
include/mysql/plugin_auth_common.h
Normal file
105
include/mysql/plugin_auth_common.h
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
#ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED
|
||||||
|
/* Copyright (C) 2010 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 */
|
||||||
|
|
||||||
|
/**
|
||||||
|
@file
|
||||||
|
|
||||||
|
This file defines constants and data structures that are the same for
|
||||||
|
both client- and server-side authentication plugins.
|
||||||
|
*/
|
||||||
|
#define MYSQL_PLUGIN_AUTH_COMMON_INCLUDED
|
||||||
|
|
||||||
|
/** the max allowed length for a user name */
|
||||||
|
#define MYSQL_USERNAME_LENGTH 48
|
||||||
|
|
||||||
|
/**
|
||||||
|
return values of the plugin authenticate_user() method.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
Authentication failed. Additionally, all other CR_xxx values
|
||||||
|
(libmysql error code) can be used too.
|
||||||
|
|
||||||
|
The client plugin may set the error code and the error message directly
|
||||||
|
in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error
|
||||||
|
code was returned, an error message in the MYSQL structure will be
|
||||||
|
overwritten. If CR_ERROR is returned without setting the error in MYSQL,
|
||||||
|
CR_UNKNOWN_ERROR will be user.
|
||||||
|
*/
|
||||||
|
#define CR_ERROR 0
|
||||||
|
/**
|
||||||
|
Authentication (client part) was successful. It does not mean that the
|
||||||
|
authentication as a whole was successful, usually it only means
|
||||||
|
that the client was able to send the user name and the password to the
|
||||||
|
server. If CR_OK is returned, the libmysql reads the next packet expecting
|
||||||
|
it to be one of OK, ERROR, or CHANGE_PLUGIN packets.
|
||||||
|
*/
|
||||||
|
#define CR_OK -1
|
||||||
|
/**
|
||||||
|
Authentication was successful.
|
||||||
|
It means that the client has done its part successfully and also that
|
||||||
|
a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN).
|
||||||
|
In this case, libmysql will not read a packet from the server,
|
||||||
|
but it will use the data at mysql->net.read_pos.
|
||||||
|
|
||||||
|
A plugin may return this value if the number of roundtrips in the
|
||||||
|
authentication protocol is not known in advance, and the client plugin
|
||||||
|
needs to read one packet more to determine if the authentication is finished
|
||||||
|
or not.
|
||||||
|
*/
|
||||||
|
#define CR_OK_HANDSHAKE_COMPLETE -2
|
||||||
|
|
||||||
|
typedef struct st_plugin_vio_info
|
||||||
|
{
|
||||||
|
enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,
|
||||||
|
MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol;
|
||||||
|
int socket; /**< it's set, if the protocol is SOCKET or TCP */
|
||||||
|
#ifdef _WIN32
|
||||||
|
HANDLE handle; /**< it's set, if the protocol is PIPE or MEMORY */
|
||||||
|
#endif
|
||||||
|
} MYSQL_PLUGIN_VIO_INFO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Provides plugin access to communication channel
|
||||||
|
*/
|
||||||
|
typedef struct st_plugin_vio
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
Plugin provides a pointer reference and this function sets it to the
|
||||||
|
contents of any incoming packet. Returns the packet length, or -1 if
|
||||||
|
the plugin should terminate.
|
||||||
|
*/
|
||||||
|
int (*read_packet)(struct st_plugin_vio *vio,
|
||||||
|
unsigned char **buf);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Plugin provides a buffer with data and the length and this
|
||||||
|
function sends it as a packet. Returns 0 on success, 1 on failure.
|
||||||
|
*/
|
||||||
|
int (*write_packet)(struct st_plugin_vio *vio,
|
||||||
|
const unsigned char *packet,
|
||||||
|
int packet_len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Fills in a st_plugin_vio_info structure, providing the information
|
||||||
|
about the connection.
|
||||||
|
*/
|
||||||
|
void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info);
|
||||||
|
|
||||||
|
} MYSQL_PLUGIN_VIO;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -162,9 +162,17 @@ enum enum_server_command
|
||||||
#define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */
|
#define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */
|
||||||
#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */
|
#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */
|
||||||
|
|
||||||
|
#define CLIENT_PLUGIN_AUTH (1UL << 19) /* Client supports plugin authentication */
|
||||||
|
|
||||||
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
|
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
|
||||||
#define CLIENT_REMEMBER_OPTIONS (1UL << 31)
|
#define CLIENT_REMEMBER_OPTIONS (1UL << 31)
|
||||||
|
|
||||||
|
#ifdef HAVE_COMPRESS
|
||||||
|
#define CAN_CLIENT_COMPRESS CLIENT_COMPRESS
|
||||||
|
#else
|
||||||
|
#define CAN_CLIENT_COMPRESS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Gather all possible capabilites (flags) supported by the server */
|
/* Gather all possible capabilites (flags) supported by the server */
|
||||||
#define CLIENT_ALL_FLAGS (CLIENT_LONG_PASSWORD | \
|
#define CLIENT_ALL_FLAGS (CLIENT_LONG_PASSWORD | \
|
||||||
CLIENT_FOUND_ROWS | \
|
CLIENT_FOUND_ROWS | \
|
||||||
|
@ -186,7 +194,8 @@ enum enum_server_command
|
||||||
CLIENT_MULTI_RESULTS | \
|
CLIENT_MULTI_RESULTS | \
|
||||||
CLIENT_PS_MULTI_RESULTS | \
|
CLIENT_PS_MULTI_RESULTS | \
|
||||||
CLIENT_SSL_VERIFY_SERVER_CERT | \
|
CLIENT_SSL_VERIFY_SERVER_CERT | \
|
||||||
CLIENT_REMEMBER_OPTIONS)
|
CLIENT_REMEMBER_OPTIONS | \
|
||||||
|
CLIENT_PLUGIN_AUTH)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Switch off the flags that are optional and depending on build flags
|
Switch off the flags that are optional and depending on build flags
|
||||||
|
@ -518,14 +527,14 @@ void create_random_string(char *to, unsigned int length, struct rand_struct *ran
|
||||||
void hash_password(unsigned long *to, const char *password, unsigned int password_len);
|
void hash_password(unsigned long *to, const char *password, unsigned int password_len);
|
||||||
void make_scrambled_password_323(char *to, const char *password);
|
void make_scrambled_password_323(char *to, const char *password);
|
||||||
void scramble_323(char *to, const char *message, const char *password);
|
void scramble_323(char *to, const char *message, const char *password);
|
||||||
my_bool check_scramble_323(const char *, const char *message,
|
my_bool check_scramble_323(const unsigned char *reply, const char *message,
|
||||||
unsigned long *salt);
|
unsigned long *salt);
|
||||||
void get_salt_from_password_323(unsigned long *res, const char *password);
|
void get_salt_from_password_323(unsigned long *res, const char *password);
|
||||||
void make_password_from_salt_323(char *to, const unsigned long *salt);
|
void make_password_from_salt_323(char *to, const unsigned long *salt);
|
||||||
|
|
||||||
void make_scrambled_password(char *to, const char *password);
|
void make_scrambled_password(char *to, const char *password);
|
||||||
void scramble(char *to, const char *message, const char *password);
|
void scramble(char *to, const char *message, const char *password);
|
||||||
my_bool check_scramble(const char *reply, const char *message,
|
my_bool check_scramble(const unsigned char *reply, const char *message,
|
||||||
const unsigned char *hash_stage2);
|
const unsigned char *hash_stage2);
|
||||||
void get_salt_from_password(unsigned char *res, const char *password);
|
void get_salt_from_password(unsigned char *res, const char *password);
|
||||||
void make_password_from_salt(char *to, const unsigned char *hash_stage2);
|
void make_password_from_salt(char *to, const unsigned char *hash_stage2);
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
/* Things we don't need in the embedded version of MySQL */
|
/* Things we don't need in the embedded version of MySQL */
|
||||||
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
|
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
|
||||||
|
|
||||||
#undef HAVE_PSTACK /* No stacktrace */
|
|
||||||
#undef HAVE_DLOPEN /* No udf functions */
|
#undef HAVE_DLOPEN /* No udf functions */
|
||||||
#undef HAVE_SMEM /* No shared memory */
|
#undef HAVE_SMEM /* No shared memory */
|
||||||
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
|
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
|
||||||
|
|
|
@ -9,12 +9,13 @@
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
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 Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This is the header file for code which implements the Secure
|
This is the header file for code which implements the Secure
|
||||||
|
@ -28,6 +29,38 @@
|
||||||
Please read the file sha1.c for more information.
|
Please read the file sha1.c for more information.
|
||||||
|
|
||||||
Modified 2002 by Peter Zaitsev to better follow MySQL standards
|
Modified 2002 by Peter Zaitsev to better follow MySQL standards
|
||||||
|
|
||||||
|
Original Source from: http://www.faqs.org/rfcs/rfc3174.html
|
||||||
|
|
||||||
|
Copyright (C) The Internet Society (2001). All Rights Reserved.
|
||||||
|
|
||||||
|
This document and translations of it may be copied and furnished to
|
||||||
|
others, and derivative works that comment on or otherwise explain it
|
||||||
|
or assist in its implementation may be prepared, copied, published
|
||||||
|
and distributed, in whole or in part, without restriction of any
|
||||||
|
kind, provided that the above copyright notice and this paragraph are
|
||||||
|
included on all such copies and derivative works. However, this
|
||||||
|
document itself may not be modified in any way, such as by removing
|
||||||
|
the copyright notice or references to the Internet Society or other
|
||||||
|
Internet organizations, except as needed for the purpose of
|
||||||
|
developing Internet standards in which case the procedures for
|
||||||
|
copyrights defined in the Internet Standards process must be
|
||||||
|
followed, or as required to translate it into languages other than
|
||||||
|
English.
|
||||||
|
|
||||||
|
The limited permissions granted above are perpetual and will not be
|
||||||
|
revoked by the Internet Society or its successors or assigns.
|
||||||
|
|
||||||
|
This document and the information contained herein is provided on an
|
||||||
|
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
|
||||||
|
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
|
||||||
|
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
|
||||||
|
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
Acknowledgement
|
||||||
|
Funding for the RFC Editor function is currently provided by the
|
||||||
|
Internet Society.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,60 @@
|
||||||
along with this program; if not, write to the Free Software
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
#define SQL_COMMON_INCLUDED
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <mysql.h>
|
||||||
|
|
||||||
extern const char *unknown_sqlstate;
|
extern const char *unknown_sqlstate;
|
||||||
extern const char *cant_connect_sqlstate;
|
extern const char *cant_connect_sqlstate;
|
||||||
extern const char *not_error_sqlstate;
|
extern const char *not_error_sqlstate;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
struct st_mysql_options_extention {
|
||||||
extern "C" {
|
char *plugin_dir;
|
||||||
|
char *default_auth;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct st_mysql_methods
|
||||||
|
{
|
||||||
|
my_bool (*read_query_result)(MYSQL *mysql);
|
||||||
|
my_bool (*advanced_command)(MYSQL *mysql,
|
||||||
|
enum enum_server_command command,
|
||||||
|
const unsigned char *header,
|
||||||
|
unsigned long header_length,
|
||||||
|
const unsigned char *arg,
|
||||||
|
unsigned long arg_length,
|
||||||
|
my_bool skip_check,
|
||||||
|
MYSQL_STMT *stmt);
|
||||||
|
MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
|
||||||
|
unsigned int fields);
|
||||||
|
MYSQL_RES * (*use_result)(MYSQL *mysql);
|
||||||
|
void (*fetch_lengths)(unsigned long *to,
|
||||||
|
MYSQL_ROW column, unsigned int field_count);
|
||||||
|
void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results);
|
||||||
|
int (*read_change_user_result)(MYSQL *mysql);
|
||||||
|
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
|
||||||
|
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
|
||||||
|
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
|
||||||
|
int (*stmt_execute)(MYSQL_STMT *stmt);
|
||||||
|
int (*read_binary_rows)(MYSQL_STMT *stmt);
|
||||||
|
int (*unbuffered_fetch)(MYSQL *mysql, char **row);
|
||||||
|
void (*free_embedded_thd)(MYSQL *mysql);
|
||||||
|
const char *(*read_statistics)(MYSQL *mysql);
|
||||||
|
my_bool (*next_result)(MYSQL *mysql);
|
||||||
|
int (*read_rows_from_cursor)(MYSQL_STMT *stmt);
|
||||||
#endif
|
#endif
|
||||||
|
} MYSQL_METHODS;
|
||||||
|
|
||||||
|
#define simple_command(mysql, command, arg, length, skip_check) \
|
||||||
|
(*(mysql)->methods->advanced_command)(mysql, command, 0, \
|
||||||
|
0, arg, length, skip_check, NULL)
|
||||||
|
#define stmt_command(mysql, command, arg, length, stmt) \
|
||||||
|
(*(mysql)->methods->advanced_command)(mysql, command, 0, \
|
||||||
|
0, arg, length, 1, stmt)
|
||||||
|
|
||||||
extern CHARSET_INFO *default_client_charset_info;
|
extern CHARSET_INFO *default_client_charset_info;
|
||||||
MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
|
MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
|
||||||
|
@ -45,6 +91,19 @@ void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net);
|
||||||
void set_stmt_error(MYSQL_STMT *stmt, int errcode, const char *sqlstate,
|
void set_stmt_error(MYSQL_STMT *stmt, int errcode, const char *sqlstate,
|
||||||
const char *err);
|
const char *err);
|
||||||
void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate);
|
void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate);
|
||||||
|
void set_mysql_extended_error(MYSQL *mysql, int errcode, const char *sqlstate,
|
||||||
|
const char *format, ...);
|
||||||
|
|
||||||
|
/* client side of the pluggable authentication */
|
||||||
|
struct st_plugin_vio_info;
|
||||||
|
void mpvio_info(Vio *vio, struct st_plugin_vio_info *info);
|
||||||
|
int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
|
||||||
|
const char *data_plugin, const char *db);
|
||||||
|
int mysql_client_plugin_init();
|
||||||
|
void mysql_client_plugin_deinit();
|
||||||
|
struct st_mysql_client_plugin;
|
||||||
|
extern struct st_mysql_client_plugin *mysql_client_builtins[];
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
31
include/welcome_copyright_notice.h
Normal file
31
include/welcome_copyright_notice.h
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
/* Copyright (c) 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 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 _welcome_copyright_notice_h_
|
||||||
|
#define _welcome_copyright_notice_h_
|
||||||
|
|
||||||
|
/*
|
||||||
|
This define specifies copyright notice which is displayed by every MySQL
|
||||||
|
program on start, or on help screen.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ORACLE_WELCOME_COPYRIGHT_NOTICE(years) \
|
||||||
|
"Copyright (c) " years ", Oracle and/or its affiliates. All rights reserved.\n" \
|
||||||
|
"\n" \
|
||||||
|
"Oracle is a registered trademark of Oracle Corporation and/or its\n" \
|
||||||
|
"affiliates. Other names may be trademarks of their respective\n" \
|
||||||
|
"owners.\n"
|
||||||
|
|
||||||
|
#endif /* _welcome_copyright_notice_h_ */
|
|
@ -140,6 +140,7 @@ SET(CLIENT_SOURCES
|
||||||
errmsg.c
|
errmsg.c
|
||||||
../sql-common/client.c
|
../sql-common/client.c
|
||||||
../sql-common/my_time.c
|
../sql-common/my_time.c
|
||||||
|
../sql-common/client_plugin.c
|
||||||
../sql/net_serv.cc
|
../sql/net_serv.cc
|
||||||
../sql-common/pack.c
|
../sql-common/pack.c
|
||||||
../sql/password.c
|
../sql/password.c
|
||||||
|
@ -148,7 +149,7 @@ ADD_CONVENIENCE_LIBRARY(clientlib ${CLIENT_SOURCES})
|
||||||
DTRACE_INSTRUMENT(clientlib)
|
DTRACE_INSTRUMENT(clientlib)
|
||||||
ADD_DEPENDENCIES(clientlib GenError)
|
ADD_DEPENDENCIES(clientlib GenError)
|
||||||
|
|
||||||
SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES})
|
SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES} ${LIBDL})
|
||||||
|
|
||||||
# Merge several convenience libraries into one big mysqlclient
|
# Merge several convenience libraries into one big mysqlclient
|
||||||
# and link them together into shared library.
|
# and link them together into shared library.
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
MYSQLDATAdir = $(localstatedir)
|
MYSQLDATAdir = $(localstatedir)
|
||||||
MYSQLSHAREdir = $(pkgdatadir)
|
MYSQLSHAREdir = $(pkgdatadir)
|
||||||
MYSQLBASEdir= $(prefix)
|
MYSQLBASEdir= $(prefix)
|
||||||
|
pkgplugindir = $(pkglibdir)/plugin
|
||||||
## We'll use CLIENT_EXTRA_LDFLAGS for threaded and non-threaded
|
## We'll use CLIENT_EXTRA_LDFLAGS for threaded and non-threaded
|
||||||
## until someone complains that they need separate options.
|
## until someone complains that they need separate options.
|
||||||
LDADD = @CLIENT_EXTRA_LDFLAGS@ $(target)
|
LDADD = @CLIENT_EXTRA_LDFLAGS@ $(target)
|
||||||
|
@ -70,26 +71,27 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo \
|
||||||
my_rename.lo my_chsize.lo my_sync.lo \
|
my_rename.lo my_chsize.lo my_sync.lo \
|
||||||
my_getsystime.lo my_symlink2.lo mf_same.lo
|
my_getsystime.lo my_symlink2.lo mf_same.lo
|
||||||
sqlobjects = net.lo
|
sqlobjects = net.lo
|
||||||
sql_cmn_objects = pack.lo client.lo my_time.lo
|
sql_cmn_objects = pack.lo client.lo my_time.lo client_plugin.lo
|
||||||
|
|
||||||
# Not needed in the minimum library
|
# Not needed in the minimum library
|
||||||
mysysobjects2 = my_lib.lo mf_qsort.lo
|
mysysobjects2 = my_lib.lo mf_qsort.lo
|
||||||
mysysobjects = $(mysysobjects1) $(mysysobjects2)
|
mysysobjects = $(mysysobjects1) $(mysysobjects2)
|
||||||
target_libadd = $(mysysobjects) $(mystringsobjects) $(dbugobjects) \
|
target_libadd = $(mysysobjects) $(mystringsobjects) $(dbugobjects) \
|
||||||
$(sql_cmn_objects) $(vio_objects) $(sqlobjects)
|
$(sql_cmn_objects) $(vio_objects) $(sqlobjects)
|
||||||
target_ldflags = -version-info @SHARED_LIB_VERSION@ @LD_VERSION_SCRIPT@
|
target_ldflags = -version-info @SHARED_LIB_VERSION@ @LD_VERSION_SCRIPT@ @LIBDL@
|
||||||
vio_objects= vio.lo viosocket.lo viossl.lo viosslfactories.lo
|
vio_objects= vio.lo viosocket.lo viossl.lo viosslfactories.lo
|
||||||
|
|
||||||
BUILT_SOURCES = link_sources
|
BUILT_SOURCES = link_sources
|
||||||
|
|
||||||
CLEANFILES = $(target_libadd) $(SHLIBOBJS) \
|
CLEANFILES = $(target_libadd) $(SHLIBOBJS) \
|
||||||
$(target) $(BUILT_SOURCES)
|
$(target) $(BUILT_SOURCES)
|
||||||
DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \
|
DEFS = -DDEFAULT_CHARSET_HOME='"$(MYSQLBASEdir)"' \
|
||||||
-DMYSQL_DATADIR="\"$(MYSQLDATAdir)\"" \
|
-DMYSQL_DATADIR='"$(MYSQLDATAdir)"' \
|
||||||
-DDEFAULT_HOME_ENV=MYSQL_HOME \
|
-DDEFAULT_HOME_ENV=MYSQL_HOME \
|
||||||
|
-DPLUGINDIR='"$(pkgplugindir)"' \
|
||||||
-DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \
|
-DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \
|
||||||
-DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \
|
-DDEFAULT_SYSCONFDIR='"$(sysconfdir)"' \
|
||||||
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" -DDISABLE_DTRACE \
|
-DSHAREDIR='"$(MYSQLSHAREdir)"' -DDISABLE_DTRACE \
|
||||||
$(target_defs)
|
$(target_defs)
|
||||||
|
|
||||||
if HAVE_YASSL
|
if HAVE_YASSL
|
||||||
|
|
|
@ -28,7 +28,8 @@ extern char * mysql_unix_port;
|
||||||
CLIENT_PROTOCOL_41 | \
|
CLIENT_PROTOCOL_41 | \
|
||||||
CLIENT_SECURE_CONNECTION | \
|
CLIENT_SECURE_CONNECTION | \
|
||||||
CLIENT_MULTI_RESULTS | \
|
CLIENT_MULTI_RESULTS | \
|
||||||
CLIENT_PS_MULTI_RESULTS)
|
CLIENT_PS_MULTI_RESULTS | \
|
||||||
|
CLIENT_PLUGIN_AUTH)
|
||||||
|
|
||||||
sig_handler my_pipe_sig_handler(int sig);
|
sig_handler my_pipe_sig_handler(int sig);
|
||||||
void read_user_name(char *name);
|
void read_user_name(char *name);
|
||||||
|
@ -67,7 +68,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt);
|
||||||
int cli_read_binary_rows(MYSQL_STMT *stmt);
|
int cli_read_binary_rows(MYSQL_STMT *stmt);
|
||||||
int cli_unbuffered_fetch(MYSQL *mysql, char **row);
|
int cli_unbuffered_fetch(MYSQL *mysql, char **row);
|
||||||
const char * cli_read_statistics(MYSQL *mysql);
|
const char * cli_read_statistics(MYSQL *mysql);
|
||||||
int cli_read_change_user_result(MYSQL *mysql, char *buff, const char *passwd);
|
int cli_read_change_user_result(MYSQL *mysql);
|
||||||
|
|
||||||
#ifdef EMBEDDED_LIBRARY
|
#ifdef EMBEDDED_LIBRARY
|
||||||
int init_embedded_server(int argc, char **argv, char **groups);
|
int init_embedded_server(int argc, char **argv, char **groups);
|
||||||
|
|
|
@ -84,7 +84,8 @@ const char *client_errors[]=
|
||||||
"Lost connection to MySQL server at '%s', system error: %d",
|
"Lost connection to MySQL server at '%s', system error: %d",
|
||||||
"Statement closed indirectly because of a preceeding %s() call",
|
"Statement closed indirectly because of a preceeding %s() call",
|
||||||
"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
|
"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
|
||||||
"This handle is already connected. Use a separate handle for each connection."
|
"This handle is already connected. Use a separate handle for each connection.",
|
||||||
|
"Authentication plugin '%s' cannot be loaded: %s",
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,8 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
|
||||||
if (my_init()) /* Will init threads */
|
if (my_init()) /* Will init threads */
|
||||||
return 1;
|
return 1;
|
||||||
init_client_errs();
|
init_client_errs();
|
||||||
|
if (mysql_client_plugin_init())
|
||||||
|
return 1;
|
||||||
if (!mysql_port)
|
if (!mysql_port)
|
||||||
{
|
{
|
||||||
char *env;
|
char *env;
|
||||||
|
@ -196,6 +198,8 @@ void STDCALL mysql_server_end()
|
||||||
if (!mysql_client_init)
|
if (!mysql_client_init)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
mysql_client_plugin_deinit();
|
||||||
|
|
||||||
#ifdef EMBEDDED_LIBRARY
|
#ifdef EMBEDDED_LIBRARY
|
||||||
end_embedded_server();
|
end_embedded_server();
|
||||||
#endif
|
#endif
|
||||||
|
@ -345,44 +349,14 @@ mysql_connect(MYSQL *mysql,const char *host,
|
||||||
Change user and database
|
Change user and database
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
int cli_read_change_user_result(MYSQL *mysql, char *buff, const char *passwd)
|
|
||||||
{
|
|
||||||
NET *net= &mysql->net;
|
|
||||||
ulong pkt_length;
|
|
||||||
|
|
||||||
pkt_length= cli_safe_read(mysql);
|
|
||||||
|
|
||||||
if (pkt_length == packet_error)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
if (pkt_length == 1 && net->read_pos[0] == 254 &&
|
|
||||||
mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
By sending this very specific reply server asks us to send scrambled
|
|
||||||
password in old format. The reply contains scramble_323.
|
|
||||||
*/
|
|
||||||
scramble_323(buff, mysql->scramble, passwd);
|
|
||||||
if (my_net_write(net, (uchar*) buff, SCRAMBLE_LENGTH_323 + 1) ||
|
|
||||||
net_flush(net))
|
|
||||||
{
|
|
||||||
set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
/* Read what server thinks about out new auth message report */
|
|
||||||
if (cli_safe_read(mysql) == packet_error)
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
|
my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
|
||||||
const char *passwd, const char *db)
|
const char *passwd, const char *db)
|
||||||
{
|
{
|
||||||
char buff[USERNAME_LENGTH+SCRAMBLED_PASSWORD_CHAR_LENGTH+NAME_LEN+2];
|
|
||||||
char *end= buff;
|
|
||||||
int rc;
|
int rc;
|
||||||
CHARSET_INFO *saved_cs= mysql->charset;
|
CHARSET_INFO *saved_cs= mysql->charset;
|
||||||
|
char *saved_user= mysql->user;
|
||||||
|
char *saved_passwd= mysql->passwd;
|
||||||
|
char *saved_db= mysql->db;
|
||||||
|
|
||||||
DBUG_ENTER("mysql_change_user");
|
DBUG_ENTER("mysql_change_user");
|
||||||
|
|
||||||
|
@ -396,49 +370,11 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
|
||||||
|
|
||||||
/* Use an empty string instead of NULL. */
|
/* Use an empty string instead of NULL. */
|
||||||
|
|
||||||
if (!user)
|
mysql->user= (char*)(user ? user : "");
|
||||||
user="";
|
mysql->passwd= (char*)(passwd ? passwd : "");
|
||||||
if (!passwd)
|
mysql->db= 0;
|
||||||
passwd="";
|
|
||||||
|
|
||||||
/*
|
rc= run_plugin_auth(mysql, 0, 0, 0, db);
|
||||||
Store user into the buffer.
|
|
||||||
Advance position as strmake returns a pointer to the closing NUL.
|
|
||||||
*/
|
|
||||||
end= strmake(end, user, USERNAME_LENGTH) + 1;
|
|
||||||
|
|
||||||
/* write scrambled password according to server capabilities */
|
|
||||||
if (passwd[0])
|
|
||||||
{
|
|
||||||
if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
|
|
||||||
{
|
|
||||||
*end++= SCRAMBLE_LENGTH;
|
|
||||||
scramble(end, mysql->scramble, passwd);
|
|
||||||
end+= SCRAMBLE_LENGTH;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scramble_323(end, mysql->scramble, passwd);
|
|
||||||
end+= SCRAMBLE_LENGTH_323 + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
*end++= '\0'; /* empty password */
|
|
||||||
/* Add database if needed */
|
|
||||||
end= strmake(end, db ? db : "", NAME_LEN) + 1;
|
|
||||||
|
|
||||||
/* Add character set number. */
|
|
||||||
|
|
||||||
if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
|
|
||||||
{
|
|
||||||
int2store(end, (ushort) mysql->charset->number);
|
|
||||||
end+= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Write authentication package */
|
|
||||||
simple_command(mysql,COM_CHANGE_USER, (uchar*) buff, (ulong) (end-buff), 1);
|
|
||||||
|
|
||||||
rc= (*mysql->methods->read_change_user_result)(mysql, buff, passwd);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The server will close all statements no matter was the attempt
|
The server will close all statements no matter was the attempt
|
||||||
|
@ -448,18 +384,21 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
|
||||||
if (rc == 0)
|
if (rc == 0)
|
||||||
{
|
{
|
||||||
/* Free old connect information */
|
/* Free old connect information */
|
||||||
my_free(mysql->user);
|
my_free(saved_user);
|
||||||
my_free(mysql->passwd);
|
my_free(saved_passwd);
|
||||||
my_free(mysql->db);
|
my_free(saved_db);
|
||||||
|
|
||||||
/* alloc new connect information */
|
/* alloc new connect information */
|
||||||
mysql->user= my_strdup(user,MYF(MY_WME));
|
mysql->user= my_strdup(mysql->user, MYF(MY_WME));
|
||||||
mysql->passwd=my_strdup(passwd,MYF(MY_WME));
|
mysql->passwd= my_strdup(mysql->passwd, MYF(MY_WME));
|
||||||
mysql->db= db ? my_strdup(db,MYF(MY_WME)) : 0;
|
mysql->db= db ? my_strdup(db, MYF(MY_WME)) : 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mysql->charset= saved_cs;
|
mysql->charset= saved_cs;
|
||||||
|
mysql->user= saved_user;
|
||||||
|
mysql->passwd= saved_passwd;
|
||||||
|
mysql->db= saved_db;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_RETURN(rc);
|
DBUG_RETURN(rc);
|
||||||
|
|
|
@ -104,3 +104,4 @@ EXPORTS
|
||||||
mysql_server_end
|
mysql_server_end
|
||||||
mysql_set_character_set
|
mysql_set_character_set
|
||||||
mysql_get_character_set_info
|
mysql_get_character_set_info
|
||||||
|
mysql_plugin_options
|
||||||
|
|
|
@ -42,6 +42,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
|
||||||
../libmysql/libmysql.c ../libmysql/errmsg.c ../client/get_password.c
|
../libmysql/libmysql.c ../libmysql/errmsg.c ../client/get_password.c
|
||||||
../sql-common/client.c ../sql-common/my_time.c
|
../sql-common/client.c ../sql-common/my_time.c
|
||||||
../sql-common/my_user.c ../sql-common/pack.c
|
../sql-common/my_user.c ../sql-common/pack.c
|
||||||
|
../sql-common/client_plugin.c
|
||||||
../sql/password.c ../sql/discover.cc ../sql/derror.cc
|
../sql/password.c ../sql/discover.cc ../sql/derror.cc
|
||||||
../sql/field.cc ../sql/field_conv.cc
|
../sql/field.cc ../sql/field_conv.cc
|
||||||
../sql/filesort.cc ../sql/gstream.cc
|
../sql/filesort.cc ../sql/gstream.cc
|
||||||
|
|
|
@ -39,7 +39,7 @@ pkglib_LIBRARIES = libmysqld.a
|
||||||
SUBDIRS = . examples
|
SUBDIRS = . examples
|
||||||
libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc
|
libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc
|
||||||
libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
|
libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
|
||||||
my_time.c
|
my_time.c client_plugin.c
|
||||||
|
|
||||||
noinst_HEADERS = embedded_priv.h emb_qcache.h
|
noinst_HEADERS = embedded_priv.h emb_qcache.h
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
|
|
||||||
/* Prototypes for the embedded version of MySQL */
|
/* Prototypes for the embedded version of MySQL */
|
||||||
|
|
||||||
|
#include <sql_common.h>
|
||||||
|
|
||||||
C_MODE_START
|
C_MODE_START
|
||||||
void lib_connection_phase(NET *net, int phase);
|
void lib_connection_phase(NET *net, int phase);
|
||||||
void init_embedded_mysql(MYSQL *mysql, int client_flag);
|
void init_embedded_mysql(MYSQL *mysql, int client_flag);
|
||||||
|
|
|
@ -35,7 +35,6 @@ C_MODE_START
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
#undef ER
|
#undef ER
|
||||||
#include "errmsg.h"
|
#include "errmsg.h"
|
||||||
#include <sql_common.h>
|
|
||||||
#include "embedded_priv.h"
|
#include "embedded_priv.h"
|
||||||
|
|
||||||
extern unsigned int mysql_server_last_errno;
|
extern unsigned int mysql_server_last_errno;
|
||||||
|
@ -414,11 +413,10 @@ static MYSQL_RES * emb_store_result(MYSQL *mysql)
|
||||||
return mysql_store_result(mysql);
|
return mysql_store_result(mysql);
|
||||||
}
|
}
|
||||||
|
|
||||||
int emb_read_change_user_result(MYSQL *mysql,
|
int emb_read_change_user_result(MYSQL *mysql)
|
||||||
char *buff __attribute__((unused)),
|
|
||||||
const char *passwd __attribute__((unused)))
|
|
||||||
{
|
{
|
||||||
return mysql_errno(mysql);
|
mysql->net.read_pos= (uchar*)""; // fake an OK packet
|
||||||
|
return mysql_errno(mysql) ? packet_error : 1 /* length of the OK packet */;
|
||||||
}
|
}
|
||||||
|
|
||||||
MYSQL_METHODS embedded_methods=
|
MYSQL_METHODS embedded_methods=
|
||||||
|
@ -429,6 +427,7 @@ MYSQL_METHODS embedded_methods=
|
||||||
emb_store_result,
|
emb_store_result,
|
||||||
emb_fetch_lengths,
|
emb_fetch_lengths,
|
||||||
emb_flush_use_result,
|
emb_flush_use_result,
|
||||||
|
emb_read_change_user_result,
|
||||||
emb_list_fields,
|
emb_list_fields,
|
||||||
emb_read_prepare_result,
|
emb_read_prepare_result,
|
||||||
emb_stmt_execute,
|
emb_stmt_execute,
|
||||||
|
@ -437,7 +436,6 @@ MYSQL_METHODS embedded_methods=
|
||||||
emb_free_embedded_thd,
|
emb_free_embedded_thd,
|
||||||
emb_read_statistics,
|
emb_read_statistics,
|
||||||
emb_read_query_result,
|
emb_read_query_result,
|
||||||
emb_read_change_user_result,
|
|
||||||
emb_read_rows_from_cursor
|
emb_read_rows_from_cursor
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -605,6 +603,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag)
|
||||||
THD *thd = (THD *)mysql->thd;
|
THD *thd = (THD *)mysql->thd;
|
||||||
thd->mysql= mysql;
|
thd->mysql= mysql;
|
||||||
mysql->server_version= server_version;
|
mysql->server_version= server_version;
|
||||||
|
mysql->client_flag= client_flag;
|
||||||
init_alloc_root(&mysql->field_alloc, 8192, 0);
|
init_alloc_root(&mysql->field_alloc, 8192, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -668,14 +667,20 @@ err:
|
||||||
int check_embedded_connection(MYSQL *mysql, const char *db)
|
int check_embedded_connection(MYSQL *mysql, const char *db)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
LEX_STRING db_str = { (char*)db, db ? strlen(db) : 0 };
|
||||||
THD *thd= (THD*)mysql->thd;
|
THD *thd= (THD*)mysql->thd;
|
||||||
thd_init_client_charset(thd, mysql->charset->number);
|
thd_init_client_charset(thd, mysql->charset->number);
|
||||||
thd->update_charset();
|
thd->update_charset();
|
||||||
Security_context *sctx= thd->security_ctx;
|
Security_context *sctx= thd->security_ctx;
|
||||||
sctx->host_or_ip= sctx->host= (char*) my_localhost;
|
sctx->host_or_ip= sctx->host= (char*) my_localhost;
|
||||||
strmake(sctx->priv_host, (char*) my_localhost, MAX_HOSTNAME-1);
|
strmake(sctx->priv_host, (char*) my_localhost, MAX_HOSTNAME-1);
|
||||||
sctx->priv_user= sctx->user= my_strdup(mysql->user, MYF(0));
|
strmake(sctx->priv_user, mysql->user, USERNAME_LENGTH-1);
|
||||||
result= check_user(thd, COM_CONNECT, NULL, 0, db, true);
|
sctx->user= my_strdup(mysql->user, MYF(0));
|
||||||
|
sctx->proxy_user[0]= 0;
|
||||||
|
sctx->master_access= GLOBAL_ACLS; // Full rights
|
||||||
|
/* Change database if necessary */
|
||||||
|
if (!(result= (db && db[0] && mysql_change_db(thd, &db_str, FALSE))))
|
||||||
|
my_ok(thd);
|
||||||
thd->protocol->end_statement();
|
thd->protocol->end_statement();
|
||||||
emb_read_query_result(mysql);
|
emb_read_query_result(mysql);
|
||||||
return result;
|
return result;
|
||||||
|
@ -684,14 +689,15 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
|
||||||
#else
|
#else
|
||||||
int check_embedded_connection(MYSQL *mysql, const char *db)
|
int check_embedded_connection(MYSQL *mysql, const char *db)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
we emulate a COM_CHANGE_USER user here,
|
||||||
|
it's easier than to emulate the complete 3-way handshake
|
||||||
|
*/
|
||||||
|
char buf[USERNAME_LENGTH + SCRAMBLE_LENGTH + 1 + 2*NAME_LEN + 2], *end;
|
||||||
|
NET *net= &mysql->net;
|
||||||
THD *thd= (THD*)mysql->thd;
|
THD *thd= (THD*)mysql->thd;
|
||||||
Security_context *sctx= thd->security_ctx;
|
Security_context *sctx= thd->security_ctx;
|
||||||
int result;
|
|
||||||
char scramble_buff[SCRAMBLE_LENGTH];
|
|
||||||
int passwd_len;
|
|
||||||
|
|
||||||
thd_init_client_charset(thd, mysql->charset->number);
|
|
||||||
thd->update_charset();
|
|
||||||
if (mysql->options.client_ip)
|
if (mysql->options.client_ip)
|
||||||
{
|
{
|
||||||
sctx->host= my_strdup(mysql->options.client_ip, MYF(0));
|
sctx->host= my_strdup(mysql->options.client_ip, MYF(0));
|
||||||
|
@ -702,37 +708,43 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
|
||||||
sctx->host_or_ip= sctx->host;
|
sctx->host_or_ip= sctx->host;
|
||||||
|
|
||||||
if (acl_check_host(sctx->host, sctx->ip))
|
if (acl_check_host(sctx->host, sctx->ip))
|
||||||
{
|
|
||||||
result= ER_HOST_NOT_PRIVILEGED;
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
|
||||||
|
|
||||||
sctx->user= my_strdup(mysql->user, MYF(0));
|
/* construct a COM_CHANGE_USER packet */
|
||||||
|
end= strmake(buf, mysql->user, USERNAME_LENGTH) + 1;
|
||||||
|
|
||||||
|
memset(thd->scramble, 55, SCRAMBLE_LENGTH); // dummy scramble
|
||||||
|
thd->scramble[SCRAMBLE_LENGTH]= 0;
|
||||||
|
|
||||||
if (mysql->passwd && mysql->passwd[0])
|
if (mysql->passwd && mysql->passwd[0])
|
||||||
{
|
{
|
||||||
memset(thd->scramble, 55, SCRAMBLE_LENGTH); // dummy scramble
|
*end++= SCRAMBLE_LENGTH;
|
||||||
thd->scramble[SCRAMBLE_LENGTH]= 0;
|
scramble(end, thd->scramble, mysql->passwd);
|
||||||
scramble(scramble_buff, thd->scramble, mysql->passwd);
|
end+= SCRAMBLE_LENGTH;
|
||||||
passwd_len= SCRAMBLE_LENGTH;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
passwd_len= 0;
|
*end++= 0;
|
||||||
|
|
||||||
if((result= check_user(thd, COM_CONNECT,
|
end= strmake(end, db ? db : "", NAME_LEN) + 1;
|
||||||
scramble_buff, passwd_len, db, true)))
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
|
int2store(end, (ushort) mysql->charset->number);
|
||||||
|
end+= 2;
|
||||||
|
|
||||||
|
/* acl_authenticate() takes the data from thd->net->read_pos */
|
||||||
|
thd->net.read_pos= (uchar*)buf;
|
||||||
|
|
||||||
|
if (acl_authenticate(thd, 0, end - buf))
|
||||||
|
{
|
||||||
|
x_free(thd->security_ctx->user);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
err:
|
err:
|
||||||
{
|
strmake(net->last_error, thd->main_da.message(), sizeof(net->last_error)-1);
|
||||||
NET *net= &mysql->net;
|
memcpy(net->sqlstate,
|
||||||
strmake(net->last_error, thd->stmt_da->message(),
|
mysql_errno_to_sqlstate(thd->main_da.sql_errno()),
|
||||||
sizeof(net->last_error)-1);
|
sizeof(net->sqlstate)-1);
|
||||||
memcpy(net->sqlstate,
|
return 1;
|
||||||
mysql_errno_to_sqlstate(thd->stmt_da->sql_errno()),
|
|
||||||
sizeof(net->sqlstate)-1);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
#include <mysqld_error.h>
|
#include <mysqld_error.h>
|
||||||
#include <my_pthread.h>
|
#include <my_pthread.h>
|
||||||
#include "embedded_priv.h"
|
|
||||||
#include <my_sys.h>
|
#include <my_sys.h>
|
||||||
#include <mysys_err.h>
|
#include <mysys_err.h>
|
||||||
#include <m_string.h>
|
#include <m_string.h>
|
||||||
|
@ -28,6 +27,7 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sql_common.h>
|
#include <sql_common.h>
|
||||||
|
#include "embedded_priv.h"
|
||||||
#include "client_settings.h"
|
#include "client_settings.h"
|
||||||
#ifdef HAVE_PWD_H
|
#ifdef HAVE_PWD_H
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
@ -165,7 +165,11 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
||||||
client_flag|=CLIENT_CAPABILITIES;
|
client_flag|=CLIENT_CAPABILITIES;
|
||||||
if (client_flag & CLIENT_MULTI_STATEMENTS)
|
if (client_flag & CLIENT_MULTI_STATEMENTS)
|
||||||
client_flag|= CLIENT_MULTI_RESULTS;
|
client_flag|= CLIENT_MULTI_RESULTS;
|
||||||
client_flag&= ~CLIENT_COMPRESS;
|
/*
|
||||||
|
no compression in embedded as we don't send any data,
|
||||||
|
and no pluggable auth, as we cannot do a client-server dialog
|
||||||
|
*/
|
||||||
|
client_flag&= ~(CLIENT_COMPRESS | CLIENT_PLUGIN_AUTH);
|
||||||
if (db)
|
if (db)
|
||||||
client_flag|=CLIENT_CONNECT_WITH_DB;
|
client_flag|=CLIENT_CONNECT_WITH_DB;
|
||||||
|
|
||||||
|
|
|
@ -2,5 +2,4 @@ perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collection
|
||||||
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row
|
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row
|
||||||
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded
|
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded
|
||||||
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1
|
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1
|
||||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_ndb_row --vardir=var-rpl_ndb_row --mysqld=--binlog-format=row --suite=rpl_ndb,ndb
|
|
||||||
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog --skip-ndb
|
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog --skip-ndb
|
||||||
|
|
|
@ -15,23 +15,17 @@ main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_m
|
||||||
main.lock_multi_bug38691 @solaris # Bug#47792 2009-10-02 alik main.lock_multi_bug38691 times out sporadically on Solaris 10
|
main.lock_multi_bug38691 @solaris # Bug#47792 2009-10-02 alik main.lock_multi_bug38691 times out sporadically on Solaris 10
|
||||||
main.log_tables # Bug#47924 2009-10-08 alik main.log_tables times out sporadically
|
main.log_tables # Bug#47924 2009-10-08 alik main.log_tables times out sporadically
|
||||||
main.lowercase_table2 @darwin # Bug#55509 2010-07-26 alik main.lowercase_table2 fails on Mac OSX (again)
|
main.lowercase_table2 @darwin # Bug#55509 2010-07-26 alik main.lowercase_table2 fails on Mac OSX (again)
|
||||||
main.mysqlbinlog_row @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max
|
|
||||||
main.mysqlbinlog_row_innodb @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max
|
|
||||||
main.mysqlbinlog_row_myisam @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max
|
|
||||||
main.outfile_loaddata @solaris # Bug#46895 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
|
main.outfile_loaddata @solaris # Bug#46895 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
|
||||||
main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
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.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
|
main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server
|
||||||
main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeout fails on OpenSolaris
|
main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeout fails on OpenSolaris
|
||||||
|
|
||||||
parts.partition_alter4_innodb # Bug#45299 2010-06-28 alik Test "partition_alter4_innodb" is taking too long, timeout
|
|
||||||
|
|
||||||
rpl.rpl_heartbeat_basic # BUG#54820 2010-06-26 alik rpl.rpl_heartbeat_basic fails sporadically again
|
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_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically
|
||||||
rpl.rpl_innodb_bug28430* # Bug#46029
|
rpl.rpl_innodb_bug28430* # Bug#46029
|
||||||
rpl.rpl_innodb_bug30888* @solaris # Bug#47646 2009-09-25 alik rpl.rpl_innodb_bug30888 fails sporadically on Solaris
|
rpl.rpl_innodb_bug30888* @solaris # Bug#47646 2009-09-25 alik rpl.rpl_innodb_bug30888 fails sporadically on Solaris
|
||||||
rpl.rpl_killed_ddl @windows # Bug#47638 2010-01-20 alik The rpl_killed_ddl test fails on Windows
|
rpl.rpl_killed_ddl @windows # Bug#47638 2010-01-20 alik The rpl_killed_ddl test fails on Windows
|
||||||
rpl.rpl_row_sp011* @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
|
||||||
|
|
||||||
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.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.slow_query_log_func @solaris # Bug#54819 2010-06-26 alik sys_vars.slow_query_log_func fails sporadically on Solaris 10
|
sys_vars.slow_query_log_func @solaris # Bug#54819 2010-06-26 alik sys_vars.slow_query_log_func fails sporadically on Solaris 10
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
perl mysql-test-run.pl --timer --force --comment=1st --experimental=collections/default.experimental 1st
|
perl mysql-test-run.pl --timer --force --comment=1st --experimental=collections/default.experimental 1st
|
||||||
|
perl mysql-test-run.pl --timer --force --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_1_2_ndb parts.partition_alter1_1_ndb parts.partition_alter1_2_innodb parts.partition_alter1_2_ndb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb main.variables-big rpl_ndb.rpl_truncate_7ndb_2
|
||||||
|
|
|
@ -1635,12 +1635,7 @@ CREATE TABLE t1 (a MEDIUMINT NULL) ENGINE=MYISAM;
|
||||||
INSERT INTO t1 VALUES (1234567);
|
INSERT INTO t1 VALUES (1234567);
|
||||||
SELECT GROUP_CONCAT(IFNULL(a,'')) FROM t1;
|
SELECT GROUP_CONCAT(IFNULL(a,'')) FROM t1;
|
||||||
SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1;
|
SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1;
|
||||||
if (`SELECT @@character_set_connection != 'ucs2'`)
|
SELECT GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) FROM t1;
|
||||||
{
|
|
||||||
# Temporarily disable for ucs2
|
|
||||||
# For details, see Bug#55744 GROUP_CONCAT + CASE + ucs return garbage
|
|
||||||
SELECT GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) FROM t1;
|
|
||||||
}
|
|
||||||
--enable_metadata
|
--enable_metadata
|
||||||
SELECT COALESCE(a,'') FROM t1 GROUP BY 1;
|
SELECT COALESCE(a,'') FROM t1 GROUP BY 1;
|
||||||
--disable_metadata
|
--disable_metadata
|
||||||
|
|
4
mysql-test/include/have_plugin_auth.inc
Normal file
4
mysql-test/include/have_plugin_auth.inc
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
disable_query_log;
|
||||||
|
--require r/true.require
|
||||||
|
select (PLUGIN_LIBRARY LIKE 'auth_test_plugin%') as `TRUE` FROM INFORMATION_SCHEMA.PLUGINS
|
||||||
|
WHERE PLUGIN_NAME='test_plugin_server';
|
|
@ -351,3 +351,115 @@ explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 4
|
||||||
select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
|
select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Bug#56423: Different count with SELECT and CREATE SELECT queries
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT,
|
||||||
|
b INT,
|
||||||
|
c INT,
|
||||||
|
d INT,
|
||||||
|
PRIMARY KEY (a),
|
||||||
|
KEY (c),
|
||||||
|
KEY bd (b,d)
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES
|
||||||
|
(1, 0, 1, 0),
|
||||||
|
(2, 1, 1, 1),
|
||||||
|
(3, 1, 1, 1),
|
||||||
|
(4, 0, 1, 1);
|
||||||
|
|
||||||
|
EXPLAIN
|
||||||
|
SELECT a
|
||||||
|
FROM t1
|
||||||
|
WHERE c = 1 AND b = 1 AND d = 1;
|
||||||
|
|
||||||
|
CREATE TABLE t2 ( a INT )
|
||||||
|
SELECT a
|
||||||
|
FROM t1
|
||||||
|
WHERE c = 1 AND b = 1 AND d = 1;
|
||||||
|
|
||||||
|
SELECT * FROM t2;
|
||||||
|
|
||||||
|
DROP TABLE t1, t2;
|
||||||
|
|
||||||
|
CREATE TABLE t1( a INT, b INT, KEY(a), KEY(b) );
|
||||||
|
INSERT INTO t1 VALUES (1, 2), (1, 2), (1, 2), (1, 2);
|
||||||
|
SELECT * FROM t1 FORCE INDEX(a, b) WHERE a = 1 AND b = 2;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo # Code coverage of fix.
|
||||||
|
CREATE TABLE t1 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b INT);
|
||||||
|
INSERT INTO t1 (b) VALUES (1);
|
||||||
|
UPDATE t1 SET b = 2 WHERE a = 1;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
CREATE TABLE t2 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(1) );
|
||||||
|
INSERT INTO t2 (b) VALUES ('a');
|
||||||
|
UPDATE t2 SET b = 'b' WHERE a = 1;
|
||||||
|
SELECT * FROM t2;
|
||||||
|
|
||||||
|
DROP TABLE t1, t2;
|
||||||
|
|
||||||
|
# The test was inactive for InnoDB at the time of pushing. The following is
|
||||||
|
# expected result for the Bug#56423 test. It can be uncommented and pasted
|
||||||
|
# into result file when reactivating the test.
|
||||||
|
|
||||||
|
##
|
||||||
|
## Bug#56423: Different count with SELECT and CREATE SELECT queries
|
||||||
|
##
|
||||||
|
#CREATE TABLE t1 (
|
||||||
|
#a INT,
|
||||||
|
#b INT,
|
||||||
|
#c INT,
|
||||||
|
#d INT,
|
||||||
|
#PRIMARY KEY (a),
|
||||||
|
#KEY (c),
|
||||||
|
#KEY bd (b,d)
|
||||||
|
#);
|
||||||
|
#INSERT INTO t1 VALUES
|
||||||
|
#(1, 0, 1, 0),
|
||||||
|
#(2, 1, 1, 1),
|
||||||
|
#(3, 1, 1, 1),
|
||||||
|
#(4, 0, 1, 1);
|
||||||
|
#EXPLAIN
|
||||||
|
#SELECT a
|
||||||
|
#FROM t1
|
||||||
|
#WHERE c = 1 AND b = 1 AND d = 1;
|
||||||
|
#id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
#1 SIMPLE t1 ref c,bd bd 10 const,const 2 Using where
|
||||||
|
#CREATE TABLE t2 ( a INT )
|
||||||
|
#SELECT a
|
||||||
|
#FROM t1
|
||||||
|
#WHERE c = 1 AND b = 1 AND d = 1;
|
||||||
|
#SELECT * FROM t2;
|
||||||
|
#a
|
||||||
|
#2
|
||||||
|
#3
|
||||||
|
#DROP TABLE t1, t2;
|
||||||
|
#CREATE TABLE t1( a INT, b INT, KEY(a), KEY(b) );
|
||||||
|
#INSERT INTO t1 VALUES (1, 2), (1, 2), (1, 2), (1, 2);
|
||||||
|
#SELECT * FROM t1 FORCE INDEX(a, b) WHERE a = 1 AND b = 2;
|
||||||
|
#a b
|
||||||
|
#1 2
|
||||||
|
#1 2
|
||||||
|
#1 2
|
||||||
|
#1 2
|
||||||
|
#DROP TABLE t1;
|
||||||
|
## Code coverage of fix.
|
||||||
|
#CREATE TABLE t1 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b INT);
|
||||||
|
#INSERT INTO t1 (b) VALUES (1);
|
||||||
|
#UPDATE t1 SET b = 2 WHERE a = 1;
|
||||||
|
#SELECT * FROM t1;
|
||||||
|
#a b
|
||||||
|
#1 2
|
||||||
|
#CREATE TABLE t2 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(1) );
|
||||||
|
#INSERT INTO t2 (b) VALUES ('a');
|
||||||
|
#UPDATE t2 SET b = 'b' WHERE a = 1;
|
||||||
|
#SELECT * FROM t2;
|
||||||
|
#a b
|
||||||
|
#1 b
|
||||||
|
#DROP TABLE t1, t2;
|
||||||
|
|
|
@ -926,7 +926,7 @@ sub collect_one_test_case {
|
||||||
{
|
{
|
||||||
# Ndb is not supported, skip it
|
# Ndb is not supported, skip it
|
||||||
$tinfo->{'skip'}= 1;
|
$tinfo->{'skip'}= 1;
|
||||||
$tinfo->{'comment'}= "No ndbcluster support";
|
$tinfo->{'comment'}= "No ndbcluster support or ndb tests not enabled";
|
||||||
return $tinfo;
|
return $tinfo;
|
||||||
}
|
}
|
||||||
elsif ( $::opt_skip_ndbcluster )
|
elsif ( $::opt_skip_ndbcluster )
|
||||||
|
|
|
@ -229,7 +229,8 @@ sub mtr_report_stats ($$;$) {
|
||||||
# Find out how we where doing
|
# Find out how we where doing
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
my $tot_skiped= 0;
|
my $tot_skipped= 0;
|
||||||
|
my $tot_skipdetect= 0;
|
||||||
my $tot_passed= 0;
|
my $tot_passed= 0;
|
||||||
my $tot_failed= 0;
|
my $tot_failed= 0;
|
||||||
my $tot_tests= 0;
|
my $tot_tests= 0;
|
||||||
|
@ -246,8 +247,9 @@ sub mtr_report_stats ($$;$) {
|
||||||
}
|
}
|
||||||
elsif ( $tinfo->{'result'} eq 'MTR_RES_SKIPPED' )
|
elsif ( $tinfo->{'result'} eq 'MTR_RES_SKIPPED' )
|
||||||
{
|
{
|
||||||
# Test was skipped
|
# Test was skipped (disabled not counted)
|
||||||
$tot_skiped++;
|
$tot_skipped++ unless $tinfo->{'disable'};
|
||||||
|
$tot_skipdetect++ if $tinfo->{'skip_detected_by_test'};
|
||||||
}
|
}
|
||||||
elsif ( $tinfo->{'result'} eq 'MTR_RES_PASSED' )
|
elsif ( $tinfo->{'result'} eq 'MTR_RES_PASSED' )
|
||||||
{
|
{
|
||||||
|
@ -376,6 +378,9 @@ sub mtr_report_stats ($$;$) {
|
||||||
print "All $tot_tests tests were successful.\n\n";
|
print "All $tot_tests tests were successful.\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "$tot_skipped tests were skipped, ".
|
||||||
|
"$tot_skipdetect by the test itself.\n\n" if $tot_skipped;
|
||||||
|
|
||||||
if ( $tot_failed != 0 || $found_problems)
|
if ( $tot_failed != 0 || $found_problems)
|
||||||
{
|
{
|
||||||
mtr_error("there were failing test cases") unless $dont_error;
|
mtr_error("there were failing test cases") unless $dont_error;
|
||||||
|
|
|
@ -126,12 +126,27 @@ my $path_vardir_trace; # unix formatted opt_vardir for trace files
|
||||||
my $opt_tmpdir; # Path to use for tmp/ dir
|
my $opt_tmpdir; # Path to use for tmp/ dir
|
||||||
my $opt_tmpdir_pid;
|
my $opt_tmpdir_pid;
|
||||||
|
|
||||||
|
my $opt_start;
|
||||||
|
my $opt_start_dirty;
|
||||||
|
my $opt_start_exit;
|
||||||
|
my $start_only;
|
||||||
|
|
||||||
|
my $auth_filename; # the name of the authentication test plugin
|
||||||
|
my $auth_plugin; # the path to the authentication test plugin
|
||||||
|
|
||||||
END {
|
END {
|
||||||
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
|
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
|
||||||
{
|
{
|
||||||
# Remove the tempdir this process has created
|
if (!$opt_start_exit)
|
||||||
mtr_verbose("Removing tmpdir '$opt_tmpdir");
|
{
|
||||||
rmtree($opt_tmpdir);
|
# Remove the tempdir this process has created
|
||||||
|
mtr_verbose("Removing tmpdir $opt_tmpdir");
|
||||||
|
rmtree($opt_tmpdir);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mtr_warning("tmpdir $opt_tmpdir should be removed after the server has finished");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,10 +249,6 @@ my $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds
|
||||||
sub suite_timeout { return $opt_suite_timeout * 60; };
|
sub suite_timeout { return $opt_suite_timeout * 60; };
|
||||||
sub check_timeout { return $opt_testcase_timeout * 6; };
|
sub check_timeout { return $opt_testcase_timeout * 6; };
|
||||||
|
|
||||||
my $opt_start;
|
|
||||||
my $opt_start_dirty;
|
|
||||||
my $opt_start_exit;
|
|
||||||
my $start_only;
|
|
||||||
my $opt_wait_all;
|
my $opt_wait_all;
|
||||||
my $opt_user_args;
|
my $opt_user_args;
|
||||||
my $opt_repeat= 1;
|
my $opt_repeat= 1;
|
||||||
|
@ -273,7 +284,8 @@ sub testcase_timeout ($) {
|
||||||
|
|
||||||
our $opt_warnings= 1;
|
our $opt_warnings= 1;
|
||||||
|
|
||||||
our $opt_skip_ndbcluster= 0;
|
our $opt_include_ndbcluster= 0;
|
||||||
|
our $opt_skip_ndbcluster= 1;
|
||||||
|
|
||||||
my $exe_ndbd;
|
my $exe_ndbd;
|
||||||
my $exe_ndb_mgmd;
|
my $exe_ndb_mgmd;
|
||||||
|
@ -869,6 +881,7 @@ sub command_line_setup {
|
||||||
# Control what test suites or cases to run
|
# Control what test suites or cases to run
|
||||||
'force' => \$opt_force,
|
'force' => \$opt_force,
|
||||||
'with-ndbcluster-only' => \&collect_option,
|
'with-ndbcluster-only' => \&collect_option,
|
||||||
|
'include-ndbcluster' => \$opt_include_ndbcluster,
|
||||||
'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
|
'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
|
||||||
'suite|suites=s' => \$opt_suites,
|
'suite|suites=s' => \$opt_suites,
|
||||||
'skip-rpl' => \&collect_option,
|
'skip-rpl' => \&collect_option,
|
||||||
|
@ -1049,6 +1062,22 @@ sub command_line_setup {
|
||||||
"$basedir/sql/share/charsets",
|
"$basedir/sql/share/charsets",
|
||||||
"$basedir/share/charsets");
|
"$basedir/share/charsets");
|
||||||
|
|
||||||
|
# Look for client test plugin
|
||||||
|
if (IS_WINDOWS)
|
||||||
|
{
|
||||||
|
$auth_filename = "auth_test_plugin.dll";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$auth_filename = "auth_test_plugin.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);
|
||||||
|
|
||||||
|
|
||||||
if (using_extern())
|
if (using_extern())
|
||||||
{
|
{
|
||||||
# Connect to the running mysqld and find out what it supports
|
# Connect to the running mysqld and find out what it supports
|
||||||
|
@ -1935,6 +1964,24 @@ sub environment_setup {
|
||||||
$ENV{'UDF_EXAMPLE_LIB_OPT'}= "--plugin-dir=".
|
$ENV{'UDF_EXAMPLE_LIB_OPT'}= "--plugin-dir=".
|
||||||
($lib_udf_example ? dirname($lib_udf_example) : "");
|
($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;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$ENV{'PLUGIN_AUTH'}= "";
|
||||||
|
$ENV{'PLUGIN_AUTH_OPT'}="--plugin-dir=";
|
||||||
|
$ENV{'PLUGIN_AUTH_LOAD'}="";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# Add the path where mysqld will find ha_example.so
|
# Add the path where mysqld will find ha_example.so
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
@ -2186,6 +2233,11 @@ sub environment_setup {
|
||||||
# to detect that valgrind is being used from test cases
|
# to detect that valgrind is being used from test cases
|
||||||
$ENV{'VALGRIND_TEST'}= $opt_valgrind;
|
$ENV{'VALGRIND_TEST'}= $opt_valgrind;
|
||||||
|
|
||||||
|
# Add dir of this perl to aid mysqltest in finding perl
|
||||||
|
my $perldir= dirname($^X);
|
||||||
|
my $pathsep= ":";
|
||||||
|
$pathsep= ";" if IS_WINDOWS && ! IS_CYGWIN;
|
||||||
|
$ENV{'PATH'}= "$ENV{'PATH'}".$pathsep.$perldir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2458,6 +2510,11 @@ sub vs_config_dirs ($$) {
|
||||||
sub check_ndbcluster_support ($) {
|
sub check_ndbcluster_support ($) {
|
||||||
my $mysqld_variables= shift;
|
my $mysqld_variables= shift;
|
||||||
|
|
||||||
|
if ($opt_include_ndbcluster)
|
||||||
|
{
|
||||||
|
$opt_skip_ndbcluster= 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ($opt_skip_ndbcluster)
|
if ($opt_skip_ndbcluster)
|
||||||
{
|
{
|
||||||
mtr_report(" - skipping ndbcluster");
|
mtr_report(" - skipping ndbcluster");
|
||||||
|
@ -3658,6 +3715,9 @@ sub run_testcase ($) {
|
||||||
# Try to get reason from test log file
|
# Try to get reason from test log file
|
||||||
find_testcase_skipped_reason($tinfo);
|
find_testcase_skipped_reason($tinfo);
|
||||||
mtr_report_test_skipped($tinfo);
|
mtr_report_test_skipped($tinfo);
|
||||||
|
# Restart if skipped due to missing perl, it may have had side effects
|
||||||
|
stop_all_servers($opt_shutdown_timeout)
|
||||||
|
if ($tinfo->{'comment'} =~ /^perl not found/);
|
||||||
}
|
}
|
||||||
elsif ( $res == 65 )
|
elsif ( $res == 65 )
|
||||||
{
|
{
|
||||||
|
@ -5016,6 +5076,10 @@ sub start_mysqltest ($) {
|
||||||
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
|
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
|
||||||
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
|
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
|
||||||
mtr_add_arg($args, "--logdir=%s/log", $opt_vardir);
|
mtr_add_arg($args, "--logdir=%s/log", $opt_vardir);
|
||||||
|
if ($auth_plugin)
|
||||||
|
{
|
||||||
|
mtr_add_arg($args, "--plugin_dir=%s", dirname($auth_plugin));
|
||||||
|
}
|
||||||
|
|
||||||
# Log line number and time for each line in .test file
|
# Log line number and time for each line in .test file
|
||||||
mtr_add_arg($args, "--mark-progress")
|
mtr_add_arg($args, "--mark-progress")
|
||||||
|
@ -5494,7 +5558,8 @@ Options to control what test suites or cases to run
|
||||||
|
|
||||||
force Continue to run the suite after failure
|
force Continue to run the suite after failure
|
||||||
with-ndbcluster-only Run only tests that include "ndb" in the filename
|
with-ndbcluster-only Run only tests that include "ndb" in the filename
|
||||||
skip-ndb[cluster] Skip all tests that need cluster
|
skip-ndb[cluster] Skip all tests that need cluster. Default.
|
||||||
|
include-ndb[cluster] Enable all tests that need cluster
|
||||||
do-test=PREFIX or REGEX
|
do-test=PREFIX or REGEX
|
||||||
Run test cases which name are prefixed with PREFIX
|
Run test cases which name are prefixed with PREFIX
|
||||||
or fulfills REGEX
|
or fulfills REGEX
|
||||||
|
|
|
@ -21,6 +21,7 @@ ndb_binlog_index
|
||||||
plugin
|
plugin
|
||||||
proc
|
proc
|
||||||
procs_priv
|
procs_priv
|
||||||
|
proxy_priv
|
||||||
servers
|
servers
|
||||||
slow_log
|
slow_log
|
||||||
tables_priv
|
tables_priv
|
||||||
|
|
|
@ -220,3 +220,14 @@ Variable_name Value
|
||||||
Qcache_hits 1
|
Qcache_hits 1
|
||||||
set GLOBAL query_cache_size=1048576;
|
set GLOBAL query_cache_size=1048576;
|
||||||
drop table t2;
|
drop table t2;
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||||
|
BEGIN;
|
||||||
|
INSERT INTO t1 VALUES(1);
|
||||||
|
ROLLBACK WORK AND CHAIN NO RELEASE;
|
||||||
|
SELECT a FROM t1;
|
||||||
|
a
|
||||||
|
ROLLBACK WORK AND CHAIN NO RELEASE;
|
||||||
|
SELECT a FROM t1;
|
||||||
|
a
|
||||||
|
ROLLBACK;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
|
@ -1,3 +1,39 @@
|
||||||
|
grant select on test.* to test_nopw;
|
||||||
|
grant select on test.* to test_oldpw identified by password "09301740536db389";
|
||||||
|
grant select on test.* to test_newpw identified by "newpw";
|
||||||
|
select user(), current_user(), database();
|
||||||
|
user() current_user() database()
|
||||||
|
root@localhost root@localhost test
|
||||||
|
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
|
||||||
|
concat('<', user(), '>') concat('<', current_user(), '>') database()
|
||||||
|
<root@localhost> <root@localhost> test
|
||||||
|
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
|
||||||
|
concat('<', user(), '>') concat('<', current_user(), '>') database()
|
||||||
|
<test_nopw@localhost> <test_nopw@%> NULL
|
||||||
|
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
|
||||||
|
concat('<', user(), '>') concat('<', current_user(), '>') database()
|
||||||
|
<test_oldpw@localhost> <test_oldpw@%> NULL
|
||||||
|
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
|
||||||
|
concat('<', user(), '>') concat('<', current_user(), '>') database()
|
||||||
|
<test_newpw@localhost> <test_newpw@%> NULL
|
||||||
|
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
|
||||||
|
concat('<', user(), '>') concat('<', current_user(), '>') database()
|
||||||
|
<root@localhost> <root@localhost> NULL
|
||||||
|
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
|
||||||
|
concat('<', user(), '>') concat('<', current_user(), '>') database()
|
||||||
|
<test_nopw@localhost> <test_nopw@%> test
|
||||||
|
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
|
||||||
|
concat('<', user(), '>') concat('<', current_user(), '>') database()
|
||||||
|
<test_oldpw@localhost> <test_oldpw@%> test
|
||||||
|
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
|
||||||
|
concat('<', user(), '>') concat('<', current_user(), '>') database()
|
||||||
|
<test_newpw@localhost> <test_newpw@%> test
|
||||||
|
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
|
||||||
|
concat('<', user(), '>') concat('<', current_user(), '>') database()
|
||||||
|
<root@localhost> <root@localhost> test
|
||||||
|
drop user test_nopw;
|
||||||
|
drop user test_oldpw;
|
||||||
|
drop user test_newpw;
|
||||||
Bug#20023
|
Bug#20023
|
||||||
SELECT @@session.sql_big_selects;
|
SELECT @@session.sql_big_selects;
|
||||||
@@session.sql_big_selects
|
@@session.sql_big_selects
|
||||||
|
|
|
@ -15,6 +15,7 @@ ndb_binlog_index
|
||||||
plugin
|
plugin
|
||||||
proc
|
proc
|
||||||
procs_priv
|
procs_priv
|
||||||
|
proxy_priv
|
||||||
servers
|
servers
|
||||||
slow_log
|
slow_log
|
||||||
tables_priv
|
tables_priv
|
||||||
|
@ -48,6 +49,7 @@ ndb_binlog_index
|
||||||
plugin
|
plugin
|
||||||
proc
|
proc
|
||||||
procs_priv
|
procs_priv
|
||||||
|
proxy_priv
|
||||||
servers
|
servers
|
||||||
slow_log
|
slow_log
|
||||||
tables_priv
|
tables_priv
|
||||||
|
@ -89,6 +91,7 @@ ndb_binlog_index
|
||||||
plugin
|
plugin
|
||||||
proc
|
proc
|
||||||
procs_priv
|
procs_priv
|
||||||
|
proxy_priv
|
||||||
servers
|
servers
|
||||||
slow_log
|
slow_log
|
||||||
tables_priv
|
tables_priv
|
||||||
|
|
|
@ -3853,6 +3853,9 @@ GROUP_CONCAT(IFNULL(a,''))
|
||||||
SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1;
|
SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1;
|
||||||
GROUP_CONCAT(IF(a,a,''))
|
GROUP_CONCAT(IF(a,a,''))
|
||||||
1234567
|
1234567
|
||||||
|
SELECT GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) FROM t1;
|
||||||
|
GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END)
|
||||||
|
1234567
|
||||||
SELECT COALESCE(a,'') FROM t1 GROUP BY 1;
|
SELECT COALESCE(a,'') FROM t1 GROUP BY 1;
|
||||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||||
def COALESCE(a,'') 253 9 7 Y 0 31 8
|
def COALESCE(a,'') 253 9 7 Y 0 31 8
|
||||||
|
|
|
@ -509,3 +509,18 @@ CREATE TABLE t3 LIKE t1;
|
||||||
DELETE FROM t1.*, test.t2.*, a.* USING t1, t2, t3 AS a;
|
DELETE FROM t1.*, test.t2.*, a.* USING t1, t2, t3 AS a;
|
||||||
DROP TABLE t1, t2, t3;
|
DROP TABLE t1, t2, t3;
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
|
#
|
||||||
|
# Bug#51099 Assertion in mysql_multi_delete_prepare()
|
||||||
|
#
|
||||||
|
DROP TABLE IF EXISTS t1, t2;
|
||||||
|
DROP VIEW IF EXISTS v1, v2;
|
||||||
|
CREATE TABLE t1(a INT);
|
||||||
|
CREATE TABLE t2(b INT);
|
||||||
|
CREATE VIEW v1 AS SELECT a, b FROM t1, t2;
|
||||||
|
CREATE VIEW v2 AS SELECT a FROM v1;
|
||||||
|
DELETE FROM v2;
|
||||||
|
ERROR HY000: Can not delete from join view 'test.v2'
|
||||||
|
DELETE v2 FROM v2;
|
||||||
|
ERROR HY000: Can not delete from join view 'test.v2'
|
||||||
|
DROP VIEW v2, v1;
|
||||||
|
DROP TABLE t1, t2;
|
||||||
|
|
|
@ -568,6 +568,7 @@ USE test;
|
||||||
SHOW GRANTS FOR CURRENT_USER;
|
SHOW GRANTS FOR CURRENT_USER;
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
SET GLOBAL event_scheduler = ON;
|
SET GLOBAL event_scheduler = ON;
|
||||||
CREATE TABLE events_test.event_log
|
CREATE TABLE events_test.event_log
|
||||||
(id int KEY AUTO_INCREMENT, ev_nm char(40), ev_cnt int, ev_tm timestamp)
|
(id int KEY AUTO_INCREMENT, ev_nm char(40), ev_cnt int, ev_tm timestamp)
|
||||||
|
|
|
@ -1316,3 +1316,14 @@ SELECT 1 FROM t1 ORDER BY @x:=makedate(a,a);
|
||||||
1
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
|
#
|
||||||
|
# Bug#57039: constant subtime expression returns incorrect result.
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (`date_date` datetime NOT NULL);
|
||||||
|
INSERT INTO t1 VALUES ('2008-01-03 00:00:00'), ('2008-01-03 00:00:00');
|
||||||
|
SELECT * FROM t1 WHERE date_date >= subtime(now(), "00:30:00");
|
||||||
|
date_date
|
||||||
|
SELECT * FROM t1 WHERE date_date <= addtime(date_add("2000-1-1", INTERVAL "1:1:1" HOUR_SECOND), "00:20:00");
|
||||||
|
date_date
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
|
|
@ -13,8 +13,48 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3
|
||||||
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
|
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
|
||||||
grant delete on mysqltest.* to mysqltest_1@localhost;
|
grant delete on mysqltest.* to mysqltest_1@localhost;
|
||||||
select * from mysql.user where user="mysqltest_1";
|
select * from mysql.user where user="mysqltest_1";
|
||||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
Host localhost
|
||||||
localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0
|
User mysqltest_1
|
||||||
|
Password
|
||||||
|
Select_priv N
|
||||||
|
Insert_priv N
|
||||||
|
Update_priv N
|
||||||
|
Delete_priv N
|
||||||
|
Create_priv N
|
||||||
|
Drop_priv N
|
||||||
|
Reload_priv N
|
||||||
|
Shutdown_priv N
|
||||||
|
Process_priv N
|
||||||
|
File_priv N
|
||||||
|
Grant_priv N
|
||||||
|
References_priv N
|
||||||
|
Index_priv N
|
||||||
|
Alter_priv N
|
||||||
|
Show_db_priv N
|
||||||
|
Super_priv N
|
||||||
|
Create_tmp_table_priv N
|
||||||
|
Lock_tables_priv N
|
||||||
|
Execute_priv N
|
||||||
|
Repl_slave_priv N
|
||||||
|
Repl_client_priv N
|
||||||
|
Create_view_priv N
|
||||||
|
Show_view_priv N
|
||||||
|
Create_routine_priv N
|
||||||
|
Alter_routine_priv N
|
||||||
|
Create_user_priv N
|
||||||
|
Event_priv N
|
||||||
|
Trigger_priv N
|
||||||
|
Create_tablespace_priv N
|
||||||
|
ssl_type SPECIFIED
|
||||||
|
ssl_cipher EDH-RSA-DES-CBC3-SHA
|
||||||
|
x509_issuer
|
||||||
|
x509_subject
|
||||||
|
max_questions 0
|
||||||
|
max_updates 0
|
||||||
|
max_connections 0
|
||||||
|
max_user_connections 0
|
||||||
|
plugin
|
||||||
|
authentication_string
|
||||||
show grants for mysqltest_1@localhost;
|
show grants for mysqltest_1@localhost;
|
||||||
Grants for mysqltest_1@localhost
|
Grants for mysqltest_1@localhost
|
||||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
|
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
|
||||||
|
@ -44,15 +84,95 @@ delete from mysql.user where user='mysqltest_1';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10;
|
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10;
|
||||||
select * from mysql.user where user="mysqltest_1";
|
select * from mysql.user where user="mysqltest_1";
|
||||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
Host localhost
|
||||||
localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0
|
User mysqltest_1
|
||||||
|
Password
|
||||||
|
Select_priv N
|
||||||
|
Insert_priv N
|
||||||
|
Update_priv N
|
||||||
|
Delete_priv N
|
||||||
|
Create_priv N
|
||||||
|
Drop_priv N
|
||||||
|
Reload_priv N
|
||||||
|
Shutdown_priv N
|
||||||
|
Process_priv N
|
||||||
|
File_priv N
|
||||||
|
Grant_priv N
|
||||||
|
References_priv N
|
||||||
|
Index_priv N
|
||||||
|
Alter_priv N
|
||||||
|
Show_db_priv N
|
||||||
|
Super_priv N
|
||||||
|
Create_tmp_table_priv N
|
||||||
|
Lock_tables_priv N
|
||||||
|
Execute_priv N
|
||||||
|
Repl_slave_priv N
|
||||||
|
Repl_client_priv N
|
||||||
|
Create_view_priv N
|
||||||
|
Show_view_priv N
|
||||||
|
Create_routine_priv N
|
||||||
|
Alter_routine_priv N
|
||||||
|
Create_user_priv N
|
||||||
|
Event_priv N
|
||||||
|
Trigger_priv N
|
||||||
|
Create_tablespace_priv N
|
||||||
|
ssl_type
|
||||||
|
ssl_cipher
|
||||||
|
x509_issuer
|
||||||
|
x509_subject
|
||||||
|
max_questions 10
|
||||||
|
max_updates 0
|
||||||
|
max_connections 0
|
||||||
|
max_user_connections 0
|
||||||
|
plugin
|
||||||
|
authentication_string
|
||||||
show grants for mysqltest_1@localhost;
|
show grants for mysqltest_1@localhost;
|
||||||
Grants for mysqltest_1@localhost
|
Grants for mysqltest_1@localhost
|
||||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10
|
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10
|
||||||
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30;
|
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30;
|
||||||
select * from mysql.user where user="mysqltest_1";
|
select * from mysql.user where user="mysqltest_1";
|
||||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
Host localhost
|
||||||
localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0
|
User mysqltest_1
|
||||||
|
Password
|
||||||
|
Select_priv N
|
||||||
|
Insert_priv N
|
||||||
|
Update_priv N
|
||||||
|
Delete_priv N
|
||||||
|
Create_priv N
|
||||||
|
Drop_priv N
|
||||||
|
Reload_priv N
|
||||||
|
Shutdown_priv N
|
||||||
|
Process_priv N
|
||||||
|
File_priv N
|
||||||
|
Grant_priv N
|
||||||
|
References_priv N
|
||||||
|
Index_priv N
|
||||||
|
Alter_priv N
|
||||||
|
Show_db_priv N
|
||||||
|
Super_priv N
|
||||||
|
Create_tmp_table_priv N
|
||||||
|
Lock_tables_priv N
|
||||||
|
Execute_priv N
|
||||||
|
Repl_slave_priv N
|
||||||
|
Repl_client_priv N
|
||||||
|
Create_view_priv N
|
||||||
|
Show_view_priv N
|
||||||
|
Create_routine_priv N
|
||||||
|
Alter_routine_priv N
|
||||||
|
Create_user_priv N
|
||||||
|
Event_priv N
|
||||||
|
Trigger_priv N
|
||||||
|
Create_tablespace_priv N
|
||||||
|
ssl_type
|
||||||
|
ssl_cipher
|
||||||
|
x509_issuer
|
||||||
|
x509_subject
|
||||||
|
max_questions 10
|
||||||
|
max_updates 20
|
||||||
|
max_connections 30
|
||||||
|
max_user_connections 0
|
||||||
|
plugin
|
||||||
|
authentication_string
|
||||||
show grants for mysqltest_1@localhost;
|
show grants for mysqltest_1@localhost;
|
||||||
Grants for mysqltest_1@localhost
|
Grants for mysqltest_1@localhost
|
||||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
|
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
|
||||||
|
@ -164,6 +284,7 @@ Warnings:
|
||||||
Warning 1364 Field 'ssl_cipher' doesn't have a default value
|
Warning 1364 Field 'ssl_cipher' doesn't have a default value
|
||||||
Warning 1364 Field 'x509_issuer' doesn't have a default value
|
Warning 1364 Field 'x509_issuer' doesn't have a default value
|
||||||
Warning 1364 Field 'x509_subject' doesn't have a default value
|
Warning 1364 Field 'x509_subject' doesn't have a default value
|
||||||
|
Warning 1364 Field 'authentication_string' doesn't have a default value
|
||||||
insert into mysql.db (host, db, user, select_priv) values
|
insert into mysql.db (host, db, user, select_priv) values
|
||||||
('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
|
('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
|
||||||
alter table mysql.db order by db asc;
|
alter table mysql.db order by db asc;
|
||||||
|
@ -625,16 +746,19 @@ show grants for root@localhost;
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
GRANT SELECT ON `ÂÄ`.* TO 'root'@'localhost'
|
GRANT SELECT ON `ÂÄ`.* TO 'root'@'localhost'
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
flush privileges;
|
flush privileges;
|
||||||
show grants for root@localhost;
|
show grants for root@localhost;
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
GRANT SELECT ON `ÂÄ`.* TO 'root'@'localhost'
|
GRANT SELECT ON `ÂÄ`.* TO 'root'@'localhost'
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
drop database ÂÄ;
|
drop database ÂÄ;
|
||||||
revoke all privileges on ÂÄ.* from root@localhost;
|
revoke all privileges on ÂÄ.* from root@localhost;
|
||||||
show grants for root@localhost;
|
show grants for root@localhost;
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
set names latin1;
|
set names latin1;
|
||||||
create user mysqltest_7@;
|
create user mysqltest_7@;
|
||||||
set password for mysqltest_7@ = password('systpass');
|
set password for mysqltest_7@ = password('systpass');
|
||||||
|
|
|
@ -11,7 +11,7 @@ grant create user on *.* to mysqltest_1@localhost;
|
||||||
create user mysqltest_2@localhost;
|
create user mysqltest_2@localhost;
|
||||||
grant select on `my\_1`.* to mysqltest_2@localhost;
|
grant select on `my\_1`.* to mysqltest_2@localhost;
|
||||||
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
|
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
|
||||||
ERROR 42000: You must have privileges to update tables in the mysql database to be able to change passwords for others
|
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql'
|
||||||
grant update on mysql.* to mysqltest_1@localhost;
|
grant update on mysql.* to mysqltest_1@localhost;
|
||||||
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
|
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
|
||||||
grant select on `my\_1`.* to mysqltest_3@localhost;
|
grant select on `my\_1`.* to mysqltest_3@localhost;
|
||||||
|
@ -287,6 +287,7 @@ Warnings:
|
||||||
Warning 1364 Field 'ssl_cipher' doesn't have a default value
|
Warning 1364 Field 'ssl_cipher' doesn't have a default value
|
||||||
Warning 1364 Field 'x509_issuer' doesn't have a default value
|
Warning 1364 Field 'x509_issuer' doesn't have a default value
|
||||||
Warning 1364 Field 'x509_subject' doesn't have a default value
|
Warning 1364 Field 'x509_subject' doesn't have a default value
|
||||||
|
Warning 1364 Field 'authentication_string' doesn't have a default value
|
||||||
create user mysqltest_A@'%';
|
create user mysqltest_A@'%';
|
||||||
rename user mysqltest_B@'%' to mysqltest_C@'%';
|
rename user mysqltest_B@'%' to mysqltest_C@'%';
|
||||||
drop user mysqltest_C@'%';
|
drop user mysqltest_C@'%';
|
||||||
|
@ -334,7 +335,7 @@ delete from mysql.user where user like 'mysqltest\_1';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
drop database mysqltest_1;
|
drop database mysqltest_1;
|
||||||
set password = password("changed");
|
set password = password("changed");
|
||||||
ERROR 42000: Access denied for user ''@'localhost' to database 'mysql'
|
ERROR 42000: Can't find any matching row in the user table
|
||||||
lock table mysql.user write;
|
lock table mysql.user write;
|
||||||
flush privileges;
|
flush privileges;
|
||||||
grant all on *.* to 'mysqltest_1'@'localhost';
|
grant all on *.* to 'mysqltest_1'@'localhost';
|
||||||
|
@ -354,6 +355,7 @@ Warnings:
|
||||||
Warning 1364 Field 'ssl_cipher' doesn't have a default value
|
Warning 1364 Field 'ssl_cipher' doesn't have a default value
|
||||||
Warning 1364 Field 'x509_issuer' doesn't have a default value
|
Warning 1364 Field 'x509_issuer' doesn't have a default value
|
||||||
Warning 1364 Field 'x509_subject' doesn't have a default value
|
Warning 1364 Field 'x509_subject' doesn't have a default value
|
||||||
|
Warning 1364 Field 'authentication_string' doesn't have a default value
|
||||||
INSERT INTO mysql.db (host, db, user, select_priv) VALUES
|
INSERT INTO mysql.db (host, db, user, select_priv) VALUES
|
||||||
('%','TESTDB','mysqltest_1','Y');
|
('%','TESTDB','mysqltest_1','Y');
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
|
|
|
@ -7,9 +7,11 @@ flush status;
|
||||||
show grants for current_user;
|
show grants for current_user;
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
show grants;
|
show grants;
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
create database if not exists mysqltest;
|
create database if not exists mysqltest;
|
||||||
create table mysqltest.t1 (a int,b int,c int);
|
create table mysqltest.t1 (a int,b int,c int);
|
||||||
create table mysqltest.t2 (a int,b int,c int);
|
create table mysqltest.t2 (a int,b int,c int);
|
||||||
|
|
|
@ -7,9 +7,11 @@ flush status;
|
||||||
show grants for current_user;
|
show grants for current_user;
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
show grants;
|
show grants;
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
create database if not exists mysqltest;
|
create database if not exists mysqltest;
|
||||||
create table mysqltest.t1 (a int,b int,c int);
|
create table mysqltest.t1 (a int,b int,c int);
|
||||||
create table mysqltest.t2 (a int,b int,c int);
|
create table mysqltest.t2 (a int,b int,c int);
|
||||||
|
|
|
@ -1156,6 +1156,61 @@ key1 key2 key3
|
||||||
38 38 38
|
38 38 38
|
||||||
39 39 39
|
39 39 39
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# Bug#56423: Different count with SELECT and CREATE SELECT queries
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a INT,
|
||||||
|
b INT,
|
||||||
|
c INT,
|
||||||
|
d INT,
|
||||||
|
PRIMARY KEY (a),
|
||||||
|
KEY (c),
|
||||||
|
KEY bd (b,d)
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES
|
||||||
|
(1, 0, 1, 0),
|
||||||
|
(2, 1, 1, 1),
|
||||||
|
(3, 1, 1, 1),
|
||||||
|
(4, 0, 1, 1);
|
||||||
|
EXPLAIN
|
||||||
|
SELECT a
|
||||||
|
FROM t1
|
||||||
|
WHERE c = 1 AND b = 1 AND d = 1;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 ref c,bd bd 10 const,const 2 Using where
|
||||||
|
CREATE TABLE t2 ( a INT )
|
||||||
|
SELECT a
|
||||||
|
FROM t1
|
||||||
|
WHERE c = 1 AND b = 1 AND d = 1;
|
||||||
|
SELECT * FROM t2;
|
||||||
|
a
|
||||||
|
2
|
||||||
|
3
|
||||||
|
DROP TABLE t1, t2;
|
||||||
|
CREATE TABLE t1( a INT, b INT, KEY(a), KEY(b) );
|
||||||
|
INSERT INTO t1 VALUES (1, 2), (1, 2), (1, 2), (1, 2);
|
||||||
|
SELECT * FROM t1 FORCE INDEX(a, b) WHERE a = 1 AND b = 2;
|
||||||
|
a b
|
||||||
|
1 2
|
||||||
|
1 2
|
||||||
|
1 2
|
||||||
|
1 2
|
||||||
|
DROP TABLE t1;
|
||||||
|
# Code coverage of fix.
|
||||||
|
CREATE TABLE t1 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b INT);
|
||||||
|
INSERT INTO t1 (b) VALUES (1);
|
||||||
|
UPDATE t1 SET b = 2 WHERE a = 1;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a b
|
||||||
|
1 2
|
||||||
|
CREATE TABLE t2 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(1) );
|
||||||
|
INSERT INTO t2 (b) VALUES ('a');
|
||||||
|
UPDATE t2 SET b = 'b' WHERE a = 1;
|
||||||
|
SELECT * FROM t2;
|
||||||
|
a b
|
||||||
|
1 b
|
||||||
|
DROP TABLE t1, t2;
|
||||||
#---------------- 2-sweeps read Index merge test 2 -------------------------------
|
#---------------- 2-sweeps read Index merge test 2 -------------------------------
|
||||||
SET SESSION STORAGE_ENGINE = MyISAM;
|
SET SESSION STORAGE_ENGINE = MyISAM;
|
||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
|
|
|
@ -88,6 +88,7 @@ host
|
||||||
plugin
|
plugin
|
||||||
proc
|
proc
|
||||||
procs_priv
|
procs_priv
|
||||||
|
proxy_priv
|
||||||
servers
|
servers
|
||||||
slow_log
|
slow_log
|
||||||
tables_priv
|
tables_priv
|
||||||
|
@ -684,6 +685,7 @@ Alter_routine_priv select,insert,update,references
|
||||||
max_questions select,insert,update,references
|
max_questions select,insert,update,references
|
||||||
max_connections select,insert,update,references
|
max_connections select,insert,update,references
|
||||||
max_user_connections select,insert,update,references
|
max_user_connections select,insert,update,references
|
||||||
|
authentication_string select,insert,update,references
|
||||||
use test;
|
use test;
|
||||||
create function sub1(i int) returns int
|
create function sub1(i int) returns int
|
||||||
return i+1;
|
return i+1;
|
||||||
|
@ -870,7 +872,7 @@ AND table_name not like 'ndb%' AND table_name not like 'innodb_%'
|
||||||
GROUP BY TABLE_SCHEMA;
|
GROUP BY TABLE_SCHEMA;
|
||||||
table_schema count(*)
|
table_schema count(*)
|
||||||
information_schema 30
|
information_schema 30
|
||||||
mysql 22
|
mysql 23
|
||||||
create table t1 (i int, j int);
|
create table t1 (i int, j int);
|
||||||
create trigger trg1 before insert on t1 for each row
|
create trigger trg1 before insert on t1 for each row
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -27,6 +27,7 @@ mysql.ndb_binlog_index OK
|
||||||
mysql.plugin OK
|
mysql.plugin OK
|
||||||
mysql.proc OK
|
mysql.proc OK
|
||||||
mysql.procs_priv OK
|
mysql.procs_priv OK
|
||||||
|
mysql.proxy_priv OK
|
||||||
mysql.renamed_general_log OK
|
mysql.renamed_general_log OK
|
||||||
mysql.servers OK
|
mysql.servers OK
|
||||||
mysql.slow_log OK
|
mysql.slow_log OK
|
||||||
|
|
|
@ -2632,7 +2632,8 @@ DROP TABLE IF EXISTS t1;
|
||||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||||
INSERT INTO t1 VALUES (1),(2),(3);
|
INSERT INTO t1 VALUES (1),(2),(3);
|
||||||
# Connection: con1
|
# Connection: con1
|
||||||
SET debug_sync='lock_table_for_truncate SIGNAL parked_truncate WAIT_FOR go_truncate';
|
LOCK TABLES t1 WRITE;
|
||||||
|
SET debug_sync='upgrade_lock_for_truncate SIGNAL parked_truncate WAIT_FOR go_truncate';
|
||||||
TRUNCATE TABLE t1;
|
TRUNCATE TABLE t1;
|
||||||
# Connection: default
|
# Connection: default
|
||||||
SET debug_sync='now WAIT_FOR parked_truncate';
|
SET debug_sync='now WAIT_FOR parked_truncate';
|
||||||
|
@ -2647,10 +2648,11 @@ FLUSH TABLES t1;
|
||||||
# Connection: default
|
# Connection: default
|
||||||
SET debug_sync='now WAIT_FOR parked_flush';
|
SET debug_sync='now WAIT_FOR parked_flush';
|
||||||
SET debug_sync='now SIGNAL go_truncate';
|
SET debug_sync='now SIGNAL go_truncate';
|
||||||
# Connection: con1
|
# Ensure that truncate waits for a exclusive lock
|
||||||
# Reaping...
|
|
||||||
# Connection: default
|
|
||||||
SET debug_sync= 'now SIGNAL go_show';
|
SET debug_sync= 'now SIGNAL go_show';
|
||||||
|
# Connection: con1 (TRUNCATE)
|
||||||
|
# Reaping...
|
||||||
|
UNLOCK TABLES;
|
||||||
# Connection: con2 (SHOW FIELDS FROM t1)
|
# Connection: con2 (SHOW FIELDS FROM t1)
|
||||||
# Reaping...
|
# Reaping...
|
||||||
Field Type Null Key Default Extra
|
Field Type Null Key Default Extra
|
||||||
|
|
|
@ -3486,12 +3486,13 @@ ALTER TABLE m1 ADD INDEX (c1);
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
DROP TABLE m1, t1;
|
DROP TABLE m1, t1;
|
||||||
#
|
#
|
||||||
# Locking the merge table will implicitly lock children.
|
# Locking the merge table won't implicitly lock children.
|
||||||
#
|
#
|
||||||
CREATE TABLE t1 (c1 INT);
|
CREATE TABLE t1 (c1 INT);
|
||||||
CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1);
|
CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1);
|
||||||
LOCK TABLE m1 WRITE;
|
LOCK TABLE m1 WRITE;
|
||||||
ALTER TABLE t1 ADD INDEX (c1);
|
ALTER TABLE t1 ADD INDEX (c1);
|
||||||
|
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||||
LOCK TABLE m1 WRITE, t1 WRITE;
|
LOCK TABLE m1 WRITE, t1 WRITE;
|
||||||
ALTER TABLE t1 ADD INDEX (c1);
|
ALTER TABLE t1 ADD INDEX (c1);
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
@ -3661,4 +3662,16 @@ REPAIR TABLE t2 USE_FRM;
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t2 repair note The storage engine for the table doesn't support repair
|
test.t2 repair note The storage engine for the table doesn't support repair
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
#
|
||||||
|
# Bug#57002 Assert in upgrade_shared_lock_to_exclusive()
|
||||||
|
# for ALTER TABLE + MERGE tables
|
||||||
|
#
|
||||||
|
DROP TABLE IF EXISTS t1, m1;
|
||||||
|
CREATE TABLE t1(a INT) engine=myisam;
|
||||||
|
CREATE TABLE m1(a INT) engine=merge UNION(t1);
|
||||||
|
LOCK TABLES t1 READ, m1 WRITE;
|
||||||
|
ALTER TABLE t1 engine=myisam;
|
||||||
|
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||||
|
UNLOCK TABLES;
|
||||||
|
DROP TABLE m1, t1;
|
||||||
End of 6.0 tests
|
End of 6.0 tests
|
||||||
|
|
|
@ -15,6 +15,7 @@ mysql.ndb_binlog_index OK
|
||||||
mysql.plugin OK
|
mysql.plugin OK
|
||||||
mysql.proc OK
|
mysql.proc OK
|
||||||
mysql.procs_priv OK
|
mysql.procs_priv OK
|
||||||
|
mysql.proxy_priv OK
|
||||||
mysql.servers OK
|
mysql.servers OK
|
||||||
mysql.slow_log OK
|
mysql.slow_log OK
|
||||||
mysql.tables_priv OK
|
mysql.tables_priv OK
|
||||||
|
@ -43,6 +44,7 @@ mysql.ndb_binlog_index OK
|
||||||
mysql.plugin OK
|
mysql.plugin OK
|
||||||
mysql.proc OK
|
mysql.proc OK
|
||||||
mysql.procs_priv OK
|
mysql.procs_priv OK
|
||||||
|
mysql.proxy_priv OK
|
||||||
mysql.servers OK
|
mysql.servers OK
|
||||||
mysql.slow_log OK
|
mysql.slow_log OK
|
||||||
mysql.tables_priv OK
|
mysql.tables_priv OK
|
||||||
|
@ -71,6 +73,7 @@ mysql.ndb_binlog_index OK
|
||||||
mysql.plugin OK
|
mysql.plugin OK
|
||||||
mysql.proc OK
|
mysql.proc OK
|
||||||
mysql.procs_priv OK
|
mysql.procs_priv OK
|
||||||
|
mysql.proxy_priv OK
|
||||||
mysql.servers OK
|
mysql.servers OK
|
||||||
mysql.slow_log OK
|
mysql.slow_log OK
|
||||||
mysql.tables_priv OK
|
mysql.tables_priv OK
|
||||||
|
@ -101,6 +104,7 @@ mysql.ndb_binlog_index OK
|
||||||
mysql.plugin OK
|
mysql.plugin OK
|
||||||
mysql.proc OK
|
mysql.proc OK
|
||||||
mysql.procs_priv OK
|
mysql.procs_priv OK
|
||||||
|
mysql.proxy_priv OK
|
||||||
mysql.servers OK
|
mysql.servers OK
|
||||||
mysql.slow_log OK
|
mysql.slow_log OK
|
||||||
mysql.tables_priv OK
|
mysql.tables_priv OK
|
||||||
|
@ -135,6 +139,7 @@ mysql.ndb_binlog_index OK
|
||||||
mysql.plugin OK
|
mysql.plugin OK
|
||||||
mysql.proc OK
|
mysql.proc OK
|
||||||
mysql.procs_priv OK
|
mysql.procs_priv OK
|
||||||
|
mysql.proxy_priv OK
|
||||||
mysql.servers OK
|
mysql.servers OK
|
||||||
mysql.slow_log OK
|
mysql.slow_log OK
|
||||||
mysql.tables_priv OK
|
mysql.tables_priv OK
|
||||||
|
@ -172,6 +177,7 @@ mysql.ndb_binlog_index OK
|
||||||
mysql.plugin OK
|
mysql.plugin OK
|
||||||
mysql.proc OK
|
mysql.proc OK
|
||||||
mysql.procs_priv OK
|
mysql.procs_priv OK
|
||||||
|
mysql.proxy_priv OK
|
||||||
mysql.servers OK
|
mysql.servers OK
|
||||||
mysql.slow_log OK
|
mysql.slow_log OK
|
||||||
mysql.tables_priv OK
|
mysql.tables_priv OK
|
||||||
|
|
|
@ -17,6 +17,7 @@ mysql.ndb_binlog_index OK
|
||||||
mysql.plugin OK
|
mysql.plugin OK
|
||||||
mysql.proc OK
|
mysql.proc OK
|
||||||
mysql.procs_priv OK
|
mysql.procs_priv OK
|
||||||
|
mysql.proxy_priv OK
|
||||||
mysql.servers OK
|
mysql.servers OK
|
||||||
mysql.slow_log OK
|
mysql.slow_log OK
|
||||||
mysql.tables_priv OK
|
mysql.tables_priv OK
|
||||||
|
|
|
@ -18,6 +18,7 @@ mysql.ndb_binlog_index OK
|
||||||
mysql.plugin OK
|
mysql.plugin OK
|
||||||
mysql.proc OK
|
mysql.proc OK
|
||||||
mysql.procs_priv OK
|
mysql.procs_priv OK
|
||||||
|
mysql.proxy_priv OK
|
||||||
mysql.servers OK
|
mysql.servers OK
|
||||||
mysql.slow_log
|
mysql.slow_log
|
||||||
note : The storage engine for the table doesn't support optimize
|
note : The storage engine for the table doesn't support optimize
|
||||||
|
@ -43,6 +44,7 @@ mysql.ndb_binlog_index OK
|
||||||
mysql.plugin OK
|
mysql.plugin OK
|
||||||
mysql.proc OK
|
mysql.proc OK
|
||||||
mysql.procs_priv OK
|
mysql.procs_priv OK
|
||||||
|
mysql.proxy_priv OK
|
||||||
mysql.servers OK
|
mysql.servers OK
|
||||||
mysql.slow_log
|
mysql.slow_log
|
||||||
note : The storage engine for the table doesn't support optimize
|
note : The storage engine for the table doesn't support optimize
|
||||||
|
|
|
@ -919,7 +919,6 @@ slave-transaction-retries 10
|
||||||
slave-type-conversions
|
slave-type-conversions
|
||||||
slow-launch-time 2
|
slow-launch-time 2
|
||||||
slow-query-log FALSE
|
slow-query-log FALSE
|
||||||
socket MySQL
|
|
||||||
sort-buffer-size 2097152
|
sort-buffer-size 2097152
|
||||||
sporadic-binlog-dump-fail FALSE
|
sporadic-binlog-dump-fail FALSE
|
||||||
sql-mode
|
sql-mode
|
||||||
|
|
|
@ -109,20 +109,13 @@ Database: information_schema
|
||||||
| TRIGGERS |
|
| TRIGGERS |
|
||||||
| USER_PRIVILEGES |
|
| USER_PRIVILEGES |
|
||||||
| VIEWS |
|
| VIEWS |
|
||||||
| INNODB_SYS_FIELDS |
|
|
||||||
| INNODB_TRX |
|
|
||||||
| INNODB_SYS_INDEXES |
|
|
||||||
| INNODB_LOCK_WAITS |
|
|
||||||
| INNODB_SYS_TABLESTATS |
|
|
||||||
| INNODB_CMP |
|
|
||||||
| INNODB_SYS_COLUMNS |
|
|
||||||
| INNODB_CMP_RESET |
|
| INNODB_CMP_RESET |
|
||||||
| INNODB_SYS_FOREIGN_COLS |
|
| INNODB_TRX |
|
||||||
| INNODB_LOCKS |
|
|
||||||
| INNODB_CMPMEM_RESET |
|
| INNODB_CMPMEM_RESET |
|
||||||
|
| INNODB_LOCK_WAITS |
|
||||||
| INNODB_CMPMEM |
|
| INNODB_CMPMEM |
|
||||||
| INNODB_SYS_FOREIGN |
|
| INNODB_CMP |
|
||||||
| INNODB_SYS_TABLES |
|
| INNODB_LOCKS |
|
||||||
+---------------------------------------+
|
+---------------------------------------+
|
||||||
Database: INFORMATION_SCHEMA
|
Database: INFORMATION_SCHEMA
|
||||||
+---------------------------------------+
|
+---------------------------------------+
|
||||||
|
@ -158,20 +151,13 @@ Database: INFORMATION_SCHEMA
|
||||||
| TRIGGERS |
|
| TRIGGERS |
|
||||||
| USER_PRIVILEGES |
|
| USER_PRIVILEGES |
|
||||||
| VIEWS |
|
| VIEWS |
|
||||||
| INNODB_SYS_FIELDS |
|
|
||||||
| INNODB_TRX |
|
|
||||||
| INNODB_SYS_INDEXES |
|
|
||||||
| INNODB_LOCK_WAITS |
|
|
||||||
| INNODB_SYS_TABLESTATS |
|
|
||||||
| INNODB_CMP |
|
|
||||||
| INNODB_SYS_COLUMNS |
|
|
||||||
| INNODB_CMP_RESET |
|
| INNODB_CMP_RESET |
|
||||||
| INNODB_SYS_FOREIGN_COLS |
|
| INNODB_TRX |
|
||||||
| INNODB_LOCKS |
|
|
||||||
| INNODB_CMPMEM_RESET |
|
| INNODB_CMPMEM_RESET |
|
||||||
|
| INNODB_LOCK_WAITS |
|
||||||
| INNODB_CMPMEM |
|
| INNODB_CMPMEM |
|
||||||
| INNODB_SYS_FOREIGN |
|
| INNODB_CMP |
|
||||||
| INNODB_SYS_TABLES |
|
| INNODB_LOCKS |
|
||||||
+---------------------------------------+
|
+---------------------------------------+
|
||||||
Wildcard: inf_rmation_schema
|
Wildcard: inf_rmation_schema
|
||||||
+--------------------+
|
+--------------------+
|
||||||
|
|
|
@ -177,6 +177,9 @@ mysqltest: At line 1: End of line junk detected: "disconnect default # comment
|
||||||
"
|
"
|
||||||
mysqltest: At line 1: Extra delimiter ";" found
|
mysqltest: At line 1: Extra delimiter ";" found
|
||||||
mysqltest: At line 1: Extra delimiter ";" found
|
mysqltest: At line 1: Extra delimiter ";" found
|
||||||
|
mysqltest: At line 1: Spurious text after `query` expression
|
||||||
|
mysqltest: At line 1: Spurious text after `query` expression
|
||||||
|
mysqltest: At line 2: Spurious text after `query` expression
|
||||||
mysqltest: At line 1: Missing argument(s) to 'error'
|
mysqltest: At line 1: Missing argument(s) to 'error'
|
||||||
mysqltest: At line 1: Missing argument(s) to 'error'
|
mysqltest: At line 1: Missing argument(s) to 'error'
|
||||||
mysqltest: At line 1: The sqlstate definition must start with an uppercase S
|
mysqltest: At line 1: The sqlstate definition must start with an uppercase S
|
||||||
|
@ -366,23 +369,24 @@ mysqltest: At line 1: Missing required argument 'sleep_delay' to command 'real_s
|
||||||
mysqltest: At line 1: Invalid argument to sleep "abc"
|
mysqltest: At line 1: Invalid argument to sleep "abc"
|
||||||
mysqltest: At line 1: Invalid argument to real_sleep "abc"
|
mysqltest: At line 1: Invalid argument to real_sleep "abc"
|
||||||
1
|
1
|
||||||
2
|
|
||||||
101
|
101
|
||||||
hej
|
-99
|
||||||
1
|
|
||||||
mysqltest: At line 1: Missing argument to inc
|
mysqltest: At line 1: Missing argument to inc
|
||||||
mysqltest: At line 1: The argument to inc must be a variable (start with $)
|
mysqltest: At line 1: The argument to inc must be a variable (start with $)
|
||||||
|
mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
|
||||||
mysqltest: At line 1: End of line junk detected: "1000"
|
mysqltest: At line 1: End of line junk detected: "1000"
|
||||||
4
|
mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
|
||||||
4
|
mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
|
||||||
|
-96
|
||||||
|
-96
|
||||||
-1
|
-1
|
||||||
-2
|
|
||||||
99
|
99
|
||||||
hej
|
|
||||||
-1
|
|
||||||
mysqltest: At line 1: Missing argument to dec
|
mysqltest: At line 1: Missing argument to dec
|
||||||
mysqltest: At line 1: The argument to dec must be a variable (start with $)
|
mysqltest: At line 1: The argument to dec must be a variable (start with $)
|
||||||
|
mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
|
||||||
mysqltest: At line 1: End of line junk detected: "1000"
|
mysqltest: At line 1: End of line junk detected: "1000"
|
||||||
|
mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
|
||||||
|
mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
|
||||||
mysqltest: At line 1: Missing arguments to system, nothing to do!
|
mysqltest: At line 1: Missing arguments to system, nothing to do!
|
||||||
mysqltest: At line 1: Missing arguments to system, nothing to do!
|
mysqltest: At line 1: Missing arguments to system, nothing to do!
|
||||||
system command 'NonExistsinfComamdn 2> /dev/null' failed
|
system command 'NonExistsinfComamdn 2> /dev/null' failed
|
||||||
|
@ -449,12 +453,16 @@ mysqltest: At line 1: Missing required argument 'host' to command 'connect'
|
||||||
mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1049: Unknown database 'illegal_db'
|
mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1049: Unknown database 'illegal_db'
|
||||||
mysqltest: At line 1: Illegal argument for port: 'illegal_port'
|
mysqltest: At line 1: Illegal argument for port: 'illegal_port'
|
||||||
mysqltest: At line 1: Illegal option to connect: SMTP
|
mysqltest: At line 1: Illegal option to connect: SMTP
|
||||||
OK
|
200 connects succeeded
|
||||||
mysqltest: The test didn't produce any output
|
|
||||||
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 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": At line 2: Connection test_con1 already exists
|
||||||
show tables;
|
show tables;
|
||||||
ERROR 3D000: No database selected
|
ERROR 3D000: No database selected
|
||||||
|
connect con1,localhost,root,,;
|
||||||
|
connection default;
|
||||||
|
connection con1;
|
||||||
|
disconnect con1;
|
||||||
|
connection default;
|
||||||
Output from mysqltest-x.inc
|
Output from mysqltest-x.inc
|
||||||
Output from mysqltest-x.inc
|
Output from mysqltest-x.inc
|
||||||
Output from mysqltest-x.inc
|
Output from mysqltest-x.inc
|
||||||
|
|
|
@ -1,5 +1,20 @@
|
||||||
drop table if exists t1, t2;
|
drop table if exists t1, t2;
|
||||||
#
|
#
|
||||||
|
# Bug#57113: ha_partition::extra(ha_extra_function):
|
||||||
|
# Assertion `m_extra_cache' failed
|
||||||
|
CREATE TABLE t1
|
||||||
|
(id INT NOT NULL PRIMARY KEY,
|
||||||
|
name VARCHAR(16) NOT NULL,
|
||||||
|
year YEAR,
|
||||||
|
INDEX name (name(8))
|
||||||
|
)
|
||||||
|
PARTITION BY HASH(id) PARTITIONS 2;
|
||||||
|
INSERT INTO t1 VALUES ( 1, 'FooBar', '1924' );
|
||||||
|
CREATE TABLE t2 (id INT);
|
||||||
|
INSERT INTO t2 VALUES (1),(2);
|
||||||
|
UPDATE t1, t2 SET t1.year = '1955' WHERE t1.name = 'FooBar';
|
||||||
|
DROP TABLE t1, t2;
|
||||||
|
#
|
||||||
# Bug#55458: Partitioned MyISAM table gets crashed by multi-table update
|
# Bug#55458: Partitioned MyISAM table gets crashed by multi-table update
|
||||||
#
|
#
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
|
@ -551,12 +566,12 @@ create table t1 (a bigint)
|
||||||
partition by range (a)
|
partition by range (a)
|
||||||
(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
|
(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
|
||||||
partition p1 values less than (10));
|
partition p1 values less than (10));
|
||||||
ERROR HY000: VALUES value must be of same type as partition function
|
ERROR HY000: VALUES value for partition 'p0' must have type INT
|
||||||
create table t1 (a bigint)
|
create table t1 (a bigint)
|
||||||
partition by list (a)
|
partition by list (a)
|
||||||
(partition p0 values in (0xFFFFFFFFFFFFFFFF),
|
(partition p0 values in (0xFFFFFFFFFFFFFFFF),
|
||||||
partition p1 values in (10));
|
partition p1 values in (10));
|
||||||
ERROR HY000: VALUES value must be of same type as partition function
|
ERROR HY000: VALUES value for partition 'p0' must have type INT
|
||||||
create table t1 (a bigint unsigned)
|
create table t1 (a bigint unsigned)
|
||||||
partition by range (a)
|
partition by range (a)
|
||||||
(partition p0 values less than (100),
|
(partition p0 values less than (100),
|
||||||
|
|
|
@ -1,4 +1,125 @@
|
||||||
drop table if exists t1;
|
drop table if exists t1, t2;
|
||||||
|
#
|
||||||
|
# Bug#50036: Inconsistent errors when using TIMESTAMP
|
||||||
|
# columns/expressions
|
||||||
|
# 1. correct and appropriate errors in light of
|
||||||
|
# the fix for BUG#42849:
|
||||||
|
CREATE TABLE t1 (c TIMESTAMP)
|
||||||
|
PARTITION BY RANGE (TO_DAYS(c))
|
||||||
|
(PARTITION p0 VALUES LESS THAN (10000),
|
||||||
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
||||||
|
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||||
|
CREATE TABLE t2 (c TIMESTAMP);
|
||||||
|
ALTER TABLE t2
|
||||||
|
PARTITION BY RANGE (TO_DAYS(c))
|
||||||
|
(PARTITION p0 VALUES LESS THAN (10000),
|
||||||
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
||||||
|
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||||
|
CREATE TABLE t1 (c TIMESTAMP)
|
||||||
|
PARTITION BY RANGE COLUMNS(c)
|
||||||
|
(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
|
||||||
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
||||||
|
ERROR HY000: Field 'c' is of a not allowed type for this type of partitioning
|
||||||
|
ALTER TABLE t2 PARTITION BY RANGE COLUMNS(c)
|
||||||
|
(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
|
||||||
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
||||||
|
ERROR HY000: Field 'c' is of a not allowed type for this type of partitioning
|
||||||
|
DROP TABLE t2;
|
||||||
|
# 2. These errors where questionable before the fix:
|
||||||
|
# VALUES clause are checked first, clearified the error message.
|
||||||
|
CREATE TABLE t1 (c TIMESTAMP)
|
||||||
|
PARTITION BY RANGE (c)
|
||||||
|
(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
|
||||||
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
||||||
|
ERROR HY000: VALUES value for partition 'p0' must have type INT
|
||||||
|
# TIMESTAMP is not INT (e.g. UNIX_TIMESTAMP).
|
||||||
|
CREATE TABLE t1 (c TIMESTAMP)
|
||||||
|
PARTITION BY RANGE (UNIX_TIMESTAMP(c))
|
||||||
|
(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
|
||||||
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
||||||
|
ERROR HY000: VALUES value for partition 'p0' must have type INT
|
||||||
|
CREATE TABLE t1 (c TIMESTAMP)
|
||||||
|
PARTITION BY RANGE (UNIX_TIMESTAMP(c))
|
||||||
|
(PARTITION p0 VALUES LESS THAN (UNIX_TIMESTAMP('2000-01-01 00:00:00')),
|
||||||
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
||||||
|
DROP TABLE t1;
|
||||||
|
# Changed error from ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
|
||||||
|
CREATE TABLE t1 (c TIMESTAMP)
|
||||||
|
PARTITION BY HASH (c) PARTITIONS 4;
|
||||||
|
ERROR HY000: Field 'c' is of a not allowed type for this type of partitioning
|
||||||
|
# Added test with existing TIMESTAMP partitioning (when it was allowed).
|
||||||
|
CREATE TABLE t1 (a TIMESTAMP)
|
||||||
|
PARTITION BY HASH (UNIX_TIMESTAMP(a));
|
||||||
|
INSERT INTO t1 VALUES ('2000-01-02 03:04:05');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a
|
||||||
|
2000-01-02 03:04:05
|
||||||
|
FLUSH TABLES;
|
||||||
|
# replacing t1.frm with TO_DAYS(a) which was allowed earlier.
|
||||||
|
# Disable warnings, since the result would differ when running with
|
||||||
|
# --ps-protocol (only for the 'SELECT * FROM t1' statement).
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a
|
||||||
|
2000-01-02 03:04:05
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
/*!50100 PARTITION BY HASH (TO_DAYS(a)) */
|
||||||
|
INSERT INTO t1 VALUES ('2001-02-03 04:05:06');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a
|
||||||
|
2000-01-02 03:04:05
|
||||||
|
2001-02-03 04:05:06
|
||||||
|
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
|
||||||
|
Warnings:
|
||||||
|
Warning 1486 Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||||
|
ALTER TABLE t1
|
||||||
|
PARTITION BY RANGE (TO_DAYS(a))
|
||||||
|
(PARTITION p0 VALUES LESS THAN (10000),
|
||||||
|
PARTITION p1 VALUES LESS THAN (MAXVALUE));
|
||||||
|
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
/*!50100 PARTITION BY HASH (TO_DAYS(a))
|
||||||
|
PARTITIONS 3 */
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
/*!50100 PARTITION BY HASH (TO_DAYS(a))
|
||||||
|
PARTITIONS 3 */
|
||||||
|
Warnings:
|
||||||
|
Warning 1486 Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||||
|
DROP TABLE t2;
|
||||||
|
CREATE TABLE t2 SELECT * FROM t1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
ALTER TABLE t1 PARTITION BY HASH (UNIX_TIMESTAMP(a));
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
/*!50100 PARTITION BY HASH (UNIX_TIMESTAMP(a)) */
|
||||||
|
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
/*!50100 PARTITION BY HASH (UNIX_TIMESTAMP(a))
|
||||||
|
PARTITIONS 3 */
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a
|
||||||
|
2000-01-02 03:04:05
|
||||||
|
2001-02-03 04:05:06
|
||||||
|
DROP TABLE t1;
|
||||||
#
|
#
|
||||||
# Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
|
# Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
|
||||||
#
|
#
|
||||||
|
@ -497,7 +618,7 @@ partition by range (a)
|
||||||
partitions 2
|
partitions 2
|
||||||
(partition x1 values less than (4.0) tablespace ts1,
|
(partition x1 values less than (4.0) tablespace ts1,
|
||||||
partition x2 values less than (8) tablespace ts2);
|
partition x2 values less than (8) tablespace ts2);
|
||||||
ERROR HY000: VALUES value must be of same type as partition function
|
ERROR HY000: VALUES value for partition 'x1' must have type INT
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
a int not null,
|
a int not null,
|
||||||
b int not null,
|
b int not null,
|
||||||
|
@ -736,7 +857,7 @@ partition by list (a)
|
||||||
partitions 2
|
partitions 2
|
||||||
(partition x1 values in (4.0, 12+8),
|
(partition x1 values in (4.0, 12+8),
|
||||||
partition x2 values in (3, 21));
|
partition x2 values in (3, 21));
|
||||||
ERROR HY000: VALUES value must be of same type as partition function
|
ERROR HY000: VALUES value for partition 'x1' must have type INT
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
a int not null,
|
a int not null,
|
||||||
b int not null,
|
b int not null,
|
||||||
|
@ -796,12 +917,12 @@ CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||||
PARTITION BY RANGE (a) (
|
PARTITION BY RANGE (a) (
|
||||||
PARTITION p VALUES LESS THAN (20080819),
|
PARTITION p VALUES LESS THAN (20080819),
|
||||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||||
ERROR HY000: The PARTITION function returns the wrong type
|
ERROR HY000: Field 'a' is of a not allowed type for this type of partitioning
|
||||||
ALTER TABLE old
|
ALTER TABLE old
|
||||||
PARTITION BY RANGE (a) (
|
PARTITION BY RANGE (a) (
|
||||||
PARTITION p VALUES LESS THAN (20080819),
|
PARTITION p VALUES LESS THAN (20080819),
|
||||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||||
ERROR HY000: The PARTITION function returns the wrong type
|
ERROR HY000: Field 'a' is of a not allowed type for this type of partitioning
|
||||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||||
PARTITION BY RANGE (a+0) (
|
PARTITION BY RANGE (a+0) (
|
||||||
PARTITION p VALUES LESS THAN (20080819),
|
PARTITION p VALUES LESS THAN (20080819),
|
||||||
|
@ -1075,4 +1196,14 @@ PARTITION p VALUES LESS THAN (1219089600),
|
||||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||||
DROP TABLE old;
|
DROP TABLE old;
|
||||||
|
#
|
||||||
|
# Bug #56709: Memory leaks at running the 5.1 test suite
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a TIMESTAMP NOT NULL PRIMARY KEY);
|
||||||
|
ALTER TABLE t1
|
||||||
|
PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
|
||||||
|
PARTITION p VALUES LESS THAN (18),
|
||||||
|
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||||
|
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||||
|
DROP TABLE t1;
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
|
|
237
mysql-test/r/plugin_auth.result
Normal file
237
mysql-test/r/plugin_auth.result
Normal file
|
@ -0,0 +1,237 @@
|
||||||
|
SELECT PLUGIN_STATUS, PLUGIN_TYPE, PLUGIN_DESCRIPTION
|
||||||
|
FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='test_plugin_server';
|
||||||
|
PLUGIN_STATUS ACTIVE
|
||||||
|
PLUGIN_TYPE AUTHENTICATION
|
||||||
|
PLUGIN_DESCRIPTION plugin API test plugin
|
||||||
|
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||||
|
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||||
|
SELECT plugin,authentication_string FROM mysql.user WHERE User='plug';
|
||||||
|
plugin authentication_string
|
||||||
|
test_plugin_server plug_dest
|
||||||
|
## test plugin auth
|
||||||
|
ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES)
|
||||||
|
GRANT PROXY ON plug_dest TO plug;
|
||||||
|
select USER(),CURRENT_USER();
|
||||||
|
USER() CURRENT_USER()
|
||||||
|
plug@localhost plug_dest@%
|
||||||
|
## test SET PASSWORD
|
||||||
|
SET PASSWORD = PASSWORD('plug_dest');
|
||||||
|
Warnings:
|
||||||
|
Note 1699 SET PASSWORD has no significance for users authenticating via plugins
|
||||||
|
## test bad credentials
|
||||||
|
ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES)
|
||||||
|
## test bad default plugin : should get CR_AUTH_PLUGIN_CANNOT_LOAD
|
||||||
|
## test correct default plugin
|
||||||
|
select USER(),CURRENT_USER();
|
||||||
|
USER() CURRENT_USER()
|
||||||
|
plug@localhost plug@%
|
||||||
|
## test no_auto_create_user sql mode with plugin users
|
||||||
|
SET @@sql_mode=no_auto_create_user;
|
||||||
|
GRANT INSERT ON TEST.* TO grant_user IDENTIFIED WITH 'test_plugin_server';
|
||||||
|
SET @@sql_mode=default;
|
||||||
|
DROP USER grant_user;
|
||||||
|
## test utf-8 user name
|
||||||
|
CREATE USER `Ÿ` IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||||
|
GRANT PROXY ON plug_dest TO `Ÿ`;
|
||||||
|
select USER(),CURRENT_USER();
|
||||||
|
USER() CURRENT_USER()
|
||||||
|
Ÿ@localhost plug_dest@%
|
||||||
|
DROP USER `Ÿ`;
|
||||||
|
## test GRANT ... IDENTIFIED WITH/BY ...
|
||||||
|
CREATE DATABASE test_grant_db;
|
||||||
|
# create new user via GRANT WITH
|
||||||
|
GRANT ALL PRIVILEGES ON test_grant_db.* TO new_grant_user
|
||||||
|
IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||||
|
GRANT PROXY ON plug_dest TO new_grant_user;
|
||||||
|
select USER(),CURRENT_USER();
|
||||||
|
USER() CURRENT_USER()
|
||||||
|
new_grant_user@localhost plug_dest@%
|
||||||
|
USE test_grant_db;
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
DROP TABLE t1;
|
||||||
|
REVOKE ALL PRIVILEGES ON test_grant_db.* FROM new_grant_user;
|
||||||
|
# try re-create existing user via GRANT IDENTIFIED BY
|
||||||
|
GRANT ALL PRIVILEGES ON test_grant_db.* TO new_grant_user
|
||||||
|
IDENTIFIED BY 'unused_password';
|
||||||
|
# make sure password doesn't take precendence
|
||||||
|
ERROR 28000: Access denied for user 'new_grant_user'@'localhost' (using password: YES)
|
||||||
|
#make sure plugin auth still available
|
||||||
|
select USER(),CURRENT_USER();
|
||||||
|
USER() CURRENT_USER()
|
||||||
|
new_grant_user@localhost plug_dest@%
|
||||||
|
USE test_grant_db;
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP USER new_grant_user;
|
||||||
|
# try re-create existing user via GRANT IDENTIFIED WITH
|
||||||
|
GRANT ALL PRIVILEGES ON test_grant_db.* TO plug
|
||||||
|
IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||||
|
ERROR HY000: GRANT with IDENTIFIED WITH is illegal because the user plug already exists
|
||||||
|
GRANT ALL PRIVILEGES ON test_grant_db.* TO plug_dest
|
||||||
|
IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||||
|
ERROR HY000: GRANT with IDENTIFIED WITH is illegal because the user plug_dest already exists
|
||||||
|
REVOKE SELECT on test_grant_db.* FROM joro
|
||||||
|
INDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||||
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'' at line 2
|
||||||
|
REVOKE SELECT on test_grant_db.* FROM joro
|
||||||
|
INDENTIFIED BY 'plug_dest_passwd';
|
||||||
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INDENTIFIED BY 'plug_dest_passwd'' at line 2
|
||||||
|
REVOKE SELECT on test_grant_db.* FROM joro
|
||||||
|
INDENTIFIED BY PASSWORD 'plug_dest_passwd';
|
||||||
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INDENTIFIED BY PASSWORD 'plug_dest_passwd'' at line 2
|
||||||
|
DROP DATABASE test_grant_db;
|
||||||
|
## GRANT PROXY tests
|
||||||
|
CREATE USER grant_plug IDENTIFIED WITH 'test_plugin_server'
|
||||||
|
AS 'grant_plug_dest';
|
||||||
|
CREATE USER grant_plug_dest IDENTIFIED BY 'grant_plug_dest_passwd';
|
||||||
|
CREATE USER grant_plug_dest2 IDENTIFIED BY 'grant_plug_dest_passwd2';
|
||||||
|
# ALL PRIVILEGES doesn't include PROXY
|
||||||
|
GRANT ALL PRIVILEGES ON *.* TO grant_plug;
|
||||||
|
ERROR 28000: Access denied for user 'grant_plug'@'localhost' (using password: YES)
|
||||||
|
GRANT ALL PRIVILEGES,PROXY ON grant_plug_dest TO grant_plug;
|
||||||
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PROXY ON grant_plug_dest TO grant_plug' at line 1
|
||||||
|
this should fail : can't combine PROXY
|
||||||
|
GRANT ALL SELECT,PROXY ON grant_plug_dest TO grant_plug;
|
||||||
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT,PROXY ON grant_plug_dest TO grant_plug' at line 1
|
||||||
|
# this should fail : no such grant
|
||||||
|
REVOKE PROXY ON grant_plug_dest FROM grant_plug;
|
||||||
|
ERROR 42000: There is no such grant defined for user 'grant_plug' on host '%'
|
||||||
|
in grant_plug_dest_con
|
||||||
|
## testing what an ordinary user can grant
|
||||||
|
this should fail : no rights to grant all
|
||||||
|
GRANT PROXY ON ''@'' TO grant_plug;
|
||||||
|
ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
|
||||||
|
this should fail : not the same user
|
||||||
|
GRANT PROXY ON grant_plug TO grant_plug_dest;
|
||||||
|
ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
|
||||||
|
this should fail : same user, but on a different host
|
||||||
|
GRANT PROXY ON grant_plug_dest TO grant_plug;
|
||||||
|
ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
|
||||||
|
this should work : same user
|
||||||
|
GRANT PROXY ON grant_plug_dest@localhost TO grant_plug_dest2;
|
||||||
|
REVOKE PROXY ON grant_plug_dest@localhost FROM grant_plug_dest2;
|
||||||
|
this should work : same user
|
||||||
|
GRANT PROXY ON grant_plug_dest@localhost TO grant_plug WITH GRANT OPTION;
|
||||||
|
REVOKE PROXY ON grant_plug_dest@localhost FROM grant_plug;
|
||||||
|
this should fail : can't create users
|
||||||
|
GRANT PROXY ON grant_plug_dest@localhost TO grant_plug@localhost;
|
||||||
|
ERROR 42000: You are not allowed to create a user with GRANT
|
||||||
|
in default connection
|
||||||
|
# test what root can grant
|
||||||
|
should work : root has PROXY to all users
|
||||||
|
GRANT PROXY ON ''@'' TO grant_plug;
|
||||||
|
REVOKE PROXY ON ''@'' FROM grant_plug;
|
||||||
|
should work : root has PROXY to all users
|
||||||
|
GRANT PROXY ON ''@'' TO proxy_admin IDENTIFIED BY 'test'
|
||||||
|
WITH GRANT OPTION;
|
||||||
|
need USAGE : PROXY doesn't contain it.
|
||||||
|
GRANT USAGE on *.* TO proxy_admin;
|
||||||
|
in proxy_admin_con;
|
||||||
|
should work : proxy_admin has proxy to ''@''
|
||||||
|
GRANT PROXY ON future_user TO grant_plug;
|
||||||
|
in default connection
|
||||||
|
SHOW GRANTS FOR grant_plug;
|
||||||
|
Grants for grant_plug@%
|
||||||
|
GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' WITH GRANT OPTION
|
||||||
|
GRANT PROXY ON 'future_user'@'%' TO 'grant_plug'@'%'
|
||||||
|
REVOKE PROXY ON future_user FROM grant_plug;
|
||||||
|
SHOW GRANTS FOR grant_plug;
|
||||||
|
Grants for grant_plug@%
|
||||||
|
GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' WITH GRANT OPTION
|
||||||
|
## testing drop user
|
||||||
|
CREATE USER test_drop@localhost;
|
||||||
|
GRANT PROXY ON future_user TO test_drop@localhost;
|
||||||
|
SHOW GRANTS FOR test_drop@localhost;
|
||||||
|
Grants for test_drop@localhost
|
||||||
|
GRANT USAGE ON *.* TO 'test_drop'@'localhost'
|
||||||
|
GRANT PROXY ON 'future_user'@'%' TO 'test_drop'@'localhost'
|
||||||
|
DROP USER test_drop@localhost;
|
||||||
|
SELECT * FROM mysql.proxy_priv WHERE Host = 'test_drop' AND User = 'localhost';
|
||||||
|
Host User Proxied_Host Proxied_User With_Grant
|
||||||
|
DROP USER proxy_admin;
|
||||||
|
DROP USER grant_plug,grant_plug_dest,grant_plug_dest2;
|
||||||
|
## END GRANT PROXY tests
|
||||||
|
## cleanup
|
||||||
|
DROP USER plug;
|
||||||
|
DROP USER plug_dest;
|
||||||
|
## @@proxy_user tests
|
||||||
|
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||||
|
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||||
|
GRANT PROXY ON plug_dest TO plug;
|
||||||
|
SELECT USER(),CURRENT_USER(),@@LOCAL.proxy_user;
|
||||||
|
USER() CURRENT_USER() @@LOCAL.proxy_user
|
||||||
|
root@localhost root@localhost NULL
|
||||||
|
SELECT @@GLOBAL.proxy_user;
|
||||||
|
ERROR HY000: Variable 'proxy_user' is a SESSION variable
|
||||||
|
SELECT @@LOCAL.proxy_user;
|
||||||
|
@@LOCAL.proxy_user
|
||||||
|
NULL
|
||||||
|
SET GLOBAL proxy_user = 'test';
|
||||||
|
ERROR HY000: Variable 'proxy_user' is a read only variable
|
||||||
|
SET LOCAL proxy_user = 'test';
|
||||||
|
ERROR HY000: Variable 'proxy_user' is a read only variable
|
||||||
|
SELECT @@LOCAL.proxy_user;
|
||||||
|
@@LOCAL.proxy_user
|
||||||
|
NULL
|
||||||
|
# in connection plug_con
|
||||||
|
SELECT @@LOCAL.proxy_user;
|
||||||
|
@@LOCAL.proxy_user
|
||||||
|
'plug'@'%'
|
||||||
|
# in connection default
|
||||||
|
## cleanup
|
||||||
|
DROP USER plug;
|
||||||
|
DROP USER plug_dest;
|
||||||
|
## END @@proxy_user tests
|
||||||
|
## @@external_user tests
|
||||||
|
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
|
||||||
|
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
|
||||||
|
GRANT PROXY ON plug_dest TO plug;
|
||||||
|
SELECT USER(),CURRENT_USER(),@@LOCAL.external_user;
|
||||||
|
USER() CURRENT_USER() @@LOCAL.external_user
|
||||||
|
root@localhost root@localhost NULL
|
||||||
|
SELECT @@GLOBAL.external_user;
|
||||||
|
ERROR HY000: Variable 'external_user' is a SESSION variable
|
||||||
|
SELECT @@LOCAL.external_user;
|
||||||
|
@@LOCAL.external_user
|
||||||
|
NULL
|
||||||
|
SET GLOBAL external_user = 'test';
|
||||||
|
ERROR HY000: Variable 'external_user' is a read only variable
|
||||||
|
SET LOCAL external_user = 'test';
|
||||||
|
ERROR HY000: Variable 'external_user' is a read only variable
|
||||||
|
SELECT @@LOCAL.external_user;
|
||||||
|
@@LOCAL.external_user
|
||||||
|
NULL
|
||||||
|
# in connection plug_con
|
||||||
|
SELECT @@LOCAL.external_user;
|
||||||
|
@@LOCAL.external_user
|
||||||
|
'plug'@'%'
|
||||||
|
# in connection default
|
||||||
|
## cleanup
|
||||||
|
DROP USER plug;
|
||||||
|
DROP USER plug_dest;
|
||||||
|
## END @@external_user tests
|
||||||
|
#
|
||||||
|
# Bug #56798 : Wrong credentials assigned when using a proxy user.
|
||||||
|
#
|
||||||
|
GRANT ALL PRIVILEGES ON *.* TO power_user;
|
||||||
|
GRANT USAGE ON anonymous_db.* TO ''@''
|
||||||
|
IDENTIFIED WITH 'test_plugin_server' AS 'power_user';
|
||||||
|
GRANT PROXY ON power_user TO ''@'';
|
||||||
|
CREATE DATABASE confidential_db;
|
||||||
|
SELECT user(),current_user(),@@proxy_user;
|
||||||
|
user() current_user() @@proxy_user
|
||||||
|
test_login_user@localhost power_user@% ''@''
|
||||||
|
DROP USER power_user;
|
||||||
|
DROP USER ''@'';
|
||||||
|
DROP DATABASE confidential_db;
|
||||||
|
# Test case #2 (crash with double grant proxy)
|
||||||
|
CREATE USER ''@'' IDENTIFIED WITH 'test_plugin_server' AS 'standard_user';
|
||||||
|
CREATE USER standard_user;
|
||||||
|
CREATE DATABASE shared;
|
||||||
|
GRANT ALL PRIVILEGES ON shared.* TO standard_user;
|
||||||
|
GRANT PROXY ON standard_user TO ''@'';
|
||||||
|
#should not crash
|
||||||
|
GRANT PROXY ON standard_user TO ''@'';
|
||||||
|
DROP USER ''@'';
|
||||||
|
DROP USER standard_user;
|
||||||
|
DROP DATABASE shared;
|
7
mysql-test/r/plugin_load_option.result
Normal file
7
mysql-test/r/plugin_load_option.result
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
UNINSTALL PLUGIN example;
|
||||||
|
ERROR HY000: Plugin 'example' is force_plus_permanent and can not be unloaded
|
||||||
|
SELECT PLUGIN_NAME, PLUGIN_STATUS, LOAD_OPTION FROM INFORMATION_SCHEMA.PLUGINS
|
||||||
|
WHERE PLUGIN_NAME IN ('MyISAM', 'EXAMPLE');
|
||||||
|
PLUGIN_NAME PLUGIN_STATUS LOAD_OPTION
|
||||||
|
MyISAM ACTIVE FORCE
|
||||||
|
EXAMPLE ACTIVE FORCE_PLUS_PERMANENT
|
|
@ -1194,13 +1194,13 @@ SET @aux= "SELECT COUNT(*)
|
||||||
prepare my_stmt from @aux;
|
prepare my_stmt from @aux;
|
||||||
execute my_stmt;
|
execute my_stmt;
|
||||||
COUNT(*)
|
COUNT(*)
|
||||||
40
|
42
|
||||||
execute my_stmt;
|
execute my_stmt;
|
||||||
COUNT(*)
|
COUNT(*)
|
||||||
40
|
42
|
||||||
execute my_stmt;
|
execute my_stmt;
|
||||||
COUNT(*)
|
COUNT(*)
|
||||||
40
|
42
|
||||||
deallocate prepare my_stmt;
|
deallocate prepare my_stmt;
|
||||||
drop procedure if exists p1|
|
drop procedure if exists p1|
|
||||||
drop table if exists t1|
|
drop table if exists t1|
|
||||||
|
|
|
@ -9,9 +9,11 @@ end|
|
||||||
call bug4902()|
|
call bug4902()|
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
call bug4902()|
|
call bug4902()|
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
drop procedure bug4902|
|
drop procedure bug4902|
|
||||||
drop procedure if exists bug4902_2|
|
drop procedure if exists bug4902_2|
|
||||||
create procedure bug4902_2()
|
create procedure bug4902_2()
|
||||||
|
@ -206,9 +208,11 @@ create procedure 15298_2 () sql security definer show grants;
|
||||||
call 15298_1();
|
call 15298_1();
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
call 15298_2();
|
call 15298_2();
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
drop user mysqltest_1@localhost;
|
drop user mysqltest_1@localhost;
|
||||||
drop procedure 15298_1;
|
drop procedure 15298_1;
|
||||||
drop procedure 15298_2;
|
drop procedure 15298_2;
|
||||||
|
@ -245,6 +249,8 @@ max_updates, max_connections, max_user_connections)
|
||||||
VALUES('%', 'mysqltest_1', password(''), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N',
|
VALUES('%', 'mysqltest_1', password(''), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N',
|
||||||
'N', 'N', 'N', 'Y', 'Y', 'N', 'N', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'N', '',
|
'N', 'N', 'N', 'Y', 'Y', 'N', 'N', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'N', '',
|
||||||
'', '', '', '0', '0', '0', '0');
|
'', '', '', '0', '0', '0', '0');
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'authentication_string' doesn't have a default value
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
CREATE PROCEDURE p1(i INT) BEGIN END;
|
CREATE PROCEDURE p1(i INT) BEGIN END;
|
||||||
DROP PROCEDURE p1;
|
DROP PROCEDURE p1;
|
||||||
|
|
|
@ -585,3 +585,20 @@ UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()|
|
||||||
ERROR 23000: Column 'f2' cannot be null
|
ERROR 23000: Column 'f2' cannot be null
|
||||||
DROP TABLE t1_aux, t1_not_null|
|
DROP TABLE t1_aux, t1_not_null|
|
||||||
DROP FUNCTION f1_two_inserts|
|
DROP FUNCTION f1_two_inserts|
|
||||||
|
#
|
||||||
|
# Bug#49938: Failing assertion: inode or deadlock in fsp/fsp0fsp.c
|
||||||
|
#
|
||||||
|
DROP PROCEDURE IF EXISTS p1|
|
||||||
|
DROP TABLE IF EXISTS t1|
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=INNODB|
|
||||||
|
CREATE PROCEDURE p1()
|
||||||
|
BEGIN
|
||||||
|
TRUNCATE TABLE t1;
|
||||||
|
END|
|
||||||
|
LOCK TABLES t1 WRITE|
|
||||||
|
CALL p1()|
|
||||||
|
FLUSH TABLES;
|
||||||
|
UNLOCK TABLES|
|
||||||
|
CALL p1()|
|
||||||
|
DROP PROCEDURE p1|
|
||||||
|
DROP TABLE t1|
|
||||||
|
|
|
@ -14,6 +14,7 @@ ndb_binlog_index
|
||||||
plugin
|
plugin
|
||||||
proc
|
proc
|
||||||
procs_priv
|
procs_priv
|
||||||
|
proxy_priv
|
||||||
servers
|
servers
|
||||||
slow_log
|
slow_log
|
||||||
tables_priv
|
tables_priv
|
||||||
|
@ -119,6 +120,8 @@ user CREATE TABLE `user` (
|
||||||
`max_updates` int(11) unsigned NOT NULL DEFAULT '0',
|
`max_updates` int(11) unsigned NOT NULL DEFAULT '0',
|
||||||
`max_connections` int(11) unsigned NOT NULL DEFAULT '0',
|
`max_connections` int(11) unsigned NOT NULL DEFAULT '0',
|
||||||
`max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
|
`max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`plugin` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||||
|
`authentication_string` text COLLATE utf8_bin NOT NULL,
|
||||||
PRIMARY KEY (`Host`,`User`)
|
PRIMARY KEY (`Host`,`User`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
|
||||||
show create table func;
|
show create table func;
|
||||||
|
|
|
@ -151,9 +151,14 @@ CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROW SET @b = 1;
|
||||||
SET @a = 0;
|
SET @a = 0;
|
||||||
SET @b = 0;
|
SET @b = 0;
|
||||||
TRUNCATE t1;
|
TRUNCATE t1;
|
||||||
|
ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `test`.`t1` (`a`))
|
||||||
SELECT @a, @b;
|
SELECT @a, @b;
|
||||||
@a @b
|
@a @b
|
||||||
0 0
|
0 0
|
||||||
|
DELETE FROM t1;
|
||||||
|
SELECT @a, @b;
|
||||||
|
@a @b
|
||||||
|
1 1
|
||||||
INSERT INTO t1 VALUES (1);
|
INSERT INTO t1 VALUES (1);
|
||||||
DELETE FROM t1;
|
DELETE FROM t1;
|
||||||
SELECT @a, @b;
|
SELECT @a, @b;
|
||||||
|
|
|
@ -31,6 +31,19 @@ SELECT @@global.debug;
|
||||||
@@global.debug
|
@@global.debug
|
||||||
|
|
||||||
SET GLOBAL debug=@old_debug;
|
SET GLOBAL debug=@old_debug;
|
||||||
|
#
|
||||||
|
# Bug #56709: Memory leaks at running the 5.1 test suite
|
||||||
|
#
|
||||||
|
SET @old_local_debug = @@debug;
|
||||||
|
SET @@debug='d,foo';
|
||||||
|
SELECT @@debug;
|
||||||
|
@@debug
|
||||||
|
d,foo
|
||||||
|
SET @@debug='';
|
||||||
|
SELECT @@debug;
|
||||||
|
@@debug
|
||||||
|
|
||||||
|
SET @@debug = @old_local_debug;
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
#
|
#
|
||||||
# Bug#46165 server crash in dbug
|
# Bug#46165 server crash in dbug
|
||||||
|
|
BIN
mysql-test/std_data/parts/t1TIMESTAMP.frm
Normal file
BIN
mysql-test/std_data/parts/t1TIMESTAMP.frm
Normal file
Binary file not shown.
|
@ -60,7 +60,7 @@ CREATE TABLE federated.t1 (
|
||||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||||
CONNECTION='mysql://user:pass@127.0.0.1:SLAVE_PORT/federated/t1';
|
CONNECTION='mysql://user:pass@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||||
SELECT * FROM federated.t1;
|
SELECT * FROM federated.t1;
|
||||||
ERROR HY000: Unable to connect to foreign data source: Access denied for user 'user'@'localhost' (using password: YES)
|
ERROR HY000: Unable to connect to foreign data source: Access denied for user 'user'@'localhost' (using password: NO)
|
||||||
DROP TABLE federated.t1;
|
DROP TABLE federated.t1;
|
||||||
CREATE TABLE federated.t1 (
|
CREATE TABLE federated.t1 (
|
||||||
`id` int(20) NOT NULL,
|
`id` int(20) NOT NULL,
|
||||||
|
|
|
@ -573,6 +573,7 @@ root@localhost
|
||||||
show grants;
|
show grants;
|
||||||
Grants for root@localhost
|
Grants for root@localhost
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
|
GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
|
||||||
drop trigger trg1_1;
|
drop trigger trg1_1;
|
||||||
use priv_db;
|
use priv_db;
|
||||||
|
|
||||||
|
|
|
@ -165,6 +165,7 @@ def information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8
|
||||||
def information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
|
def information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
|
||||||
def information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
def information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||||
def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
|
def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
|
||||||
|
def information_schema PLUGINS LOAD_OPTION 11 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||||
def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||||
def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||||
def information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
def information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||||
|
@ -562,6 +563,7 @@ NULL information_schema PARTITIONS CHECKSUM bigint NULL NULL NULL NULL bigint(21
|
||||||
3.0000 information_schema PLUGINS PLUGIN_AUTHOR varchar 64 192 utf8 utf8_general_ci varchar(64)
|
3.0000 information_schema PLUGINS PLUGIN_AUTHOR varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||||
1.0000 information_schema PLUGINS PLUGIN_DESCRIPTION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
1.0000 information_schema PLUGINS PLUGIN_DESCRIPTION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||||
3.0000 information_schema PLUGINS PLUGIN_LICENSE varchar 80 240 utf8 utf8_general_ci varchar(80)
|
3.0000 information_schema PLUGINS PLUGIN_LICENSE varchar 80 240 utf8 utf8_general_ci varchar(80)
|
||||||
|
3.0000 information_schema PLUGINS LOAD_OPTION varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||||
NULL information_schema PROCESSLIST ID bigint NULL NULL NULL NULL bigint(4)
|
NULL information_schema PROCESSLIST ID bigint NULL NULL NULL NULL bigint(4)
|
||||||
3.0000 information_schema PROCESSLIST USER varchar 16 48 utf8 utf8_general_ci varchar(16)
|
3.0000 information_schema PROCESSLIST USER varchar 16 48 utf8 utf8_general_ci varchar(16)
|
||||||
3.0000 information_schema PROCESSLIST HOST varchar 64 192 utf8 utf8_general_ci varchar(64)
|
3.0000 information_schema PROCESSLIST HOST varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||||
|
|
|
@ -134,6 +134,11 @@ def mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_general_
|
||||||
def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI select,insert,update,references
|
def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI select,insert,update,references
|
||||||
def mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
|
def mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
|
||||||
def mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
def mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||||
|
def mysql proxy_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
|
||||||
|
def mysql proxy_priv Proxied_Host 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||||
|
def mysql proxy_priv Proxied_User 4 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
|
||||||
|
def mysql proxy_priv User 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||||
|
def mysql proxy_priv With_Grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(1) select,insert,update,references
|
||||||
def mysql servers Db 3 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
|
def mysql servers Db 3 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
|
||||||
def mysql servers Host 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
|
def mysql servers Host 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
|
||||||
def mysql servers Owner 9 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
|
def mysql servers Owner 9 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
|
||||||
|
@ -178,6 +183,7 @@ def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NU
|
||||||
def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
|
def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
|
||||||
def mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
def mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||||
def mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
def mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||||
|
def mysql user authentication_string 42 NULL NO text 65535 65535 NULL NULL utf8 utf8_bin text select,insert,update,references
|
||||||
def mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
def mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||||
def mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
def mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||||
def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||||
|
@ -199,6 +205,7 @@ def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsign
|
||||||
def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||||
def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||||
def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) select,insert,update,references
|
def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) select,insert,update,references
|
||||||
|
def mysql user plugin 41 NO char 60 180 NULL NULL utf8 utf8_bin char(60) select,insert,update,references
|
||||||
def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||||
def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||||
def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||||
|
@ -418,6 +425,11 @@ NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp
|
||||||
3.0000 mysql procs_priv Grantor char 77 231 utf8 utf8_bin char(77)
|
3.0000 mysql procs_priv Grantor char 77 231 utf8 utf8_bin char(77)
|
||||||
3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
|
3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
|
||||||
NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
|
NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
|
||||||
|
3.0000 mysql proxy_priv Host char 60 180 utf8 utf8_bin char(60)
|
||||||
|
3.0000 mysql proxy_priv User char 16 48 utf8 utf8_bin char(16)
|
||||||
|
3.0000 mysql proxy_priv Proxied_Host char 16 48 utf8 utf8_bin char(16)
|
||||||
|
3.0000 mysql proxy_priv Proxied_User char 60 180 utf8 utf8_bin char(60)
|
||||||
|
NULL mysql proxy_priv With_Grant tinyint NULL NULL NULL NULL tinyint(1)
|
||||||
3.0000 mysql servers Server_name char 64 192 utf8 utf8_general_ci char(64)
|
3.0000 mysql servers Server_name char 64 192 utf8 utf8_general_ci char(64)
|
||||||
3.0000 mysql servers Host char 64 192 utf8 utf8_general_ci char(64)
|
3.0000 mysql servers Host char 64 192 utf8 utf8_general_ci char(64)
|
||||||
3.0000 mysql servers Db char 64 192 utf8 utf8_general_ci char(64)
|
3.0000 mysql servers Db char 64 192 utf8 utf8_general_ci char(64)
|
||||||
|
@ -500,3 +512,5 @@ NULL mysql user max_questions int NULL NULL NULL NULL int(11) unsigned
|
||||||
NULL mysql user max_updates int NULL NULL NULL NULL int(11) unsigned
|
NULL mysql user max_updates int NULL NULL NULL NULL int(11) unsigned
|
||||||
NULL mysql user max_connections int NULL NULL NULL NULL int(11) unsigned
|
NULL mysql user max_connections int NULL NULL NULL NULL int(11) unsigned
|
||||||
NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) unsigned
|
NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) unsigned
|
||||||
|
3.0000 mysql user plugin char 60 180 utf8 utf8_bin char(60)
|
||||||
|
1.0000 mysql user authentication_string text 65535 65535 utf8 utf8_bin text
|
||||||
|
|
|
@ -106,6 +106,10 @@ def mysql PRIMARY def mysql procs_priv Db
|
||||||
def mysql PRIMARY def mysql procs_priv User
|
def mysql PRIMARY def mysql procs_priv User
|
||||||
def mysql PRIMARY def mysql procs_priv Routine_name
|
def mysql PRIMARY def mysql procs_priv Routine_name
|
||||||
def mysql PRIMARY def mysql procs_priv Routine_type
|
def mysql PRIMARY def mysql procs_priv Routine_type
|
||||||
|
def mysql PRIMARY def mysql proxy_priv Host
|
||||||
|
def mysql PRIMARY def mysql proxy_priv User
|
||||||
|
def mysql PRIMARY def mysql proxy_priv Proxied_Host
|
||||||
|
def mysql PRIMARY def mysql proxy_priv Proxied_User
|
||||||
def mysql PRIMARY def mysql servers Server_name
|
def mysql PRIMARY def mysql servers Server_name
|
||||||
def mysql PRIMARY def mysql tables_priv Host
|
def mysql PRIMARY def mysql tables_priv Host
|
||||||
def mysql PRIMARY def mysql tables_priv Db
|
def mysql PRIMARY def mysql tables_priv Db
|
||||||
|
|
|
@ -118,6 +118,10 @@ def mysql procs_priv mysql PRIMARY
|
||||||
def mysql procs_priv mysql PRIMARY
|
def mysql procs_priv mysql PRIMARY
|
||||||
def mysql procs_priv mysql PRIMARY
|
def mysql procs_priv mysql PRIMARY
|
||||||
def mysql procs_priv mysql Grantor
|
def mysql procs_priv mysql Grantor
|
||||||
|
def mysql proxy_priv mysql PRIMARY
|
||||||
|
def mysql proxy_priv mysql PRIMARY
|
||||||
|
def mysql proxy_priv mysql PRIMARY
|
||||||
|
def mysql proxy_priv mysql PRIMARY
|
||||||
def mysql servers mysql PRIMARY
|
def mysql servers mysql PRIMARY
|
||||||
def mysql tables_priv mysql PRIMARY
|
def mysql tables_priv mysql PRIMARY
|
||||||
def mysql tables_priv mysql PRIMARY
|
def mysql tables_priv mysql PRIMARY
|
||||||
|
|
|
@ -40,6 +40,10 @@ def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||||
def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||||
def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
|
def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
|
||||||
def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
|
def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
|
||||||
|
def mysql proxy_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||||
|
def mysql proxy_priv 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
|
||||||
|
def mysql proxy_priv 0 mysql PRIMARY 3 Proxied_Host A #CARD# NULL NULL BTREE
|
||||||
|
def mysql proxy_priv 0 mysql PRIMARY 4 Proxied_User A #CARD# NULL NULL BTREE
|
||||||
def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
|
def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
|
||||||
def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
|
def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
|
||||||
def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||||
|
|
|
@ -73,6 +73,7 @@ def mysql PRIMARY mysql ndb_binlog_index
|
||||||
def mysql PRIMARY mysql plugin
|
def mysql PRIMARY mysql plugin
|
||||||
def mysql PRIMARY mysql proc
|
def mysql PRIMARY mysql proc
|
||||||
def mysql PRIMARY mysql procs_priv
|
def mysql PRIMARY mysql procs_priv
|
||||||
|
def mysql PRIMARY mysql proxy_priv
|
||||||
def mysql PRIMARY mysql servers
|
def mysql PRIMARY mysql servers
|
||||||
def mysql PRIMARY mysql tables_priv
|
def mysql PRIMARY mysql tables_priv
|
||||||
def mysql PRIMARY mysql time_zone
|
def mysql PRIMARY mysql time_zone
|
||||||
|
|
|
@ -23,6 +23,7 @@ def mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
|
||||||
def mysql PRIMARY mysql plugin PRIMARY KEY
|
def mysql PRIMARY mysql plugin PRIMARY KEY
|
||||||
def mysql PRIMARY mysql proc PRIMARY KEY
|
def mysql PRIMARY mysql proc PRIMARY KEY
|
||||||
def mysql PRIMARY mysql procs_priv PRIMARY KEY
|
def mysql PRIMARY mysql procs_priv PRIMARY KEY
|
||||||
|
def mysql PRIMARY mysql proxy_priv PRIMARY KEY
|
||||||
def mysql PRIMARY mysql servers PRIMARY KEY
|
def mysql PRIMARY mysql servers PRIMARY KEY
|
||||||
def mysql PRIMARY mysql tables_priv PRIMARY KEY
|
def mysql PRIMARY mysql tables_priv PRIMARY KEY
|
||||||
def mysql PRIMARY mysql time_zone PRIMARY KEY
|
def mysql PRIMARY mysql time_zone PRIMARY KEY
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue