Merge bk@192.168.21.1:/usr/home/bk/mysql-4.1

into deer.(none):/home/hf/work/mysql-4.1.4815
This commit is contained in:
hf@deer.(none) 2004-09-02 11:11:16 +05:00
commit 21acb551ab
197 changed files with 2933 additions and 1061 deletions

View file

@ -14,6 +14,7 @@
*/.pure
*~
.*.swp
./config.h
.defs.mk
.depend
.depend.mk
@ -258,7 +259,7 @@ cmd-line-utils/libedit/common.h
cmd-line-utils/libedit/makelist
comon.h
config.cache
./config.h
config.h
config.h.in
config.log
config.status
@ -830,6 +831,7 @@ support-files/MacOSX/postinstall
support-files/MacOSX/preinstall
support-files/binary-configure
support-files/my-huge.cnf
support-files/my-innodb-heavy-4G.cnf
support-files/my-large.cnf
support-files/my-medium.cnf
support-files/my-small.cnf

View file

@ -80,6 +80,7 @@ jcole@mugatu.jcole.us
jcole@mugatu.spaceapes.com
jcole@sarvik.tfr.cafe.ee
jcole@tetra.spaceapes.com
joerg@mysql.com
joreland@mysql.com
jorge@linux.jorge.mysql.com
jplindst@t41.(none)

View file

@ -376,7 +376,7 @@ if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
log_timestamp();
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
safe_cd("${test_dir}/mysql-test");
check_system("./mysql-test-run $flags --warnings --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
check_system("./mysql-test-run $flags --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
}
#

View file

@ -204,7 +204,7 @@ sub trim_the_fat
open(CONFIGURE,">configure.in") or die "Unable to open configure.in for write: $!\n";
print CONFIGURE $configure;
close(CONFIGURE);
`autoconf`;
`aclocal && autoheader && aclocal && automake && autoconf`;
die "'./configure' was not produced!" unless (-f "configure");
chdir("$cwd");
}

8
VC++Files/sql/message.mc Normal file
View file

@ -0,0 +1,8 @@
MessageId = 100
Severity = Error
Facility = Application
SymbolicName = MSG_DEFAULT
Language = English
%1For more information, see Help and Support Center at http://www.mysql.com.

View file

@ -920,6 +920,89 @@ SOURCE=.\log_event.cpp
# End Source File
# Begin Source File
SOURCE=.\message.mc
!IF "$(CFG)" == "mysqld - Win32 Release"
!ELSEIF "$(CFG)" == "mysqld - Win32 Debug"
!ELSEIF "$(CFG)" == "mysqld - Win32 nt"
# Begin Custom Build - Compiling messages
InputDir=.
InputPath=.\message.mc
InputName=message
BuildCmds= \
mc.exe "$(InputDir)\$(InputName).mc"
"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "mysqld - Win32 Max nt"
# Begin Custom Build - Compiling messages
InputDir=.
InputPath=.\message.mc
InputName=message
BuildCmds= \
mc.exe "$(InputDir)\$(InputName).mc"
"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
# Begin Custom Build - Compiling messages
InputDir=.
InputPath=.\message.mc
InputName=message
BuildCmds= \
mc.exe "$(InputDir)\$(InputName).mc"
"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
# Begin Custom Build - Compiling messages
InputDir=.
InputPath=.\message.mc
InputName=message
BuildCmds= \
mc.exe "$(InputDir)\$(InputName).mc"
"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\message.rc
# End Source File
# Begin Source File
SOURCE=.\mf_iocache.cpp
!IF "$(CFG)" == "mysqld - Win32 Release"

View file

@ -6,7 +6,6 @@ AC_DEFUN(MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY,[
AC_TRY_COMPILE(
[
#include "stdio.h"
#undef __P // readline-4.2 declares own __P
#include "readline/readline.h"
],
[
@ -27,7 +26,6 @@ AC_DEFUN(MYSQL_CHECK_LIBEDIT_INTERFACE,[
AC_TRY_COMPILE(
[
#include "stdio.h"
#undef __P // readline-4.2 declares own __P
#include "readline/readline.h"
],
[
@ -49,7 +47,6 @@ AC_DEFUN(MYSQL_CHECK_NEW_RL_INTERFACE,[
AC_TRY_COMPILE(
[
#include "stdio.h"
#undef __P // readline-4.2 declares own __P
#include "readline/readline.h"
],
[
@ -668,6 +665,41 @@ AC_DEFINE(STRUCT_DIRENT_HAS_D_INO, [1],
fi
])
AC_DEFUN(MYSQL_STRUCT_DIRENT_D_NAMLEN,
[AC_REQUIRE([AC_HEADER_DIRENT])
AC_MSG_CHECKING(if struct dirent has a d_namlen member)
AC_CACHE_VAL(mysql_cv_dirent_has_dnamlen,
[AC_TRY_COMPILE([
#include <stdio.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#if defined(HAVE_DIRENT_H)
# include <dirent.h>
#else
# define dirent direct
# ifdef HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif /* SYSNDIR */
# ifdef HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif /* SYSDIR */
# ifdef HAVE_NDIR_H
# include <ndir.h>
# endif
#endif /* HAVE_DIRENT_H */
],[
struct dirent d; int z; z = (int)d.d_namlen;
], mysql_cv_dirent_has_dnamlen=yes, mysql_cv_dirent_has_dnamlen=no)])
AC_MSG_RESULT($mysql_cv_dirent_has_dnamlen)
if test "$mysql_cv_dirent_has_dnamlen" = "yes"; then
AC_DEFINE(STRUCT_DIRENT_HAS_D_NAMLEN, [1],
[d_namlen member present in struct dirent])
fi
])
AC_DEFUN(MYSQL_TYPE_SIGHANDLER,
[AC_MSG_CHECKING([whether signal handlers are of type void])
AC_CACHE_VAL(mysql_cv_void_sighandler,

View file

@ -44,7 +44,7 @@
#include <locale.h>
#endif
const char *VER= "14.5";
const char *VER= "14.6";
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
@ -84,7 +84,6 @@ extern "C" {
#if defined( __WIN__) || defined(OS2)
#include <conio.h>
#elif !defined(__NETWARE__)
#undef __P // readline-4.2 declares own __P
#include <readline/readline.h>
#define HAVE_READLINE
#endif
@ -608,7 +607,7 @@ static struct my_option my_long_options[] =
{"silent", 's', "Be more silent. Print results with a tab as separator, each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
@ -793,6 +792,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
while (*argument) *argument++= 'x'; // Destroy argument
if (*start)
start[1]=0 ;
tty_password= 0;
}
else
tty_password= 1;
@ -859,7 +859,7 @@ static int get_options(int argc, char **argv)
opt_max_allowed_packet= *mysql_params->p_max_allowed_packet;
opt_net_buffer_length= *mysql_params->p_net_buffer_length;
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
exit(ho_error);
*mysql_params->p_max_allowed_packet= opt_max_allowed_packet;
@ -1670,15 +1670,15 @@ static int com_server_help(String *buffer __attribute__((unused)),
if (num_fields == 2)
{
put_info("Many help items for your request exist", INFO_INFO);
put_info("For more specific request please type 'help <item>' where item is one of next", INFO_INFO);
put_info("To make a more specific request, please type 'help <item>',\nwhere item is one of next", INFO_INFO);
num_name= 0;
num_cat= 1;
last_char= '_';
}
else if ((cur= mysql_fetch_row(result)))
{
tee_fprintf(PAGER, "You asked help about help category: \"%s\"\n", cur[0]);
put_info("For a more information type 'help <item>' where item is one of the following", INFO_INFO);
tee_fprintf(PAGER, "You asked for help about help category: \"%s\"\n", cur[0]);
put_info("For more information, type 'help <item>', where item is one of the following", INFO_INFO);
num_name= 1;
num_cat= 2;
print_help_item(&cur,1,2,&last_char);
@ -1692,7 +1692,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
else
{
put_info("\nNothing found", INFO_INFO);
put_info("Please try to run 'help contents' for list of all accessible topics\n", INFO_INFO);
put_info("Please try to run 'help contents' for a list of all accessible topics\n", INFO_INFO);
}
}
@ -1711,9 +1711,9 @@ com_help(String *buffer __attribute__((unused)),
if (help_arg)
return com_server_help(buffer,line,help_arg+1);
put_info("\nFor the complete MySQL Manual online visit:\n http://www.mysql.com/documentation\n", INFO_INFO);
put_info("For info on technical support from MySQL developers visit:\n http://www.mysql.com/support\n", INFO_INFO);
put_info("For info on MySQL books, utilities, consultants, etc. visit:\n http://www.mysql.com/portal\n", INFO_INFO);
put_info("\nFor the complete MySQL Manual online, visit:\n http://www.mysql.com/documentation\n", INFO_INFO);
put_info("For info on technical support from MySQL developers, visit:\n http://www.mysql.com/support\n", INFO_INFO);
put_info("For info on MySQL books, utilities, consultants, etc., visit:\n http://www.mysql.com/portal\n", INFO_INFO);
put_info("List of all MySQL commands:", INFO_INFO);
if (!named_cmds)
put_info("Note that all text commands must be first on line and end with ';'",INFO_INFO);
@ -2020,21 +2020,27 @@ print_table_data(MYSQL_RES *result)
while ((cur= mysql_fetch_row(result)))
{
ulong *lengths= mysql_fetch_lengths(result);
(void) tee_fputs("|", PAGER);
mysql_field_seek(result, 0);
for (uint off= 0; off < mysql_num_fields(result); off++)
{
const char *str= cur[off] ? cur[off] : "NULL";
field= mysql_fetch_field(result);
uint length= field->max_length;
if (length > MAX_COLUMN_LENGTH)
uint maxlength= field->max_length;
if (maxlength > MAX_COLUMN_LENGTH)
{
tee_fputs(str, PAGER);
tee_fputs(" |", PAGER);
}
else
tee_fprintf(PAGER, num_flag[off] ? "%*s |" : " %-*s|",
length, str);
{
uint currlength= (uint) lengths[off];
uint numcells= charset_info->cset->numcells(charset_info,
str, str + currlength);
tee_fprintf(PAGER, num_flag[off] ? "%*s |" : " %-*s|",
maxlength + currlength - numcells, str);
}
}
(void) tee_fputs("\n", PAGER);
}

View file

@ -151,7 +151,7 @@ static struct my_option my_long_options[] =
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
@ -276,7 +276,7 @@ int main(int argc,char *argv[])
mysql_init(&mysql);
load_defaults("my",load_default_groups,&argc,&argv);
save_argv = argv; /* Save for free_defaults */
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
{
free_defaults(save_argv);
exit(ho_error);

View file

@ -666,7 +666,7 @@ static int parse_args(int *argc, char*** argv)
result_file = stdout;
load_defaults("my",load_default_groups,argc,argv);
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
exit(ho_error);
return 0;

View file

@ -125,7 +125,7 @@ static struct my_option my_long_options[] =
"Can fix almost anything except unique keys that aren't unique.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
@ -295,7 +295,7 @@ static int get_options(int *argc, char ***argv)
load_defaults("my", load_default_groups, argc, argv);
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, 0)))
exit(ho_error);
if (!what_to_do)

View file

@ -276,7 +276,7 @@ static struct my_option my_long_options[] =
"Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\r\\n' (carriage return + line feed).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
@ -604,7 +604,7 @@ static int get_options(int *argc, char ***argv)
md_result_file= stdout;
load_defaults("my",load_default_groups,argc,argv);
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, 0)))
exit(ho_error);
*mysql_params->p_max_allowed_packet= opt_max_allowed_packet;

View file

@ -123,7 +123,7 @@ static struct my_option my_long_options[] =
{"replace", 'r', "If duplicate unique key was found, replace old row.",
(gptr*) &replace, (gptr*) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
@ -228,7 +228,7 @@ static int get_options(int *argc, char ***argv)
{
int ho_error;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, 0)))
exit(ho_error);
if (enclosed && opt_enclosed)

View file

@ -95,7 +95,7 @@ int parse_args(int argc, char** argv)
{
int ho_error;
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
exit(ho_error);
return 0;

View file

@ -133,7 +133,7 @@ int parse_args(int argc, char **argv)
load_defaults("my",load_default_groups,&argc,&argv);
default_argv= argv;
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
exit(ho_error);
return 0;

View file

@ -188,7 +188,7 @@ static struct my_option my_long_options[] =
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
@ -297,7 +297,7 @@ get_options(int *argc,char ***argv)
{
int ho_error;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, 0)))
exit(ho_error);
if (tty_password)

View file

@ -2100,7 +2100,7 @@ int parse_args(int argc, char **argv)
load_defaults("my",load_default_groups,&argc,&argv);
default_argv= argv;
if ((handle_options(&argc, &argv, my_long_options, get_one_option)))
if ((handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
exit(1);
if (argc > 1)

View file

@ -23,14 +23,14 @@ libedit_a_DEPENDENCIES = @LIBEDIT_LOBJECTS@
pkginclude_HEADERS = readline/readline.h
noinst_HEADERS = chared.h el.h histedit.h key.h parse.h refresh.h sig.h \
sys.h tokenizer.h config.h hist.h map.h prompt.h \
search.h tty.h
sys.h tokenizer.h config.h hist.h map.h prompt.h read.h \
search.h tty.h libedit_term.h term.h
EXTRA_DIST = makelist.sh np/unvis.c np/strlcpy.c np/vis.c np/strlcat.c np/fgetln.c
EXTRA_DIST = makelist.sh np/unvis.c np/strlcpy.c np/vis.c np/vis.h np/strlcat.c np/fgetln.c
CLEANFILES = makelist common.h emacs.h vi.h fcns.h help.h fcns.c help.c
DEFS = -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR '-D__RCSID(x)=' '-D__COPYRIGHT(x)=' '-D__RENAME(x)=' '-D_DIAGASSERT(x)='
DEFS = -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR
SUFFIXES = .sh

View file

@ -62,13 +62,13 @@ cv_undo(EditLine *el)
{
c_undo_t *vu = &el->el_chared.c_undo;
c_redo_t *r = &el->el_chared.c_redo;
uint size;
int size;
/* Save entire line for undo */
size = el->el_line.lastchar - el->el_line.buffer;
vu->len = size;
vu->cursor = el->el_line.cursor - el->el_line.buffer;
memcpy(vu->buf, el->el_line.buffer, size);
memcpy(vu->buf, el->el_line.buffer, (size_t)size);
/* save command info for redo */
r->count = el->el_state.doingarg ? el->el_state.argument : 0;

View file

@ -0,0 +1,14 @@
#include "my_config.h"
#include "sys.h"
#define __RCSID(x)
#define __COPYRIGHT(x)
#define __RENAME(x)
#define _DIAGASSERT(x)
#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
#define __attribute__(A)
#endif

View file

@ -661,12 +661,6 @@ history_load(History *h, const char *fname)
if ((fp = fopen(fname, "r")) == NULL)
return (i);
if ((line = fgetln(fp, &sz)) == NULL)
goto done;
if (strncmp(line, hist_cookie, sz) != 0)
goto done;
ptr = h_malloc(max_size = 1024);
if (ptr == NULL)
goto done;
@ -720,8 +714,6 @@ history_save(History *h, const char *fname)
if (fchmod(fileno(fp), S_IRUSR|S_IWUSR) == -1)
goto done;
if (fputs(hist_cookie, fp) == EOF)
goto done;
ptr = h_malloc(max_size = 1024);
if (ptr == NULL)
goto done;
@ -740,7 +732,7 @@ history_save(History *h, const char *fname)
ptr = nptr;
}
(void) strvis(ptr, ev.str, VIS_WHITE);
(void) fprintf(fp, "%s\n", ptr);
(void) fprintf(fp, "%s\n", ev.str);
}
oomem:
h_free((ptr_t)ptr);

View file

@ -33,6 +33,7 @@
* SUCH DAMAGE.
*/
#include "config.h"
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93";

View file

@ -34,12 +34,12 @@
* SUCH DAMAGE.
*/
#include "config.h"
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: vis.c,v 1.22 2002/03/23 17:38:27 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#include "config.h"
#include <sys/types.h>
#include <assert.h>
#ifdef HAVE_ALLOCA_H

View file

@ -1345,7 +1345,7 @@ filename_completion_function(const char *text, int state)
/* otherwise, get first entry where first */
/* filename_len characters are equal */
if (entry->d_name[0] == filename[0]
#if defined(__SVR4) || defined(__linux__)
#ifndef STRUCT_DIRENT_HAS_D_NAMLEN
&& strlen(entry->d_name) >= filename_len
#else
&& entry->d_namlen >= filename_len
@ -1358,7 +1358,7 @@ filename_completion_function(const char *text, int state)
if (entry) { /* match found */
struct stat stbuf;
#if defined(__SVR4) || defined(__linux__)
#ifndef STRUCT_DIRENT_HAS_D_NAMLEN
len = strlen(entry->d_name) +
#else
len = entry->d_namlen +

View file

@ -50,6 +50,7 @@ __RCSID("$NetBSD: search.c,v 1.14 2002/11/20 16:50:08 christos Exp $");
*/
#include <stdlib.h>
#if defined(REGEX)
#include <sys/types.h>
#include <regex.h>
#elif defined(REGEXP)
#include <regexp.h>

View file

@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE(mysql, 4.1.4-gamma)
AM_INIT_AUTOMAKE(mysql, 4.1.5-gamma)
AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10
@ -972,8 +972,8 @@ MAX_CXX_OPTIMIZE="-O3"
# workaround for Sun Forte/x86 see BUG#4681
case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc in
*solaris*-i?86-no)
CFLAGS="$CFLAGS -DBIG_FILES"
CXXFLAGS="$CXXFLAGS -DBIG_FILES"
CFLAGS="$CFLAGS -DBIG_TABLES"
CXXFLAGS="$CXXFLAGS -DBIG_TABLES"
;;
*) ;;
esac
@ -1865,6 +1865,7 @@ MYSQL_HAVE_TIOCGWINSZ
MYSQL_HAVE_FIONREAD
MYSQL_HAVE_TIOCSTAT
MYSQL_STRUCT_DIRENT_D_INO
MYSQL_STRUCT_DIRENT_D_NAMLEN
MYSQL_TYPE_SIGHANDLER
if test "$with_named_curses" = "no"
then
@ -2402,7 +2403,7 @@ dnl you must also create strings/ctype-$charset_name.c
AC_DIVERT_PUSH(0)
define(CHARSETS_AVAILABLE0,binary)
define(CHARSETS_AVAILABLE1,ascii armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257)
define(CHARSETS_AVAILABLE1,armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257)
define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 dec8 euckr gb2312 gbk geostd8)
define(CHARSETS_AVAILABLE3,greek hebrew hp8 keybcs2 koi8r koi8u)
define(CHARSETS_AVAILABLE4,latin1 latin2 latin5 latin7 macce macroman)

View file

@ -99,7 +99,7 @@ static int get_options(int *argc,char ***argv)
{
int ho_error;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
exit(ho_error);
if (*argc < 1)

View file

@ -20,6 +20,7 @@
#include <my_global.h>
#include <m_string.h>
#include <my_sys.h>
#include <my_getopt.h>
#include <signal.h>
#include <errno.h>
@ -66,7 +67,7 @@ int main(int argc, char *argv[])
progname= argv[0];
if (handle_options(&argc, &argv, my_long_options, get_one_option))
if (handle_options(&argc, &argv, my_long_options, get_one_option, NULL))
exit(-1);
if (!argv[0] || !argv[1] || (pid= atoi(argv[0])) <= 0 ||
(t= atoi(argv[1])) <= 0)

View file

@ -157,7 +157,7 @@ static int get_options(int *argc,char ***argv)
{
int ho_error;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
exit(ho_error);
if (!*argc && !print_all_codes)

View file

@ -121,7 +121,7 @@ static int parse_args(int argc, char **argv)
{
int ho_error;
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
exit(ho_error);
/*

View file

@ -90,7 +90,7 @@ static int get_options(int *argc,char ***argv)
{
int ho_error;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
exit(ho_error);
if (*argc == 0)

View file

@ -246,12 +246,12 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
if (seg->type == HA_KEYTYPE_TEXT)
{
CHARSET_INFO *cs= seg->charset;
uint length= ((uchar*)key) - pos;
uint char_length= length / cs->mbmaxlen;
if (length > char_length)
uint char_length= (uint) ((uchar*) key - pos);
if (cs->mbmaxlen > 1)
{
char_length= my_charpos(cs, pos, pos + length, char_length);
set_if_smaller(char_length, length);
uint length= char_length;
char_length= my_charpos(cs, pos, pos + length, length/cs->mbmaxlen);
set_if_smaller(char_length, length); /* QQ: ok to remove? */
}
cs->coll->hash_sort(cs, pos, char_length, &nr, &nr2);
}
@ -289,11 +289,12 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
if (seg->type == HA_KEYTYPE_TEXT)
{
CHARSET_INFO *cs= seg->charset;
uint char_length= seg->length / cs->mbmaxlen;
if (seg->length > char_length)
uint char_length= seg->length;
if (cs->mbmaxlen > 1)
{
char_length= my_charpos(cs, pos, pos + seg->length, char_length);
set_if_smaller(char_length, seg->length);
char_length= my_charpos(cs, pos, pos + char_length,
char_length / cs->mbmaxlen);
set_if_smaller(char_length, seg->length); /* QQ: ok to remove? */
}
cs->coll->hash_sort(cs, pos, char_length, &nr, &nr2);
}
@ -417,17 +418,17 @@ int hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2)
if (seg->type == HA_KEYTYPE_TEXT)
{
CHARSET_INFO *cs= seg->charset;
uint char_length= seg->length / cs->mbmaxlen;
uint char_length1;
uint char_length2;
uchar *pos1= (uchar*)rec1 + seg->start;
uchar *pos2= (uchar*)rec2 + seg->start;
if (seg->length > char_length)
if (cs->mbmaxlen > 1)
{
uint char_length= seg->length / cs->mbmaxlen;
char_length1= my_charpos(cs, pos1, pos1 + seg->length, char_length);
set_if_smaller(char_length1, seg->length);
set_if_smaller(char_length1, seg->length); /* QQ: ok to remove? */
char_length2= my_charpos(cs, pos2, pos2 + seg->length, char_length);
set_if_smaller(char_length2, seg->length);
set_if_smaller(char_length2, seg->length); /* QQ: ok to remove? */
}
else
{
@ -468,12 +469,12 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key)
if (seg->type == HA_KEYTYPE_TEXT)
{
CHARSET_INFO *cs= seg->charset;
uint char_length= seg->length / cs->mbmaxlen;
uint char_length_key;
uint char_length_rec;
uchar *pos= (uchar*) rec + seg->start;
if (seg->length > char_length)
if (cs->mbmaxlen > 1)
{
uint char_length= seg->length / cs->mbmaxlen;
char_length_key= my_charpos(cs, key, key + seg->length, char_length);
set_if_smaller(char_length_key, seg->length);
char_length_rec= my_charpos(cs, pos, pos + seg->length, char_length);
@ -509,21 +510,22 @@ void hp_make_key(HP_KEYDEF *keydef, byte *key, const byte *rec)
for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++)
{
CHARSET_INFO *cs= seg->charset;
uint char_length= (cs && cs->mbmaxlen > 1) ? seg->length / cs->mbmaxlen :
seg->length;
uint char_length= seg->length;
uchar *pos= (uchar*) rec + seg->start;
if (seg->null_bit)
*key++= test(rec[seg->null_pos] & seg->null_bit);
if (seg->length > char_length)
if (cs->mbmaxlen > 1)
{
char_length= my_charpos(cs, pos, pos + seg->length, char_length);
set_if_smaller(char_length, seg->length);
char_length= my_charpos(cs, pos, pos + seg->length,
char_length / cs->mbmaxlen);
set_if_smaller(char_length, seg->length); /* QQ: ok to remove? */
}
memcpy(key,rec+seg->start,(size_t) char_length);
key+= char_length;
}
}
uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
const byte *rec, byte *recpos)
{
@ -575,13 +577,13 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
}
continue;
}
char_length= seg->length / (seg->charset ? seg->charset->mbmaxlen : 1);
if (seg->length > char_length)
char_length= seg->length;
if (seg->charset->mbmaxlen > 1)
{
char_length= my_charpos(seg->charset,
rec + seg->start, rec + seg->start + seg->length,
char_length);
set_if_smaller(char_length, seg->length);
rec + seg->start, rec + seg->start + char_length,
char_length / seg->charset->mbmaxlen);
set_if_smaller(char_length, seg->length); /* QQ: ok to remove? */
if (char_length < seg->length)
seg->charset->cset->fill(seg->charset, key + char_length,
seg->length - char_length, ' ');
@ -593,7 +595,9 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
return key - start_key;
}
uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, uint k_len)
uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
uint k_len)
{
HA_KEYSEG *seg, *endseg;
uchar *start_key= key;
@ -623,11 +627,12 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, uint k_len)
}
continue;
}
char_length= seg->length / (seg->charset ? seg->charset->mbmaxlen : 1);
if (seg->length > char_length)
char_length= seg->length;
if (seg->charset->mbmaxlen > 1)
{
char_length= my_charpos(seg->charset, old, old+seg->length, char_length);
set_if_smaller(char_length, seg->length);
char_length= my_charpos(seg->charset, old, old+char_length,
char_length / seg->charset->mbmaxlen);
set_if_smaller(char_length, seg->length); /* QQ: ok to remove? */
if (char_length < seg->length)
seg->charset->cset->fill(seg->charset, key + char_length,
seg->length - char_length, ' ');
@ -639,12 +644,14 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old, uint k_len)
return key - start_key;
}
uint hp_rb_key_length(HP_KEYDEF *keydef,
const byte *key __attribute__((unused)))
{
return keydef->length;
}
uint hp_rb_null_key_length(HP_KEYDEF *keydef, const byte *key)
{
const byte *start_key= key;

View file

@ -149,6 +149,7 @@ typedef struct my_charset_handler_st
uint (*well_formed_len)(struct charset_info_st *,
const char *b,const char *e, uint nchars);
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
uint (*numcells)(struct charset_info_st *, const char *b, const char *e);
/* Unicode convertion */
int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc,
@ -325,6 +326,7 @@ int my_wildcmp_8bit(CHARSET_INFO *,
int escape, int w_one, int w_many);
uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
@ -342,6 +344,7 @@ int my_wildcmp_mb(CHARSET_INFO *,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
uint my_instr_mb(struct charset_info_st *,

View file

@ -238,6 +238,9 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error);
#ifndef HAVE_STRTOULL
#define HAVE_STRTOULL
#endif
#ifndef HAVE_STRTOLL
#define HAVE_STRTOLL
#endif
#else
#ifdef HAVE_LONG_LONG
extern char *longlong2str(longlong val,char *dst,int radix);

View file

@ -14,6 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef _my_getopt_h
#define _my_getopt_h
C_MODE_START
#define GET_NO_ARG 1
@ -54,11 +57,12 @@ struct my_option
extern char *disabled_my_option;
extern my_bool my_getopt_print_errors;
typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
extern int handle_options (int *argc, char ***argv,
const struct my_option *longopts,
my_bool (*get_one_option)(int,
const struct my_option *,
char *));
const struct my_option *longopts, my_get_one_option,
my_error_reporter );
extern void my_print_help(const struct my_option *options);
extern void my_print_variables(const struct my_option *options);
extern void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint,
@ -66,4 +70,8 @@ extern void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint,
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp);
my_bool getopt_compare_strings(const char *s, const char *t, uint length);
C_MODE_END
#endif /* _my_getopt_h */

View file

@ -244,6 +244,12 @@ typedef struct wild_file_pack /* Struct to hold info when selecting files */
my_string *wild; /* Pointer to wildcards */
} WF_PACK;
enum loglevel {
ERROR_LEVEL,
WARNING_LEVEL,
INFORMATION_LEVEL
};
enum cache_type
{
READ_CACHE,WRITE_CACHE,

View file

@ -99,7 +99,7 @@ typedef struct st_mysql_field {
unsigned int flags; /* Div flags */
unsigned int decimals; /* Number of decimals in field */
unsigned int charsetnr; /* Character set */
enum enum_field_types type; /* Type of field. Se mysql_com.h for types */
enum enum_field_types type; /* Type of field. See mysql_com.h for types */
} MYSQL_FIELD;
typedef char **MYSQL_ROW; /* return data as array of strings */
@ -175,7 +175,7 @@ struct st_mysql_options {
*/
my_bool rpl_parse;
/*
If set, never read from a master,only from slave, when doing
If set, never read from a master, only from slave, when doing
a read that is replication-aware
*/
my_bool no_master_reads;
@ -538,7 +538,7 @@ enum enum_mysql_stmt_state
typedef struct st_mysql_bind
{
unsigned long *length; /* output length pointer */
my_bool *is_null; /* Pointer to null indicators */
my_bool *is_null; /* Pointer to null indicator */
void *buffer; /* buffer to get/put data */
enum enum_field_types buffer_type; /* buffer type */
unsigned long buffer_length; /* buffer length, must be set for str/binary */
@ -581,7 +581,7 @@ typedef struct st_mysql_stmt
unsigned char **row);
unsigned long stmt_id; /* Id for prepared statement */
unsigned int last_errno; /* error code */
unsigned int param_count; /* inpute parameters count */
unsigned int param_count; /* input parameter count */
unsigned int field_count; /* number of columns in result set */
enum enum_mysql_stmt_state state; /* statement state */
char last_error[MYSQL_ERRMSG_SIZE]; /* error message */

View file

@ -318,4 +318,5 @@
#define ER_WARN_INVALID_TIMESTAMP 1299
#define ER_INVALID_CHARACTER_STRING 1300
#define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301
#define ER_ERROR_MESSAGES 302
#define ER_CONFLICTING_DECLARATIONS 1302
#define ER_ERROR_MESSAGES 303

View file

@ -629,6 +629,8 @@ buf_read_ibuf_merge_pages(
}
}
os_aio_simulated_wake_handler_threads();
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();

View file

@ -671,7 +671,7 @@ static void get_options(register int *argc, register char ***argv)
if (isatty(fileno(stdout)))
testflag|=T_WRITE_LOOP;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
exit(ho_error);
if (*argc == 0)

View file

@ -337,7 +337,7 @@ static void get_options(int *argc, char ***argv)
{
int ho_error;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
exit(ho_error);
my_progname= argv[0][0];

View file

@ -3339,6 +3339,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
}
case MYSQL_TYPE_DATE:
case MYSQL_TYPE_DATETIME:
case MYSQL_TYPE_TIMESTAMP:
{
MYSQL_TIME *tm= (MYSQL_TIME *)buffer;
str_to_datetime(value, length, tm, 0, &err);
@ -3393,7 +3394,7 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
longlong value)
{
char *buffer= (char *)param->buffer;
uint field_is_unsigned= (field->flags & UNSIGNED_FLAG);
uint field_is_unsigned= field->flags & UNSIGNED_FLAG;
switch (param->buffer_type) {
case MYSQL_TYPE_NULL: /* do nothing */
@ -3429,7 +3430,7 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
char buff[22]; /* Enough for longlong */
char *end= longlong10_to_str(value, buff, field_is_unsigned ? 10: -10);
/* Resort to string conversion which supports all typecodes */
fetch_string_with_conversion(param, buff, end - buff);
fetch_string_with_conversion(param, buff, (uint) (end - buff));
break;
}
}
@ -3505,7 +3506,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
sprintf(buff, "%.*f", (int) field->decimals, value);
end= strend(buff);
}
fetch_string_with_conversion(param, buff, end - buff);
fetch_string_with_conversion(param, buff, (uint) (end - buff));
break;
}
}
@ -3590,14 +3591,14 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
{
ulong length;
enum enum_field_types field_type= field->type;
uint field_is_unsigned= field->flags & UNSIGNED_FLAG;
switch (field_type) {
case MYSQL_TYPE_TINY:
{
char value= (char) **row;
uint field_is_unsigned= (field->flags & UNSIGNED_FLAG);
longlong data= (field_is_unsigned) ? (longlong) (unsigned char) value:
(longlong) value;
longlong data= field_is_unsigned ? (longlong) (unsigned char) value :
(longlong) value;
fetch_long_with_conversion(param, field, data);
length= 1;
break;
@ -3606,19 +3607,18 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
case MYSQL_TYPE_YEAR:
{
short value= sint2korr(*row);
uint field_is_unsigned= (field->flags & UNSIGNED_FLAG);
longlong data= ((field_is_unsigned) ? (longlong) (unsigned short) value:
(longlong) value);
longlong data= field_is_unsigned ? (longlong) (unsigned short) value :
(longlong) value;
fetch_long_with_conversion(param, field, data);
length= 2;
break;
}
case MYSQL_TYPE_INT24: /* mediumint is sent as 4 bytes int */
case MYSQL_TYPE_LONG:
{
long value= sint4korr(*row);
uint field_is_unsigned= (field->flags & UNSIGNED_FLAG);
longlong data= ((field_is_unsigned) ? (longlong) (unsigned long) value:
(longlong) value);
longlong data= field_is_unsigned ? (longlong) (unsigned long) value :
(longlong) value;
fetch_long_with_conversion(param, field, data);
length= 4;
break;

125
libmysqld/libmysqld.rc Executable file
View file

@ -0,0 +1,125 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,0,20,0
PRODUCTVERSION 4,0,20,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x9L
#else
FILEFLAGS 0x8L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
#ifdef _DEBUG
VALUE "Comments", "Embedded Server\0"
VALUE "CompanyName", "MySQL AB\0"
VALUE "FileDescription", "Embedded Server\0"
VALUE "FileVersion", "4.0.20\0"
VALUE "InternalName", "Embedded Server\0"
VALUE "LegalCopyright", "Copyright © 2004\0"
VALUE "LegalTrademarks", "MySQL and MySQL AB\0"
VALUE "OriginalFilename", "libmysqld.dll debug\0"
VALUE "PrivateBuild", "libmysqld.dll debug \0"
VALUE "ProductName", "libmysqld.dll debug\0"
VALUE "ProductVersion", "4.0.20\0"
VALUE "SpecialBuild", "\0"
#else
VALUE "Comments", "Embedded Server\0"
VALUE "CompanyName", "MySQL AB\0"
VALUE "FileDescription", "Embedded Server\0"
VALUE "FileVersion", "4.0.20\0"
VALUE "InternalName", "Embedded Server\0"
VALUE "LegalCopyright", "Copyright © 2004\0"
VALUE "LegalTrademarks", "MySQL and MySQL AB\0"
VALUE "OriginalFilename", "libmysqld.dll release\0"
VALUE "PrivateBuild", "libmysqld.dll release \0"
VALUE "ProductName", "libmysqld.dll release\0"
VALUE "ProductVersion", "4.0.20\0"
VALUE "SpecialBuild", "\0"
#endif
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

15
libmysqld/resource.h Executable file
View file

@ -0,0 +1,15 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by libmysqld.rc
//
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View file

@ -27,7 +27,7 @@
#define misc_word_char(X) ((X)=='\'')
#define word_char(s,X) (true_word_char(s,X) || misc_word_char(X))
#define FT_MAX_WORD_LEN_FOR_SORT 20
#define FT_MAX_WORD_LEN_FOR_SORT 31
#define COMPILE_STOPWORDS_IN

View file

@ -2020,12 +2020,14 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
if (sort_param.keyinfo->flag & HA_FULLTEXT)
{
uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT*
sort_param.keyinfo->seg->charset->mbmaxlen;
sort_info.max_records=
(ha_rows) (sort_info.filelength/FT_MAX_WORD_LEN_FOR_SORT+1);
(ha_rows) (sort_info.filelength/ft_max_word_len_for_sort+1);
sort_param.key_read=sort_ft_key_read;
sort_param.key_write=sort_ft_key_write;
sort_param.key_length+=FT_MAX_WORD_LEN_FOR_SORT-HA_FT_MAXBYTELEN;
sort_param.key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN;
}
else
{
@ -2425,7 +2427,11 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
total_key_length+=sort_param[i].key_length;
if (sort_param[i].keyinfo->flag & HA_FULLTEXT)
sort_param[i].key_length+=FT_MAX_WORD_LEN_FOR_SORT-HA_FT_MAXBYTELEN;
{
uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT*
sort_param[i].keyinfo->seg->charset->mbmaxlen;
sort_param[i].key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN;
}
}
sort_info.total_keys=i;
sort_param[0].master= 1;
@ -2634,7 +2640,6 @@ static int sort_key_read(MI_SORT_PARAM *sort_param, void *key)
DBUG_RETURN(sort_write_record(sort_param));
} /* sort_key_read */
static int sort_ft_key_read(MI_SORT_PARAM *sort_param, void *key)
{
int error;
@ -3950,8 +3955,22 @@ static ha_checksum mi_byte_checksum(const byte *buf, uint length)
return crc;
}
static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows)
{
uint key_maxlength=key->maxlength;
if (key->flag & HA_FULLTEXT)
{
uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT*
key->seg->charset->mbmaxlen;
key_maxlength+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN;
}
return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) &&
((ulonglong) rows * key_maxlength >
(ulonglong) myisam_max_temp_length));
}
/*
Deactive all not unique index that can be recreated fast
Deactivate all not unique index that can be recreated fast
These include packed keys on which sorting will use more temporary
space than the max allowed file length or for which the unpacked keys
will take much more space than packed keys.
@ -3959,17 +3978,6 @@ static ha_checksum mi_byte_checksum(const byte *buf, uint length)
rows we will put into the file.
*/
static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows)
{
uint key_maxlength=key->maxlength;
if (key->flag & HA_FULLTEXT)
key_maxlength+=FT_MAX_WORD_LEN_FOR_SORT-HA_FT_MAXBYTELEN;
return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) &&
((ulonglong) rows * key_maxlength >
(ulonglong) myisam_max_temp_length));
}
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows)
{
MYISAM_SHARE *share=info->s;

View file

@ -23,11 +23,14 @@
#include <ieeefp.h>
#endif
#define CHECK_KEYS
#define CHECK_KEYS /* Enable safety checks */
#define FIX_LENGTH if (length > char_length) \
char_length= my_charpos(cs, pos, pos+length, char_length); \
set_if_smaller(char_length,length); \
#define FIX_LENGTH(cs, pos, length, char_length) \
do { \
if (length > char_length) \
char_length= my_charpos(cs, pos, pos+length, char_length); \
set_if_smaller(char_length,length); \
} while(0)
static int _mi_put_key_in_record(MI_INFO *info,uint keynr,byte *record);
@ -45,7 +48,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
my_bool is_ft= info->s->keyinfo[keynr].flag & HA_FULLTEXT;
DBUG_ENTER("_mi_make_key");
if(info->s->keyinfo[keynr].flag & HA_SPATIAL)
if (info->s->keyinfo[keynr].flag & HA_SPATIAL)
{
/*
TODO: nulls processing
@ -75,7 +78,8 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
*key++=1; /* Not NULL */
}
char_length= (!is_ft && cs && cs->mbmaxlen > 1) ? length/cs->mbmaxlen : length;
char_length= ((!is_ft && cs && cs->mbmaxlen > 1) ? length/cs->mbmaxlen :
length);
pos= (byte*) record+keyseg->start;
if (keyseg->flag & HA_SPACE_PACK)
@ -92,7 +96,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
pos++;
}
length=(uint) (end-pos);
FIX_LENGTH;
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
memcpy((byte*) key,(byte*) pos,(size_t) char_length);
key+=char_length;
@ -103,7 +107,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
uint tmp_length=uint2korr(pos);
pos+=2; /* Skip VARCHAR length */
set_if_smaller(length,tmp_length);
FIX_LENGTH;
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
memcpy((byte*) key,(byte*) pos,(size_t) char_length);
key+= char_length;
@ -114,7 +118,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos);
memcpy_fixed((byte*) &pos,pos+keyseg->bit_start,sizeof(char*));
set_if_smaller(length,tmp_length);
FIX_LENGTH;
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
memcpy((byte*) key,(byte*) pos,(size_t) char_length);
key+= char_length;
@ -154,10 +158,10 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
}
continue;
}
FIX_LENGTH;
FIX_LENGTH(cs, pos, length, char_length);
memcpy((byte*) key, pos, char_length);
if (length > char_length)
bfill(key+char_length, length-char_length, ' ');
cs->cset->fill(cs, key+char_length, length-char_length, ' ');
key+= length;
}
_mi_dpointer(info,key,filepos);
@ -234,7 +238,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
}
k_length-=length;
length=(uint) (end-pos);
FIX_LENGTH;
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
memcpy((byte*) key,pos,(size_t) char_length);
key+= char_length;
@ -247,7 +251,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
k_length-= 2+length;
pos+=2;
set_if_smaller(length,tmp_length); /* Safety */
FIX_LENGTH;
FIX_LENGTH(cs, pos, length, char_length);
store_key_length_inc(key,char_length);
old+=2; /* Skip length */
memcpy((byte*) key, pos,(size_t) char_length);
@ -264,10 +268,10 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
}
continue;
}
FIX_LENGTH;
FIX_LENGTH(cs, pos, length, char_length);
memcpy((byte*) key, pos, char_length);
if (length > char_length)
bfill(key+char_length, length-char_length, ' ');
cs->cset->fill(cs,key+char_length, length-char_length, ' ');
key+= length;
k_length-=length;
}

View file

@ -451,9 +451,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
/* We have to compare k and vseg as if they where space extended */
for (end=vseg + (len-cmplen) ;
vseg < end && *vseg == (uchar) ' ';
vseg++) ;
if (vseg == end)
goto cmp_rest; /* should never happen */
vseg++, matched++) ;
DBUG_ASSERT(vseg < end);
if (*vseg > (uchar) ' ')
{

View file

@ -644,7 +644,7 @@ static void get_options(int argc, char *argv[])
{
int ho_error;
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
exit(ho_error);
return;

View file

@ -68,7 +68,7 @@ int main(int argc,char *argv[])
struct { MI_INFO *info; } aio0, *aio=&aio0; /* for GWS_IN_USE */
MY_INIT(argv[0]);
if ((error=handle_options(&argc, &argv, my_long_options, get_one_option)))
if ((error=handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
exit(error);
if (count || dump)
verbose=0;

View file

@ -154,7 +154,7 @@ enum options_mc {
OPT_KEY_CACHE_BLOCK_SIZE, OPT_MYISAM_BLOCK_SIZE,
OPT_READ_BUFFER_SIZE, OPT_WRITE_BUFFER_SIZE, OPT_SORT_BUFFER_SIZE,
OPT_SORT_KEY_BLOCKS, OPT_DECODE_BITS, OPT_FT_MIN_WORD_LEN,
OPT_FT_MAX_WORD_LEN, OPT_FT_MAX_WORD_LEN_FOR_SORT, OPT_FT_STOPWORD_FILE,
OPT_FT_MAX_WORD_LEN, OPT_FT_STOPWORD_FILE,
OPT_MAX_RECORD_LENGTH
};
@ -696,7 +696,7 @@ static void get_options(register int *argc,register char ***argv)
if (isatty(fileno(stdout)))
check_param.testflag|=T_WRITE_LOOP;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
exit(ho_error);
/* If using repair, then update checksum if one uses --update-state */

View file

@ -350,7 +350,7 @@ static void get_options(int *argc,char ***argv)
if (isatty(fileno(stdout)))
write_loop=1;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
exit(ho_error);
if (!*argc)

View file

@ -204,7 +204,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
reinit_io_cache(&tempfile,READ_CACHE,0L,0,0))
goto err; /* purecov: inspected */
if (!no_messages)
puts(" - Last merge and dumping keys\n"); /* purecov: tested */
printf(" - Last merge and dumping keys\n"); /* purecov: tested */
if (merge_index(info,keys,sort_keys,dynamic_element(&buffpek,0,BUFFPEK *),
maxbuffer,&tempfile))
goto err; /* purecov: inspected */
@ -219,6 +219,8 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
uint keyno=info->key;
uint key_length, ref_length=index->s->rec_reflength;
if (!no_messages)
printf(" - Adding exceptions\n"); /* purecov: tested */
if (flush_io_cache(&tempfile_for_exceptions) ||
reinit_io_cache(&tempfile_for_exceptions,READ_CACHE,0L,0,0))
goto err;

View file

@ -367,10 +367,12 @@ while test $# -gt 0; do
VALGRIND=`which valgrind` # this will print an error if not found
# Give good warning to the user and stop
if [ -z "$VALGRIND" ] ; then
$ECHO "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://developer.kde.org/~sewardj ."
$ECHO "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://valgrind.kde.org ."
exit 1
fi
VALGRIND="$VALGRIND --tool=memcheck --alignment=8 --leak-check=yes --num-callers=16"
# >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr
valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && VALGRIND="$VALGRIND --tool=memcheck"
VALGRIND="$VALGRIND --alignment=8 --leak-check=yes --num-callers=16"
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc --skip-bdb"
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb"
SLEEP_TIME_AFTER_RESTART=10

View file

@ -24,13 +24,13 @@ ExecuteOnComputer: 2
[MGM]
PortNumber: CHOOSE_PORT_MGM
[API]
[MYSQLD]
[API]
[MYSQLD]
[API]
[MYSQLD]
[API]
[MYSQLD]
[TCP DEFAULT]
PortNumber: CHOOSE_PORT_TRANSPORTER

View file

@ -111,10 +111,10 @@ a b
aaa bbb
select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
charset(a) charset(b) charset(binary 'ccc')
latin1 binary latin1
latin1 binary binary
select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
collation(a) collation(b) collation(binary 'ccc')
latin1_bin binary latin1_bin
latin1_bin binary binary
drop table t1;
create table t1( firstname char(20), lastname char(20));
insert into t1 values ("john","doe"),("John","Doe");

View file

@ -40,6 +40,7 @@ show tables;
Tables_in_test
update mysql.user set password=old_password("gambling2") where user=_binary"test";
flush privileges;
set password="";
set password='gambling3';
ERROR HY000: Password hash should be a 41-digit hexadecimal number
set password=old_password('gambling3');

View file

@ -1,19 +1,19 @@
drop table if exists t1, t2;
CREATE TABLE t1 ( a int );
INSERT INTO t1 VALUES (1),(2),(1);
CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1;
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
ERROR 23000: Duplicate entry '1' for key 1
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1;
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
ERROR 23000: Duplicate entry '1' for key 1
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1;
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
ERROR 23000: Duplicate entry '1' for key 1
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1;
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
ERROR 23000: Duplicate entry '1' for key 1
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist

View file

@ -49,8 +49,8 @@ a b
aaa bbb
select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
charset(a) charset(b) charset(binary 'ccc')
cp1251 binary cp1251
cp1251 binary binary
select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
collation(a) collation(b) collation(binary 'ccc')
cp1251_bin binary cp1251_bin
cp1251_bin binary binary
drop table t1;

View file

@ -54,4 +54,12 @@ t1 CREATE TABLE `t1` (
`a` char(10) collate latin1_german1_ci default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
DROP TABLE t1;
create table t1 (a char) character set latin1 character set latin2;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET latin2'
create table t1 (a char) character set latin1 collate latin2_bin;
ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1'
create database d1 default character set latin1 character set latin2;
ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET latin2'
create database d1 default character set latin1 collate latin2_bin;
ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1'
DROP DATABASE mysqltest1;

View file

@ -1,5 +1,4 @@
drop table if exists t1;
drop table if exists t2;
drop table if exists t1,t2;
set names utf8;
select left(_utf8 0xD0B0D0B1D0B2,1);
left(_utf8 0xD0B0D0B1D0B2,1)
@ -412,6 +411,36 @@ select c as c_a from t1 where c='б';
c_a
б
drop table t1;
create table t1 (
c char(10) character set utf8,
unique key a (c(1))
) engine=bdb;
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
ERROR 23000: Duplicate entry 'aa' for key 1
insert into t1 values ('aaa');
ERROR 23000: Duplicate entry 'aaa' for key 1
insert into t1 values ('б');
insert into t1 values ('бб');
ERROR 23000: Duplicate entry 'бÐ' for key 1
insert into t1 values ('ббб');
ERROR 23000: Duplicate entry 'бÐ' for key 1
select c as c_all from t1 order by c;
c_all
a
b
c
d
e
f
б
select c as c_a from t1 where c='a';
c_a
a
select c as c_a from t1 where c='б';
c_a
б
drop table t1;
create table t1 (c varchar(30) character set utf8 collate utf8_bin, unique(c(10)));
insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
insert into t1 values ('aaaaaaaaaa');
@ -541,6 +570,36 @@ c_a
б
drop table t1;
create table t1 (
c char(10) character set utf8 collate utf8_bin,
unique key a (c(1))
) engine=bdb;
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
ERROR 23000: Duplicate entry 'aa' for key 1
insert into t1 values ('aaa');
ERROR 23000: Duplicate entry 'aaa' for key 1
insert into t1 values ('б');
insert into t1 values ('бб');
ERROR 23000: Duplicate entry 'бÐ' for key 1
insert into t1 values ('ббб');
ERROR 23000: Duplicate entry 'бÐ' for key 1
select c as c_all from t1 order by c;
c_all
a
b
c
d
e
f
б
select c as c_a from t1 where c='a';
c_a
a
select c as c_a from t1 where c='б';
c_a
б
drop table t1;
create table t1 (
str varchar(255) character set utf8 not null,
key str (str(2))
) engine=myisam;
@ -570,3 +629,13 @@ select * from t1 where str='str';
str
str
drop table t1;
create table t1 (
str varchar(255) character set utf8 not null,
key str (str(2))
) engine=bdb;
INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str';
str
str
drop table t1;

View file

@ -19,7 +19,7 @@ select 'a a' > 'a', 'a \0' < 'a';
1 1
select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a';
binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a'
1 0 0
1 1 1
create table t1 (text1 varchar(32) not NULL, KEY key1 (text1));
insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
check table t1;
@ -52,13 +52,13 @@ select * from t1 ignore key (key1) where text1='teststring' or text1 like 'tests
text1
teststring
teststring
select * from t1 where text1='teststring' or text1 like 'teststring_%';
text1
teststring
teststring
select * from t1 where text1='teststring' or text1 > 'teststring\t';
text1
teststring
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
concat('|', text1, '|')
|teststring |
|teststring|
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
concat('|', text1, '|')
|teststring|
select text1, length(text1) from t1 order by text1;
text1 length(text1)
nothing 7
@ -77,7 +77,28 @@ concat('|', text1, '|')
|teststring|
|teststring |
|teststring |
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
concat('|', text1, '|')
|teststring|
|teststring |
select concat('|', text1, '|') from t1 where text1='teststring';
concat('|', text1, '|')
|teststring|
select concat('|', text1, '|') from t1 where text1='teststring ';
concat('|', text1, '|')
|teststring |
alter table t1 modify text1 text not null, pack_keys=1;
select concat('|', text1, '|') from t1 where text1='teststring';
concat('|', text1, '|')
|teststring|
|teststring |
select concat('|', text1, '|') from t1 where text1='teststring ';
concat('|', text1, '|')
|teststring|
|teststring |
explain select concat('|', text1, '|') from t1 where text1='teststring ';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range key1 key1 22 NULL 2 Using where
select * from t1 where text1 like 'teststring_%';
text1
teststring
@ -87,10 +108,10 @@ text1
teststring
teststring
teststring
select * from t1 where text1='teststring' or text1 > 'teststring\t';
text1
teststring
teststring
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
concat('|', text1, '|')
|teststring|
|teststring |
select concat('|', text1, '|') from t1 order by text1;
concat('|', text1, '|')
|nothing|

View file

@ -18,7 +18,7 @@ explain extended select grp,group_concat(c) from t1 group by grp;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
Warnings:
Note 1003 select test.t1.grp AS `grp`,group_concat(test.t1.c seperator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp
Note 1003 select test.t1.grp AS `grp`,group_concat(test.t1.c separator ',') AS `group_concat(c)` from test.t1 group by test.t1.grp
select grp,group_concat(a,c) from t1 group by grp;
grp group_concat(a,c)
1 1a
@ -93,7 +93,7 @@ explain extended select grp,group_concat(distinct c order by c desc) from t1 gro
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
Warnings:
Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp
Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c separator ',') AS `group_concat(distinct c order by c desc)` from test.t1 group by test.t1.grp
select grp,group_concat(c order by c separator ",") from t1 group by grp;
grp group_concat(c order by c separator ",")
1 a
@ -113,7 +113,7 @@ explain extended select grp,group_concat(distinct c order by c separator ",") fr
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
Warnings:
Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c seperator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp
Note 1003 select test.t1.grp AS `grp`,group_concat(distinct test.t1.c order by test.t1.c separator ',') AS `group_concat(distinct c order by c separator ",")` from test.t1 group by test.t1.grp
select grp,group_concat(distinct c order by c desc separator ",") from t1 group by grp;
grp group_concat(distinct c order by c desc separator ",")
1 a

View file

@ -43,7 +43,7 @@ explain extended select if(u=1,st,binary st) s from t1 where st like "%a%" order
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using filesort
Warnings:
Note 1003 select if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY')) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,(test.t1.st collate _latin1'BINARY'))
Note 1003 select if((test.t1.u = 1),test.t1.st,cast(test.t1.st as char charset binary)) AS `s` from test.t1 where (test.t1.st like _latin1'%a%') order by if((test.t1.u = 1),test.t1.st,cast(test.t1.st as char charset binary))
select nullif(u=0, 'test') from t1;
nullif(u=0, 'test')
NULL

View file

@ -148,6 +148,16 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 select test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 where (_latin1'a' in (test.t1.a,test.t1.b,(test.t1.c collate _latin1'latin1_bin')))
drop table t1;
set names utf8;
create table t1 (a char(10) character set utf8 not null);
insert into t1 values ('bbbb'),(_koi8r'ÃÃÃÃ'),(_latin1'ÄÄÄÄ');
select a from t1 where a in ('bbbb',_koi8r'ÃÃÃÃ',_latin1'ÄÄÄÄ') order by a;
a
ÄÄÄÄ
bbbb
цццц
drop table t1;
set names latin1;
select '1.0' in (1,2);
'1.0' in (1,2)
1

View file

@ -41,8 +41,7 @@ interval(null, 1, 10, 100)
-1
drop table if exists t1,t2;
create table t1 (id int(10) not null unique);
create table t2 (id int(10) not null primary key,
val int(10) not null);
create table t2 (id int(10) not null primary key, val int(10) not null);
insert into t1 values (1),(2),(4);
insert into t2 values (1,1),(2,1),(3,1),(4,2);
select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id;
@ -56,3 +55,12 @@ id elt(two.val,'one','two')
2 one
4 two
drop table t1,t2;
select find_in_set(binary 'a',binary 'A,B,C');
find_in_set(binary 'a',binary 'A,B,C')
0
select find_in_set('a',binary 'A,B,C');
find_in_set('a',binary 'A,B,C')
0
select find_in_set(binary 'a', 'A,B,C');
find_in_set(binary 'a', 'A,B,C')
0

View file

@ -638,7 +638,7 @@ explain extended select md5('hello'), sha('abc'), sha1('abc'), soundex(''), 'moo
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,(_latin1'HE' collate _latin1'BINARY') AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000))) AS `decode(encode(repeat("a",100000),"monty"),"monty")`
Note 1003 select md5(_latin1'hello') AS `md5('hello')`,sha(_latin1'abc') AS `sha('abc')`,sha(_latin1'abc') AS `sha1('abc')`,soundex(_latin1'') AS `soundex('')`,(soundex(_latin1'mood') = soundex(_latin1'mud')) AS `'mood' sounds like 'mud'`,aes_decrypt(aes_encrypt(_latin1'abc',_latin1'1'),_latin1'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')`,concat(_latin1'*',repeat(_latin1' ',5),_latin1'*') AS `concat('*',space(5),'*')`,reverse(_latin1'abc') AS `reverse('abc')`,rpad(_latin1'a',4,_latin1'1') AS `rpad('a',4,'1')`,lpad(_latin1'a',4,_latin1'1') AS `lpad('a',4,'1')`,concat_ws(_latin1',',_latin1'',NULL,_latin1'a') AS `concat_ws(',','',NULL,'a')`,make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a',_latin2'b',_latin2'c')`,elt(2,1) AS `elt(2,1)`,locate(_latin1'a',_latin1'b',2) AS `locate("a","b",2)`,format(130,10) AS `format(130,10)`,char(0) AS `char(0)`,conv(130,16,10) AS `conv(130,16,10)`,hex(130) AS `hex(130)`,cast(_latin1'HE' as char charset binary) AS `binary 'HE'`,export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y',_latin2'n',_latin2' ')`,field((_latin1'b' collate _latin1'latin1_bin'),_latin1'A',_latin1'B') AS `FIELD('b' COLLATE latin1_bin,'A','B')`,find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B',_latin1'a,b,c,d')`,collation(conv(130,16,10)) AS `collation(conv(130,16,10))`,coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))`,length(_latin1'\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,bit_length(_latin1'\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`,concat(_latin1'monty',_latin1' was here ',_latin1'again') AS `concat('monty',' was here ','again')`,length(_latin1'hello') AS `length('hello')`,char(ascii(_latin1'h')) AS `char(ascii('h'))`,ord(_latin1'h') AS `ord('h')`,quote((1 / 0)) AS `quote(1/0)`,crc32(_latin1'123') AS `crc32("123")`,replace(_latin1'aaaa',_latin1'a',_latin1'b') AS `replace('aaaa','a','b')`,insert(_latin1'txs',2,1,_latin1'hi') AS `insert('txs',2,1,'hi')`,left(_latin2'a',1) AS `left(_latin2'a',1)`,right(_latin2'a',1) AS `right(_latin2'a',1)`,lcase(_latin2'a') AS `lcase(_latin2'a')`,ucase(_latin2'a') AS `ucase(_latin2'a')`,substr(_latin1'abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)`,substr_index(_latin1'1abcd;2abcd;3abcd;4abcd',_latin1';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)`,trim(_latin2' a ') AS `trim(_latin2' a ')`,ltrim(_latin2' a ') AS `ltrim(_latin2' a ')`,rtrim(_latin2' a ') AS `rtrim(_latin2' a ')`,decode(encode(repeat(_latin1'a',100000))) AS `decode(encode(repeat("a",100000),"monty"),"monty")`
SELECT lpad(12345, 5, "#");
lpad(12345, 5, "#")
12345

View file

@ -466,3 +466,22 @@ insert IGNORE into t1 values ('Garbage');
ERROR HY000: Unknown error
alter table t1 add spatial index(a);
drop table t1;
create table t1(a geometry not null, spatial index(a));
insert into t1 values
(GeomFromText('POINT(1 1)')), (GeomFromText('POINT(3 3)')),
(GeomFromText('POINT(4 4)')), (GeomFromText('POINT(6 6)'));
select AsText(a) from t1 where
MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
or
MBRContains(GeomFromText('Polygon((2 2, 2 5, 5 5, 5 2, 2 2))'), a);
AsText(a)
POINT(1 1)
POINT(3 3)
POINT(4 4)
select AsText(a) from t1 where
MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
and
MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a);
AsText(a)
POINT(1 1)
drop table t1;

View file

@ -127,3 +127,4 @@ having (a.description is not null) and (c=0);
id description c
1 test 0
2 test2 0
drop table t1,t2,t3;

View file

@ -58,3 +58,10 @@ ERROR 42000: Not unique table/alias: 'C'
drop table t1, t2;
show tables;
Tables_in_test
create table t1 (a int);
select TEST.t1.* from TEST.t1;
a
alter table t1 rename to T1;
select TEST.t1.* from TEST.t1;
a
drop table t1;

View file

@ -412,7 +412,6 @@ aaa.
aaa .
select concat(a,'.') from t1 where binary a='aaa';
concat(a,'.')
aaa .
aaa.
update t1 set a='bbb' where a='aaa';
select concat(a,'.') from t1;
@ -429,6 +428,22 @@ select * from t1 where a='807780' and b='477' and c='165';
a b c
807780 477 165
drop table t1;
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
CREATE TABLE t1 (a varchar(150) NOT NULL, KEY (a));
INSERT t1 VALUES ("can \tcan");
INSERT t1 VALUES ("can can");
INSERT t1 VALUES ("can");
SELECT * FROM t1;
a
can can
can
can can
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
create table t1 (a blob);
insert into t1 values('a '),('a');
select concat(a,'.') from t1 where a='a';

View file

@ -35,10 +35,10 @@ update t1 set name="Autodiscover" where id = 2;
show status like 'handler_discover%';
Variable_name Value
Handler_discover 4
select * from t1 order by name;
select * from t1 order by id;
id name
2 Autodiscover
1 Autodiscover
2 Autodiscover
3 Discover 3
show status like 'handler_discover%';
Variable_name Value

View file

@ -234,6 +234,18 @@ select * from t4 where a = 7 and b = 17 order by a;
a b c d
select * from t4 where a = 7 and b != 16 order by b;
a b c d
delete from t2 where a > 5;
select x1.a, x1.b from t2 x1, t2 x2 where x1.b = x2.b order by x1.a;
a b
1 10
3 12
5 14
select a, b FROM t2 outer_table where
a = (select a from t2 where b = outer_table.b ) order by a;
a b
1 10
3 12
5 14
delete from t2;
delete from t3;
delete from t4;

View file

@ -205,4 +205,55 @@ a b c
select * from t1 where b<=5 and c=0 or b<=5 and c=2;
a b c
19 4 0
select count(*) from t1 where b = 0;
count(*)
0
select count(*) from t1 where b = 1;
count(*)
1
drop table t1;
CREATE TABLE t1 (
a int unsigned NOT NULL PRIMARY KEY,
b int unsigned,
c int unsigned,
KEY bc(b,c)
) engine = ndb;
insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL);
select * from t1 use index (bc) where b IS NULL;
a b c
3 NULL NULL
2 NULL 2
select * from t1 use index (bc)order by a;
a b c
1 1 1
2 NULL 2
3 NULL NULL
4 4 NULL
select * from t1 use index (bc) order by a;
a b c
1 1 1
2 NULL 2
3 NULL NULL
4 4 NULL
select * from t1 use index (PRIMARY) where b IS NULL order by a;
a b c
2 NULL 2
3 NULL NULL
select * from t1 use index (bc) where b IS NULL order by a;
a b c
2 NULL 2
3 NULL NULL
select * from t1 use index (bc) where b IS NULL and c IS NULL order by a;
a b c
3 NULL NULL
select * from t1 use index (bc) where b IS NULL and c = 2 order by a;
a b c
2 NULL 2
select * from t1 use index (bc) where b < 4 order by a;
a b c
1 1 1
select * from t1 use index (bc) where b IS NOT NULL order by a;
a b c
1 1 1
4 4 NULL
drop table t1;

View file

@ -109,6 +109,68 @@ a b c
3 4 6
drop table t3;
CREATE TABLE t1 (
pk int NOT NULL PRIMARY KEY,
a int unsigned,
UNIQUE KEY (a)
) engine=ndbcluster;
insert into t1 values (-1,NULL), (0,0), (1,NULL),(2,2),(3,NULL),(4,4);
select * from t1 order by pk;
pk a
-1 NULL
0 0
1 NULL
2 2
3 NULL
4 4
insert into t1 values (5,0);
ERROR 23000: Can't write, because of unique constraint, to table 't1'
select * from t1 order by pk;
pk a
-1 NULL
0 0
1 NULL
2 2
3 NULL
4 4
delete from t1 where a = 0;
insert into t1 values (5,0);
select * from t1 order by pk;
pk a
-1 NULL
1 NULL
2 2
3 NULL
4 4
5 0
CREATE TABLE t2 (
pk int NOT NULL PRIMARY KEY,
a int unsigned,
b tinyint NOT NULL,
c VARCHAR(10),
UNIQUE KEY si(a, c)
) engine=ndbcluster;
insert into t2 values (-1,1,17,NULL),(0,NULL,18,NULL),(1,3,19,'abc');
select * from t2 order by pk;
pk a b c
-1 1 17 NULL
0 NULL 18 NULL
1 3 19 abc
insert into t2 values(2,3,19,'abc');
ERROR 23000: Can't write, because of unique constraint, to table 't2'
select * from t2 order by pk;
pk a b c
-1 1 17 NULL
0 NULL 18 NULL
1 3 19 abc
delete from t2 where c IS NOT NULL;
insert into t2 values(2,3,19,'abc');
select * from t2 order by pk;
pk a b c
-1 1 17 NULL
0 NULL 18 NULL
2 3 19 abc
drop table t1, t2;
CREATE TABLE t1 (
cid smallint(5) unsigned NOT NULL default '0',
cv varchar(250) NOT NULL default '',
PRIMARY KEY (cid),

View file

@ -11,7 +11,7 @@ insert into t1 (gesuchnr, benutzer_id) value (3,2);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
insert into t1 (gesuchnr,benutzer_id) values (1,1);
ERROR 23000: Can't write; duplicate key in table 't1'
ERROR 23000: Duplicate entry '1-1' for key 1
replace into t1 (gesuchnr,benutzer_id) values (1,1);
select * from t1 order by gesuchnr;
gesuchnr benutzer_id

View file

@ -375,4 +375,17 @@ a
13
14
15
delete from t1 where a > 3;
select a, not(not(a)) from t1;
a not(not(a))
NULL NULL
0 0
1 1
2 1
3 1
explain extended select a, not(not(a)), not(a <= 2 and not(a)), not(a not like "1"), not (a not in (1,2)), not(a != 2) from t1 where not(not(a)) having not(not(a));
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 5 NULL 5 Using where; Using index
Warnings:
Note 1003 select test.t1.a AS `a`,(test.t1.a <> 0) AS `not(not(a))`,((test.t1.a > 2) or test.t1.a) AS `not(a <= 2 and not(a))`,(test.t1.a like _latin1'1') AS `not(a not like "1")`,(test.t1.a in (1,2)) AS `not (a not in (1,2))`,(test.t1.a = 2) AS `not(a != 2)` from test.t1 where test.t1.a having test.t1.a
drop table t1;

View file

@ -226,3 +226,36 @@ a b
execute stmt1;
a b
deallocate prepare stmt1;
drop table t1;
prepare stmt1 from "select 1 into @var";
execute stmt1;
execute stmt1;
prepare stmt1 from "create table t1 select 1 as i";
execute stmt1;
drop table t1;
execute stmt1;
prepare stmt1 from "insert into t1 select i from t1";
execute stmt1;
execute stmt1;
prepare stmt1 from "select * from t1 into outfile 'f1.txt'";
execute stmt1;
deallocate prepare stmt1;
drop table t1;
prepare stmt1 from 'select 1';
prepare STMT1 from 'select 2';
execute sTmT1;
2
2
deallocate prepare StMt1;
deallocate prepare Stmt1;
ERROR HY000: Unknown prepared statement handler (Stmt1) given to DEALLOCATE PREPARE
set names utf8;
prepare `Ăź` from 'select 1234';
execute `Ăź` ;
1234
1234
set names latin1;
execute `ü`;
1234
1234
set names default;

View file

@ -31,4 +31,25 @@ SELECT * from t1;
a
1
2
delete from t1;
insert into t1 (a) values (NULL),(NULL);
SELECT * from t1;
a
3
4
drop table t1;
create temporary table t1 (a integer auto_increment primary key);
insert into t1 (a) values (NULL),(NULL);
truncate table t1;
insert into t1 (a) values (NULL),(NULL);
SELECT * from t1;
a
1
2
delete from t1;
insert into t1 (a) values (NULL),(NULL);
SELECT * from t1;
a
3
4
drop table t1;

View file

@ -593,9 +593,12 @@ create table t1 (id integer primary key auto_increment, txt text, unique index t
insert into t1 (txt) values ('Chevy'), ('Chevy '), (NULL);
select * from t1 where txt='Chevy' or txt is NULL;
id txt
3 NULL
1 Chevy
2 Chevy
3 NULL
explain select * from t1 where txt='Chevy' or txt is NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range txt_index txt_index 23 NULL 2 Using where
select * from t1 where txt='Chevy ';
id txt
1 Chevy
@ -663,6 +666,21 @@ id txt
1 Chevy
2 Chevy
4 Ford
alter table t1 modify column txt blob;
explain select * from t1 where txt='Chevy' or txt is NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref_or_null txt_index txt_index 23 const 2 Using where
select * from t1 where txt='Chevy' or txt is NULL;
id txt
1 Chevy
3 NULL
explain select * from t1 where txt='Chevy' or txt is NULL order by txt;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref_or_null txt_index txt_index 23 const 2 Using where; Using filesort
select * from t1 where txt='Chevy' or txt is NULL order by txt;
id txt
3 NULL
1 Chevy
drop table t1;
CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1)));
INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,'');

View file

@ -272,7 +272,7 @@ auto bigint(17) unsigned NULL PRI 0 select,insert,update,references
t1 bigint(1) NULL 0 select,insert,update,references
t2 char(1) latin1_swedish_ci select,insert,update,references
t3 longtext latin1_swedish_ci select,insert,update,references
t4 longtext latin1_bin select,insert,update,references
t4 longblob NULL select,insert,update,references
select * from t2;
auto t1 t2 t3 t4
11 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

View file

@ -365,3 +365,15 @@ select * from t1;
t1 i
2004-04-01 00:00:00 10
drop table t1;
create table t1 (ts timestamp(19));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`ts` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1
set TIMESTAMP=1000000000;
insert into t1 values ();
select * from t1;
ts
2001-09-09 04:46:40
drop table t1;

View file

@ -436,3 +436,19 @@ SELECT @@global.session.key_buffer_size;
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 'key_buffer_size' at line 1
SELECT @@global.local.key_buffer_size;
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 'key_buffer_size' at line 1
set @tstlw = @@log_warnings;
show global variables like 'log_warnings';
Variable_name Value
log_warnings 1
set global log_warnings = 0;
show global variables like 'log_warnings';
Variable_name Value
log_warnings 0
set global log_warnings = 42;
show global variables like 'log_warnings';
Variable_name Value
log_warnings 42
set global log_warnings = @tstlw;
show global variables like 'log_warnings';
Variable_name Value
log_warnings 1

View file

@ -48,6 +48,7 @@ flush privileges;
#connect (con1,localhost,test,gambling2,"");
#show tables;
connect (con1,localhost,test,gambling2,mysql);
set password="";
--error 1105
set password='gambling3';
set password=old_password('gambling3');

View file

@ -12,18 +12,18 @@ drop table if exists t1, t2;
CREATE TABLE t1 ( a int );
INSERT INTO t1 VALUES (1),(2),(1);
--error 1062;
CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1;
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
--error 1146;
select * from t2;
--error 1062;
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1;
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
--error 1146;
select * from t2;
--error 1062;
CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1;
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
--error 1146;
select * from t2;
--error 1062;
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1;
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
--error 1146;
select * from t2;

View file

@ -71,6 +71,18 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;
#
# Bug#
# CREATE TABLE and CREATE DATABASE didn't fail in some cases
#
--error 1302
create table t1 (a char) character set latin1 character set latin2;
--error 1253
create table t1 (a char) character set latin1 collate latin2_bin;
--error 1302
create database d1 default character set latin1 character set latin2;
--error 1253
create database d1 default character set latin1 collate latin2_bin;
#
#
DROP DATABASE mysqltest1;

View file

@ -3,8 +3,7 @@
#
--disable_warnings
drop table if exists t1;
drop table if exists t2;
drop table if exists t1,t2;
--enable_warnings
set names utf8;
@ -294,6 +293,30 @@ select c as c_a from t1 where c='a';
select c as c_a from t1 where c='б';
drop table t1;
#
# Bug 4531: unique key prefix interacts poorly with utf8
# Check BDB, case insensitive collation
#
--disable_warnings
create table t1 (
c char(10) character set utf8,
unique key a (c(1))
) engine=bdb;
--enable_warnings
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
--error 1062
insert into t1 values ('aa');
--error 1062
insert into t1 values ('aaa');
insert into t1 values ('б');
--error 1062
insert into t1 values ('бб');
--error 1062
insert into t1 values ('ббб');
select c as c_all from t1 order by c;
select c as c_a from t1 where c='a';
select c as c_a from t1 where c='б';
drop table t1;
#
# Bug 4521: unique key prefix interacts poorly with utf8
@ -393,6 +416,31 @@ select c as c_a from t1 where c='a';
select c as c_a from t1 where c='б';
drop table t1;
#
# Bug 4531: unique key prefix interacts poorly with utf8
# Check BDB, binary collation
#
--disable_warnings
create table t1 (
c char(10) character set utf8 collate utf8_bin,
unique key a (c(1))
) engine=bdb;
--enable_warnings
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
--error 1062
insert into t1 values ('aa');
--error 1062
insert into t1 values ('aaa');
insert into t1 values ('б');
--error 1062
insert into t1 values ('бб');
--error 1062
insert into t1 values ('ббб');
select c as c_all from t1 order by c;
select c as c_a from t1 where c='a';
select c as c_a from t1 where c='б';
drop table t1;
# Bug#4594: column index make = failed for gbk, but like works
# Check MYISAM
@ -429,3 +477,18 @@ INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str';
drop table t1;
# the same for BDB
#
--disable_warnings
create table t1 (
str varchar(255) character set utf8 not null,
key str (str(2))
) engine=bdb;
--enable_warnings
INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str';
drop table t1;

View file

@ -31,19 +31,25 @@ explain select * from t1 order by text1;
alter table t1 modify text1 char(32) binary not null;
check table t1;
select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
select * from t1 where text1='teststring' or text1 like 'teststring_%';
select * from t1 where text1='teststring' or text1 > 'teststring\t';
select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%';
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
select text1, length(text1) from t1 order by text1;
select text1, length(text1) from t1 order by binary text1;
alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20));
insert into t1 values ('teststring ');
select concat('|', text1, '|') from t1 order by text1;
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
select concat('|', text1, '|') from t1 where text1='teststring';
select concat('|', text1, '|') from t1 where text1='teststring ';
alter table t1 modify text1 text not null, pack_keys=1;
select concat('|', text1, '|') from t1 where text1='teststring';
select concat('|', text1, '|') from t1 where text1='teststring ';
explain select concat('|', text1, '|') from t1 where text1='teststring ';
select * from t1 where text1 like 'teststring_%';
select * from t1 where text1='teststring' or text1 like 'teststring_%';
select * from t1 where text1='teststring' or text1 > 'teststring\t';
select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t';
select concat('|', text1, '|') from t1 order by text1;
drop table t1;

View file

@ -75,6 +75,13 @@ select * from t1 where 'a' in (a,b,c collate latin1_bin);
explain extended select * from t1 where 'a' in (a,b,c collate latin1_bin);
drop table t1;
set names utf8;
create table t1 (a char(10) character set utf8 not null);
insert into t1 values ('bbbb'),(_koi8r'ÃÃÃÃ'),(_latin1'ÄÄÄÄ');
select a from t1 where a in ('bbbb',_koi8r'ÃÃÃÃ',_latin1'ÄÄÄÄ') order by a;
drop table t1;
set names latin1;
select '1.0' in (1,2);
select 1 in ('1.0',2);
select 1 in (1,'2.0');

View file

@ -31,11 +31,19 @@ drop table if exists t1,t2;
--enable_warnings
create table t1 (id int(10) not null unique);
create table t2 (id int(10) not null primary key,
val int(10) not null);
create table t2 (id int(10) not null primary key, val int(10) not null);
insert into t1 values (1),(2),(4);
insert into t2 values (1,1),(2,1),(3,1),(4,2);
select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id;
select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id;
drop table t1,t2;
#
# Bug4340: find_in_set is case insensitive even on binary operators
#
select find_in_set(binary 'a',binary 'A,B,C');
select find_in_set('a',binary 'A,B,C');
select find_in_set(binary 'a', 'A,B,C');

View file

@ -172,3 +172,21 @@ insert IGNORE into t1 values ('Garbage');
alter table t1 add spatial index(a);
drop table t1;
#
# Bug #5219: problem with range optimizer
#
create table t1(a geometry not null, spatial index(a));
insert into t1 values
(GeomFromText('POINT(1 1)')), (GeomFromText('POINT(3 3)')),
(GeomFromText('POINT(4 4)')), (GeomFromText('POINT(6 6)'));
select AsText(a) from t1 where
MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
or
MBRContains(GeomFromText('Polygon((2 2, 2 5, 5 5, 5 2, 2 2))'), a);
select AsText(a) from t1 where
MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
and
MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a);
drop table t1;

View file

@ -121,3 +121,4 @@ select
from t1 a left join t3 b on a.id=b.order_id
group by a.id, a.description
having (a.description is not null) and (c=0);
drop table t1,t2,t3;

View file

@ -54,3 +54,13 @@ select C.a, c.a from t1 c, t2 C;
drop table t1, t2;
show tables;
#
# Test all caps database name
#
create table t1 (a int);
select TEST.t1.* from TEST.t1;
alter table t1 rename to T1;
select TEST.t1.* from TEST.t1;
drop table t1;

View file

@ -422,6 +422,18 @@ insert into t1 values('807780', '472', '162');
select * from t1 where a='807780' and b='477' and c='165';
drop table t1;
#
# space-stripping in _mi_prefix_search: BUG#5284
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a varchar(150) NOT NULL, KEY (a));
INSERT t1 VALUES ("can \tcan");
INSERT t1 VALUES ("can can");
INSERT t1 VALUES ("can");
SELECT * FROM t1;
CHECK TABLE t1;
DROP TABLE t1;
#
# Verify blob handling
#

View file

@ -50,7 +50,7 @@ flush tables;
system rm var/master-data/test/t1.frm ;
update t1 set name="Autodiscover" where id = 2;
show status like 'handler_discover%';
select * from t1 order by name;
select * from t1 order by id;
show status like 'handler_discover%';
#

View file

@ -221,6 +221,12 @@ while ($1)
}
enable_query_log;
delete from t2 where a > 5;
select x1.a, x1.b from t2 x1, t2 x2 where x1.b = x2.b order by x1.a;
select a, b FROM t2 outer_table where
a = (select a from t2 where b = outer_table.b ) order by a;
delete from t2;
delete from t3;
delete from t4;

View file

@ -113,24 +113,31 @@ select * from t1 where b<=5 and c=0;
select * from t1 where b=4 and c<=5 order by a;
select * from t1 where b<=4 and c<=5 order by a;
select * from t1 where b<=5 and c=0 or b<=5 and c=2;
select count(*) from t1 where b = 0;
select count(*) from t1 where b = 1;
drop table t1;
#
# Indexing NULL values
#
#CREATE TABLE t1 (
# a int unsigned NOT NULL PRIMARY KEY,
# b int unsigned,
# c int unsigned,
# KEY bc(b,c)
#) engine = ndb;
CREATE TABLE t1 (
a int unsigned NOT NULL PRIMARY KEY,
b int unsigned,
c int unsigned,
KEY bc(b,c)
) engine = ndb;
#insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL);
#select * from t1 use index (bc);
#select count(*) from t1 use index (bc);
#select count(*) from t1 use index (PRIMARY) where b IS NULL;
#select count(*) from t1 use index (bc) where b IS NULL;
#select count(*) from t1 use index (bc) where b IS NULL and c = 2;
#select count(*) from t1 use index (bc) where b IS NOT NULL;
#drop table t1;
insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL);
select * from t1 use index (bc) where b IS NULL;
select * from t1 use index (bc)order by a;
select * from t1 use index (bc) order by a;
select * from t1 use index (PRIMARY) where b IS NULL order by a;
select * from t1 use index (bc) where b IS NULL order by a;
select * from t1 use index (bc) where b IS NULL and c IS NULL order by a;
select * from t1 use index (bc) where b IS NULL and c = 2 order by a;
select * from t1 use index (bc) where b < 4 order by a;
select * from t1 use index (bc) where b IS NOT NULL order by a;
drop table t1;

View file

@ -82,43 +82,43 @@ drop table t3;
# Indexes on NULL-able columns
#
#CREATE TABLE t1 (
# pk int NOT NULL PRIMARY KEY,
# a int unsigned,
# UNIQUE KEY (a)
#) engine=ndbcluster;
CREATE TABLE t1 (
pk int NOT NULL PRIMARY KEY,
a int unsigned,
UNIQUE KEY (a)
) engine=ndbcluster;
#insert into t1 values (-1,NULL), (0,0), (1,NULL),(2,2),(3,NULL),(4,4);
insert into t1 values (-1,NULL), (0,0), (1,NULL),(2,2),(3,NULL),(4,4);
#select * from t1 order by pk;
select * from t1 order by pk;
#--error 1169
#insert into t1 values (5,0);
#select * from t1 order by pk;
#delete from t1 where a = 0;
#insert into t1 values (5,0);
#select * from t1 order by pk;
--error 1169
insert into t1 values (5,0);
select * from t1 order by pk;
delete from t1 where a = 0;
insert into t1 values (5,0);
select * from t1 order by pk;
#CREATE TABLE t2 (
# pk int NOT NULL PRIMARY KEY,
# a int unsigned,
# b tinyint NOT NULL,
# c VARCHAR(10),
# UNIQUE KEY si(a, c)
#) engine=ndbcluster;
CREATE TABLE t2 (
pk int NOT NULL PRIMARY KEY,
a int unsigned,
b tinyint NOT NULL,
c VARCHAR(10),
UNIQUE KEY si(a, c)
) engine=ndbcluster;
#insert into t2 values (-1,1,17,NULL),(0,NULL,18,NULL),(1,3,19,'abc');
insert into t2 values (-1,1,17,NULL),(0,NULL,18,NULL),(1,3,19,'abc');
#select * from t2 order by pk;
select * from t2 order by pk;
#--error 1169
#insert into t2 values(2,3,19,'abc');
#select * from t2 order by pk;
#delete from t2 where c IS NOT NULL;
#insert into t2 values(2,3,19,'abc');
#select * from t2 order by pk;
--error 1169
insert into t2 values(2,3,19,'abc');
select * from t2 order by pk;
delete from t2 where c IS NOT NULL;
insert into t2 values(2,3,19,'abc');
select * from t2 order by pk;
#drop table t1, t2;
drop table t1, t2;
#
# More complex tables

View file

@ -20,7 +20,7 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1);
insert into t1 (gesuchnr, benutzer_id) value (3,2);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
--error 1022
--error 1062
insert into t1 (gesuchnr,benutzer_id) values (1,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
select * from t1 order by gesuchnr;

View file

@ -65,4 +65,8 @@ select * from t1 where not((a < 5 and a < 10) and (not(a > 16) or a > 17));
explain select * from t1 where ((a between 5 and 15) and (not(a like 10)));
select * from t1 where ((a between 5 and 15) and (not(a like 10)));
delete from t1 where a > 3;
select a, not(not(a)) from t1;
explain extended select a, not(not(a)), not(a <= 2 and not(a)), not(a not like "1"), not (a not in (1,2)), not(a != 2) from t1 where not(not(a)) having not(not(a));
drop table t1;

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