mirror of
https://github.com/MariaDB/server.git
synced 2026-05-06 23:25:34 +02:00
Auto-merge from upstream 5.1-bugteam
This commit is contained in:
commit
a58bc1bef3
112 changed files with 1427 additions and 373 deletions
|
|
@ -11,16 +11,33 @@ test -f Makefile && make maintainer-clean
|
|||
path=`dirname $0`
|
||||
. $path/autorun.sh
|
||||
|
||||
gmake=
|
||||
for x in gmake gnumake make; do
|
||||
if $x --version 2>/dev/null | grep GNU > /dev/null; then
|
||||
gmake=$x
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$gmake" ]; then
|
||||
# Our build may not depend on GNU make, but I wouldn't count on it
|
||||
echo "Please install GNU make, and ensure it is in your path as gnumake, gmake, or make" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Default to gcc for CC and CXX
|
||||
if test -z "$CXX" ; then
|
||||
export CXX
|
||||
CXX=gcc
|
||||
# Set some required compile options
|
||||
if test -z "$CXXFLAGS" ; then
|
||||
export CXXFLAGS
|
||||
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$CC" ; then
|
||||
export CC
|
||||
CC=gcc
|
||||
fi
|
||||
|
||||
|
|
@ -28,36 +45,22 @@ fi
|
|||
# Use ccache, if available
|
||||
if ccache -V > /dev/null 2>&1
|
||||
then
|
||||
if echo "$CC" | grep "ccache" > /dev/null
|
||||
if echo "$CC" | grep -v ccache > /dev/null
|
||||
then
|
||||
:
|
||||
else
|
||||
export CC
|
||||
CC="ccache $CC"
|
||||
fi
|
||||
if echo "$CXX" | grep "ccache" > /dev/null
|
||||
if echo "$CXX" | grep -v ccache > /dev/null
|
||||
then
|
||||
:
|
||||
else
|
||||
export CXX
|
||||
CXX="ccache $CXX"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$MAKE"
|
||||
then
|
||||
if gmake -v > /dev/null 2>&1
|
||||
then
|
||||
MAKE="gmake"
|
||||
else
|
||||
MAKE="make"
|
||||
fi
|
||||
fi
|
||||
|
||||
export CC CXX MAKE
|
||||
|
||||
# Make sure to enable all features that affect "make dist"
|
||||
# Remember that configure restricts the man pages to the configured features !
|
||||
./configure \
|
||||
--with-embedded-server \
|
||||
--with-ndbcluster
|
||||
$MAKE
|
||||
$gmake
|
||||
|
||||
|
|
|
|||
23
Makefile.am
23
Makefile.am
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2000-2006 MySQL AB
|
||||
# Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -159,6 +159,8 @@ test-bt:
|
|||
@PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --force --comment=jp --suite=jp
|
||||
-if [ -d mysql-test/suite/nist ] ; then \
|
||||
cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --comment=nist --force --suite=nist ; \
|
||||
|
|
@ -175,15 +177,28 @@ test-bt:
|
|||
echo "no program found for 'embedded' tests - skipped testing" ; \
|
||||
fi
|
||||
|
||||
# Re-enable the "jp" suite when bug#28563 is fixed
|
||||
# -cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
# @PERL@ ./mysql-test-run.pl --force --comment=jp --suite=jp
|
||||
test-bt-fast:
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --comment=ps --force --timer \
|
||||
--skip-ndbcluster --ps-protocol --report-features
|
||||
-if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
|
||||
cd mysql-test ; \
|
||||
MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --comment=ndb --force --timer \
|
||||
--with-ndbcluster-only ; \
|
||||
else \
|
||||
echo "no program found for 'ndbcluster' tests - skipped testing" ; \
|
||||
fi
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
|
||||
|
||||
test-bt-debug:
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --comment=debug --force --timer \
|
||||
--skip-ndbcluster --skip-rpl --report-features
|
||||
|
||||
test-bt-debug-fast:
|
||||
|
||||
# Keep these for a while
|
||||
test-pl: test
|
||||
test-full-pl: test-full
|
||||
|
|
|
|||
|
|
@ -1535,7 +1535,7 @@ static void usage(int version)
|
|||
if (version)
|
||||
return;
|
||||
printf("\
|
||||
Copyright (C) 2000-2008 MySQL AB\n\
|
||||
Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n\
|
||||
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
|
||||
and you are welcome to modify and redistribute it under the GPL license\n");
|
||||
printf("Usage: %s [OPTIONS] [database]\n", my_progname);
|
||||
|
|
|
|||
|
|
@ -634,7 +634,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
case ADMIN_VER:
|
||||
new_line=1;
|
||||
print_version();
|
||||
puts("Copyright (C) 2000-2006 MySQL AB");
|
||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
||||
printf("Server version\t\t%s\n", mysql_get_server_info(mysql));
|
||||
printf("Protocol version\t%d\n", mysql_get_proto_info(mysql));
|
||||
|
|
@ -1023,7 +1023,7 @@ static void print_version(void)
|
|||
static void usage(void)
|
||||
{
|
||||
print_version();
|
||||
puts("Copyright (C) 2000-2006 MySQL AB");
|
||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
||||
puts("Administration program for the mysqld daemon.");
|
||||
printf("Usage: %s [OPTIONS] command command....\n", my_progname);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ static void print_version(void)
|
|||
static void usage(void)
|
||||
{
|
||||
print_version();
|
||||
puts("Copyright (C) 2000-2006 MySQL AB");
|
||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
||||
printf("\
|
||||
Loads tables from text files in various formats. The base name of the\n\
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ static void print_version(void)
|
|||
static void usage(void)
|
||||
{
|
||||
print_version();
|
||||
puts("Copyright (C) 2000-2006 MySQL AB");
|
||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
||||
puts("Shows the structure of a mysql database (databases,tables and columns)\n");
|
||||
printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname);
|
||||
|
|
|
|||
|
|
@ -688,9 +688,7 @@ static void usage(void)
|
|||
{
|
||||
print_version();
|
||||
puts("Copyright (C) 2005 MySQL AB");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\
|
||||
\nand you are welcome to modify and redistribute it under the GPL \
|
||||
license\n");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
||||
puts("Run a query multiple times against the server\n");
|
||||
printf("Usage: %s [OPTIONS]\n",my_progname);
|
||||
print_defaults("my",load_default_groups);
|
||||
|
|
|
|||
|
|
@ -1327,6 +1327,35 @@ static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...)
|
|||
DBUG_RETURN(ret);
|
||||
}
|
||||
|
||||
/*
|
||||
Test if diff is present. This is needed on Windows systems
|
||||
as the OS returns 1 whether diff is successful or if it is
|
||||
not present.
|
||||
|
||||
We run diff -v and look for output in stdout.
|
||||
We don't redirect stderr to stdout to make for a simplified check
|
||||
Windows will output '"diff"' is not recognized... to stderr if it is
|
||||
not present.
|
||||
*/
|
||||
|
||||
int diff_check()
|
||||
{
|
||||
char buf[512]= {0};
|
||||
FILE *res_file;
|
||||
char *cmd = "diff -v";
|
||||
int have_diff = 0;
|
||||
|
||||
if (!(res_file= popen(cmd, "r")))
|
||||
die("popen(\"%s\", \"r\") failed", cmd);
|
||||
|
||||
/* if diff is not present, nothing will be in stdout to increment have_diff */
|
||||
if (fgets(buf, sizeof(buf), res_file))
|
||||
{
|
||||
have_diff += 1;
|
||||
}
|
||||
pclose(res_file);
|
||||
return have_diff;
|
||||
}
|
||||
|
||||
/*
|
||||
Show the diff of two files using the systems builtin diff
|
||||
|
|
@ -1346,34 +1375,51 @@ void show_diff(DYNAMIC_STRING* ds,
|
|||
{
|
||||
|
||||
DYNAMIC_STRING ds_tmp;
|
||||
int have_diff = 0;
|
||||
|
||||
if (init_dynamic_string(&ds_tmp, "", 256, 256))
|
||||
die("Out of memory");
|
||||
|
||||
/* determine if we have diff on Windows
|
||||
needs special processing due to return values
|
||||
on that OS
|
||||
*/
|
||||
have_diff = diff_check();
|
||||
|
||||
/* First try with unified diff */
|
||||
if (run_tool("diff",
|
||||
&ds_tmp, /* Get output from diff in ds_tmp */
|
||||
"-u",
|
||||
filename1,
|
||||
filename2,
|
||||
"2>&1",
|
||||
NULL) > 1) /* Most "diff" tools return >1 if error */
|
||||
if (have_diff)
|
||||
{
|
||||
dynstr_set(&ds_tmp, "");
|
||||
|
||||
/* Fallback to context diff with "diff -c" */
|
||||
/* First try with unified diff */
|
||||
if (run_tool("diff",
|
||||
&ds_tmp, /* Get output from diff in ds_tmp */
|
||||
"-c",
|
||||
"-u",
|
||||
filename1,
|
||||
filename2,
|
||||
"2>&1",
|
||||
NULL) > 1) /* Most "diff" tools return >1 if error */
|
||||
{
|
||||
/*
|
||||
Fallback to dump both files to result file and inform
|
||||
about installing "diff"
|
||||
*/
|
||||
dynstr_set(&ds_tmp, "");
|
||||
|
||||
/* Fallback to context diff with "diff -c" */
|
||||
if (run_tool("diff",
|
||||
&ds_tmp, /* Get output from diff in ds_tmp */
|
||||
"-c",
|
||||
filename1,
|
||||
filename2,
|
||||
"2>&1",
|
||||
NULL) > 1) /* Most "diff" tools return >1 if error */
|
||||
{
|
||||
have_diff= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!(have_diff))
|
||||
{
|
||||
/*
|
||||
Fallback to dump both files to result file and inform
|
||||
about installing "diff"
|
||||
*/
|
||||
|
||||
dynstr_set(&ds_tmp, "");
|
||||
|
||||
dynstr_append(&ds_tmp,
|
||||
|
|
@ -1397,8 +1443,7 @@ void show_diff(DYNAMIC_STRING* ds,
|
|||
dynstr_append(&ds_tmp, " >>>\n");
|
||||
cat_file(&ds_tmp, filename2);
|
||||
dynstr_append(&ds_tmp, "<<<<\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ds)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
|
|||
esac
|
||||
|
||||
# libndbclient versioning when linked with GNU ld.
|
||||
if $LD --version 2>/dev/null|grep -q GNU; then
|
||||
if $LD --version 2>/dev/null|grep GNU >/dev/null 2>&1 ; then
|
||||
NDB_LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/storage/ndb/src/libndb.ver"
|
||||
AC_CONFIG_FILES(storage/ndb/src/libndb.ver)
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -377,7 +377,7 @@ fi
|
|||
MYSQL_PROG_AR
|
||||
|
||||
# libmysqlclient versioning when linked with GNU ld.
|
||||
if $LD --version 2>/dev/null|grep -q GNU; then
|
||||
if $LD --version 2>/dev/null| grep GNU >/dev/null 2>&1; then
|
||||
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libmysql/libmysql.ver"
|
||||
AC_CONFIG_FILES(libmysql/libmysql.ver)
|
||||
fi
|
||||
|
|
@ -449,11 +449,11 @@ AC_SUBST(PERL5)
|
|||
|
||||
# Enable the abi_check rule only if gcc is available
|
||||
|
||||
if expr "$CC" : ".*gcc.*"
|
||||
if test "$GCC" != "yes" || expr "$CC" : ".*icc.*"
|
||||
then
|
||||
ABI_CHECK="abi_check"
|
||||
else
|
||||
ABI_CHECK=""
|
||||
else
|
||||
ABI_CHECK="abi_check"
|
||||
fi
|
||||
|
||||
AC_SUBST(ABI_CHECK)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -380,6 +380,9 @@ inline ulonglong double2ulonglong(double d)
|
|||
#define HAVE_OPENSSL 1
|
||||
#define HAVE_YASSL 1
|
||||
|
||||
#define COMMUNITY_SERVER 1
|
||||
#define ENABLED_PROFILING 1
|
||||
|
||||
/* Define charsets you want */
|
||||
/* #undef HAVE_CHARSET_armscii8 */
|
||||
/* #undef HAVE_CHARSET_ascii */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -472,6 +472,7 @@ my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);
|
|||
uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len);
|
||||
my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
|
||||
my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs);
|
||||
uint my_charset_repertoire(CHARSET_INFO *cs);
|
||||
|
||||
|
||||
#define _MY_U 01 /* Upper case */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
16
mysql-test/include/cleanup_fake_relay_log.inc
Normal file
16
mysql-test/include/cleanup_fake_relay_log.inc
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# ==== Purpose ====
|
||||
#
|
||||
# Clean up files create by setup_fake_relay_log.inc.
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# See setup_fake_relay_log.inc
|
||||
|
||||
--echo Cleaning up after setup_fake_relay_log.inc
|
||||
|
||||
# Remove files.
|
||||
remove_file $_fake_relay_log;
|
||||
remove_file $_fake_relay_index;
|
||||
--disable_query_log
|
||||
eval SET @@global.relay_log_purge= $_fake_relay_log_purge;
|
||||
--enable_query_log
|
||||
16
mysql-test/include/have_simple_parser.inc
Normal file
16
mysql-test/include/have_simple_parser.inc
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
# Check if server has support for loading udf's
|
||||
# i.e it will support dlopen
|
||||
#
|
||||
--require r/have_dynamic_loading.require
|
||||
disable_query_log;
|
||||
show variables like 'have_dynamic_loading';
|
||||
enable_query_log;
|
||||
|
||||
#
|
||||
# Check if the variable SIMPLE_PARSER is set
|
||||
#
|
||||
--require r/have_simple_parser.require
|
||||
disable_query_log;
|
||||
eval select LENGTH('$SIMPLE_PARSER') > 0 as 'have_simple_parser';
|
||||
enable_query_log;
|
||||
|
|
@ -501,4 +501,30 @@ SELECT b,a from t1 WHERE (b!='c' AND b!='f' && b!='h') OR
|
|||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # BUG#40974: Incorrect query results when using clause evaluated using range check
|
||||
--echo #
|
||||
create table t0 (a int);
|
||||
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2);
|
||||
create table t2(a int, b int);
|
||||
insert into t2 values (1,1), (2, 1000);
|
||||
create table t3 (a int, b int, filler char(100), key(a), key(b));
|
||||
|
||||
insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
|
||||
insert into t3 values (1,1,'data');
|
||||
insert into t3 values (1,1,'data');
|
||||
-- echo The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
|
||||
explain select * from t1
|
||||
where exists (select 1 from t2, t3
|
||||
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
|
||||
|
||||
select * from t1
|
||||
where exists (select 1 from t2, t3
|
||||
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
|
||||
|
||||
drop table t0, t1, t2, t3;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
|
|
|||
78
mysql-test/include/setup_fake_relay_log.inc
Normal file
78
mysql-test/include/setup_fake_relay_log.inc
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
# ==== Purpose ====
|
||||
#
|
||||
# Setup replication from an existing relay log in the current
|
||||
# connection.
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# Make sure the slave is not running and issue:
|
||||
#
|
||||
# let $fake_relay_log= /path/to/fake-relay-log-file.000001
|
||||
# source include/setup_fake_relay_log.inc;
|
||||
# START SLAVE SQL_THREAD; # setup_fake_relay_log doesn't start slave
|
||||
# ...
|
||||
# source include/cleanup_fake_relay_log.inc
|
||||
#
|
||||
# You must run the server with --relay-log=FILE. You probably want to
|
||||
# run with --replicate-same-server-id too.
|
||||
#
|
||||
# ==== Implementation ====
|
||||
#
|
||||
# First makes a sanity check, ensuring that the slave threads are not
|
||||
# running. Then copies the $fake_relay_log to RELAY_BIN-fake.000001,
|
||||
# where RELAY_BIN is the basename of the relay log, and updates
|
||||
# RELAY_BIN.index. Finally issues CHANGE MASTER so that it uses the
|
||||
# given files.
|
||||
#
|
||||
# ==== Side effects ====
|
||||
#
|
||||
# Creates a binlog file and a binlog index file, and sets
|
||||
# @@global.relay_log_purge=1. All this is restored when you call
|
||||
# cleanup_fake_relay_log.inc.
|
||||
#
|
||||
# Enables the query log.
|
||||
|
||||
|
||||
--disable_query_log
|
||||
|
||||
# Print message.
|
||||
let $_fake_relay_log_printable= `SELECT REPLACE('$fake_relay_log', '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')`;
|
||||
--echo Setting up fake replication from $_fake_relay_log_printable
|
||||
|
||||
# Sanity check.
|
||||
let $_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
|
||||
let $_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
|
||||
if (`SELECT "$_sql_running" = "Yes" OR "$_io_running" = "Yes"`) {
|
||||
--echo Error: Slave was running when test case sourced
|
||||
--echo include/setup_fake_replication.inc
|
||||
--echo Slave_IO_Running = $_io_running; Slave_SQL_Running = $_sql_running
|
||||
--echo Printing some debug info:
|
||||
SHOW SLAVE STATUS;
|
||||
SHOW MASTER STATUS;
|
||||
SHOW BINLOG EVENTS;
|
||||
SHOW PROCESSLIST;
|
||||
}
|
||||
|
||||
# Read server variables.
|
||||
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
let $_fake_filename= query_get_value(SHOW VARIABLES LIKE 'relay_log', Value, 1);
|
||||
if (`SELECT '$_fake_filename' = ''`) {
|
||||
--echo Badly written test case: relay_log variable is empty. Please use the
|
||||
--echo server option --relay-log=FILE.
|
||||
}
|
||||
let $_fake_relay_log= $MYSQLD_DATADIR/$_fake_filename-fake.000001;
|
||||
let $_fake_relay_index= $MYSQLD_DATADIR/$_fake_filename.index;
|
||||
# Need to restore relay_log_purge in cleanup_fake_relay_log.inc, since
|
||||
# CHANGE MASTER modifies it (see the manual for CHANGE MASTER).
|
||||
let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`;
|
||||
|
||||
# Create relay log file.
|
||||
copy_file $fake_relay_log $_fake_relay_log;
|
||||
|
||||
# Create relay log index.
|
||||
eval SELECT '$_fake_relay_log' INTO OUTFILE '$_fake_relay_index';
|
||||
|
||||
# Setup replication from existing relay log.
|
||||
eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_relay_log', RELAY_LOG_POS=4;
|
||||
|
||||
--enable_query_log
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ our $exe_my_print_defaults;
|
|||
our $exe_perror;
|
||||
our $lib_udf_example;
|
||||
our $lib_example_plugin;
|
||||
our $lib_simple_parser;
|
||||
our $exe_libtool;
|
||||
|
||||
our $opt_bench= 0;
|
||||
|
|
@ -1577,16 +1578,22 @@ sub executable_setup_ndb () {
|
|||
"$glob_basedir/storage/ndb",
|
||||
"$glob_basedir/bin");
|
||||
|
||||
# Some might be found in sbin, not bin.
|
||||
my $daemon_path= mtr_file_exists("$glob_basedir/ndb",
|
||||
"$glob_basedir/storage/ndb",
|
||||
"$glob_basedir/sbin",
|
||||
"$glob_basedir/bin");
|
||||
|
||||
$exe_ndbd=
|
||||
mtr_exe_maybe_exists("$ndb_path/src/kernel/ndbd",
|
||||
"$ndb_path/ndbd",
|
||||
"$daemon_path/ndbd",
|
||||
"$glob_basedir/libexec/ndbd");
|
||||
$exe_ndb_mgm=
|
||||
mtr_exe_maybe_exists("$ndb_path/src/mgmclient/ndb_mgm",
|
||||
"$ndb_path/ndb_mgm");
|
||||
$exe_ndb_mgmd=
|
||||
mtr_exe_maybe_exists("$ndb_path/src/mgmsrv/ndb_mgmd",
|
||||
"$ndb_path/ndb_mgmd",
|
||||
"$daemon_path/ndb_mgmd",
|
||||
"$glob_basedir/libexec/ndb_mgmd");
|
||||
$exe_ndb_waiter=
|
||||
mtr_exe_maybe_exists("$ndb_path/tools/ndb_waiter",
|
||||
|
|
@ -1717,6 +1724,10 @@ sub executable_setup () {
|
|||
mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
|
||||
"$glob_basedir/storage/example/.libs/ha_example.so",);
|
||||
|
||||
# Look for the simple_parser library
|
||||
$lib_simple_parser=
|
||||
mtr_file_exists(vs_config_dirs('plugin/fulltext', 'mypluglib.dll'),
|
||||
"$glob_basedir/plugin/fulltext/.libs/mypluglib.so",);
|
||||
}
|
||||
|
||||
# Look for mysqltest executable
|
||||
|
|
@ -2199,6 +2210,14 @@ sub environment_setup () {
|
|||
$ENV{'EXAMPLE_PLUGIN_OPT'}=
|
||||
($lib_example_plugin ? "--plugin_dir=" . dirname($lib_example_plugin) : "");
|
||||
|
||||
# ----------------------------------------------------
|
||||
# Add the path where mysqld will find mypluglib.so
|
||||
# ----------------------------------------------------
|
||||
$ENV{'SIMPLE_PARSER'}=
|
||||
($lib_simple_parser ? basename($lib_simple_parser) : "");
|
||||
$ENV{'SIMPLE_PARSER_OPT'}=
|
||||
($lib_simple_parser ? "--plugin_dir=" . dirname($lib_simple_parser) : "");
|
||||
|
||||
# ----------------------------------------------------
|
||||
# Setup env so childs can execute myisampack and myisamchk
|
||||
# ----------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1890,5 +1890,7 @@ c1 c2
|
|||
DROP TABLE t1;
|
||||
|
||||
# -- End of Bug#34274
|
||||
create table `me:i`(id int);
|
||||
drop table `me:i`;
|
||||
|
||||
End of 5.1 tests
|
||||
|
|
|
|||
|
|
@ -5394,4 +5394,17 @@ select * from t1;
|
|||
ERROR HY000: File './test/t1.CSV' not found (Errcode: 2)
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
create table t1(a enum ('a') not null) engine=csv;
|
||||
insert into t1 values (2);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'a' at row 1
|
||||
select * from t1 limit 1;
|
||||
ERROR HY000: Table 't1' is marked as crashed and should be repaired
|
||||
repair table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair Warning Data truncated for column 'a' at row 1
|
||||
test.t1 repair status OK
|
||||
select * from t1 limit 1;
|
||||
a
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
|
|
|
|||
|
|
@ -1157,4 +1157,57 @@ set names latin1;
|
|||
select hex(char(0x41 using ucs2));
|
||||
hex(char(0x41 using ucs2))
|
||||
0041
|
||||
SET character_set_connection=ucs2;
|
||||
SELECT CHARSET(DAYNAME(19700101));
|
||||
CHARSET(DAYNAME(19700101))
|
||||
ucs2
|
||||
SELECT CHARSET(MONTHNAME(19700101));
|
||||
CHARSET(MONTHNAME(19700101))
|
||||
ucs2
|
||||
SELECT LOWER(DAYNAME(19700101));
|
||||
LOWER(DAYNAME(19700101))
|
||||
thursday
|
||||
SELECT LOWER(MONTHNAME(19700101));
|
||||
LOWER(MONTHNAME(19700101))
|
||||
january
|
||||
SELECT UPPER(DAYNAME(19700101));
|
||||
UPPER(DAYNAME(19700101))
|
||||
THURSDAY
|
||||
SELECT UPPER(MONTHNAME(19700101));
|
||||
UPPER(MONTHNAME(19700101))
|
||||
JANUARY
|
||||
SELECT HEX(MONTHNAME(19700101));
|
||||
HEX(MONTHNAME(19700101))
|
||||
004A0061006E0075006100720079
|
||||
SELECT HEX(DAYNAME(19700101));
|
||||
HEX(DAYNAME(19700101))
|
||||
00540068007500720073006400610079
|
||||
SET LC_TIME_NAMES=ru_RU;
|
||||
SET NAMES utf8;
|
||||
SET character_set_connection=ucs2;
|
||||
SELECT CHARSET(DAYNAME(19700101));
|
||||
CHARSET(DAYNAME(19700101))
|
||||
ucs2
|
||||
SELECT CHARSET(MONTHNAME(19700101));
|
||||
CHARSET(MONTHNAME(19700101))
|
||||
ucs2
|
||||
SELECT LOWER(DAYNAME(19700101));
|
||||
LOWER(DAYNAME(19700101))
|
||||
четверг
|
||||
SELECT LOWER(MONTHNAME(19700101));
|
||||
LOWER(MONTHNAME(19700101))
|
||||
января
|
||||
SELECT UPPER(DAYNAME(19700101));
|
||||
UPPER(DAYNAME(19700101))
|
||||
ЧЕТВЕРГ
|
||||
SELECT UPPER(MONTHNAME(19700101));
|
||||
UPPER(MONTHNAME(19700101))
|
||||
ЯНВАРЯ
|
||||
SELECT HEX(MONTHNAME(19700101));
|
||||
HEX(MONTHNAME(19700101))
|
||||
042F043D043204300440044F
|
||||
SELECT HEX(DAYNAME(19700101));
|
||||
HEX(DAYNAME(19700101))
|
||||
0427043504420432043504400433
|
||||
SET character_set_connection=latin1;
|
||||
End of 5.0 tests
|
||||
|
|
|
|||
5
mysql-test/r/fulltext_plugin.result
Normal file
5
mysql-test/r/fulltext_plugin.result
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
INSTALL PLUGIN simple_parser SONAME 'mypluglib.so';
|
||||
CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
|
||||
ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
|
||||
DROP TABLE t1;
|
||||
UNINSTALL PLUGIN simple_parser;
|
||||
|
|
@ -575,4 +575,16 @@ id
|
|||
select * from t1 where NOT id in (null, 1);
|
||||
id
|
||||
drop table t1;
|
||||
CREATE TABLE t1(c0 INTEGER, c1 INTEGER, c2 INTEGER);
|
||||
INSERT INTO t1 VALUES(1, 1, 1), (1, 1, 1);
|
||||
SELECT CASE AVG (c0) WHEN c1 * c2 THEN 1 END FROM t1;
|
||||
CASE AVG (c0) WHEN c1 * c2 THEN 1 END
|
||||
1
|
||||
SELECT CASE c1 * c2 WHEN SUM(c0) THEN 1 WHEN AVG(c0) THEN 2 END FROM t1;
|
||||
CASE c1 * c2 WHEN SUM(c0) THEN 1 WHEN AVG(c0) THEN 2 END
|
||||
2
|
||||
SELECT CASE c1 WHEN c1 + 1 THEN 1 END, ABS(AVG(c0)) FROM t1;
|
||||
CASE c1 WHEN c1 + 1 THEN 1 END ABS(AVG(c0))
|
||||
NULL 1.0000
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
|
|
|||
|
|
@ -592,6 +592,21 @@ unix_timestamp('1970-01-01 03:00:01')
|
|||
select unix_timestamp('2038-01-19 07:14:07');
|
||||
unix_timestamp('2038-01-19 07:14:07')
|
||||
0
|
||||
SELECT CHARSET(DAYNAME(19700101));
|
||||
CHARSET(DAYNAME(19700101))
|
||||
latin1
|
||||
SELECT CHARSET(MONTHNAME(19700101));
|
||||
CHARSET(MONTHNAME(19700101))
|
||||
latin1
|
||||
SELECT LOWER(DAYNAME(19700101));
|
||||
LOWER(DAYNAME(19700101))
|
||||
thursday
|
||||
SELECT LOWER(MONTHNAME(19700101));
|
||||
LOWER(MONTHNAME(19700101))
|
||||
january
|
||||
SELECT COERCIBILITY(MONTHNAME('1970-01-01')),COERCIBILITY(DAYNAME('1970-01-01'));
|
||||
COERCIBILITY(MONTHNAME('1970-01-01')) COERCIBILITY(DAYNAME('1970-01-01'))
|
||||
4 4
|
||||
CREATE TABLE t1 (datetime datetime, timestamp timestamp, date date, time time);
|
||||
INSERT INTO t1 values ("2001-01-02 03:04:05", "2002-01-02 03:04:05", "2003-01-02", "06:07:08");
|
||||
SELECT * from t1;
|
||||
|
|
|
|||
|
|
@ -1246,6 +1246,11 @@ drop user 'greg'@'localhost';
|
|||
drop view v1;
|
||||
drop table test;
|
||||
drop function test_function;
|
||||
SELECT CURRENT_USER();
|
||||
CURRENT_USER()
|
||||
root@localhost
|
||||
SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
|
||||
SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
|
||||
End of 5.0 tests
|
||||
set names utf8;
|
||||
grant select on test.* to юзер_юзер@localhost;
|
||||
|
|
|
|||
2
mysql-test/r/have_simple_parser.require
Normal file
2
mysql-test/r/have_simple_parser.require
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
have_simple_parser
|
||||
1
|
||||
|
|
@ -529,6 +529,34 @@ b a
|
|||
y
|
||||
z
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#40974: Incorrect query results when using clause evaluated using range check
|
||||
#
|
||||
create table t0 (a int);
|
||||
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2);
|
||||
create table t2(a int, b int);
|
||||
insert into t2 values (1,1), (2, 1000);
|
||||
create table t3 (a int, b int, filler char(100), key(a), key(b));
|
||||
insert into t3 select 1000, 1000,'filler' from t0 A, t0 B, t0 C;
|
||||
insert into t3 values (1,1,'data');
|
||||
insert into t3 values (1,1,'data');
|
||||
The plan should be ALL/ALL/ALL(Range checked for each record (index map: 0x3)
|
||||
explain select * from t1
|
||||
where exists (select 1 from t2, t3
|
||||
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
|
||||
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||
2 DEPENDENT SUBQUERY t3 ALL a,b NULL NULL NULL 1002 Range checked for each record (index map: 0x3)
|
||||
select * from t1
|
||||
where exists (select 1 from t2, t3
|
||||
where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
|
||||
a
|
||||
1
|
||||
2
|
||||
drop table t0, t1, t2, t3;
|
||||
End of 5.0 tests
|
||||
#---------------- ROR-index_merge tests -----------------------
|
||||
SET SESSION STORAGE_ENGINE = MyISAM;
|
||||
|
|
|
|||
|
|
@ -4340,6 +4340,39 @@ Handler_read_prev 0
|
|||
Handler_read_rnd 0
|
||||
Handler_read_rnd_next 6
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0',
|
||||
f2 int(11) NOT NULL default '0',
|
||||
f3 bigint(20) NOT NULL default '0',
|
||||
f4 varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (f1),
|
||||
KEY key1 (f4),
|
||||
KEY key2 (f2));
|
||||
CREATE TABLE t2 (f1 int(11) NOT NULL default '0',
|
||||
f2 enum('A1','A2','A3') NOT NULL default 'A1',
|
||||
f3 int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (f1),
|
||||
KEY key1 (f3));
|
||||
CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0',
|
||||
f2 datetime NOT NULL default '1980-01-01 00:00:00',
|
||||
PRIMARY KEY (f1));
|
||||
insert into t1 values (1, 1, 1, 'abc');
|
||||
insert into t1 values (2, 1, 2, 'def');
|
||||
insert into t1 values (3, 1, 2, 'def');
|
||||
insert into t2 values (1, 'A1', 1);
|
||||
insert into t3 values (1, '1980-01-01');
|
||||
SELECT a.f3, cr.f4, count(*) count
|
||||
FROM t2 a
|
||||
STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1
|
||||
LEFT JOIN
|
||||
(t1 cr2
|
||||
JOIN t3 ae2 ON cr2.f3 = ae2.f1
|
||||
) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND
|
||||
cr.f4 = cr2.f4
|
||||
GROUP BY a.f3, cr.f4;
|
||||
f3 f4 count
|
||||
1 abc 1
|
||||
1 def 2
|
||||
drop table t1, t2, t3;
|
||||
End of 5.0 tests
|
||||
create table t1(a INT, KEY (a));
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
|
||||
|
|
|
|||
|
|
@ -209,4 +209,29 @@ ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table '
|
|||
drop database db37908;
|
||||
drop procedure proc37908;
|
||||
drop function func37908;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
CREATE FUNCTION f1() RETURNS INTEGER
|
||||
BEGIN
|
||||
DECLARE foo INTEGER;
|
||||
DECLARE bar INTEGER;
|
||||
SET foo=1;
|
||||
SET bar=2;
|
||||
RETURN foo;
|
||||
END $$
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
SELECT 1;
|
||||
END $$
|
||||
SELECT f1();
|
||||
f1()
|
||||
1
|
||||
CALL p1();
|
||||
1
|
||||
1
|
||||
SELECT 9;
|
||||
9
|
||||
9
|
||||
DROP PROCEDURE p1;
|
||||
DROP FUNCTION f1;
|
||||
set @@global.concurrent_insert= @old_concurrent_insert;
|
||||
|
|
|
|||
|
|
@ -1347,6 +1347,13 @@ t1 CREATE TABLE `t1` (
|
|||
`i` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*'
|
||||
drop table t1;
|
||||
CREATE TABLE t3 (f1 INT) COMMENT 'כקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחן';
|
||||
SHOW CREATE TABLE t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`f1` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='כקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחן'
|
||||
DROP TABLE t3;
|
||||
set sql_mode= 'traditional';
|
||||
create table t1(col1 tinyint, col2 tinyint unsigned,
|
||||
col3 smallint, col4 smallint unsigned,
|
||||
|
|
|
|||
BIN
mysql-test/std_data/bug40482-bin.000001
Normal file
BIN
mysql-test/std_data/bug40482-bin.000001
Normal file
Binary file not shown.
8
mysql-test/suite/rpl/r/rpl_binlog_corruption.result
Normal file
8
mysql-test/suite/rpl/r/rpl_binlog_corruption.result
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
call mtr.add_suppression('Found invalid event in binary log');
|
||||
==== Initialize ====
|
||||
Setting up fake replication from MYSQL_TEST_DIR/std_data/bug40482-bin.000001
|
||||
==== Test ====
|
||||
START SLAVE SQL_THREAD;
|
||||
Last_SQL_Error = Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
|
||||
==== Clean up ====
|
||||
Cleaning up after setup_fake_relay_log.inc
|
||||
|
|
@ -10,3 +10,4 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
rpl_binlog_corruption : BUG#41793 2008-12-30 sven rpl_binlog_corruption disabled in main (needs new mtr)
|
||||
|
|
|
|||
1
mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
Normal file
1
mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
Normal file
|
|
@ -0,0 +1 @@
|
|||
--replicate-same-server-id --relay-log=slave-relay-bin
|
||||
42
mysql-test/suite/rpl/t/rpl_binlog_corruption.test
Normal file
42
mysql-test/suite/rpl/t/rpl_binlog_corruption.test
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# ==== Purpose ====
|
||||
#
|
||||
# Verify that the slave stops gracefully when reading a relay log with
|
||||
# corrupted data.
|
||||
#
|
||||
# ==== Implementation ====
|
||||
#
|
||||
# Setup "fake replication" where the slave only starts the SQL thread,
|
||||
# not the IO thread, and reads from an existing relay log that has
|
||||
# been prepared so that it contains the error. This requires some
|
||||
# extra server options: see the -master.opt file.
|
||||
#
|
||||
# ==== Related bugs ====
|
||||
#
|
||||
# BUG#31793: log event corruption causes crash
|
||||
# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
|
||||
|
||||
source include/have_log_bin.inc;
|
||||
# BUG#40482 only manifested itself in debug-compiled binaries.
|
||||
source include/have_debug.inc;
|
||||
|
||||
call mtr.add_suppression('Found invalid event in binary log');
|
||||
|
||||
|
||||
#
|
||||
# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
|
||||
#
|
||||
# The relay log contains an Incident_log_event with a non-existing
|
||||
# incident number.
|
||||
|
||||
--echo ==== Initialize ====
|
||||
let $fake_relay_log= $MYSQL_TEST_DIR/std_data/bug40482-bin.000001;
|
||||
source include/setup_fake_relay_log.inc;
|
||||
|
||||
--echo ==== Test ====
|
||||
START SLAVE SQL_THREAD;
|
||||
source include/wait_for_slave_sql_error.inc;
|
||||
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
|
||||
--echo Last_SQL_Error = $error
|
||||
|
||||
--echo ==== Clean up ====
|
||||
source include/cleanup_fake_relay_log.inc;
|
||||
|
|
@ -1532,5 +1532,11 @@ DROP TABLE t1;
|
|||
|
||||
###########################################################################
|
||||
|
||||
#
|
||||
# Bug#40104 regression with table names?
|
||||
#
|
||||
create table `me:i`(id int);
|
||||
drop table `me:i`;
|
||||
|
||||
--echo
|
||||
--echo End of 5.1 tests
|
||||
|
|
|
|||
|
|
@ -1804,4 +1804,17 @@ unlock tables;
|
|||
drop table t1;
|
||||
--disconnect con1
|
||||
|
||||
#
|
||||
# Bug#41441 repair csv table crashes debug server
|
||||
#
|
||||
# Note: The test should be removed after Bug#33717 is fixed
|
||||
|
||||
create table t1(a enum ('a') not null) engine=csv;
|
||||
insert into t1 values (2);
|
||||
--error ER_CRASHED_ON_USAGE
|
||||
select * from t1 limit 1;
|
||||
repair table t1;
|
||||
select * from t1 limit 1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
|
|
|||
|
|
@ -697,4 +697,29 @@ set names latin1;
|
|||
#
|
||||
select hex(char(0x41 using ucs2));
|
||||
|
||||
#
|
||||
# Bug#37575: UCASE fails on monthname
|
||||
#
|
||||
SET character_set_connection=ucs2;
|
||||
SELECT CHARSET(DAYNAME(19700101));
|
||||
SELECT CHARSET(MONTHNAME(19700101));
|
||||
SELECT LOWER(DAYNAME(19700101));
|
||||
SELECT LOWER(MONTHNAME(19700101));
|
||||
SELECT UPPER(DAYNAME(19700101));
|
||||
SELECT UPPER(MONTHNAME(19700101));
|
||||
SELECT HEX(MONTHNAME(19700101));
|
||||
SELECT HEX(DAYNAME(19700101));
|
||||
SET LC_TIME_NAMES=ru_RU;
|
||||
SET NAMES utf8;
|
||||
SET character_set_connection=ucs2;
|
||||
SELECT CHARSET(DAYNAME(19700101));
|
||||
SELECT CHARSET(MONTHNAME(19700101));
|
||||
SELECT LOWER(DAYNAME(19700101));
|
||||
SELECT LOWER(MONTHNAME(19700101));
|
||||
SELECT UPPER(DAYNAME(19700101));
|
||||
SELECT UPPER(MONTHNAME(19700101));
|
||||
SELECT HEX(MONTHNAME(19700101));
|
||||
SELECT HEX(DAYNAME(19700101));
|
||||
SET character_set_connection=latin1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
|
|
|||
1
mysql-test/t/fulltext_plugin-master.opt
Normal file
1
mysql-test/t/fulltext_plugin-master.opt
Normal file
|
|
@ -0,0 +1 @@
|
|||
$SIMPLE_PARSER_OPT
|
||||
10
mysql-test/t/fulltext_plugin.test
Normal file
10
mysql-test/t/fulltext_plugin.test
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
--source include/have_simple_parser.inc
|
||||
|
||||
#
|
||||
# BUG#39746 - Debug flag breaks struct definition (server crash)
|
||||
#
|
||||
INSTALL PLUGIN simple_parser SONAME 'mypluglib.so';
|
||||
CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
|
||||
ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
|
||||
DROP TABLE t1;
|
||||
UNINSTALL PLUGIN simple_parser;
|
||||
|
|
@ -426,4 +426,17 @@ select * from t1 where NOT id in (select null union all select 1);
|
|||
select * from t1 where NOT id in (null, 1);
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #41363: crash of mysqld on windows with aggregate in case
|
||||
#
|
||||
|
||||
CREATE TABLE t1(c0 INTEGER, c1 INTEGER, c2 INTEGER);
|
||||
INSERT INTO t1 VALUES(1, 1, 1), (1, 1, 1);
|
||||
|
||||
SELECT CASE AVG (c0) WHEN c1 * c2 THEN 1 END FROM t1;
|
||||
SELECT CASE c1 * c2 WHEN SUM(c0) THEN 1 WHEN AVG(c0) THEN 2 END FROM t1;
|
||||
SELECT CASE c1 WHEN c1 + 1 THEN 1 END, ABS(AVG(c0)) FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
|
|
|||
|
|
@ -304,6 +304,15 @@ select unix_timestamp('1970-01-01 03:00:01');
|
|||
# check bad date, close to the boundary (we cut them off in the very end)
|
||||
select unix_timestamp('2038-01-19 07:14:07');
|
||||
|
||||
#
|
||||
# Bug #28759: DAYNAME() and MONTHNAME() return binary string
|
||||
#
|
||||
|
||||
SELECT CHARSET(DAYNAME(19700101));
|
||||
SELECT CHARSET(MONTHNAME(19700101));
|
||||
SELECT LOWER(DAYNAME(19700101));
|
||||
SELECT LOWER(MONTHNAME(19700101));
|
||||
SELECT COERCIBILITY(MONTHNAME('1970-01-01')),COERCIBILITY(DAYNAME('1970-01-01'));
|
||||
|
||||
#
|
||||
# Test types from + INTERVAL
|
||||
|
|
|
|||
|
|
@ -1294,6 +1294,13 @@ drop view v1;
|
|||
drop table test;
|
||||
drop function test_function;
|
||||
|
||||
#
|
||||
# Bug#41456 SET PASSWORD hates CURRENT_USER()
|
||||
#
|
||||
SELECT CURRENT_USER();
|
||||
SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
|
||||
SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
|
|
|
|||
|
|
@ -3690,6 +3690,42 @@ SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3;
|
|||
SHOW STATUS LIKE 'Handler_read%';
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# Bug#40953 SELECT query throws "ERROR 1062 (23000): Duplicate entry..." error
|
||||
#
|
||||
CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0',
|
||||
f2 int(11) NOT NULL default '0',
|
||||
f3 bigint(20) NOT NULL default '0',
|
||||
f4 varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (f1),
|
||||
KEY key1 (f4),
|
||||
KEY key2 (f2));
|
||||
CREATE TABLE t2 (f1 int(11) NOT NULL default '0',
|
||||
f2 enum('A1','A2','A3') NOT NULL default 'A1',
|
||||
f3 int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (f1),
|
||||
KEY key1 (f3));
|
||||
CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0',
|
||||
f2 datetime NOT NULL default '1980-01-01 00:00:00',
|
||||
PRIMARY KEY (f1));
|
||||
|
||||
insert into t1 values (1, 1, 1, 'abc');
|
||||
insert into t1 values (2, 1, 2, 'def');
|
||||
insert into t1 values (3, 1, 2, 'def');
|
||||
insert into t2 values (1, 'A1', 1);
|
||||
insert into t3 values (1, '1980-01-01');
|
||||
|
||||
SELECT a.f3, cr.f4, count(*) count
|
||||
FROM t2 a
|
||||
STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1
|
||||
LEFT JOIN
|
||||
(t1 cr2
|
||||
JOIN t3 ae2 ON cr2.f3 = ae2.f1
|
||||
) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND
|
||||
cr.f4 = cr2.f4
|
||||
GROUP BY a.f3, cr.f4;
|
||||
|
||||
drop table t1, t2, t3;
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
|
|
|
|||
|
|
@ -238,6 +238,8 @@ let $tmp_table2 = `show global status like 'Created_tmp_tables'`;
|
|||
--disable_query_log
|
||||
eval select substring_index('$rnd_next2',0x9,-1)-substring_index('$rnd_next',0x9,-1) as rnd_diff, substring_index('$tmp_table2',0x9,-1)-substring_index('$tmp_table',0x9,-1) as tmp_table_diff;
|
||||
--enable_query_log
|
||||
disconnect con1;
|
||||
connection default;
|
||||
|
||||
#
|
||||
# Bug#30252 Com_create_function is not incremented.
|
||||
|
|
@ -291,6 +293,43 @@ connection root;
|
|||
drop database db37908;
|
||||
drop procedure proc37908;
|
||||
drop function func37908;
|
||||
|
||||
#
|
||||
# Bug#41131 "Questions" fails to increment - ignores statements instead stored procs
|
||||
#
|
||||
connect (con1,localhost,root,,);
|
||||
connection con1;
|
||||
--disable_warnings
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
--enable_warnings
|
||||
DELIMITER $$;
|
||||
CREATE FUNCTION f1() RETURNS INTEGER
|
||||
BEGIN
|
||||
DECLARE foo INTEGER;
|
||||
DECLARE bar INTEGER;
|
||||
SET foo=1;
|
||||
SET bar=2;
|
||||
RETURN foo;
|
||||
END $$
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
SELECT 1;
|
||||
END $$
|
||||
DELIMITER ;$$
|
||||
let $org_queries= `SHOW STATUS LIKE 'Queries'`;
|
||||
SELECT f1();
|
||||
CALL p1();
|
||||
let $new_queries= `SHOW STATUS LIKE 'Queries'`;
|
||||
--disable_log
|
||||
let $diff= `SELECT SUBSTRING('$new_queries',9)-SUBSTRING('$org_queries',9)`;
|
||||
--enable_log
|
||||
eval SELECT $diff;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
DROP PROCEDURE p1;
|
||||
DROP FUNCTION f1;
|
||||
|
||||
# End of 5.1 tests
|
||||
|
||||
# Restore global concurrent_insert value. Keep in the end of the test file.
|
||||
|
|
|
|||
|
|
@ -1198,6 +1198,15 @@ comment '123456789*123456789*123456789*123456789*123456789*123456789*';
|
|||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #39591: Crash if table comment is longer than 62 characters
|
||||
#
|
||||
|
||||
#60 chars, 120 (+1) bytes (UTF-8 with 2-byte chars)
|
||||
CREATE TABLE t3 (f1 INT) COMMENT 'כקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחןכקבהחן';
|
||||
SHOW CREATE TABLE t3;
|
||||
DROP TABLE t3;
|
||||
|
||||
#
|
||||
# Bug #26359: Strings becoming truncated and converted to numbers under STRICT mode
|
||||
#
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2004-2006 MySQL AB
|
||||
/* Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ int main(int argc,char **argv)
|
|||
printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n");
|
||||
|
||||
printf("\
|
||||
/* Copyright (C) 2001-2004 MySQL AB\n\
|
||||
/* Copyright 2001-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n\
|
||||
\n\
|
||||
This program is free software; you can redistribute it and/or modify\n\
|
||||
it under the terms of the GNU General Public License as published by\n\
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2005 MySQL AB
|
||||
/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2005 MySQL AB
|
||||
/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -2713,6 +2713,16 @@ void Item_func_case::fix_length_and_dec()
|
|||
nagg++;
|
||||
if (!(found_types= collect_cmp_types(agg, nagg)))
|
||||
return;
|
||||
if (with_sum_func || current_thd->lex->current_select->group_list.elements)
|
||||
{
|
||||
/*
|
||||
See TODO commentary in the setup_copy_fields function:
|
||||
item in a group may be wrapped with an Item_copy_string item.
|
||||
That item has a STRING_RESULT result type, so we need
|
||||
to take this type into account.
|
||||
*/
|
||||
found_types |= (1 << item_cmp_type(left_result_type, STRING_RESULT));
|
||||
}
|
||||
|
||||
for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1033,12 +1033,25 @@ longlong Item_func_month::val_int()
|
|||
}
|
||||
|
||||
|
||||
void Item_func_monthname::fix_length_and_dec()
|
||||
{
|
||||
THD* thd= current_thd;
|
||||
CHARSET_INFO *cs= thd->variables.collation_connection;
|
||||
uint32 repertoire= my_charset_repertoire(cs);
|
||||
locale= thd->variables.lc_time_names;
|
||||
collation.set(cs, DERIVATION_COERCIBLE, repertoire);
|
||||
decimals=0;
|
||||
max_length= locale->max_month_name_length * collation.collation->mbmaxlen;
|
||||
maybe_null=1;
|
||||
}
|
||||
|
||||
|
||||
String* Item_func_monthname::val_str(String* str)
|
||||
{
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
const char *month_name;
|
||||
uint month= (uint) val_int();
|
||||
THD *thd= current_thd;
|
||||
uint month= (uint) val_int();
|
||||
uint err;
|
||||
|
||||
if (null_value || !month)
|
||||
{
|
||||
|
|
@ -1046,8 +1059,9 @@ String* Item_func_monthname::val_str(String* str)
|
|||
return (String*) 0;
|
||||
}
|
||||
null_value=0;
|
||||
month_name= thd->variables.lc_time_names->month_names->type_names[month-1];
|
||||
str->set(month_name, strlen(month_name), system_charset_info);
|
||||
month_name= locale->month_names->type_names[month-1];
|
||||
str->copy(month_name, strlen(month_name), &my_charset_utf8_bin,
|
||||
collation.collation, &err);
|
||||
return str;
|
||||
}
|
||||
|
||||
|
|
@ -1172,19 +1186,32 @@ longlong Item_func_weekday::val_int()
|
|||
odbc_type) + test(odbc_type);
|
||||
}
|
||||
|
||||
void Item_func_dayname::fix_length_and_dec()
|
||||
{
|
||||
THD* thd= current_thd;
|
||||
CHARSET_INFO *cs= thd->variables.collation_connection;
|
||||
uint32 repertoire= my_charset_repertoire(cs);
|
||||
locale= thd->variables.lc_time_names;
|
||||
collation.set(cs, DERIVATION_COERCIBLE, repertoire);
|
||||
decimals=0;
|
||||
max_length= locale->max_day_name_length * collation.collation->mbmaxlen;
|
||||
maybe_null=1;
|
||||
}
|
||||
|
||||
|
||||
String* Item_func_dayname::val_str(String* str)
|
||||
{
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
uint weekday=(uint) val_int(); // Always Item_func_daynr()
|
||||
const char *day_name;
|
||||
THD *thd= current_thd;
|
||||
uint err;
|
||||
|
||||
if (null_value)
|
||||
return (String*) 0;
|
||||
|
||||
day_name= thd->variables.lc_time_names->day_names->type_names[weekday];
|
||||
str->set(day_name, strlen(day_name), system_charset_info);
|
||||
day_name= locale->day_names->type_names[weekday];
|
||||
str->copy(day_name, strlen(day_name), &my_charset_utf8_bin,
|
||||
collation.collation, &err);
|
||||
return str;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,18 +116,13 @@ public:
|
|||
|
||||
class Item_func_monthname :public Item_func_month
|
||||
{
|
||||
MY_LOCALE *locale;
|
||||
public:
|
||||
Item_func_monthname(Item *a) :Item_func_month(a) {}
|
||||
const char *func_name() const { return "monthname"; }
|
||||
String *val_str(String *str);
|
||||
enum Item_result result_type () const { return STRING_RESULT; }
|
||||
void fix_length_and_dec()
|
||||
{
|
||||
collation.set(&my_charset_bin);
|
||||
decimals=0;
|
||||
max_length=10*my_charset_bin.mbmaxlen;
|
||||
maybe_null=1;
|
||||
}
|
||||
void fix_length_and_dec();
|
||||
bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
|
||||
};
|
||||
|
||||
|
|
@ -291,18 +286,13 @@ public:
|
|||
|
||||
class Item_func_dayname :public Item_func_weekday
|
||||
{
|
||||
MY_LOCALE *locale;
|
||||
public:
|
||||
Item_func_dayname(Item *a) :Item_func_weekday(a,0) {}
|
||||
const char *func_name() const { return "dayname"; }
|
||||
String *val_str(String *str);
|
||||
enum Item_result result_type () const { return STRING_RESULT; }
|
||||
void fix_length_and_dec()
|
||||
{
|
||||
collation.set(&my_charset_bin);
|
||||
decimals=0;
|
||||
max_length=9*MY_CHARSET_BIN_MB_MAXLEN;
|
||||
maybe_null=1;
|
||||
}
|
||||
void fix_length_and_dec();
|
||||
bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2004 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -9057,7 +9057,17 @@ Incident_log_event::Incident_log_event(const char *buf, uint event_len,
|
|||
DBUG_PRINT("info",("event_len: %u; common_header_len: %d; post_header_len: %d",
|
||||
event_len, common_header_len, post_header_len));
|
||||
|
||||
m_incident= static_cast<Incident>(uint2korr(buf + common_header_len));
|
||||
int incident_number= uint2korr(buf + common_header_len);
|
||||
if (incident_number >= INCIDENT_COUNT ||
|
||||
incident_number <= INCIDENT_NONE)
|
||||
{
|
||||
// If the incident is not recognized, this binlog event is
|
||||
// invalid. If we set incident_number to INCIDENT_NONE, the
|
||||
// invalidity will be detected by is_valid().
|
||||
incident_number= INCIDENT_NONE;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
m_incident= static_cast<Incident>(incident_number);
|
||||
char const *ptr= buf + common_header_len + post_header_len;
|
||||
char const *const str_end= buf + event_len;
|
||||
uint8 len= 0; // Assignment to keep compiler happy
|
||||
|
|
@ -9085,9 +9095,6 @@ Incident_log_event::description() const
|
|||
|
||||
DBUG_PRINT("info", ("m_incident: %d", m_incident));
|
||||
|
||||
DBUG_ASSERT(0 <= m_incident);
|
||||
DBUG_ASSERT((size_t) m_incident <= sizeof(description)/sizeof(*description));
|
||||
|
||||
return description[m_incident];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3870,7 +3870,10 @@ public:
|
|||
|
||||
virtual Log_event_type get_type_code() { return INCIDENT_EVENT; }
|
||||
|
||||
virtual bool is_valid() const { return 1; }
|
||||
virtual bool is_valid() const
|
||||
{
|
||||
return m_incident > INCIDENT_NONE && m_incident < INCIDENT_COUNT;
|
||||
}
|
||||
virtual int get_data_size() {
|
||||
return INCIDENT_HEADER_LEN + 1 + m_message.length;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -148,15 +148,20 @@ typedef struct my_locale_st
|
|||
TYPELIB *ab_month_names;
|
||||
TYPELIB *day_names;
|
||||
TYPELIB *ab_day_names;
|
||||
uint max_month_name_length;
|
||||
uint max_day_name_length;
|
||||
#ifdef __cplusplus
|
||||
my_locale_st(uint number_par,
|
||||
const char *name_par, const char *descr_par, bool is_ascii_par,
|
||||
TYPELIB *month_names_par, TYPELIB *ab_month_names_par,
|
||||
TYPELIB *day_names_par, TYPELIB *ab_day_names_par) :
|
||||
TYPELIB *day_names_par, TYPELIB *ab_day_names_par,
|
||||
uint max_month_name_length_par, uint max_day_name_length_par) :
|
||||
number(number_par),
|
||||
name(name_par), description(descr_par), is_ascii(is_ascii_par),
|
||||
month_names(month_names_par), ab_month_names(ab_month_names_par),
|
||||
day_names(day_names_par), ab_day_names(ab_day_names_par)
|
||||
day_names(day_names_par), ab_day_names(ab_day_names_par),
|
||||
max_month_name_length(max_month_name_length_par),
|
||||
max_day_name_length(max_day_name_length_par)
|
||||
{}
|
||||
#endif
|
||||
} MY_LOCALE;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -230,7 +230,7 @@ extern "C" sig_handler handle_segfault(int sig);
|
|||
#if defined(__linux__)
|
||||
#define ENABLE_TEMP_POOL 1
|
||||
#else
|
||||
#define ENABLE_TEMP_TOOL 0
|
||||
#define ENABLE_TEMP_POOL 0
|
||||
#endif
|
||||
|
||||
/* Constants */
|
||||
|
|
@ -4129,6 +4129,44 @@ void decrement_handler_count()
|
|||
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
#ifndef DBUG_OFF
|
||||
/*
|
||||
Debugging helper function to keep the locale database
|
||||
(see sql_locale.cc) and max_month_name_length and
|
||||
max_day_name_length variable values in consistent state.
|
||||
*/
|
||||
static void test_lc_time_sz()
|
||||
{
|
||||
DBUG_ENTER("test_lc_time_sz");
|
||||
for (MY_LOCALE **loc= my_locales; *loc; loc++)
|
||||
{
|
||||
uint max_month_len= 0;
|
||||
uint max_day_len = 0;
|
||||
for (const char **month= (*loc)->month_names->type_names; *month; month++)
|
||||
{
|
||||
set_if_bigger(max_month_len,
|
||||
my_numchars_mb(&my_charset_utf8_general_ci,
|
||||
*month, *month + strlen(*month)));
|
||||
}
|
||||
for (const char **day= (*loc)->day_names->type_names; *day; day++)
|
||||
{
|
||||
set_if_bigger(max_day_len,
|
||||
my_numchars_mb(&my_charset_utf8_general_ci,
|
||||
*day, *day + strlen(*day)));
|
||||
}
|
||||
if ((*loc)->max_month_name_length != max_month_len ||
|
||||
(*loc)->max_day_name_length != max_day_len)
|
||||
{
|
||||
DBUG_PRINT("Wrong max day name(or month name) length for locale:",
|
||||
("%s", (*loc)->name));
|
||||
DBUG_ASSERT(0);
|
||||
}
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
#endif//DBUG_OFF
|
||||
|
||||
|
||||
#ifdef __WIN__
|
||||
int win_main(int argc, char **argv)
|
||||
#else
|
||||
|
|
@ -4229,6 +4267,10 @@ int main(int argc, char **argv)
|
|||
openlog(libwrapName, LOG_PID, LOG_AUTH);
|
||||
#endif
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
test_lc_time_sz();
|
||||
#endif
|
||||
|
||||
/*
|
||||
We have enough space for fiddling with the argv, continue
|
||||
*/
|
||||
|
|
@ -6868,6 +6910,14 @@ The minimum value for this variable is 4096.",
|
|||
};
|
||||
|
||||
|
||||
static int show_queries(THD *thd, SHOW_VAR *var, char *buff)
|
||||
{
|
||||
var->type= SHOW_LONGLONG;
|
||||
var->value= (char *)&thd->query_id;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int show_net_compression(THD *thd, SHOW_VAR *var, char *buff)
|
||||
{
|
||||
var->type= SHOW_MY_BOOL;
|
||||
|
|
@ -7283,6 +7333,7 @@ SHOW_VAR status_vars[]= {
|
|||
{"Qcache_queries_in_cache", (char*) &query_cache.queries_in_cache, SHOW_LONG_NOFLUSH},
|
||||
{"Qcache_total_blocks", (char*) &query_cache.total_blocks, SHOW_LONG_NOFLUSH},
|
||||
#endif /*HAVE_QUERY_CACHE*/
|
||||
{"Queries", (char*) &show_queries, SHOW_FUNC},
|
||||
{"Questions", (char*) offsetof(STATUS_VAR, questions), SHOW_LONG_STATUS},
|
||||
#ifdef HAVE_REPLICATION
|
||||
{"Rpl_status", (char*) &show_rpl_status, SHOW_FUNC},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1245,6 +1245,9 @@ QUICK_INDEX_MERGE_SELECT::~QUICK_INDEX_MERGE_SELECT()
|
|||
quick->file= NULL;
|
||||
quick_selects.delete_elements();
|
||||
delete pk_quick_select;
|
||||
/* It's ok to call the next two even if they are already deinitialized */
|
||||
end_read_record(&read_record);
|
||||
free_io_cache(head);
|
||||
free_root(&alloc,MYF(0));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2006 MySQL AB
|
||||
/* Copyright 2006-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@
|
|||
*/
|
||||
enum Incident {
|
||||
/** No incident */
|
||||
INCIDENT_NONE,
|
||||
INCIDENT_NONE = 0,
|
||||
|
||||
/** There are possibly lost events in the replication stream */
|
||||
INCIDENT_LOST_EVENTS,
|
||||
INCIDENT_LOST_EVENTS = 1,
|
||||
|
||||
/** Shall be last event of the enumeration */
|
||||
INCIDENT_COUNT
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -3549,6 +3549,7 @@ int set_var_password::check(THD *thd)
|
|||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
if (!user->host.str)
|
||||
{
|
||||
DBUG_ASSERT(thd->security_ctx->priv_host);
|
||||
if (*thd->security_ctx->priv_host != 0)
|
||||
{
|
||||
user->host.str= (char *) thd->security_ctx->priv_host;
|
||||
|
|
@ -3560,6 +3561,12 @@ int set_var_password::check(THD *thd)
|
|||
user->host.length= 1;
|
||||
}
|
||||
}
|
||||
if (!user->user.str)
|
||||
{
|
||||
DBUG_ASSERT(thd->security_ctx->priv_user);
|
||||
user->user.str= (char *) thd->security_ctx->priv_user;
|
||||
user->user.length= strlen(thd->security_ctx->priv_user);
|
||||
}
|
||||
/* Returns 1 as the function sends error to client */
|
||||
return check_change_password(thd, user->host.str, user->user.str,
|
||||
password, strlen(password)) ? 1 : 0;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2002 MySQL AB
|
||||
/* Copyright 2002-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
123
sql/sql_acl.cc
123
sql/sql_acl.cc
|
|
@ -6304,10 +6304,12 @@ int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr)
|
|||
}
|
||||
|
||||
|
||||
void update_schema_privilege(TABLE *table, char *buff, const char* db,
|
||||
const char* t_name, const char* column,
|
||||
uint col_length, const char *priv,
|
||||
uint priv_length, const char* is_grantable)
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
static bool update_schema_privilege(THD *thd, TABLE *table, char *buff,
|
||||
const char* db, const char* t_name,
|
||||
const char* column, uint col_length,
|
||||
const char *priv, uint priv_length,
|
||||
const char* is_grantable)
|
||||
{
|
||||
int i= 2;
|
||||
CHARSET_INFO *cs= system_charset_info;
|
||||
|
|
@ -6320,14 +6322,16 @@ void update_schema_privilege(TABLE *table, char *buff, const char* db,
|
|||
if (column)
|
||||
table->field[i++]->store(column, col_length, cs);
|
||||
table->field[i++]->store(priv, priv_length, cs);
|
||||
table->field[i]->store(is_grantable, (uint) strlen(is_grantable), cs);
|
||||
table->file->ha_write_row(table->record[0]);
|
||||
table->field[i]->store(is_grantable, strlen(is_grantable), cs);
|
||||
return schema_table_store_record(thd, table);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
{
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
int error= 0;
|
||||
uint counter;
|
||||
ACL_USER *acl_user;
|
||||
ulong want_access;
|
||||
|
|
@ -6361,8 +6365,14 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
|
||||
strxmov(buff,"'",user,"'@'",host,"'",NullS);
|
||||
if (!(want_access & ~GRANT_ACL))
|
||||
update_schema_privilege(table, buff, 0, 0, 0, 0,
|
||||
STRING_WITH_LEN("USAGE"), is_grantable);
|
||||
{
|
||||
if (update_schema_privilege(thd, table, buff, 0, 0, 0, 0,
|
||||
STRING_WITH_LEN("USAGE"), is_grantable))
|
||||
{
|
||||
error= 1;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint priv_id;
|
||||
|
|
@ -6370,16 +6380,22 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
for (priv_id=0, j = SELECT_ACL;j <= GLOBAL_ACLS; priv_id++,j <<= 1)
|
||||
{
|
||||
if (test_access & j)
|
||||
update_schema_privilege(table, buff, 0, 0, 0, 0,
|
||||
command_array[priv_id],
|
||||
command_lengths[priv_id], is_grantable);
|
||||
{
|
||||
if (update_schema_privilege(thd, table, buff, 0, 0, 0, 0,
|
||||
command_array[priv_id],
|
||||
command_lengths[priv_id], is_grantable))
|
||||
{
|
||||
error= 1;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
err:
|
||||
pthread_mutex_unlock(&acl_cache->lock);
|
||||
|
||||
DBUG_RETURN(0);
|
||||
DBUG_RETURN(error);
|
||||
#else
|
||||
return(0);
|
||||
#endif
|
||||
|
|
@ -6389,6 +6405,7 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
{
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
int error= 0;
|
||||
uint counter;
|
||||
ACL_DB *acl_db;
|
||||
ulong want_access;
|
||||
|
|
@ -6426,24 +6443,36 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
}
|
||||
strxmov(buff,"'",user,"'@'",host,"'",NullS);
|
||||
if (!(want_access & ~GRANT_ACL))
|
||||
update_schema_privilege(table, buff, acl_db->db, 0, 0,
|
||||
0, STRING_WITH_LEN("USAGE"), is_grantable);
|
||||
{
|
||||
if (update_schema_privilege(thd, table, buff, acl_db->db, 0, 0,
|
||||
0, STRING_WITH_LEN("USAGE"), is_grantable))
|
||||
{
|
||||
error= 1;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int cnt;
|
||||
ulong j,test_access= want_access & ~GRANT_ACL;
|
||||
for (cnt=0, j = SELECT_ACL; j <= DB_ACLS; cnt++,j <<= 1)
|
||||
if (test_access & j)
|
||||
update_schema_privilege(table, buff, acl_db->db, 0, 0, 0,
|
||||
command_array[cnt], command_lengths[cnt],
|
||||
is_grantable);
|
||||
{
|
||||
if (update_schema_privilege(thd, table, buff, acl_db->db, 0, 0, 0,
|
||||
command_array[cnt], command_lengths[cnt],
|
||||
is_grantable))
|
||||
{
|
||||
error= 1;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
err:
|
||||
pthread_mutex_unlock(&acl_cache->lock);
|
||||
|
||||
DBUG_RETURN(0);
|
||||
DBUG_RETURN(error);
|
||||
#else
|
||||
return (0);
|
||||
#endif
|
||||
|
|
@ -6453,6 +6482,7 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
{
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
int error= 0;
|
||||
uint index;
|
||||
char buff[100];
|
||||
TABLE *table= tables->table;
|
||||
|
|
@ -6492,8 +6522,15 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
|
||||
strxmov(buff, "'", user, "'@'", host, "'", NullS);
|
||||
if (!test_access)
|
||||
update_schema_privilege(table, buff, grant_table->db, grant_table->tname,
|
||||
0, 0, STRING_WITH_LEN("USAGE"), is_grantable);
|
||||
{
|
||||
if (update_schema_privilege(thd, table, buff, grant_table->db,
|
||||
grant_table->tname, 0, 0,
|
||||
STRING_WITH_LEN("USAGE"), is_grantable))
|
||||
{
|
||||
error= 1;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ulong j;
|
||||
|
|
@ -6501,17 +6538,24 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
for (cnt= 0, j= SELECT_ACL; j <= TABLE_ACLS; cnt++, j<<= 1)
|
||||
{
|
||||
if (test_access & j)
|
||||
update_schema_privilege(table, buff, grant_table->db,
|
||||
grant_table->tname, 0, 0, command_array[cnt],
|
||||
command_lengths[cnt], is_grantable);
|
||||
{
|
||||
if (update_schema_privilege(thd, table, buff, grant_table->db,
|
||||
grant_table->tname, 0, 0,
|
||||
command_array[cnt],
|
||||
command_lengths[cnt], is_grantable))
|
||||
{
|
||||
error= 1;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
err:
|
||||
rw_unlock(&LOCK_grant);
|
||||
|
||||
DBUG_RETURN(0);
|
||||
DBUG_RETURN(error);
|
||||
#else
|
||||
return (0);
|
||||
#endif
|
||||
|
|
@ -6521,6 +6565,7 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
{
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
int error= 0;
|
||||
uint index;
|
||||
char buff[100];
|
||||
TABLE *table= tables->table;
|
||||
|
|
@ -6570,22 +6615,28 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
GRANT_COLUMN *grant_column = (GRANT_COLUMN*)
|
||||
hash_element(&grant_table->hash_columns,col_index);
|
||||
if ((grant_column->rights & j) && (table_access & j))
|
||||
update_schema_privilege(table, buff, grant_table->db,
|
||||
grant_table->tname,
|
||||
grant_column->column,
|
||||
grant_column->key_length,
|
||||
command_array[cnt],
|
||||
command_lengths[cnt], is_grantable);
|
||||
{
|
||||
if (update_schema_privilege(thd, table, buff, grant_table->db,
|
||||
grant_table->tname,
|
||||
grant_column->column,
|
||||
grant_column->key_length,
|
||||
command_array[cnt],
|
||||
command_lengths[cnt], is_grantable))
|
||||
{
|
||||
error= 1;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
err:
|
||||
rw_unlock(&LOCK_grant);
|
||||
|
||||
DBUG_RETURN(0);
|
||||
DBUG_RETURN(error);
|
||||
#else
|
||||
return (0);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2005, 2006 MySQL AB
|
||||
/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -2587,7 +2587,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
|
|||
if (s->dependent & table->map)
|
||||
s->dependent |= table->reginfo.join_tab->dependent;
|
||||
}
|
||||
if (s->dependent)
|
||||
if (outer_join & s->table->map)
|
||||
s->table->maybe_null= 1;
|
||||
}
|
||||
/* Catch illegal cross references for outer joins */
|
||||
|
|
|
|||
|
|
@ -285,7 +285,11 @@ public:
|
|||
fetching data from a cursor
|
||||
*/
|
||||
bool resume_nested_loop;
|
||||
table_map const_table_map,found_const_table_map,outer_join;
|
||||
table_map const_table_map,found_const_table_map;
|
||||
/*
|
||||
Bitmap of all inner tables from outer joins
|
||||
*/
|
||||
table_map outer_join;
|
||||
ha_rows send_records,found_records,examined_rows,row_limit, select_limit;
|
||||
/**
|
||||
Used to fetch no more than given amount of rows per one
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2004 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -474,6 +474,7 @@ find_files(THD *thd, List<LEX_STRING> *files, const char *db,
|
|||
if (wild && !wild[0])
|
||||
wild=0;
|
||||
|
||||
|
||||
bzero((char*) &table_list,sizeof(table_list));
|
||||
|
||||
if (!(dirp = my_dir(path,MYF(dir ? MY_WANT_STAT : 0))))
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2006 MySQL AB
|
||||
/* Copyright 2006-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2004 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -3427,14 +3427,6 @@ bool mysql_create_table_no_lock(THD *thd,
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef FN_DEVCHAR
|
||||
/* check if the table name contains FN_DEVCHAR when defined */
|
||||
if (strchr(alias, FN_DEVCHAR))
|
||||
{
|
||||
my_error(ER_WRONG_TABLE_NAME, MYF(0), alias);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
#endif
|
||||
path_length= build_table_filename(path, sizeof(path), db, alias, reg_ext,
|
||||
internal_tmp_table ? FN_IS_TMP : 0);
|
||||
}
|
||||
|
|
@ -5870,7 +5862,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
|
|||
if (key_info->flags & HA_USES_BLOCK_SIZE)
|
||||
key_create_info.block_size= key_info->block_size;
|
||||
if (key_info->flags & HA_USES_PARSER)
|
||||
key_create_info.parser_name= *key_info->parser_name;
|
||||
key_create_info.parser_name= *plugin_name(key_info->parser);
|
||||
|
||||
if (key_info->flags & HA_SPATIAL)
|
||||
key_type= Key::SPATIAL;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
25
sql/table.cc
25
sql/table.cc
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -400,6 +400,8 @@ void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key,
|
|||
void free_table_share(TABLE_SHARE *share)
|
||||
{
|
||||
MEM_ROOT mem_root;
|
||||
uint idx;
|
||||
KEY *key_info;
|
||||
DBUG_ENTER("free_table_share");
|
||||
DBUG_PRINT("enter", ("table: %s.%s", share->db.str, share->table_name.str));
|
||||
DBUG_ASSERT(share->ref_count == 0);
|
||||
|
|
@ -426,6 +428,16 @@ void free_table_share(TABLE_SHARE *share)
|
|||
plugin_unlock(NULL, share->db_plugin);
|
||||
share->db_plugin= NULL;
|
||||
|
||||
/* Release fulltext parsers */
|
||||
key_info= share->key_info;
|
||||
for (idx= share->keys; idx; idx--, key_info++)
|
||||
{
|
||||
if (key_info->flags & HA_USES_PARSER)
|
||||
{
|
||||
plugin_unlock(NULL, key_info->parser);
|
||||
key_info->flags= 0;
|
||||
}
|
||||
}
|
||||
/* We must copy mem_root from share because share is allocated through it */
|
||||
memcpy((char*) &mem_root, (char*) &share->mem_root, sizeof(mem_root));
|
||||
free_root(&mem_root, MYF(0)); // Free's share
|
||||
|
|
@ -1943,22 +1955,11 @@ partititon_err:
|
|||
int closefrm(register TABLE *table, bool free_share)
|
||||
{
|
||||
int error=0;
|
||||
uint idx;
|
||||
KEY *key_info;
|
||||
DBUG_ENTER("closefrm");
|
||||
DBUG_PRINT("enter", ("table: 0x%lx", (long) table));
|
||||
|
||||
if (table->db_stat)
|
||||
error=table->file->close();
|
||||
key_info= table->key_info;
|
||||
for (idx= table->s->keys; idx; idx--, key_info++)
|
||||
{
|
||||
if (key_info->flags & HA_USES_PARSER)
|
||||
{
|
||||
plugin_unlock(NULL, key_info->parser);
|
||||
key_info->flags= 0;
|
||||
}
|
||||
}
|
||||
my_free((char*) table->alias, MYF(MY_ALLOW_ZERO_PTR));
|
||||
table->alias= 0;
|
||||
if (table->field)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -205,6 +205,24 @@ bool mysql_create_frm(THD *thd, const char *file_name,
|
|||
(create_info->min_rows == 1) && (keys == 0));
|
||||
int2store(fileinfo+28,key_info_length);
|
||||
|
||||
/*
|
||||
This gives us the byte-position of the character at
|
||||
(character-position, not byte-position) TABLE_COMMENT_MAXLEN.
|
||||
The trick here is that character-positions start at 0, so the last
|
||||
character in a maximum-allowed length string would be at char-pos
|
||||
MAXLEN-1; charpos MAXLEN will be the position of the terminator.
|
||||
Consequently, bytepos(charpos(MAXLEN)) should be equal to
|
||||
comment[length] (which should also be the terminator, or at least
|
||||
the first byte after the payload in the strict sense). If this is
|
||||
not so (bytepos(charpos(MAXLEN)) comes /before/ the end of the
|
||||
string), the string is too long.
|
||||
|
||||
For additional credit, realise that UTF-8 has 1-3 bytes before 6.0,
|
||||
and 1-4 bytes in 6.0 (6.0 also has UTF-32). This means that the
|
||||
inlined COMMENT supposedly does not exceed 60 character plus
|
||||
terminator, vulgo, 181 bytes.
|
||||
*/
|
||||
|
||||
tmp_len= system_charset_info->cset->charpos(system_charset_info,
|
||||
create_info->comment.str,
|
||||
create_info->comment.str +
|
||||
|
|
@ -227,14 +245,6 @@ bool mysql_create_frm(THD *thd, const char *file_name,
|
|||
strmake((char*) forminfo+47, create_info->comment.str ?
|
||||
create_info->comment.str : "", create_info->comment.length);
|
||||
forminfo[46]=(uchar) create_info->comment.length;
|
||||
#ifdef EXTRA_DEBUG
|
||||
/*
|
||||
EXTRA_DEBUG causes strmake() to initialize its buffer behind the
|
||||
payload with a magic value to detect wrong buffer-sizes. We
|
||||
explicitly zero that segment again.
|
||||
*/
|
||||
memset((char*) forminfo+47 + forminfo[46], 0, 61 - forminfo[46]);
|
||||
#endif
|
||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||
if (part_info)
|
||||
{
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue