mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
Merge tulin@bk-internal.mysql.com:/home/bk/wl2299
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-ndb ndb/src/mgmsrv/Services.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/mysqld.cc: Auto merged
This commit is contained in:
commit
2f2b792248
151 changed files with 2059 additions and 861 deletions
|
@ -754,6 +754,7 @@ ndb/examples/ndbapi_example3/ndbapi_example3
|
||||||
ndb/examples/ndbapi_example5/ndbapi_example5
|
ndb/examples/ndbapi_example5/ndbapi_example5
|
||||||
ndb/examples/select_all/select_all
|
ndb/examples/select_all/select_all
|
||||||
ndb/include/ndb_global.h
|
ndb/include/ndb_global.h
|
||||||
|
ndb/include/ndb_types.h
|
||||||
ndb/include/ndb_version.h
|
ndb/include/ndb_version.h
|
||||||
ndb/lib/libMGM_API.so
|
ndb/lib/libMGM_API.so
|
||||||
ndb/lib/libNDB_API.so
|
ndb/lib/libNDB_API.so
|
||||||
|
|
|
@ -3,28 +3,27 @@
|
||||||
while test $# -gt 0
|
while test $# -gt 0
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--debug) EXTRA_CONFIG_FLAGS=--with-debug; shift ;;
|
--debug) EXTRA_CONFIG_FLAGS=--with-debug; shift ;;
|
||||||
-h | --help ) cat <<EOF; exit 0 ;;
|
-h | --help )
|
||||||
Usage: $0 [-h|-n] [configure-options]
|
echo "Usage: $0 [-h|-n] [configure-options]"
|
||||||
--debug Compile with DBUG enabled
|
echo " --debug Compile with DBUG enabled"
|
||||||
EOF
|
exit 0 ;;
|
||||||
*) echo "No such option '$1'" ; exit ;;
|
*) echo "No such option '$1'" ; exit ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
gmake -k clean || true
|
gmake -k clean || true
|
||||||
/bin/rm -f */.deps/*.P config.cache
|
/bin/rm -f */.deps/*.P config.cache
|
||||||
aclocal && autoheader && aclocal && automake && autoconf
|
aclocal && autoheader && aclocal && automake && autoconf
|
||||||
(cd bdb/dist && sh s_all)
|
# (cd bdb/dist && sh s_all)
|
||||||
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||||
|
|
||||||
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-berkeley-db --with-innodb $EXTRA_CONFIG_FLAGS
|
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --without-berkeley-db --with-embedded-server --with-innodb $EXTRA_CONFIG_FLAGS
|
||||||
|
|
||||||
gmake -j 4
|
gmake -j 4
|
||||||
|
|
||||||
cd sql ; mv mysqld mysqld-org ;
|
cd sql ; mv mysqld mysqld-org ;
|
||||||
make CXXLD="purify -best-effort g++" mysqld ; mv mysqld mysqld-purify
|
gmake CXXLD="purify -best-effort g++" mysqld ; mv mysqld mysqld-purify
|
||||||
make CXXLD="quantify -best-effort g++" mysqld ; mv mysqld mysqld-quantify
|
gmake CXXLD="quantify -best-effort g++" mysqld ; mv mysqld mysqld-quantify
|
||||||
make CXXLD="purecov -best-effort g++" mysqld ; mv mysqld mysqld-purecov
|
gmake CXXLD="purecov -best-effort g++" mysqld ; mv mysqld mysqld-purecov
|
||||||
mv mysqld-org mysqld
|
mv mysqld-org mysqld
|
||||||
|
|
||||||
|
|
|
@ -197,6 +197,7 @@ ram@mysql.r18.ru
|
||||||
ram@ram.(none)
|
ram@ram.(none)
|
||||||
ranger@regul.home.lan
|
ranger@regul.home.lan
|
||||||
rburnett@build.mysql.com
|
rburnett@build.mysql.com
|
||||||
|
reggie@bob.(none)
|
||||||
root@home.(none)
|
root@home.(none)
|
||||||
root@mc04.(none)
|
root@mc04.(none)
|
||||||
root@x3.internalnet
|
root@x3.internalnet
|
||||||
|
|
|
@ -265,7 +265,8 @@ if ($opt_stage <= 1)
|
||||||
$opt_config_options.= " --with-berkeley-db" if ($opt_bdb);
|
$opt_config_options.= " --with-berkeley-db" if ($opt_bdb);
|
||||||
$opt_config_options.= " --with-zlib-dir=bundled" if ($opt_bundled_zlib);
|
$opt_config_options.= " --with-zlib-dir=bundled" if ($opt_bundled_zlib);
|
||||||
$opt_config_options.= " --with-client-ldflags=-all-static" if ($opt_static_client);
|
$opt_config_options.= " --with-client-ldflags=-all-static" if ($opt_static_client);
|
||||||
$opt_config_options.= " --with-debug" if ($opt_with_debug);
|
$opt_config_options.= " --with-debug" if ($opt_with_debug);
|
||||||
|
$opt_config_options.= " --without-ndb-debug" if ($opt_with_debug && $opt_with_cluster);
|
||||||
$opt_config_options.= " --with-libwrap" if ($opt_libwrap);
|
$opt_config_options.= " --with-libwrap" if ($opt_libwrap);
|
||||||
$opt_config_options.= " --with-low-memory" if ($opt_with_low_memory);
|
$opt_config_options.= " --with-low-memory" if ($opt_with_low_memory);
|
||||||
$opt_config_options.= " --with-mysqld-ldflags=-all-static" if ($opt_static_server);
|
$opt_config_options.= " --with-mysqld-ldflags=-all-static" if ($opt_static_server);
|
||||||
|
|
|
@ -87,7 +87,7 @@ $BUILDDIR= "$PWD/$HOST";
|
||||||
$PREFPANE= "$PWD/mysql-administrator/source/mac/PreferencePane/build/MySQL.prefPane";
|
$PREFPANE= "$PWD/mysql-administrator/source/mac/PreferencePane/build/MySQL.prefPane";
|
||||||
$SRCBASEDIR= <$BUILDDIR/mysql*-$VERSION>;
|
$SRCBASEDIR= <$BUILDDIR/mysql*-$VERSION>;
|
||||||
$SUPFILEDIR= <$SRCBASEDIR/support-files/MacOSX>;
|
$SUPFILEDIR= <$SRCBASEDIR/support-files/MacOSX>;
|
||||||
$TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc.tar.gz>;
|
$TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc*.tar.gz>;
|
||||||
$TAR =~ /.*\/$NAME(.*)\.tar\.gz$/;
|
$TAR =~ /.*\/$NAME(.*)\.tar\.gz$/;
|
||||||
$ARCH= $1;
|
$ARCH= $1;
|
||||||
$NAME= $NAME . $ARCH;
|
$NAME= $NAME . $ARCH;
|
||||||
|
|
|
@ -20,9 +20,8 @@
|
||||||
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \
|
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \
|
||||||
$(openssl_includes) -I$(top_srcdir)/extra
|
$(openssl_includes) -I$(top_srcdir)/extra
|
||||||
LIBS = @CLIENT_LIBS@
|
LIBS = @CLIENT_LIBS@
|
||||||
DEPLIB= ../libmysql/libmysqlclient.la
|
LDADD= @CLIENT_EXTRA_LDFLAGS@ \
|
||||||
REGEXLIB= ../regex/libregex.a
|
$(top_builddir)/libmysql/libmysqlclient.la
|
||||||
LDADD = @CLIENT_EXTRA_LDFLAGS@ $(DEPLIB)
|
|
||||||
bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \
|
bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \
|
||||||
mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen
|
mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen
|
||||||
noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
|
noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
|
||||||
|
@ -31,19 +30,10 @@ mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc
|
||||||
mysqladmin_SOURCES = mysqladmin.cc
|
mysqladmin_SOURCES = mysqladmin.cc
|
||||||
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS)
|
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS)
|
||||||
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
|
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
|
||||||
mysql_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
mysqltest_SOURCES= mysqltest.c $(top_srcdir)/mysys/my_getsystime.c
|
||||||
mysqladmin_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD)
|
||||||
mysqlcheck_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
mysqlbinlog_SOURCES = mysqlbinlog.cc $(top_srcdir)/mysys/mf_tempdir.c
|
||||||
mysqlshow_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
|
||||||
mysqldump_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
|
||||||
mysqlimport_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
|
||||||
mysqltest_SOURCES= mysqltest.c ../mysys/my_getsystime.c
|
|
||||||
mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(REGEXLIB) $(DEPLIB)
|
|
||||||
mysqltest_LDADD = $(REGEXLIB) $(LDADD)
|
|
||||||
mysqlbinlog_SOURCES = mysqlbinlog.cc ../mysys/mf_tempdir.c
|
|
||||||
mysqlbinlog_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
|
||||||
mysqlmanagerc_SOURCES = mysqlmanagerc.c
|
mysqlmanagerc_SOURCES = mysqlmanagerc.c
|
||||||
mysqlmanagerc_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
|
||||||
sql_src=log_event.h mysql_priv.h log_event.cc
|
sql_src=log_event.h mysql_priv.h log_event.cc
|
||||||
|
|
||||||
# Fix for mit-threads
|
# Fix for mit-threads
|
||||||
|
|
|
@ -172,7 +172,7 @@ static char *shared_memory_base_name=0;
|
||||||
#endif
|
#endif
|
||||||
static uint opt_protocol=0;
|
static uint opt_protocol=0;
|
||||||
static CHARSET_INFO *charset_info= &my_charset_latin1;
|
static CHARSET_INFO *charset_info= &my_charset_latin1;
|
||||||
|
|
||||||
#include "sslopt-vars.h"
|
#include "sslopt-vars.h"
|
||||||
|
|
||||||
const char *default_dbug_option="d:t:o,/tmp/mysql.trace";
|
const char *default_dbug_option="d:t:o,/tmp/mysql.trace";
|
||||||
|
@ -1520,7 +1520,7 @@ You can turn off this feature to get a quicker startup with -A\n\n");
|
||||||
j=0;
|
j=0;
|
||||||
while ((sql_field=mysql_fetch_field(fields)))
|
while ((sql_field=mysql_fetch_field(fields)))
|
||||||
{
|
{
|
||||||
sprintf(buf,"%s.%s",table_row[0],sql_field->name);
|
sprintf(buf,"%.64s.%.64s",table_row[0],sql_field->name);
|
||||||
field_names[i][j] = strdup_root(&hash_mem_root,buf);
|
field_names[i][j] = strdup_root(&hash_mem_root,buf);
|
||||||
add_word(&ht,field_names[i][j]);
|
add_word(&ht,field_names[i][j]);
|
||||||
field_names[i][num_fields+j] = strdup_root(&hash_mem_root,
|
field_names[i][num_fields+j] = strdup_root(&hash_mem_root,
|
||||||
|
@ -1597,7 +1597,7 @@ int mysql_real_query_for_lazy(const char *buf, int length)
|
||||||
for (uint retry=0;; retry++)
|
for (uint retry=0;; retry++)
|
||||||
{
|
{
|
||||||
if (!mysql_real_query(&mysql,buf,length))
|
if (!mysql_real_query(&mysql,buf,length))
|
||||||
return 0;
|
return 0;
|
||||||
int error= put_error(&mysql);
|
int error= put_error(&mysql);
|
||||||
if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR || retry > 1 ||
|
if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR || retry > 1 ||
|
||||||
!opt_reconnect)
|
!opt_reconnect)
|
||||||
|
@ -2526,7 +2526,7 @@ com_connect(String *buffer, char *line)
|
||||||
{
|
{
|
||||||
sprintf(buff,"Connection id: %lu",mysql_thread_id(&mysql));
|
sprintf(buff,"Connection id: %lu",mysql_thread_id(&mysql));
|
||||||
put_info(buff,INFO_INFO);
|
put_info(buff,INFO_INFO);
|
||||||
sprintf(buff,"Current database: %s\n",
|
sprintf(buff,"Current database: %.128s\n",
|
||||||
current_db ? current_db : "*** NONE ***");
|
current_db ? current_db : "*** NONE ***");
|
||||||
put_info(buff,INFO_INFO);
|
put_info(buff,INFO_INFO);
|
||||||
}
|
}
|
||||||
|
@ -3234,13 +3234,20 @@ static const char* construct_prompt()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'p':
|
case 'p':
|
||||||
|
{
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
if (!connected)
|
if (!connected)
|
||||||
{
|
{
|
||||||
processed_prompt.append("not_connected");
|
processed_prompt.append("not_connected");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (strstr(mysql_get_host_info(&mysql),"TCP/IP") ||
|
|
||||||
|
const char *host_info = mysql_get_host_info(&mysql);
|
||||||
|
if (strstr(host_info, "memory"))
|
||||||
|
{
|
||||||
|
processed_prompt.append( mysql.host );
|
||||||
|
}
|
||||||
|
else if (strstr(host_info,"TCP/IP") ||
|
||||||
!mysql.unix_socket)
|
!mysql.unix_socket)
|
||||||
add_int_to_prompt(mysql.port);
|
add_int_to_prompt(mysql.port);
|
||||||
else
|
else
|
||||||
|
@ -3249,6 +3256,7 @@ static const char* construct_prompt()
|
||||||
processed_prompt.append(pos ? pos+1 : mysql.unix_socket);
|
processed_prompt.append(pos ? pos+1 : mysql.unix_socket);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'U':
|
case 'U':
|
||||||
if (!full_username)
|
if (!full_username)
|
||||||
|
|
|
@ -833,7 +833,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
||||||
if (argv[1][0])
|
if (argv[1][0])
|
||||||
{
|
{
|
||||||
char *pw= argv[1];
|
char *pw= argv[1];
|
||||||
bool old= find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD;
|
bool old= (find_type(argv[0], &command_typelib, 2) ==
|
||||||
|
ADMIN_OLD_PASSWORD);
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
uint pw_len= strlen(pw);
|
uint pw_len= strlen(pw);
|
||||||
if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'')
|
if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'')
|
||||||
|
@ -844,21 +845,29 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
||||||
If we don't already know to use an old-style password, see what
|
If we don't already know to use an old-style password, see what
|
||||||
the server is using
|
the server is using
|
||||||
*/
|
*/
|
||||||
if (!old) {
|
if (!old)
|
||||||
if (mysql_query(mysql, "SHOW VARIABLES LIKE 'old_passwords'")) {
|
{
|
||||||
|
if (mysql_query(mysql, "SHOW VARIABLES LIKE 'old_passwords'"))
|
||||||
|
{
|
||||||
my_printf_error(0, "Could not determine old_passwords setting from server; error: '%s'",
|
my_printf_error(0, "Could not determine old_passwords setting from server; error: '%s'",
|
||||||
MYF(ME_BELL),mysql_error(mysql));
|
MYF(ME_BELL),mysql_error(mysql));
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
MYSQL_RES *res= mysql_store_result(mysql);
|
MYSQL_RES *res= mysql_store_result(mysql);
|
||||||
if (!res) {
|
if (!res)
|
||||||
my_printf_error(0, "Could not get old_passwords setting from server; error: '%s'",
|
{
|
||||||
|
my_printf_error(0,
|
||||||
|
"Could not get old_passwords setting from "
|
||||||
|
"server; error: '%s'",
|
||||||
MYF(ME_BELL),mysql_error(mysql));
|
MYF(ME_BELL),mysql_error(mysql));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!mysql_num_rows(res)) {
|
if (!mysql_num_rows(res))
|
||||||
old= 1;
|
old= 1;
|
||||||
} else {
|
else
|
||||||
|
{
|
||||||
MYSQL_ROW row= mysql_fetch_row(res);
|
MYSQL_ROW row= mysql_fetch_row(res);
|
||||||
old= !strncmp(row[1], "ON", 2);
|
old= !strncmp(row[1], "ON", 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,6 +305,9 @@ static struct my_option my_long_options[] =
|
||||||
{"opt", OPT_OPTIMIZE,
|
{"opt", OPT_OPTIMIZE,
|
||||||
"Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt.",
|
"Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt.",
|
||||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
{"order-by-primary", OPT_ORDER_BY_PRIMARY,
|
||||||
|
"Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.",
|
||||||
|
(gptr*) &opt_order_by_primary, (gptr*) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"password", 'p',
|
{"password", 'p',
|
||||||
"Password to use when connecting to server. If password is not given it's solicited on the tty.",
|
"Password to use when connecting to server. If password is not given it's solicited on the tty.",
|
||||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
@ -356,9 +359,6 @@ static struct my_option my_long_options[] =
|
||||||
{"socket", 'S', "Socket file to use for connection.",
|
{"socket", 'S', "Socket file to use for connection.",
|
||||||
(gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR,
|
(gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR,
|
||||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"order-by-primary", OPT_ORDER_BY_PRIMARY,
|
|
||||||
"Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.",
|
|
||||||
(gptr*) &opt_order_by_primary, (gptr*) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
||||||
#include <sslopt-longopts.h>
|
#include <sslopt-longopts.h>
|
||||||
{"tab",'T',
|
{"tab",'T',
|
||||||
"Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon.",
|
"Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon.",
|
||||||
|
@ -2308,8 +2308,15 @@ static int start_transaction(MYSQL *mysql_con, my_bool consistent_read_now)
|
||||||
We use BEGIN for old servers. --single-transaction --master-data will fail
|
We use BEGIN for old servers. --single-transaction --master-data will fail
|
||||||
on old servers, but that's ok as it was already silently broken (it didn't
|
on old servers, but that's ok as it was already silently broken (it didn't
|
||||||
do a consistent read, so better tell people frankly, with the error).
|
do a consistent read, so better tell people frankly, with the error).
|
||||||
|
|
||||||
|
We want the first consistent read to be used for all tables to dump so we
|
||||||
|
need the REPEATABLE READ level (not anything lower, for example READ
|
||||||
|
COMMITTED would give one new consistent read per dumped table).
|
||||||
*/
|
*/
|
||||||
return (mysql_query_with_error_report(mysql_con, 0,
|
return (mysql_query_with_error_report(mysql_con, 0,
|
||||||
|
"SET SESSION TRANSACTION ISOLATION "
|
||||||
|
"LEVEL REPEATABLE READ") ||
|
||||||
|
mysql_query_with_error_report(mysql_con, 0,
|
||||||
consistent_read_now ?
|
consistent_read_now ?
|
||||||
"START TRANSACTION "
|
"START TRANSACTION "
|
||||||
"WITH CONSISTENT SNAPSHOT" :
|
"WITH CONSISTENT SNAPSHOT" :
|
||||||
|
|
|
@ -123,6 +123,17 @@ typedef struct
|
||||||
} code;
|
} code;
|
||||||
} match_err;
|
} match_err;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
const char *name;
|
||||||
|
long code;
|
||||||
|
} st_error;
|
||||||
|
|
||||||
|
static st_error global_error[] = {
|
||||||
|
#include <mysqld_ername.h>
|
||||||
|
{ 0, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
static match_err global_expected_errno[MAX_EXPECTED_ERRORS];
|
static match_err global_expected_errno[MAX_EXPECTED_ERRORS];
|
||||||
static uint global_expected_errors;
|
static uint global_expected_errors;
|
||||||
|
|
||||||
|
@ -1340,6 +1351,7 @@ static uint get_errcodes(match_err *to,struct st_query* q)
|
||||||
{
|
{
|
||||||
char* p= q->first_argument;
|
char* p= q->first_argument;
|
||||||
uint count= 0;
|
uint count= 0;
|
||||||
|
|
||||||
DBUG_ENTER("get_errcodes");
|
DBUG_ENTER("get_errcodes");
|
||||||
|
|
||||||
if (!*p)
|
if (!*p)
|
||||||
|
@ -1350,19 +1362,41 @@ static uint get_errcodes(match_err *to,struct st_query* q)
|
||||||
if (*p == 'S')
|
if (*p == 'S')
|
||||||
{
|
{
|
||||||
/* SQLSTATE string */
|
/* SQLSTATE string */
|
||||||
int i;
|
char *end= ++p + SQLSTATE_LENGTH;
|
||||||
p++;
|
char *to_ptr= to[count].code.sqlstate;
|
||||||
for (i = 0; my_isalnum(charset_info, *p) && i < SQLSTATE_LENGTH; p++, i++)
|
|
||||||
to[count].code.sqlstate[i]= *p;
|
for (; my_isalnum(charset_info, *p) && p != end; p++)
|
||||||
to[count].code.sqlstate[i]= '\0';
|
*to_ptr++= *p;
|
||||||
|
*to_ptr= 0;
|
||||||
|
|
||||||
to[count].type= ERR_SQLSTATE;
|
to[count].type= ERR_SQLSTATE;
|
||||||
}
|
}
|
||||||
|
else if (*p == 'E')
|
||||||
|
{
|
||||||
|
/* SQL error as string */
|
||||||
|
st_error *e= global_error;
|
||||||
|
char *start= p++;
|
||||||
|
|
||||||
|
for (; *p == '_' || my_isalnum(charset_info, *p); p++)
|
||||||
|
;
|
||||||
|
for (; e->name; e++)
|
||||||
|
{
|
||||||
|
if (!strncmp(start, e->name, (int) (p - start)))
|
||||||
|
{
|
||||||
|
to[count].code.errnum= (uint) e->code;
|
||||||
|
to[count].type= ERR_ERRNO;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!e->name)
|
||||||
|
die("Unknown SQL error '%s'\n", start);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
long val;
|
long val;
|
||||||
p=str2int(p,10,(long) INT_MIN, (long) INT_MAX, &val);
|
|
||||||
if (p == NULL)
|
if (!(p= str2int(p,10,(long) INT_MIN, (long) INT_MAX, &val)))
|
||||||
die("Invalid argument in %s\n", q->query);
|
die("Invalid argument in %s\n", q->query);
|
||||||
to[count].code.errnum= (uint) val;
|
to[count].code.errnum= (uint) val;
|
||||||
to[count].type= ERR_ERRNO;
|
to[count].type= ERR_ERRNO;
|
||||||
}
|
}
|
||||||
|
@ -2855,6 +2889,7 @@ static int normal_handle_error(const char *query, struct st_query *q,
|
||||||
mysql_error(mysql));
|
mysql_error(mysql));
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
return 0; /* Keep compiler happy */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1922,7 +1922,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
|
||||||
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
|
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
|
||||||
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
|
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
|
||||||
realpath rename rint rwlock_init setupterm \
|
realpath rename rint rwlock_init setupterm \
|
||||||
shmget shmat shmdt shmctl sigaction \
|
shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
|
||||||
sighold sigset sigthreadmask \
|
sighold sigset sigthreadmask \
|
||||||
snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \
|
snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \
|
||||||
strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr)
|
strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr)
|
||||||
|
@ -2629,7 +2629,7 @@ AC_SUBST(server_scripts)
|
||||||
sql_union_dirs=" $sql_server_dirs "
|
sql_union_dirs=" $sql_server_dirs "
|
||||||
for DIR in $sql_client_dirs
|
for DIR in $sql_client_dirs
|
||||||
do
|
do
|
||||||
if echo $sql_union_dirs | grep " $DIR " >/dev/null
|
if echo " $sql_union_dirs " | grep " $DIR " >/dev/null
|
||||||
then
|
then
|
||||||
: # already present, skip
|
: # already present, skip
|
||||||
else
|
else
|
||||||
|
@ -2709,7 +2709,10 @@ if test "$ac_cv_func_shmget" = "yes" &&
|
||||||
test "$ac_cv_func_shmat" = "yes" &&
|
test "$ac_cv_func_shmat" = "yes" &&
|
||||||
test "$ac_cv_func_shmdt" = "yes" &&
|
test "$ac_cv_func_shmdt" = "yes" &&
|
||||||
test "$ac_cv_func_shmctl" = "yes" &&
|
test "$ac_cv_func_shmctl" = "yes" &&
|
||||||
test "$ac_cv_func_sigaction" = "yes"
|
test "$ac_cv_func_sigaction" = "yes" &&
|
||||||
|
test "$ac_cv_func_sigemptyset" = "yes" &&
|
||||||
|
test "$ac_cv_func_sigaddset" = "yes" &&
|
||||||
|
test "$ac_cv_func_pthread_sigmask" = "yes"
|
||||||
then
|
then
|
||||||
AC_DEFINE([NDB_SHM_TRANSPORTER], [1],
|
AC_DEFINE([NDB_SHM_TRANSPORTER], [1],
|
||||||
[Including Ndb Cluster DB shared memory transporter])
|
[Including Ndb Cluster DB shared memory transporter])
|
||||||
|
|
|
@ -154,15 +154,15 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
|
||||||
keyseg->flag= 0;
|
keyseg->flag= 0;
|
||||||
keyseg->null_bit= 0;
|
keyseg->null_bit= 0;
|
||||||
keyseg++;
|
keyseg++;
|
||||||
|
|
||||||
init_tree(&keyinfo->rb_tree, 0, 0, sizeof(byte*),
|
init_tree(&keyinfo->rb_tree, 0, 0, sizeof(byte*),
|
||||||
(qsort_cmp2)keys_compare, 1, NULL, NULL);
|
(qsort_cmp2)keys_compare, 1, NULL, NULL);
|
||||||
keyinfo->delete_key= hp_rb_delete_key;
|
keyinfo->delete_key= hp_rb_delete_key;
|
||||||
keyinfo->write_key= hp_rb_write_key;
|
keyinfo->write_key= hp_rb_write_key;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
init_block(&keyinfo->block, sizeof(HASH_INFO), min_records,
|
init_block(&keyinfo->block, sizeof(HASH_INFO), min_records,
|
||||||
max_records);
|
max_records);
|
||||||
keyinfo->delete_key= hp_delete_key;
|
keyinfo->delete_key= hp_delete_key;
|
||||||
keyinfo->write_key= hp_write_key;
|
keyinfo->write_key= hp_write_key;
|
||||||
|
@ -171,6 +171,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
|
||||||
}
|
}
|
||||||
share->min_records= min_records;
|
share->min_records= min_records;
|
||||||
share->max_records= max_records;
|
share->max_records= max_records;
|
||||||
|
share->max_table_size= create_info->max_table_size;
|
||||||
share->data_length= share->index_length= 0;
|
share->data_length= share->index_length= 0;
|
||||||
share->reclength= reclength;
|
share->reclength= reclength;
|
||||||
share->blength= 1;
|
share->blength= 1;
|
||||||
|
|
|
@ -143,7 +143,8 @@ static byte *next_free_record_pos(HP_SHARE *info)
|
||||||
}
|
}
|
||||||
if (!(block_pos=(info->records % info->block.records_in_block)))
|
if (!(block_pos=(info->records % info->block.records_in_block)))
|
||||||
{
|
{
|
||||||
if (info->records > info->max_records && info->max_records)
|
if ((info->records > info->max_records && info->max_records) ||
|
||||||
|
(info->data_length + info->index_length >= info->max_table_size))
|
||||||
{
|
{
|
||||||
my_errno=HA_ERR_RECORD_FILE_FULL;
|
my_errno=HA_ERR_RECORD_FILE_FULL;
|
||||||
DBUG_RETURN(NULL);
|
DBUG_RETURN(NULL);
|
||||||
|
|
|
@ -125,8 +125,8 @@ typedef struct st_hp_keydef /* Key definition with open */
|
||||||
TREE rb_tree;
|
TREE rb_tree;
|
||||||
int (*write_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo,
|
int (*write_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo,
|
||||||
const byte *record, byte *recpos);
|
const byte *record, byte *recpos);
|
||||||
int (*delete_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo,
|
int (*delete_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo,
|
||||||
const byte *record, byte *recpos, int flag);
|
const byte *record, byte *recpos, int flag);
|
||||||
uint (*get_key_length)(struct st_hp_keydef *keydef, const byte *key);
|
uint (*get_key_length)(struct st_hp_keydef *keydef, const byte *key);
|
||||||
} HP_KEYDEF;
|
} HP_KEYDEF;
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ typedef struct st_heap_share
|
||||||
HP_BLOCK block;
|
HP_BLOCK block;
|
||||||
HP_KEYDEF *keydef;
|
HP_KEYDEF *keydef;
|
||||||
ulong min_records,max_records; /* Params to open */
|
ulong min_records,max_records; /* Params to open */
|
||||||
ulong data_length,index_length;
|
ulong data_length,index_length,max_table_size;
|
||||||
uint records; /* records */
|
uint records; /* records */
|
||||||
uint blength; /* records rounded up to 2^n */
|
uint blength; /* records rounded up to 2^n */
|
||||||
uint deleted; /* Deleted records in database */
|
uint deleted; /* Deleted records in database */
|
||||||
|
@ -185,6 +185,7 @@ typedef struct st_heap_create_info
|
||||||
{
|
{
|
||||||
uint auto_key;
|
uint auto_key;
|
||||||
uint auto_key_type;
|
uint auto_key_type;
|
||||||
|
ulong max_table_size;
|
||||||
ulonglong auto_increment;
|
ulonglong auto_increment;
|
||||||
} HP_CREATE_INFO;
|
} HP_CREATE_INFO;
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,7 @@ extern char *strstr(const char *, const char *);
|
||||||
extern int is_prefix(const char *, const char *);
|
extern int is_prefix(const char *, const char *);
|
||||||
|
|
||||||
/* Conversion routines */
|
/* Conversion routines */
|
||||||
double my_strtod(const char *str, char **end);
|
double my_strtod(const char *str, char **end, int *error);
|
||||||
double my_atof(const char *nptr);
|
double my_atof(const char *nptr);
|
||||||
|
|
||||||
extern char *llstr(longlong value,char *buff);
|
extern char *llstr(longlong value,char *buff);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
typedef struct st_bitmap
|
typedef struct st_bitmap
|
||||||
{
|
{
|
||||||
uchar *bitmap;
|
uchar *bitmap;
|
||||||
uint bitmap_size;
|
uint bitmap_size; /* number of bytes occupied by the above */
|
||||||
/*
|
/*
|
||||||
mutex will be acquired for the duration of each bitmap operation if
|
mutex will be acquired for the duration of each bitmap operation if
|
||||||
thread_safe flag in bitmap_init was set. Otherwise, we optimize by not
|
thread_safe flag in bitmap_init was set. Otherwise, we optimize by not
|
||||||
|
|
|
@ -688,6 +688,7 @@ extern int init_io_cache(IO_CACHE *info,File file,uint cachesize,
|
||||||
extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
|
extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
|
||||||
my_off_t seek_offset,pbool use_async_io,
|
my_off_t seek_offset,pbool use_async_io,
|
||||||
pbool clear_cache);
|
pbool clear_cache);
|
||||||
|
extern void setup_io_cache(IO_CACHE* info);
|
||||||
extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count);
|
extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count);
|
||||||
#ifdef THREAD
|
#ifdef THREAD
|
||||||
extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count);
|
extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count);
|
||||||
|
|
|
@ -165,6 +165,17 @@ dtype_is_non_binary_string_type(
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
Gets the MySQL charset-collation code for MySQL string types. */
|
||||||
|
|
||||||
|
ulint
|
||||||
|
dtype_get_charset_coll_noninline(
|
||||||
|
/*=============================*/
|
||||||
|
ulint prtype) /* in: precise data type */
|
||||||
|
{
|
||||||
|
return(dtype_get_charset_coll(prtype));
|
||||||
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Forms a precise type from the < 4.1.2 format precise type plus the
|
Forms a precise type from the < 4.1.2 format precise type plus the
|
||||||
charset-collation code. */
|
charset-collation code. */
|
||||||
|
|
|
@ -223,6 +223,7 @@ dict_boot(void)
|
||||||
dict_index_t* index;
|
dict_index_t* index;
|
||||||
dict_hdr_t* dict_hdr;
|
dict_hdr_t* dict_hdr;
|
||||||
mtr_t mtr;
|
mtr_t mtr;
|
||||||
|
ibool success;
|
||||||
|
|
||||||
mtr_start(&mtr);
|
mtr_start(&mtr);
|
||||||
|
|
||||||
|
@ -275,20 +276,20 @@ dict_boot(void)
|
||||||
|
|
||||||
dict_mem_index_add_field(index, "NAME", 0, 0);
|
dict_mem_index_add_field(index, "NAME", 0, 0);
|
||||||
|
|
||||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_TABLES,
|
|
||||||
MLOG_4BYTES, &mtr);
|
|
||||||
index->id = DICT_TABLES_ID;
|
index->id = DICT_TABLES_ID;
|
||||||
|
|
||||||
ut_a(dict_index_add_to_cache(table, index));
|
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
|
||||||
|
dict_hdr + DICT_HDR_TABLES, MLOG_4BYTES, &mtr));
|
||||||
|
ut_a(success);
|
||||||
/*-------------------------*/
|
/*-------------------------*/
|
||||||
index = dict_mem_index_create("SYS_TABLES", "ID_IND",
|
index = dict_mem_index_create("SYS_TABLES", "ID_IND",
|
||||||
DICT_HDR_SPACE, DICT_UNIQUE, 1);
|
DICT_HDR_SPACE, DICT_UNIQUE, 1);
|
||||||
dict_mem_index_add_field(index, "ID", 0, 0);
|
dict_mem_index_add_field(index, "ID", 0, 0);
|
||||||
|
|
||||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_TABLE_IDS,
|
|
||||||
MLOG_4BYTES, &mtr);
|
|
||||||
index->id = DICT_TABLE_IDS_ID;
|
index->id = DICT_TABLE_IDS_ID;
|
||||||
ut_a(dict_index_add_to_cache(table, index));
|
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
|
||||||
|
dict_hdr + DICT_HDR_TABLE_IDS, MLOG_4BYTES, &mtr));
|
||||||
|
ut_a(success);
|
||||||
/*-------------------------*/
|
/*-------------------------*/
|
||||||
table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, FALSE);
|
table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, FALSE);
|
||||||
|
|
||||||
|
@ -311,10 +312,10 @@ dict_boot(void)
|
||||||
dict_mem_index_add_field(index, "TABLE_ID", 0, 0);
|
dict_mem_index_add_field(index, "TABLE_ID", 0, 0);
|
||||||
dict_mem_index_add_field(index, "POS", 0, 0);
|
dict_mem_index_add_field(index, "POS", 0, 0);
|
||||||
|
|
||||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_COLUMNS,
|
|
||||||
MLOG_4BYTES, &mtr);
|
|
||||||
index->id = DICT_COLUMNS_ID;
|
index->id = DICT_COLUMNS_ID;
|
||||||
ut_a(dict_index_add_to_cache(table, index));
|
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
|
||||||
|
dict_hdr + DICT_HDR_COLUMNS, MLOG_4BYTES, &mtr));
|
||||||
|
ut_a(success);
|
||||||
/*-------------------------*/
|
/*-------------------------*/
|
||||||
table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, FALSE);
|
table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, FALSE);
|
||||||
|
|
||||||
|
@ -332,6 +333,9 @@ dict_boot(void)
|
||||||
#endif
|
#endif
|
||||||
#if DICT_SYS_INDEXES_SPACE_NO_FIELD != 5 + 2
|
#if DICT_SYS_INDEXES_SPACE_NO_FIELD != 5 + 2
|
||||||
#error "DICT_SYS_INDEXES_SPACE_NO_FIELD != 5 + 2"
|
#error "DICT_SYS_INDEXES_SPACE_NO_FIELD != 5 + 2"
|
||||||
|
#endif
|
||||||
|
#if DICT_SYS_INDEXES_TYPE_FIELD != 4 + 2
|
||||||
|
#error "DICT_SYS_INDEXES_TYPE_FIELD != 4 + 2"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
table->id = DICT_INDEXES_ID;
|
table->id = DICT_INDEXES_ID;
|
||||||
|
@ -344,10 +348,10 @@ dict_boot(void)
|
||||||
dict_mem_index_add_field(index, "TABLE_ID", 0, 0);
|
dict_mem_index_add_field(index, "TABLE_ID", 0, 0);
|
||||||
dict_mem_index_add_field(index, "ID", 0, 0);
|
dict_mem_index_add_field(index, "ID", 0, 0);
|
||||||
|
|
||||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_INDEXES,
|
|
||||||
MLOG_4BYTES, &mtr);
|
|
||||||
index->id = DICT_INDEXES_ID;
|
index->id = DICT_INDEXES_ID;
|
||||||
ut_a(dict_index_add_to_cache(table, index));
|
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
|
||||||
|
dict_hdr + DICT_HDR_INDEXES, MLOG_4BYTES, &mtr));
|
||||||
|
ut_a(success);
|
||||||
/*-------------------------*/
|
/*-------------------------*/
|
||||||
table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, FALSE);
|
table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, FALSE);
|
||||||
|
|
||||||
|
@ -365,10 +369,10 @@ dict_boot(void)
|
||||||
dict_mem_index_add_field(index, "INDEX_ID", 0, 0);
|
dict_mem_index_add_field(index, "INDEX_ID", 0, 0);
|
||||||
dict_mem_index_add_field(index, "POS", 0, 0);
|
dict_mem_index_add_field(index, "POS", 0, 0);
|
||||||
|
|
||||||
index->page_no = mtr_read_ulint(dict_hdr + DICT_HDR_FIELDS,
|
|
||||||
MLOG_4BYTES, &mtr);
|
|
||||||
index->id = DICT_FIELDS_ID;
|
index->id = DICT_FIELDS_ID;
|
||||||
ut_a(dict_index_add_to_cache(table, index));
|
success = dict_index_add_to_cache(table, index, mtr_read_ulint(
|
||||||
|
dict_hdr + DICT_HDR_FIELDS, MLOG_4BYTES, &mtr));
|
||||||
|
ut_a(success);
|
||||||
|
|
||||||
mtr_commit(&mtr);
|
mtr_commit(&mtr);
|
||||||
/*-------------------------*/
|
/*-------------------------*/
|
||||||
|
|
|
@ -544,9 +544,7 @@ dict_build_index_def_step(
|
||||||
table in the same tablespace */
|
table in the same tablespace */
|
||||||
|
|
||||||
index->space = table->space;
|
index->space = table->space;
|
||||||
|
node->page_no = FIL_NULL;
|
||||||
index->page_no = FIL_NULL;
|
|
||||||
|
|
||||||
row = dict_create_sys_indexes_tuple(index, node->heap);
|
row = dict_create_sys_indexes_tuple(index, node->heap);
|
||||||
node->ind_row = row;
|
node->ind_row = row;
|
||||||
|
|
||||||
|
@ -624,18 +622,18 @@ dict_create_index_tree_step(
|
||||||
|
|
||||||
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
|
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
|
||||||
|
|
||||||
index->page_no = btr_create(index->type, index->space, index->id,
|
node->page_no = btr_create(index->type, index->space, index->id,
|
||||||
table->comp, &mtr);
|
table->comp, &mtr);
|
||||||
/* printf("Created a new index tree in space %lu root page %lu\n",
|
/* printf("Created a new index tree in space %lu root page %lu\n",
|
||||||
index->space, index->page_no); */
|
index->space, index->page_no); */
|
||||||
|
|
||||||
page_rec_write_index_page_no(btr_pcur_get_rec(&pcur),
|
page_rec_write_index_page_no(btr_pcur_get_rec(&pcur),
|
||||||
DICT_SYS_INDEXES_PAGE_NO_FIELD,
|
DICT_SYS_INDEXES_PAGE_NO_FIELD,
|
||||||
index->page_no, &mtr);
|
node->page_no, &mtr);
|
||||||
btr_pcur_close(&pcur);
|
btr_pcur_close(&pcur);
|
||||||
mtr_commit(&mtr);
|
mtr_commit(&mtr);
|
||||||
|
|
||||||
if (index->page_no == FIL_NULL) {
|
if (node->page_no == FIL_NULL) {
|
||||||
|
|
||||||
return(DB_OUT_OF_FILE_SPACE);
|
return(DB_OUT_OF_FILE_SPACE);
|
||||||
}
|
}
|
||||||
|
@ -706,6 +704,101 @@ dict_drop_index_tree(
|
||||||
DICT_SYS_INDEXES_PAGE_NO_FIELD, FIL_NULL, mtr);
|
DICT_SYS_INDEXES_PAGE_NO_FIELD, FIL_NULL, mtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
Truncates the index tree associated with a row in SYS_INDEXES table. */
|
||||||
|
|
||||||
|
void
|
||||||
|
dict_truncate_index_tree(
|
||||||
|
/*=====================*/
|
||||||
|
dict_table_t* table, /* in: the table the index belongs to */
|
||||||
|
rec_t* rec, /* in: record in the clustered index of
|
||||||
|
SYS_INDEXES table */
|
||||||
|
mtr_t* mtr) /* in: mtr having the latch
|
||||||
|
on the record page */
|
||||||
|
{
|
||||||
|
ulint root_page_no;
|
||||||
|
ulint space;
|
||||||
|
ulint type;
|
||||||
|
dulint index_id;
|
||||||
|
byte* ptr;
|
||||||
|
ulint len;
|
||||||
|
ibool comp;
|
||||||
|
dict_index_t* index;
|
||||||
|
|
||||||
|
#ifdef UNIV_SYNC_DEBUG
|
||||||
|
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||||
|
#endif /* UNIV_SYNC_DEBUG */
|
||||||
|
|
||||||
|
ut_a(!dict_sys->sys_indexes->comp);
|
||||||
|
ptr = rec_get_nth_field_old(rec, DICT_SYS_INDEXES_PAGE_NO_FIELD, &len);
|
||||||
|
|
||||||
|
ut_ad(len == 4);
|
||||||
|
|
||||||
|
root_page_no = mtr_read_ulint(ptr, MLOG_4BYTES, mtr);
|
||||||
|
|
||||||
|
if (root_page_no == FIL_NULL) {
|
||||||
|
/* The tree has been freed. */
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ptr = rec_get_nth_field_old(rec,
|
||||||
|
DICT_SYS_INDEXES_SPACE_NO_FIELD, &len);
|
||||||
|
|
||||||
|
ut_ad(len == 4);
|
||||||
|
|
||||||
|
space = mtr_read_ulint(ptr, MLOG_4BYTES, mtr);
|
||||||
|
|
||||||
|
if (!fil_tablespace_exists_in_mem(space)) {
|
||||||
|
/* It is a single table tablespace and the .ibd file is
|
||||||
|
missing: do nothing */
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ptr = rec_get_nth_field_old(rec,
|
||||||
|
DICT_SYS_INDEXES_TYPE_FIELD, &len);
|
||||||
|
ut_ad(len == 4);
|
||||||
|
type = mach_read_from_4(ptr);
|
||||||
|
|
||||||
|
ptr = rec_get_nth_field_old(rec, 1, &len);
|
||||||
|
ut_ad(len == 8);
|
||||||
|
index_id = mach_read_from_8(ptr);
|
||||||
|
|
||||||
|
/* We free all the pages but the root page first; this operation
|
||||||
|
may span several mini-transactions */
|
||||||
|
|
||||||
|
btr_free_but_not_root(space, root_page_no);
|
||||||
|
|
||||||
|
/* Then we free the root page in the same mini-transaction where
|
||||||
|
we create the b-tree and write its new root page number to the
|
||||||
|
appropriate field in the SYS_INDEXES record: this mini-transaction
|
||||||
|
marks the B-tree totally truncated */
|
||||||
|
|
||||||
|
comp = page_is_comp(btr_page_get(
|
||||||
|
space, root_page_no, RW_X_LATCH, mtr));
|
||||||
|
|
||||||
|
btr_free_root(space, root_page_no, mtr);
|
||||||
|
|
||||||
|
/* Find the index corresponding to this SYS_INDEXES record. */
|
||||||
|
for (index = UT_LIST_GET_FIRST(table->indexes);
|
||||||
|
index;
|
||||||
|
index = UT_LIST_GET_NEXT(indexes, index)) {
|
||||||
|
if (!ut_dulint_cmp(index->id, index_id)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
root_page_no = btr_create(type, space, index_id, comp, mtr);
|
||||||
|
if (index) {
|
||||||
|
index->tree->page = root_page_no;
|
||||||
|
}
|
||||||
|
|
||||||
|
page_rec_write_index_page_no(rec,
|
||||||
|
DICT_SYS_INDEXES_PAGE_NO_FIELD,
|
||||||
|
root_page_no, mtr);
|
||||||
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Creates a table create graph. */
|
Creates a table create graph. */
|
||||||
|
|
||||||
|
@ -762,6 +855,7 @@ ind_create_graph_create(
|
||||||
node->index = index;
|
node->index = index;
|
||||||
|
|
||||||
node->state = INDEX_BUILD_INDEX_DEF;
|
node->state = INDEX_BUILD_INDEX_DEF;
|
||||||
|
node->page_no = FIL_NULL;
|
||||||
node->heap = mem_heap_create(256);
|
node->heap = mem_heap_create(256);
|
||||||
|
|
||||||
node->ind_def = ins_node_create(INS_DIRECT,
|
node->ind_def = ins_node_create(INS_DIRECT,
|
||||||
|
@ -981,7 +1075,8 @@ dict_create_index_step(
|
||||||
|
|
||||||
if (node->state == INDEX_ADD_TO_CACHE) {
|
if (node->state == INDEX_ADD_TO_CACHE) {
|
||||||
|
|
||||||
success = dict_index_add_to_cache(node->table, node->index);
|
success = dict_index_add_to_cache(node->table, node->index,
|
||||||
|
node->page_no);
|
||||||
|
|
||||||
ut_a(success);
|
ut_a(success);
|
||||||
|
|
||||||
|
|
|
@ -1374,8 +1374,9 @@ dict_index_add_to_cache(
|
||||||
/*====================*/
|
/*====================*/
|
||||||
/* out: TRUE if success */
|
/* out: TRUE if success */
|
||||||
dict_table_t* table, /* in: table on which the index is */
|
dict_table_t* table, /* in: table on which the index is */
|
||||||
dict_index_t* index) /* in, own: index; NOTE! The index memory
|
dict_index_t* index, /* in, own: index; NOTE! The index memory
|
||||||
object is freed in this function! */
|
object is freed in this function! */
|
||||||
|
ulint page_no)/* in: root page number of the index */
|
||||||
{
|
{
|
||||||
dict_index_t* new_index;
|
dict_index_t* new_index;
|
||||||
dict_tree_t* tree;
|
dict_tree_t* tree;
|
||||||
|
@ -1461,10 +1462,9 @@ dict_index_add_to_cache(
|
||||||
tree = dict_index_get_tree(
|
tree = dict_index_get_tree(
|
||||||
UT_LIST_GET_FIRST(cluster->indexes));
|
UT_LIST_GET_FIRST(cluster->indexes));
|
||||||
new_index->tree = tree;
|
new_index->tree = tree;
|
||||||
new_index->page_no = tree->page;
|
|
||||||
} else {
|
} else {
|
||||||
/* Create an index tree memory object for the index */
|
/* Create an index tree memory object for the index */
|
||||||
tree = dict_tree_create(new_index);
|
tree = dict_tree_create(new_index, page_no);
|
||||||
ut_ad(tree);
|
ut_ad(tree);
|
||||||
|
|
||||||
new_index->tree = tree;
|
new_index->tree = tree;
|
||||||
|
@ -1749,7 +1749,6 @@ dict_index_build_internal_clust(
|
||||||
new_index->n_user_defined_cols = index->n_fields;
|
new_index->n_user_defined_cols = index->n_fields;
|
||||||
|
|
||||||
new_index->id = index->id;
|
new_index->id = index->id;
|
||||||
new_index->page_no = index->page_no;
|
|
||||||
|
|
||||||
if (table->type != DICT_TABLE_ORDINARY) {
|
if (table->type != DICT_TABLE_ORDINARY) {
|
||||||
/* The index is mixed: copy common key prefix fields */
|
/* The index is mixed: copy common key prefix fields */
|
||||||
|
@ -1928,7 +1927,6 @@ dict_index_build_internal_non_clust(
|
||||||
new_index->n_user_defined_cols = index->n_fields;
|
new_index->n_user_defined_cols = index->n_fields;
|
||||||
|
|
||||||
new_index->id = index->id;
|
new_index->id = index->id;
|
||||||
new_index->page_no = index->page_no;
|
|
||||||
|
|
||||||
/* Copy fields from index to new_index */
|
/* Copy fields from index to new_index */
|
||||||
dict_index_copy(new_index, index, 0, index->n_fields);
|
dict_index_copy(new_index, index, 0, index->n_fields);
|
||||||
|
@ -3565,9 +3563,10 @@ dict_tree_t*
|
||||||
dict_tree_create(
|
dict_tree_create(
|
||||||
/*=============*/
|
/*=============*/
|
||||||
/* out, own: created tree */
|
/* out, own: created tree */
|
||||||
dict_index_t* index) /* in: the index for which to create: in the
|
dict_index_t* index, /* in: the index for which to create: in the
|
||||||
case of a mixed tree, this should be the
|
case of a mixed tree, this should be the
|
||||||
index of the cluster object */
|
index of the cluster object */
|
||||||
|
ulint page_no)/* in: root page number of the index */
|
||||||
{
|
{
|
||||||
dict_tree_t* tree;
|
dict_tree_t* tree;
|
||||||
|
|
||||||
|
@ -3577,7 +3576,7 @@ dict_tree_create(
|
||||||
|
|
||||||
tree->type = index->type;
|
tree->type = index->type;
|
||||||
tree->space = index->space;
|
tree->space = index->space;
|
||||||
tree->page = index->page_no;
|
tree->page = page_no;
|
||||||
|
|
||||||
tree->id = index->id;
|
tree->id = index->id;
|
||||||
|
|
||||||
|
|
|
@ -681,12 +681,10 @@ dict_load_indexes(
|
||||||
} else {
|
} else {
|
||||||
index = dict_mem_index_create(table->name, name_buf,
|
index = dict_mem_index_create(table->name, name_buf,
|
||||||
space, type, n_fields);
|
space, type, n_fields);
|
||||||
index->page_no = page_no;
|
|
||||||
index->id = id;
|
index->id = id;
|
||||||
|
|
||||||
dict_load_fields(table, index, heap);
|
dict_load_fields(table, index, heap);
|
||||||
|
dict_index_add_to_cache(table, index, page_no);
|
||||||
dict_index_add_to_cache(table, index);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
|
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
|
||||||
|
|
|
@ -548,11 +548,9 @@ ibuf_data_init_for_space(
|
||||||
dict_mem_index_add_field(index, "PAGE_NO", 0, 0);
|
dict_mem_index_add_field(index, "PAGE_NO", 0, 0);
|
||||||
dict_mem_index_add_field(index, "TYPES", 0, 0);
|
dict_mem_index_add_field(index, "TYPES", 0, 0);
|
||||||
|
|
||||||
index->page_no = FSP_IBUF_TREE_ROOT_PAGE_NO;
|
|
||||||
|
|
||||||
index->id = ut_dulint_add(DICT_IBUF_ID_MIN, space);
|
index->id = ut_dulint_add(DICT_IBUF_ID_MIN, space);
|
||||||
|
|
||||||
dict_index_add_to_cache(table, index);
|
dict_index_add_to_cache(table, index, FSP_IBUF_TREE_ROOT_PAGE_NO);
|
||||||
|
|
||||||
data->index = dict_table_get_first_index(table);
|
data->index = dict_table_get_first_index(table);
|
||||||
|
|
||||||
|
|
|
@ -234,6 +234,13 @@ dtype_get_prtype(
|
||||||
dtype_t* type);
|
dtype_t* type);
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Gets the MySQL charset-collation code for MySQL string types. */
|
Gets the MySQL charset-collation code for MySQL string types. */
|
||||||
|
|
||||||
|
ulint
|
||||||
|
dtype_get_charset_coll_noninline(
|
||||||
|
/*=============================*/
|
||||||
|
ulint prtype);/* in: precise data type */
|
||||||
|
/*************************************************************************
|
||||||
|
Gets the MySQL charset-collation code for MySQL string types. */
|
||||||
UNIV_INLINE
|
UNIV_INLINE
|
||||||
ulint
|
ulint
|
||||||
dtype_get_charset_coll(
|
dtype_get_charset_coll(
|
||||||
|
|
|
@ -119,6 +119,7 @@ dict_create(void);
|
||||||
clustered index */
|
clustered index */
|
||||||
#define DICT_SYS_INDEXES_PAGE_NO_FIELD 8
|
#define DICT_SYS_INDEXES_PAGE_NO_FIELD 8
|
||||||
#define DICT_SYS_INDEXES_SPACE_NO_FIELD 7
|
#define DICT_SYS_INDEXES_SPACE_NO_FIELD 7
|
||||||
|
#define DICT_SYS_INDEXES_TYPE_FIELD 6
|
||||||
|
|
||||||
/* When a row id which is zero modulo this number (which must be a power of
|
/* When a row id which is zero modulo this number (which must be a power of
|
||||||
two) is assigned, the field DICT_HDR_ROW_ID on the dictionary header page is
|
two) is assigned, the field DICT_HDR_ROW_ID on the dictionary header page is
|
||||||
|
|
|
@ -54,6 +54,17 @@ dict_create_index_step(
|
||||||
/* out: query thread to run next or NULL */
|
/* out: query thread to run next or NULL */
|
||||||
que_thr_t* thr); /* in: query thread */
|
que_thr_t* thr); /* in: query thread */
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
Truncates the index tree associated with a row in SYS_INDEXES table. */
|
||||||
|
|
||||||
|
void
|
||||||
|
dict_truncate_index_tree(
|
||||||
|
/*=====================*/
|
||||||
|
dict_table_t* table, /* in: the table the index belongs to */
|
||||||
|
rec_t* rec, /* in: record in the clustered index of
|
||||||
|
SYS_INDEXES table */
|
||||||
|
mtr_t* mtr); /* in: mtr having the latch
|
||||||
|
on the record page */
|
||||||
|
/***********************************************************************
|
||||||
Drops the index tree associated with a row in SYS_INDEXES table. */
|
Drops the index tree associated with a row in SYS_INDEXES table. */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -142,6 +153,7 @@ struct ind_node_struct{
|
||||||
/*----------------------*/
|
/*----------------------*/
|
||||||
/* Local storage for this graph node */
|
/* Local storage for this graph node */
|
||||||
ulint state; /* node execution state */
|
ulint state; /* node execution state */
|
||||||
|
ulint page_no;/* root page number of the index */
|
||||||
dict_table_t* table; /* table which owns the index */
|
dict_table_t* table; /* table which owns the index */
|
||||||
dtuple_t* ind_row;/* index definition row built */
|
dtuple_t* ind_row;/* index definition row built */
|
||||||
ulint field_no;/* next field definition to insert */
|
ulint field_no;/* next field definition to insert */
|
||||||
|
|
|
@ -508,8 +508,9 @@ dict_index_add_to_cache(
|
||||||
/*====================*/
|
/*====================*/
|
||||||
/* out: TRUE if success */
|
/* out: TRUE if success */
|
||||||
dict_table_t* table, /* in: table on which the index is */
|
dict_table_t* table, /* in: table on which the index is */
|
||||||
dict_index_t* index); /* in, own: index; NOTE! The index memory
|
dict_index_t* index, /* in, own: index; NOTE! The index memory
|
||||||
object is freed in this function! */
|
object is freed in this function! */
|
||||||
|
ulint page_no);/* in: root page number of the index */
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
Gets the number of fields in the internal representation of an index,
|
Gets the number of fields in the internal representation of an index,
|
||||||
including fields added by the dictionary system. */
|
including fields added by the dictionary system. */
|
||||||
|
@ -686,9 +687,10 @@ dict_tree_t*
|
||||||
dict_tree_create(
|
dict_tree_create(
|
||||||
/*=============*/
|
/*=============*/
|
||||||
/* out, own: created tree */
|
/* out, own: created tree */
|
||||||
dict_index_t* index); /* in: the index for which to create: in the
|
dict_index_t* index, /* in: the index for which to create: in the
|
||||||
case of a mixed tree, this should be the
|
case of a mixed tree, this should be the
|
||||||
index of the cluster object */
|
index of the cluster object */
|
||||||
|
ulint page_no);/* in: root page number of the index */
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
Frees an index tree struct. */
|
Frees an index tree struct. */
|
||||||
|
|
||||||
|
|
|
@ -218,7 +218,6 @@ struct dict_index_struct{
|
||||||
const char* table_name; /* table name */
|
const char* table_name; /* table name */
|
||||||
dict_table_t* table; /* back pointer to table */
|
dict_table_t* table; /* back pointer to table */
|
||||||
ulint space; /* space where the index tree is placed */
|
ulint space; /* space where the index tree is placed */
|
||||||
ulint page_no;/* page number of the index tree root */
|
|
||||||
ulint trx_id_offset;/* position of the the trx id column
|
ulint trx_id_offset;/* position of the the trx id column
|
||||||
in a clustered index record, if the fields
|
in a clustered index record, if the fields
|
||||||
before it are known to be of a fixed size,
|
before it are known to be of a fixed size,
|
||||||
|
|
|
@ -363,6 +363,15 @@ row_get_background_drop_list_len_low(void);
|
||||||
/*======================================*/
|
/*======================================*/
|
||||||
/* out: how many tables in list */
|
/* out: how many tables in list */
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
Truncates a table for MySQL. */
|
||||||
|
|
||||||
|
int
|
||||||
|
row_truncate_table_for_mysql(
|
||||||
|
/*=========================*/
|
||||||
|
/* out: error code or DB_SUCCESS */
|
||||||
|
dict_table_t* table, /* in: table handle */
|
||||||
|
trx_t* trx); /* in: transaction handle */
|
||||||
|
/*************************************************************************
|
||||||
Drops a table for MySQL. If the name of the dropped table ends to
|
Drops a table for MySQL. If the name of the dropped table ends to
|
||||||
characters INNODB_MONITOR, then this also stops printing of monitor
|
characters INNODB_MONITOR, then this also stops printing of monitor
|
||||||
output by the master thread. */
|
output by the master thread. */
|
||||||
|
@ -447,6 +456,8 @@ struct mysql_row_templ_struct {
|
||||||
zero if column cannot be NULL */
|
zero if column cannot be NULL */
|
||||||
ulint type; /* column type in Innobase mtype
|
ulint type; /* column type in Innobase mtype
|
||||||
numbers DATA_CHAR... */
|
numbers DATA_CHAR... */
|
||||||
|
ulint charset; /* MySQL charset-collation code
|
||||||
|
of the column, or zero */
|
||||||
ulint is_unsigned; /* if a column type is an integer
|
ulint is_unsigned; /* if a column type is an integer
|
||||||
type and this field is != 0, then
|
type and this field is != 0, then
|
||||||
it is an unsigned integer type */
|
it is an unsigned integer type */
|
||||||
|
|
|
@ -91,12 +91,33 @@ row_mysql_store_col_in_innobase_format(
|
||||||
}
|
}
|
||||||
} else if (type == DATA_VARCHAR || type == DATA_VARMYSQL
|
} else if (type == DATA_VARCHAR || type == DATA_VARMYSQL
|
||||||
|| type == DATA_BINARY) {
|
|| type == DATA_BINARY) {
|
||||||
|
/* Remove trailing spaces. */
|
||||||
|
|
||||||
|
/* Handle UCS2 strings differently. As no new
|
||||||
|
collations will be introduced in 4.1, we hardcode the
|
||||||
|
charset-collation codes here. In 5.0, the logic will
|
||||||
|
be based on mbminlen. */
|
||||||
|
ulint cset = dtype_get_charset_coll(
|
||||||
|
dtype_get_prtype(dfield_get_type(dfield)));
|
||||||
ptr = row_mysql_read_var_ref(&col_len, mysql_data);
|
ptr = row_mysql_read_var_ref(&col_len, mysql_data);
|
||||||
|
if (cset == 35/*ucs2_general_ci*/
|
||||||
/* Remove trailing spaces */
|
|| cset == 90/*ucs2_bin*/
|
||||||
while (col_len > 0 && ptr[col_len - 1] == ' ') {
|
|| (cset >= 128/*ucs2_unicode_ci*/
|
||||||
col_len--;
|
&& cset <= 144/*ucs2_persian_ci*/)) {
|
||||||
}
|
/* space=0x0020 */
|
||||||
|
/* Trim "half-chars", just in case. */
|
||||||
|
col_len &= ~1;
|
||||||
|
|
||||||
|
while (col_len >= 2 && ptr[col_len - 2] == 0x00
|
||||||
|
&& ptr[col_len - 1] == 0x20) {
|
||||||
|
col_len -= 2;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* space=0x20 */
|
||||||
|
while (col_len > 0 && ptr[col_len - 1] == 0x20) {
|
||||||
|
col_len--;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (type == DATA_BLOB) {
|
} else if (type == DATA_BLOB) {
|
||||||
ptr = row_mysql_read_blob_ref(&col_len, mysql_data, col_len);
|
ptr = row_mysql_read_blob_ref(&col_len, mysql_data, col_len);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,10 @@ extern dulint srv_start_lsn;
|
||||||
void set_panic_flag_for_netware(void);
|
void set_panic_flag_for_netware(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_DARWIN_THREADS
|
||||||
|
extern ibool srv_have_fullfsync;
|
||||||
|
#endif
|
||||||
|
|
||||||
extern ulint srv_sizeof_trx_t_in_ha_innodb_cc;
|
extern ulint srv_sizeof_trx_t_in_ha_innodb_cc;
|
||||||
|
|
||||||
extern ibool srv_is_being_started;
|
extern ibool srv_is_being_started;
|
||||||
|
|
|
@ -1773,19 +1773,31 @@ os_file_flush(
|
||||||
#else
|
#else
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
#if defined(HAVE_DARWIN_THREADS) && defined(F_FULLFSYNC)
|
#if defined(HAVE_DARWIN_THREADS)
|
||||||
|
# ifndef F_FULLFSYNC
|
||||||
|
/* The following definition is from the Mac OS X 10.3 <sys/fcntl.h> */
|
||||||
|
# define F_FULLFSYNC 51 /* fsync + ask the drive to flush to the media */
|
||||||
|
# elif F_FULLFSYNC != 51
|
||||||
|
# error "F_FULLFSYNC != 51: ABI incompatibility with Mac OS X 10.3"
|
||||||
|
# endif
|
||||||
/* Apple has disabled fsync() for internal disk drives in OS X. That
|
/* Apple has disabled fsync() for internal disk drives in OS X. That
|
||||||
caused corruption for a user when he tested a power outage. Let us in
|
caused corruption for a user when he tested a power outage. Let us in
|
||||||
OS X use a nonstandard flush method recommended by an Apple
|
OS X use a nonstandard flush method recommended by an Apple
|
||||||
engineer. */
|
engineer. */
|
||||||
|
|
||||||
ret = fcntl(file, F_FULLFSYNC, NULL);
|
if (!srv_have_fullfsync) {
|
||||||
|
/* If we are not on an operating system that supports this,
|
||||||
if (ret) {
|
then fall back to a plain fsync. */
|
||||||
/* If we are not on a file system that supports this, then
|
|
||||||
fall back to a plain fsync. */
|
|
||||||
|
|
||||||
ret = fsync(file);
|
ret = fsync(file);
|
||||||
|
} else {
|
||||||
|
ret = fcntl(file, F_FULLFSYNC, NULL);
|
||||||
|
|
||||||
|
if (ret) {
|
||||||
|
/* If we are not on a file system that supports this,
|
||||||
|
then fall back to a plain fsync. */
|
||||||
|
ret = fsync(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#elif HAVE_FDATASYNC
|
#elif HAVE_FDATASYNC
|
||||||
ret = fdatasync(file);
|
ret = fdatasync(file);
|
||||||
|
|
|
@ -262,22 +262,6 @@ cmp_whole_field(
|
||||||
"InnoDB: comparison!\n");
|
"InnoDB: comparison!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MySQL does not pad the ends of strings with spaces in a
|
|
||||||
comparison. That would cause a foreign key check to fail for
|
|
||||||
non-latin1 character sets if we have different length columns.
|
|
||||||
To prevent that we remove trailing spaces here before doing
|
|
||||||
the comparison. NOTE that if we in the future map more MySQL
|
|
||||||
types to DATA_MYSQL or DATA_VARMYSQL, we have to change this
|
|
||||||
code. */
|
|
||||||
|
|
||||||
while (a_length > 0 && a[a_length - 1] == ' ') {
|
|
||||||
a_length--;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (b_length > 0 && b[b_length - 1] == ' ') {
|
|
||||||
b_length--;
|
|
||||||
}
|
|
||||||
|
|
||||||
return(innobase_mysql_cmp(
|
return(innobase_mysql_cmp(
|
||||||
(int)(type->prtype & DATA_MYSQL_TYPE_MASK),
|
(int)(type->prtype & DATA_MYSQL_TYPE_MASK),
|
||||||
(uint)dtype_get_charset_coll(type->prtype),
|
(uint)dtype_get_charset_coll(type->prtype),
|
||||||
|
|
|
@ -2421,6 +2421,294 @@ funct_exit:
|
||||||
return((int) err);
|
return((int) err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
Truncates a table for MySQL. */
|
||||||
|
|
||||||
|
int
|
||||||
|
row_truncate_table_for_mysql(
|
||||||
|
/*=========================*/
|
||||||
|
/* out: error code or DB_SUCCESS */
|
||||||
|
dict_table_t* table, /* in: table handle */
|
||||||
|
trx_t* trx) /* in: transaction handle */
|
||||||
|
{
|
||||||
|
dict_foreign_t* foreign;
|
||||||
|
ulint err;
|
||||||
|
ibool locked_dictionary = FALSE;
|
||||||
|
mem_heap_t* heap;
|
||||||
|
byte* buf;
|
||||||
|
dtuple_t* tuple;
|
||||||
|
dfield_t* dfield;
|
||||||
|
dict_index_t* sys_index;
|
||||||
|
btr_pcur_t pcur;
|
||||||
|
mtr_t mtr;
|
||||||
|
dulint new_id;
|
||||||
|
char* sql;
|
||||||
|
que_thr_t* thr;
|
||||||
|
que_t* graph = NULL;
|
||||||
|
|
||||||
|
/* How do we prevent crashes caused by ongoing operations on the table? Old
|
||||||
|
operations could try to access non-existent pages.
|
||||||
|
|
||||||
|
1) SQL queries, INSERT, SELECT, ...: we must get an exclusive MySQL table lock
|
||||||
|
on the table before we can do TRUNCATE TABLE. Then there are no running
|
||||||
|
queries on the table.
|
||||||
|
2) Purge and rollback: we assign a new table id for the table. Since purge and
|
||||||
|
rollback look for the table based on the table id, they see the table as
|
||||||
|
'dropped' and discard their operations.
|
||||||
|
3) Insert buffer: TRUNCATE TABLE is analogous to DROP TABLE, so we do not
|
||||||
|
have to remove insert buffer records, as the insert buffer works at a low
|
||||||
|
level. If a freed page is later reallocated, the allocator will remove
|
||||||
|
the ibuf entries for it.
|
||||||
|
|
||||||
|
TODO: when we truncate *.ibd files (analogous to DISCARD TABLESPACE), we
|
||||||
|
will have to remove we remove all entries for the table in the insert
|
||||||
|
buffer tree!
|
||||||
|
|
||||||
|
4) Linear readahead and random readahead: we use the same method as in 3) to
|
||||||
|
discard ongoing operations. (This will only be relevant for TRUNCATE TABLE
|
||||||
|
by DISCARD TABLESPACE.)
|
||||||
|
5) FOREIGN KEY operations: if table->n_foreign_key_checks_running > 0, we
|
||||||
|
do not allow the TRUNCATE. We also reserve the data dictionary latch. */
|
||||||
|
|
||||||
|
static const char renumber_tablespace_proc[] =
|
||||||
|
"PROCEDURE RENUMBER_TABLESPACE_PROC () IS\n"
|
||||||
|
"old_id CHAR;\n"
|
||||||
|
"new_id CHAR;\n"
|
||||||
|
"old_id_low INT;\n"
|
||||||
|
"old_id_high INT;\n"
|
||||||
|
"new_id_low INT;\n"
|
||||||
|
"new_id_high INT;\n"
|
||||||
|
"BEGIN\n"
|
||||||
|
"old_id_high := %lu;\n"
|
||||||
|
"old_id_low := %lu;\n"
|
||||||
|
"new_id_high := %lu;\n"
|
||||||
|
"new_id_low := %lu;\n"
|
||||||
|
"old_id := CONCAT(TO_BINARY(old_id_high, 4), TO_BINARY(old_id_low, 4));\n"
|
||||||
|
"new_id := CONCAT(TO_BINARY(new_id_high, 4), TO_BINARY(new_id_low, 4));\n"
|
||||||
|
"UPDATE SYS_TABLES SET ID = new_id\n"
|
||||||
|
"WHERE ID = old_id;\n"
|
||||||
|
"UPDATE SYS_COLUMNS SET TABLE_ID = new_id\n"
|
||||||
|
"WHERE TABLE_ID = old_id;\n"
|
||||||
|
"UPDATE SYS_INDEXES SET TABLE_ID = new_id\n"
|
||||||
|
"WHERE TABLE_ID = old_id;\n"
|
||||||
|
"COMMIT WORK;\n"
|
||||||
|
"END;\n";
|
||||||
|
|
||||||
|
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
||||||
|
ut_ad(table);
|
||||||
|
|
||||||
|
if (srv_created_new_raw) {
|
||||||
|
fputs(
|
||||||
|
"InnoDB: A new raw disk partition was initialized or\n"
|
||||||
|
"InnoDB: innodb_force_recovery is on: we do not allow\n"
|
||||||
|
"InnoDB: database modifications by the user. Shut down\n"
|
||||||
|
"InnoDB: mysqld and edit my.cnf so that newraw is replaced\n"
|
||||||
|
"InnoDB: with raw, and innodb_force_... is removed.\n",
|
||||||
|
stderr);
|
||||||
|
|
||||||
|
return(DB_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
trx->op_info = "truncating table";
|
||||||
|
|
||||||
|
trx_start_if_not_started(trx);
|
||||||
|
|
||||||
|
/* Serialize data dictionary operations with dictionary mutex:
|
||||||
|
no deadlocks can occur then in these operations */
|
||||||
|
|
||||||
|
if (trx->dict_operation_lock_mode != RW_X_LATCH) {
|
||||||
|
/* Prevent foreign key checks etc. while we are truncating the
|
||||||
|
table */
|
||||||
|
|
||||||
|
row_mysql_lock_data_dictionary(trx);
|
||||||
|
|
||||||
|
locked_dictionary = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef UNIV_SYNC_DEBUG
|
||||||
|
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||||
|
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
|
||||||
|
#endif /* UNIV_SYNC_DEBUG */
|
||||||
|
|
||||||
|
/* Check if the table is referenced by foreign key constraints from
|
||||||
|
some other table (not the table itself) */
|
||||||
|
|
||||||
|
foreign = UT_LIST_GET_FIRST(table->referenced_list);
|
||||||
|
|
||||||
|
while (foreign && foreign->foreign_table == table) {
|
||||||
|
foreign = UT_LIST_GET_NEXT(referenced_list, foreign);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (foreign && trx->check_foreigns) {
|
||||||
|
FILE* ef = dict_foreign_err_file;
|
||||||
|
|
||||||
|
/* We only allow truncating a referenced table if
|
||||||
|
FOREIGN_KEY_CHECKS is set to 0 */
|
||||||
|
|
||||||
|
mutex_enter(&dict_foreign_err_mutex);
|
||||||
|
rewind(ef);
|
||||||
|
ut_print_timestamp(ef);
|
||||||
|
|
||||||
|
fputs(" Cannot truncate table ", ef);
|
||||||
|
ut_print_name(ef, trx, table->name);
|
||||||
|
fputs("\n"
|
||||||
|
"because it is referenced by ", ef);
|
||||||
|
ut_print_name(ef, trx, foreign->foreign_table_name);
|
||||||
|
putc('\n', ef);
|
||||||
|
mutex_exit(&dict_foreign_err_mutex);
|
||||||
|
|
||||||
|
err = DB_ERROR;
|
||||||
|
goto funct_exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (table->n_mysql_handles_opened > 1) {
|
||||||
|
ut_print_timestamp(stderr);
|
||||||
|
fputs(" InnoDB: Warning: MySQL is trying to truncate table ", stderr);
|
||||||
|
ut_print_name(stderr, trx, table->name);
|
||||||
|
fputs("\n"
|
||||||
|
"InnoDB: though there are still open handles to it.\n", stderr);
|
||||||
|
err = DB_ERROR;
|
||||||
|
|
||||||
|
goto funct_exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TODO: could we replace the counter n_foreign_key_checks_running
|
||||||
|
with lock checks on the table? Acquire here an exclusive lock on the
|
||||||
|
table, and rewrite lock0lock.c and the lock wait in srv0srv.c so that
|
||||||
|
they can cope with the table having been truncated here? Foreign key
|
||||||
|
checks take an IS or IX lock on the table. */
|
||||||
|
|
||||||
|
if (table->n_foreign_key_checks_running > 0) {
|
||||||
|
ut_print_timestamp(stderr);
|
||||||
|
fputs(" InnoDB: You are trying to truncate table ", stderr);
|
||||||
|
ut_print_name(stderr, trx, table->name);
|
||||||
|
fputs("\n"
|
||||||
|
"InnoDB: though there is a foreign key check running on it.\n",
|
||||||
|
stderr);
|
||||||
|
err = DB_ERROR;
|
||||||
|
|
||||||
|
goto funct_exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remove any locks there are on the table or its records */
|
||||||
|
|
||||||
|
lock_reset_all_on_table(table);
|
||||||
|
|
||||||
|
trx->dict_operation = TRUE;
|
||||||
|
trx->table_id = table->id;
|
||||||
|
|
||||||
|
/* scan SYS_INDEXES for all indexes of the table */
|
||||||
|
heap = mem_heap_create(800);
|
||||||
|
|
||||||
|
tuple = dtuple_create(heap, 1);
|
||||||
|
dfield = dtuple_get_nth_field(tuple, 0);
|
||||||
|
|
||||||
|
buf = mem_heap_alloc(heap, 8);
|
||||||
|
mach_write_to_8(buf, table->id);
|
||||||
|
|
||||||
|
dfield_set_data(dfield, buf, 8);
|
||||||
|
sys_index = dict_table_get_first_index(dict_sys->sys_indexes);
|
||||||
|
dict_index_copy_types(tuple, sys_index, 1);
|
||||||
|
|
||||||
|
mtr_start(&mtr);
|
||||||
|
btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
|
||||||
|
BTR_MODIFY_LEAF, &pcur, &mtr);
|
||||||
|
for (;;) {
|
||||||
|
rec_t* rec;
|
||||||
|
const byte* field;
|
||||||
|
ulint len;
|
||||||
|
|
||||||
|
if (!btr_pcur_is_on_user_rec(&pcur, &mtr)) {
|
||||||
|
/* The end of SYS_INDEXES has been reached. */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
rec = btr_pcur_get_rec(&pcur);
|
||||||
|
|
||||||
|
field = rec_get_nth_field_old(rec, 0, &len);
|
||||||
|
ut_ad(len == 8);
|
||||||
|
|
||||||
|
if (memcmp(buf, field, len) != 0) {
|
||||||
|
/* End of indexes for the table (TABLE_ID mismatch). */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rec_get_deleted_flag(rec, FALSE)) {
|
||||||
|
/* The index has been dropped. */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
dict_truncate_index_tree(table, rec, &mtr);
|
||||||
|
|
||||||
|
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
btr_pcur_close(&pcur);
|
||||||
|
mtr_commit(&mtr);
|
||||||
|
|
||||||
|
new_id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID);
|
||||||
|
|
||||||
|
mem_heap_empty(heap);
|
||||||
|
sql = mem_heap_alloc(heap, (sizeof renumber_tablespace_proc) + 40);
|
||||||
|
sprintf(sql, renumber_tablespace_proc,
|
||||||
|
(ulong) ut_dulint_get_high(table->id),
|
||||||
|
(ulong) ut_dulint_get_low(table->id),
|
||||||
|
(ulong) ut_dulint_get_high(new_id),
|
||||||
|
(ulong) ut_dulint_get_low(new_id));
|
||||||
|
|
||||||
|
graph = pars_sql(sql);
|
||||||
|
|
||||||
|
ut_a(graph);
|
||||||
|
|
||||||
|
mem_heap_free(heap);
|
||||||
|
|
||||||
|
graph->trx = trx;
|
||||||
|
trx->graph = NULL;
|
||||||
|
|
||||||
|
graph->fork_type = QUE_FORK_MYSQL_INTERFACE;
|
||||||
|
|
||||||
|
thr = que_fork_start_command(graph);
|
||||||
|
ut_a(thr);
|
||||||
|
|
||||||
|
que_run_threads(thr);
|
||||||
|
|
||||||
|
que_graph_free(graph);
|
||||||
|
|
||||||
|
err = trx->error_state;
|
||||||
|
|
||||||
|
if (err != DB_SUCCESS) {
|
||||||
|
trx->error_state = DB_SUCCESS;
|
||||||
|
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
||||||
|
trx->error_state = DB_SUCCESS;
|
||||||
|
ut_print_timestamp(stderr);
|
||||||
|
fputs(" InnoDB: Unable to assign a new identifier to table ", stderr);
|
||||||
|
ut_print_name(stderr, trx, table->name);
|
||||||
|
fputs("\n"
|
||||||
|
"InnoDB: after truncating it. Background processes may corrupt the table!\n",
|
||||||
|
stderr);
|
||||||
|
err = DB_ERROR;
|
||||||
|
} else {
|
||||||
|
dict_table_change_id_in_cache(table, new_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
dict_table_autoinc_initialize(table, 0);
|
||||||
|
dict_update_statistics(table);
|
||||||
|
|
||||||
|
trx_commit_for_mysql(trx);
|
||||||
|
|
||||||
|
funct_exit:
|
||||||
|
|
||||||
|
if (locked_dictionary) {
|
||||||
|
row_mysql_unlock_data_dictionary(trx);
|
||||||
|
}
|
||||||
|
|
||||||
|
trx->op_info = "";
|
||||||
|
|
||||||
|
srv_wake_master_thread();
|
||||||
|
|
||||||
|
return((int) err);
|
||||||
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Drops a table for MySQL. If the name of the table to be dropped is equal
|
Drops a table for MySQL. If the name of the table to be dropped is equal
|
||||||
with one of the predefined magic table names, then this also stops printing
|
with one of the predefined magic table names, then this also stops printing
|
||||||
|
|
|
@ -2271,9 +2271,6 @@ row_sel_field_store_in_mysql_format(
|
||||||
dest = row_mysql_store_var_len(dest, len);
|
dest = row_mysql_store_var_len(dest, len);
|
||||||
ut_memcpy(dest, data, len);
|
ut_memcpy(dest, data, len);
|
||||||
|
|
||||||
/* Pad with trailing spaces */
|
|
||||||
memset(dest + len, ' ', col_len - len);
|
|
||||||
|
|
||||||
/* ut_ad(col_len >= len + 2); No real var implemented in
|
/* ut_ad(col_len >= len + 2); No real var implemented in
|
||||||
MySQL yet! */
|
MySQL yet! */
|
||||||
|
|
||||||
|
@ -2406,7 +2403,45 @@ row_sel_store_mysql_rec(
|
||||||
mysql_rec + templ->mysql_col_offset,
|
mysql_rec + templ->mysql_col_offset,
|
||||||
templ->mysql_col_len, data, len,
|
templ->mysql_col_len, data, len,
|
||||||
templ->type, templ->is_unsigned);
|
templ->type, templ->is_unsigned);
|
||||||
|
|
||||||
|
if (templ->type == DATA_VARCHAR
|
||||||
|
|| templ->type == DATA_VARMYSQL
|
||||||
|
|| templ->type == DATA_BINARY) {
|
||||||
|
/* Pad with trailing spaces */
|
||||||
|
data = mysql_rec + templ->mysql_col_offset;
|
||||||
|
|
||||||
|
/* Handle UCS2 strings differently. As no new
|
||||||
|
collations will be introduced in 4.1, we
|
||||||
|
hardcode the charset-collation codes here.
|
||||||
|
5.0 will use a different approach. */
|
||||||
|
if (templ->charset == 35
|
||||||
|
|| templ->charset == 90
|
||||||
|
|| (templ->charset >= 128
|
||||||
|
&& templ->charset <= 144)) {
|
||||||
|
/* space=0x0020 */
|
||||||
|
ulint col_len = templ->mysql_col_len;
|
||||||
|
|
||||||
|
ut_a(!(col_len & 1));
|
||||||
|
if (len & 1) {
|
||||||
|
/* A 0x20 has been stripped
|
||||||
|
from the column.
|
||||||
|
Pad it back. */
|
||||||
|
goto pad_0x20;
|
||||||
|
}
|
||||||
|
/* Pad the rest of the string
|
||||||
|
with 0x0020 */
|
||||||
|
while (len < col_len) {
|
||||||
|
data[len++] = 0x00;
|
||||||
|
pad_0x20:
|
||||||
|
data[len++] = 0x20;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* space=0x20 */
|
||||||
|
memset(data + len, 0x20,
|
||||||
|
templ->mysql_col_len - len);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Cleanup */
|
/* Cleanup */
|
||||||
if (extern_field_heap) {
|
if (extern_field_heap) {
|
||||||
mem_heap_free(extern_field_heap);
|
mem_heap_free(extern_field_heap);
|
||||||
|
@ -2442,8 +2477,29 @@ row_sel_store_mysql_rec(
|
||||||
pad_char = '\0';
|
pad_char = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(mysql_rec + templ->mysql_col_offset, pad_char,
|
/* Handle UCS2 strings differently. As no new
|
||||||
templ->mysql_col_len);
|
collations will be introduced in 4.1,
|
||||||
|
we hardcode the charset-collation codes here.
|
||||||
|
5.0 will use a different approach. */
|
||||||
|
if (templ->charset == 35
|
||||||
|
|| templ->charset == 90
|
||||||
|
|| (templ->charset >= 128
|
||||||
|
&& templ->charset <= 144)) {
|
||||||
|
/* There are two bytes per char, so the length
|
||||||
|
has to be an even number. */
|
||||||
|
ut_a(!(templ->mysql_col_len & 1));
|
||||||
|
data = mysql_rec + templ->mysql_col_offset;
|
||||||
|
len = templ->mysql_col_len;
|
||||||
|
/* Pad with 0x0020. */
|
||||||
|
while (len >= 2) {
|
||||||
|
*data++ = 0x00;
|
||||||
|
*data++ = 0x20;
|
||||||
|
len -= 2;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
memset(mysql_rec + templ->mysql_col_offset,
|
||||||
|
pad_char, templ->mysql_col_len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,11 @@ dulint srv_start_lsn;
|
||||||
/* Log sequence number at shutdown */
|
/* Log sequence number at shutdown */
|
||||||
dulint srv_shutdown_lsn;
|
dulint srv_shutdown_lsn;
|
||||||
|
|
||||||
|
#ifdef HAVE_DARWIN_THREADS
|
||||||
|
# include <sys/utsname.h>
|
||||||
|
ibool srv_have_fullfsync = FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
ibool srv_start_raw_disk_in_use = FALSE;
|
ibool srv_start_raw_disk_in_use = FALSE;
|
||||||
|
|
||||||
static ibool srv_start_has_been_called = FALSE;
|
static ibool srv_start_has_been_called = FALSE;
|
||||||
|
@ -935,6 +940,28 @@ innobase_start_or_create_for_mysql(void)
|
||||||
ulint i;
|
ulint i;
|
||||||
ibool srv_file_per_table_original_value = srv_file_per_table;
|
ibool srv_file_per_table_original_value = srv_file_per_table;
|
||||||
mtr_t mtr;
|
mtr_t mtr;
|
||||||
|
#ifdef HAVE_DARWIN_THREADS
|
||||||
|
# ifdef F_FULLFSYNC
|
||||||
|
/* This executable has been compiled on Mac OS X 10.3 or later.
|
||||||
|
Assume that F_FULLFSYNC is available at run-time. */
|
||||||
|
srv_have_fullfsync = TRUE;
|
||||||
|
# else /* F_FULLFSYNC */
|
||||||
|
/* This executable has been compiled on Mac OS X 10.2
|
||||||
|
or earlier. Determine if the executable is running
|
||||||
|
on Mac OS X 10.3 or later. */
|
||||||
|
struct utsname utsname;
|
||||||
|
if (uname(&utsname)) {
|
||||||
|
fputs("InnoDB: cannot determine Mac OS X version!\n", stderr);
|
||||||
|
} else {
|
||||||
|
srv_have_fullfsync = strcmp(utsname.release, "7.") >= 0;
|
||||||
|
}
|
||||||
|
if (!srv_have_fullfsync) {
|
||||||
|
fputs(
|
||||||
|
"InnoDB: On Mac OS X, fsync() may be broken on internal drives,\n"
|
||||||
|
"InnoDB: making transactions unsafe!\n", stderr);
|
||||||
|
}
|
||||||
|
# endif /* F_FULLFSYNC */
|
||||||
|
#endif /* HAVE_DARWIN_THREADS */
|
||||||
|
|
||||||
if (sizeof(ulint) != sizeof(void*)) {
|
if (sizeof(ulint) != sizeof(void*)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
|
|
@ -857,6 +857,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
|
||||||
err:
|
err:
|
||||||
/* free up memory allocated with _init, usually */
|
/* free up memory allocated with _init, usually */
|
||||||
(*options->local_infile_end)(li_ptr);
|
(*options->local_infile_end)(li_ptr);
|
||||||
|
my_free(buf, MYF(0));
|
||||||
DBUG_RETURN(result);
|
DBUG_RETURN(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1509,7 +1510,7 @@ ulong STDCALL mysql_thread_id(MYSQL *mysql)
|
||||||
|
|
||||||
const char * STDCALL mysql_character_set_name(MYSQL *mysql)
|
const char * STDCALL mysql_character_set_name(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
return mysql->charset->name;
|
return mysql->charset->csname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -148,9 +148,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
/* Don't call realpath() if the name can't be a link */
|
/* Don't call realpath() if the name can't be a link */
|
||||||
if (strcmp(name_buff, org_name))
|
if (!strcmp(name_buff, org_name) ||
|
||||||
(void) my_readlink(index_name, org_name, MYF(0));
|
my_readlink(index_name, org_name, MYF(0)) == -1)
|
||||||
else
|
|
||||||
(void) strmov(index_name, org_name);
|
(void) strmov(index_name, org_name);
|
||||||
(void) fn_format(data_name,org_name,"",MI_NAME_DEXT,2+4+16);
|
(void) fn_format(data_name,org_name,"",MI_NAME_DEXT,2+4+16);
|
||||||
|
|
||||||
|
|
|
@ -427,6 +427,9 @@ while test $# -gt 0; do
|
||||||
--fast)
|
--fast)
|
||||||
FAST_START=1
|
FAST_START=1
|
||||||
;;
|
;;
|
||||||
|
--use-old-data)
|
||||||
|
USE_OLD_DATA=1;
|
||||||
|
;;
|
||||||
-- ) shift; break ;;
|
-- ) shift; break ;;
|
||||||
--* ) $ECHO "Unrecognized option: $1"; exit 1 ;;
|
--* ) $ECHO "Unrecognized option: $1"; exit 1 ;;
|
||||||
* ) break ;;
|
* ) break ;;
|
||||||
|
@ -538,7 +541,12 @@ else
|
||||||
MYSQLD="$VALGRIND $BASEDIR/bin/mysqld"
|
MYSQLD="$VALGRIND $BASEDIR/bin/mysqld"
|
||||||
fi
|
fi
|
||||||
CLIENT_BINDIR="$BASEDIR/bin"
|
CLIENT_BINDIR="$BASEDIR/bin"
|
||||||
TESTS_BINDIR="$BASEDIR/bin"
|
if test -d "$BASEDIR/tests"
|
||||||
|
then
|
||||||
|
TESTS_BINDIR="$BASEDIR/tests"
|
||||||
|
else
|
||||||
|
TESTS_BINDIR="$BASEDIR/bin"
|
||||||
|
fi
|
||||||
MYSQL_TEST="$CLIENT_BINDIR/mysqltest"
|
MYSQL_TEST="$CLIENT_BINDIR/mysqltest"
|
||||||
MYSQL_DUMP="$CLIENT_BINDIR/mysqldump"
|
MYSQL_DUMP="$CLIENT_BINDIR/mysqldump"
|
||||||
MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog"
|
MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog"
|
||||||
|
@ -768,12 +776,14 @@ report_stats () {
|
||||||
|
|
||||||
mysql_install_db () {
|
mysql_install_db () {
|
||||||
$ECHO "Removing Stale Files"
|
$ECHO "Removing Stale Files"
|
||||||
$RM -rf $MASTER_MYDDIR $MASTER_MYDDIR"1" $SLAVE_MYDDIR $MY_LOG_DIR/*
|
if [ -z "$USE_OLD_DATA" ]; then
|
||||||
$ECHO "Installing Master Databases"
|
$RM -rf $MASTER_MYDDIR $MASTER_MYDDIR"1"
|
||||||
$INSTALL_DB
|
$ECHO "Installing Master Databases"
|
||||||
if [ $? != 0 ]; then
|
$INSTALL_DB
|
||||||
|
if [ $? != 0 ]; then
|
||||||
error "Could not install master test DBs"
|
error "Could not install master test DBs"
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [ ! -z "$USE_NDBCLUSTER" ]
|
if [ ! -z "$USE_NDBCLUSTER" ]
|
||||||
then
|
then
|
||||||
|
@ -785,6 +795,7 @@ mysql_install_db () {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
$ECHO "Installing Slave Databases"
|
$ECHO "Installing Slave Databases"
|
||||||
|
$RM -rf $SLAVE_MYDDIR $MY_LOG_DIR/*
|
||||||
$INSTALL_DB -slave
|
$INSTALL_DB -slave
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
error "Could not install slave test DBs"
|
error "Could not install slave test DBs"
|
||||||
|
|
|
@ -493,3 +493,7 @@ select hex(a) from t1;
|
||||||
hex(a)
|
hex(a)
|
||||||
F2E5F1F2
|
F2E5F1F2
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 ( a timestamp );
|
||||||
|
alter table t1 add unique ( a(1) );
|
||||||
|
ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -36,16 +36,16 @@ create table t2 select * from t1 where 0=1 procedure analyse();
|
||||||
show create table t2;
|
show create table t2;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t2 CREATE TABLE `t2` (
|
t2 CREATE TABLE `t2` (
|
||||||
`Field_name` varchar(255) NOT NULL default '',
|
`Field_name` varbinary(255) NOT NULL default '',
|
||||||
`Min_value` varchar(255) default NULL,
|
`Min_value` varbinary(255) default NULL,
|
||||||
`Max_value` varchar(255) default NULL,
|
`Max_value` varbinary(255) default NULL,
|
||||||
`Min_length` bigint(11) NOT NULL default '0',
|
`Min_length` bigint(11) NOT NULL default '0',
|
||||||
`Max_length` bigint(11) NOT NULL default '0',
|
`Max_length` bigint(11) NOT NULL default '0',
|
||||||
`Empties_or_zeros` bigint(11) NOT NULL default '0',
|
`Empties_or_zeros` bigint(11) NOT NULL default '0',
|
||||||
`Nulls` bigint(11) NOT NULL default '0',
|
`Nulls` bigint(11) NOT NULL default '0',
|
||||||
`Avg_value_or_avg_length` varchar(255) NOT NULL default '',
|
`Avg_value_or_avg_length` varbinary(255) NOT NULL default '',
|
||||||
`Std` varchar(255) default NULL,
|
`Std` varbinary(255) default NULL,
|
||||||
`Optimal_fieldtype` varchar(64) NOT NULL default ''
|
`Optimal_fieldtype` varbinary(64) NOT NULL default ''
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
select * from t1 where 0=1 procedure analyse();
|
select * from t1 where 0=1 procedure analyse();
|
||||||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||||
|
@ -55,16 +55,16 @@ create table t2 select * from t1 where 0=1 procedure analyse();
|
||||||
show create table t2;
|
show create table t2;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t2 CREATE TABLE `t2` (
|
t2 CREATE TABLE `t2` (
|
||||||
`Field_name` varchar(255) NOT NULL default '',
|
`Field_name` varbinary(255) NOT NULL default '',
|
||||||
`Min_value` varchar(255) default NULL,
|
`Min_value` varbinary(255) default NULL,
|
||||||
`Max_value` varchar(255) default NULL,
|
`Max_value` varbinary(255) default NULL,
|
||||||
`Min_length` bigint(11) NOT NULL default '0',
|
`Min_length` bigint(11) NOT NULL default '0',
|
||||||
`Max_length` bigint(11) NOT NULL default '0',
|
`Max_length` bigint(11) NOT NULL default '0',
|
||||||
`Empties_or_zeros` bigint(11) NOT NULL default '0',
|
`Empties_or_zeros` bigint(11) NOT NULL default '0',
|
||||||
`Nulls` bigint(11) NOT NULL default '0',
|
`Nulls` bigint(11) NOT NULL default '0',
|
||||||
`Avg_value_or_avg_length` varchar(255) NOT NULL default '',
|
`Avg_value_or_avg_length` varbinary(255) NOT NULL default '',
|
||||||
`Std` varchar(255) default NULL,
|
`Std` varbinary(255) default NULL,
|
||||||
`Optimal_fieldtype` varchar(64) NOT NULL default ''
|
`Optimal_fieldtype` varbinary(64) NOT NULL default ''
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
select * from t2;
|
select * from t2;
|
||||||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||||
|
@ -78,16 +78,16 @@ create table t2 select * from t1 where 0=1 procedure analyse();
|
||||||
show create table t2;
|
show create table t2;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t2 CREATE TABLE `t2` (
|
t2 CREATE TABLE `t2` (
|
||||||
`Field_name` varchar(255) NOT NULL default '',
|
`Field_name` varbinary(255) NOT NULL default '',
|
||||||
`Min_value` varchar(255) default NULL,
|
`Min_value` varbinary(255) default NULL,
|
||||||
`Max_value` varchar(255) default NULL,
|
`Max_value` varbinary(255) default NULL,
|
||||||
`Min_length` bigint(11) NOT NULL default '0',
|
`Min_length` bigint(11) NOT NULL default '0',
|
||||||
`Max_length` bigint(11) NOT NULL default '0',
|
`Max_length` bigint(11) NOT NULL default '0',
|
||||||
`Empties_or_zeros` bigint(11) NOT NULL default '0',
|
`Empties_or_zeros` bigint(11) NOT NULL default '0',
|
||||||
`Nulls` bigint(11) NOT NULL default '0',
|
`Nulls` bigint(11) NOT NULL default '0',
|
||||||
`Avg_value_or_avg_length` varchar(255) NOT NULL default '',
|
`Avg_value_or_avg_length` varbinary(255) NOT NULL default '',
|
||||||
`Std` varchar(255) default NULL,
|
`Std` varbinary(255) default NULL,
|
||||||
`Optimal_fieldtype` varchar(64) NOT NULL default ''
|
`Optimal_fieldtype` varbinary(64) NOT NULL default ''
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
select * from t2;
|
select * from t2;
|
||||||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||||
|
|
|
@ -98,10 +98,10 @@ Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`c1` varchar(1) character set latin1 collate latin1_danish_ci NOT NULL default '',
|
`c1` varchar(1) character set latin1 collate latin1_danish_ci NOT NULL default '',
|
||||||
`c2` varchar(1) character set latin1 collate latin1_danish_ci NOT NULL default '',
|
`c2` varchar(1) character set latin1 collate latin1_danish_ci NOT NULL default '',
|
||||||
`c3` varchar(1) NOT NULL default '',
|
`c3` varbinary(1) NOT NULL default '',
|
||||||
`c4` varchar(1) NOT NULL default '',
|
`c4` varbinary(1) NOT NULL default '',
|
||||||
`c5` varchar(3) NOT NULL default '',
|
`c5` varbinary(3) NOT NULL default '',
|
||||||
`c6` varchar(3) NOT NULL default '',
|
`c6` varbinary(3) NOT NULL default '',
|
||||||
`c7` double(3,1) NOT NULL default '0.0',
|
`c7` double(3,1) NOT NULL default '0.0',
|
||||||
`c8` double(3,1) NOT NULL default '0.0',
|
`c8` double(3,1) NOT NULL default '0.0',
|
||||||
`c9` double(3,1) default NULL
|
`c9` double(3,1) default NULL
|
||||||
|
@ -149,8 +149,8 @@ t1 CREATE TABLE `t1` (
|
||||||
`COALESCE(1.0)` double(3,1) NOT NULL default '0.0',
|
`COALESCE(1.0)` double(3,1) NOT NULL default '0.0',
|
||||||
`COALESCE('a')` varchar(1) NOT NULL default '',
|
`COALESCE('a')` varchar(1) NOT NULL default '',
|
||||||
`COALESCE(1,1.0)` double(3,1) NOT NULL default '0.0',
|
`COALESCE(1,1.0)` double(3,1) NOT NULL default '0.0',
|
||||||
`COALESCE(1,'1')` varchar(1) NOT NULL default '',
|
`COALESCE(1,'1')` varbinary(1) NOT NULL default '',
|
||||||
`COALESCE(1.1,'1')` varchar(3) NOT NULL default '',
|
`COALESCE(1.1,'1')` varbinary(3) NOT NULL default '',
|
||||||
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) character set latin1 collate latin1_bin NOT NULL default ''
|
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) character set latin1 collate latin1_bin NOT NULL default ''
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
|
@ -204,7 +204,7 @@ show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`a` int(11) NOT NULL
|
`a` int(11) NOT NULL
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
SET SESSION storage_engine="gemini";
|
SET SESSION storage_engine="gemini";
|
||||||
ERROR 42000: Unknown table engine 'gemini'
|
ERROR 42000: Unknown table engine 'gemini'
|
||||||
|
@ -216,7 +216,7 @@ show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`a` int(11) NOT NULL
|
`a` int(11) NOT NULL
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
SET SESSION storage_engine=default;
|
SET SESSION storage_engine=default;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));
|
create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));
|
||||||
|
@ -361,7 +361,7 @@ show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`a` int(11) NOT NULL
|
`a` int(11) NOT NULL
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
SET SESSION storage_engine="gemini";
|
SET SESSION storage_engine="gemini";
|
||||||
ERROR 42000: Unknown table engine 'gemini'
|
ERROR 42000: Unknown table engine 'gemini'
|
||||||
|
@ -373,7 +373,7 @@ show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`a` int(11) NOT NULL
|
`a` int(11) NOT NULL
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
SET SESSION storage_engine=default;
|
SET SESSION storage_engine=default;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob);
|
create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob);
|
||||||
|
|
|
@ -11315,3 +11315,23 @@ DROP TABLE t1;
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
DROP TABLE t3;
|
DROP TABLE t3;
|
||||||
DROP TABLE t4;
|
DROP TABLE t4;
|
||||||
|
SET collation_connection='cp932_japanese_ci';
|
||||||
|
create table t1 select repeat('a',4000) a;
|
||||||
|
delete from t1;
|
||||||
|
insert into t1 values ('a'), ('a '), ('a\t');
|
||||||
|
select collation(a),hex(a) from t1 order by a;
|
||||||
|
collation(a) hex(a)
|
||||||
|
cp932_japanese_ci 6109
|
||||||
|
cp932_japanese_ci 61
|
||||||
|
cp932_japanese_ci 6120
|
||||||
|
drop table t1;
|
||||||
|
SET collation_connection='cp932_bin';
|
||||||
|
create table t1 select repeat('a',4000) a;
|
||||||
|
delete from t1;
|
||||||
|
insert into t1 values ('a'), ('a '), ('a\t');
|
||||||
|
select collation(a),hex(a) from t1 order by a;
|
||||||
|
collation(a) hex(a)
|
||||||
|
cp932_bin 6109
|
||||||
|
cp932_bin 61
|
||||||
|
cp932_bin 6120
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -9785,3 +9785,23 @@ DROP TABLE t1;
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
DROP TABLE t3;
|
DROP TABLE t3;
|
||||||
DROP TABLE t4;
|
DROP TABLE t4;
|
||||||
|
SET collation_connection='eucjpms_japanese_ci';
|
||||||
|
create table t1 select repeat('a',4000) a;
|
||||||
|
delete from t1;
|
||||||
|
insert into t1 values ('a'), ('a '), ('a\t');
|
||||||
|
select collation(a),hex(a) from t1 order by a;
|
||||||
|
collation(a) hex(a)
|
||||||
|
eucjpms_japanese_ci 6109
|
||||||
|
eucjpms_japanese_ci 61
|
||||||
|
eucjpms_japanese_ci 6120
|
||||||
|
drop table t1;
|
||||||
|
SET collation_connection='eucjpms_bin';
|
||||||
|
create table t1 select repeat('a',4000) a;
|
||||||
|
delete from t1;
|
||||||
|
insert into t1 values ('a'), ('a '), ('a\t');
|
||||||
|
select collation(a),hex(a) from t1 order by a;
|
||||||
|
collation(a) hex(a)
|
||||||
|
eucjpms_bin 6109
|
||||||
|
eucjpms_bin 61
|
||||||
|
eucjpms_bin 6120
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -528,7 +528,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
master-bin.000001 95 User var 1 135 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
|
master-bin.000001 95 User var 1 135 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
|
||||||
master-bin.000001 135 Query 1 218 use `test`; insert into t2 values (@v)
|
master-bin.000001 135 Query 1 218 use `test`; insert into t2 values (@v)
|
||||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||||
SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci;
|
SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`;
|
||||||
use test;
|
use test;
|
||||||
SET TIMESTAMP=10000;
|
SET TIMESTAMP=10000;
|
||||||
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
|
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
|
||||||
|
|
|
@ -413,7 +413,7 @@ Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`c` char(10) character set utf8 default NULL,
|
`c` char(10) character set utf8 default NULL,
|
||||||
UNIQUE KEY `a` USING HASH (`c`(1))
|
UNIQUE KEY `a` USING HASH (`c`(1))
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||||
insert into t1 values ('aa');
|
insert into t1 values ('aa');
|
||||||
ERROR 23000: Duplicate entry 'aa' for key 1
|
ERROR 23000: Duplicate entry 'aa' for key 1
|
||||||
|
@ -449,7 +449,7 @@ Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`c` char(10) character set utf8 default NULL,
|
`c` char(10) character set utf8 default NULL,
|
||||||
UNIQUE KEY `a` USING BTREE (`c`(1))
|
UNIQUE KEY `a` USING BTREE (`c`(1))
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||||
insert into t1 values ('aa');
|
insert into t1 values ('aa');
|
||||||
ERROR 23000: Duplicate entry 'aa' for key 1
|
ERROR 23000: Duplicate entry 'aa' for key 1
|
||||||
|
@ -571,7 +571,7 @@ Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`c` char(10) character set utf8 collate utf8_bin default NULL,
|
`c` char(10) character set utf8 collate utf8_bin default NULL,
|
||||||
UNIQUE KEY `a` USING HASH (`c`(1))
|
UNIQUE KEY `a` USING HASH (`c`(1))
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||||
insert into t1 values ('aa');
|
insert into t1 values ('aa');
|
||||||
ERROR 23000: Duplicate entry 'aa' for key 1
|
ERROR 23000: Duplicate entry 'aa' for key 1
|
||||||
|
@ -607,7 +607,7 @@ Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`c` char(10) character set utf8 collate utf8_bin default NULL,
|
`c` char(10) character set utf8 collate utf8_bin default NULL,
|
||||||
UNIQUE KEY `a` USING BTREE (`c`(1))
|
UNIQUE KEY `a` USING BTREE (`c`(1))
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||||
insert into t1 values ('aa');
|
insert into t1 values ('aa');
|
||||||
ERROR 23000: Duplicate entry 'aa' for key 1
|
ERROR 23000: Duplicate entry 'aa' for key 1
|
||||||
|
@ -849,3 +849,15 @@ utf8_bin 6109
|
||||||
utf8_bin 61
|
utf8_bin 61
|
||||||
utf8_bin 6120
|
utf8_bin 6120
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
user varchar(255) NOT NULL default ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
INSERT INTO t1 VALUES ('one'),('two');
|
||||||
|
SELECT CHARSET('a');
|
||||||
|
CHARSET('a')
|
||||||
|
utf8
|
||||||
|
SELECT user, CONCAT('<', user, '>') AS c FROM t1;
|
||||||
|
user c
|
||||||
|
one <one>
|
||||||
|
two <two>
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
|
@ -457,6 +457,11 @@ group_concat(distinct b order by b)
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
|
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE t1 (id int);
|
||||||
|
SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL;
|
||||||
|
gc
|
||||||
|
NULL
|
||||||
|
DROP TABLE t1;
|
||||||
create table t1 (a char(3), b char(20), primary key (a, b));
|
create table t1 (a char(3), b char(20), primary key (a, b));
|
||||||
insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
|
insert into t1 values ('ABW', 'Dutch'), ('ABW', 'English');
|
||||||
select group_concat(a) from t1 group by b;
|
select group_concat(a) from t1 group by b;
|
||||||
|
|
|
@ -107,13 +107,16 @@ timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002")
|
||||||
46:58:57.999999
|
46:58:57.999999
|
||||||
select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002");
|
select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002");
|
||||||
timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002")
|
timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002")
|
||||||
-23:59:59.999999
|
-24:00:00.000001
|
||||||
select timediff("1997-12-31 23:59:59.000001","23:59:59.000001");
|
select timediff("1997-12-31 23:59:59.000001","23:59:59.000001");
|
||||||
timediff("1997-12-31 23:59:59.000001","23:59:59.000001")
|
timediff("1997-12-31 23:59:59.000001","23:59:59.000001")
|
||||||
NULL
|
NULL
|
||||||
select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001");
|
select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001");
|
||||||
timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001")
|
timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001")
|
||||||
-00:00:00.000001
|
-00:00:00.000001
|
||||||
|
select timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50");
|
||||||
|
timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50")
|
||||||
|
-00:00:00.000001
|
||||||
select maketime(10,11,12);
|
select maketime(10,11,12);
|
||||||
maketime(10,11,12)
|
maketime(10,11,12)
|
||||||
10:11:12
|
10:11:12
|
||||||
|
@ -185,7 +188,7 @@ f8 date YES NULL
|
||||||
f9 time YES NULL
|
f9 time YES NULL
|
||||||
select * from t1;
|
select * from t1;
|
||||||
f1 f2 f3 f4 f5 f6 f7 f8 f9
|
f1 f2 f3 f4 f5 f6 f7 f8 f9
|
||||||
1997-01-01 1998-01-02 01:01:00 49:01:01 46:58:57 -23:59:59 10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59
|
1997-01-01 1998-01-02 01:01:00 49:01:01 46:58:57 -24:00:00 10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59
|
||||||
create table test(t1 datetime, t2 time, t3 time, t4 datetime);
|
create table test(t1 datetime, t2 time, t3 time, t4 datetime);
|
||||||
insert into test values
|
insert into test values
|
||||||
('2001-01-01 01:01:01', '01:01:01', null, '2001-02-01 01:01:01'),
|
('2001-01-01 01:01:01', '01:01:01', null, '2001-02-01 01:01:01'),
|
||||||
|
|
|
@ -466,7 +466,7 @@ collation(hex(130)) coercibility(hex(130))
|
||||||
latin1_swedish_ci 3
|
latin1_swedish_ci 3
|
||||||
select collation(char(130)), coercibility(hex(130));
|
select collation(char(130)), coercibility(hex(130));
|
||||||
collation(char(130)) coercibility(hex(130))
|
collation(char(130)) coercibility(hex(130))
|
||||||
binary 3
|
latin1_swedish_ci 3
|
||||||
select collation(format(130,10)), coercibility(format(130,10));
|
select collation(format(130,10)), coercibility(format(130,10));
|
||||||
collation(format(130,10)) coercibility(format(130,10))
|
collation(format(130,10)) coercibility(format(130,10))
|
||||||
latin1_swedish_ci 3
|
latin1_swedish_ci 3
|
||||||
|
|
|
@ -266,7 +266,7 @@ t1 CREATE TABLE `t1` (
|
||||||
`v` varchar(10) default NULL,
|
`v` varchar(10) default NULL,
|
||||||
`c` char(10) default NULL,
|
`c` char(10) default NULL,
|
||||||
`t` varchar(50) default NULL
|
`t` varchar(50) default NULL
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
create table t2 like t1;
|
create table t2 like t1;
|
||||||
show create table t2;
|
show create table t2;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
|
@ -274,7 +274,7 @@ t2 CREATE TABLE `t2` (
|
||||||
`v` varchar(10) default NULL,
|
`v` varchar(10) default NULL,
|
||||||
`c` char(10) default NULL,
|
`c` char(10) default NULL,
|
||||||
`t` varchar(50) default NULL
|
`t` varchar(50) default NULL
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
create table t3 select * from t1;
|
create table t3 select * from t1;
|
||||||
show create table t3;
|
show create table t3;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
|
@ -282,7 +282,7 @@ t3 CREATE TABLE `t3` (
|
||||||
`v` varchar(10) default NULL,
|
`v` varchar(10) default NULL,
|
||||||
`c` char(10) default NULL,
|
`c` char(10) default NULL,
|
||||||
`t` varchar(50) default NULL
|
`t` varchar(50) default NULL
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
alter table t1 modify c varchar(10);
|
alter table t1 modify c varchar(10);
|
||||||
show create table t1;
|
show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
|
@ -290,7 +290,7 @@ t1 CREATE TABLE `t1` (
|
||||||
`v` varchar(10) default NULL,
|
`v` varchar(10) default NULL,
|
||||||
`c` varchar(10) default NULL,
|
`c` varchar(10) default NULL,
|
||||||
`t` varchar(50) default NULL
|
`t` varchar(50) default NULL
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
alter table t1 modify v char(10);
|
alter table t1 modify v char(10);
|
||||||
show create table t1;
|
show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
|
@ -298,7 +298,7 @@ t1 CREATE TABLE `t1` (
|
||||||
`v` char(10) default NULL,
|
`v` char(10) default NULL,
|
||||||
`c` varchar(10) default NULL,
|
`c` varchar(10) default NULL,
|
||||||
`t` varchar(50) default NULL
|
`t` varchar(50) default NULL
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
alter table t1 modify t varchar(10);
|
alter table t1 modify t varchar(10);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1265 Data truncated for column 't' at row 2
|
Warning 1265 Data truncated for column 't' at row 2
|
||||||
|
@ -308,7 +308,7 @@ t1 CREATE TABLE `t1` (
|
||||||
`v` char(10) default NULL,
|
`v` char(10) default NULL,
|
||||||
`c` varchar(10) default NULL,
|
`c` varchar(10) default NULL,
|
||||||
`t` varchar(10) default NULL
|
`t` varchar(10) default NULL
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
select concat('*',v,'*',c,'*',t,'*') from t1;
|
select concat('*',v,'*',c,'*',t,'*') from t1;
|
||||||
concat('*',v,'*',c,'*',t,'*')
|
concat('*',v,'*',c,'*',t,'*')
|
||||||
*+*+*+ *
|
*+*+*+ *
|
||||||
|
@ -324,7 +324,7 @@ t1 CREATE TABLE `t1` (
|
||||||
KEY `v` (`v`),
|
KEY `v` (`v`),
|
||||||
KEY `c` (`c`),
|
KEY `c` (`c`),
|
||||||
KEY `t` (`t`(10))
|
KEY `t` (`t`(10))
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
select count(*) from t1;
|
select count(*) from t1;
|
||||||
count(*)
|
count(*)
|
||||||
270
|
270
|
||||||
|
@ -559,7 +559,7 @@ t1 CREATE TABLE `t1` (
|
||||||
KEY `v` USING BTREE (`v`),
|
KEY `v` USING BTREE (`v`),
|
||||||
KEY `c` USING BTREE (`c`),
|
KEY `c` USING BTREE (`c`),
|
||||||
KEY `t` USING BTREE (`t`(10))
|
KEY `t` USING BTREE (`t`(10))
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
select count(*) from t1;
|
select count(*) from t1;
|
||||||
count(*)
|
count(*)
|
||||||
270
|
270
|
||||||
|
@ -650,7 +650,7 @@ t1 CREATE TABLE `t1` (
|
||||||
KEY `v` (`v`(5)),
|
KEY `v` (`v`(5)),
|
||||||
KEY `c` (`c`(5)),
|
KEY `c` (`c`(5)),
|
||||||
KEY `t` (`t`(5))
|
KEY `t` (`t`(5))
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (v varchar(65530), key(v(10)));
|
create table t1 (v varchar(65530), key(v(10)));
|
||||||
show create table t1;
|
show create table t1;
|
||||||
|
@ -658,7 +658,7 @@ Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`v` varchar(65530) default NULL,
|
`v` varchar(65530) default NULL,
|
||||||
KEY `v` (`v`(10))
|
KEY `v` (`v`(10))
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
insert into t1 values(repeat('a',65530));
|
insert into t1 values(repeat('a',65530));
|
||||||
select length(v) from t1 where v=repeat('a',65530);
|
select length(v) from t1 where v=repeat('a',65530);
|
||||||
length(v)
|
length(v)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
drop table if exists t1;
|
drop table if exists t1,t2;
|
||||||
create table t1
|
create table t1
|
||||||
(
|
(
|
||||||
key1 int not null,
|
key1 int not null,
|
||||||
|
|
|
@ -26,7 +26,7 @@ primary key (pk1, pk2)
|
||||||
) engine=innodb;
|
) engine=innodb;
|
||||||
explain select * from t1 where pk1 = 1 and pk2 < 80 and key1=0;
|
explain select * from t1 where pk1 = 1 and pk2 < 80 and key1=0;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref PRIMARY,key1 PRIMARY 4 const 1 Using where
|
1 SIMPLE t1 range PRIMARY,key1 PRIMARY 8 NULL 9 Using where
|
||||||
select * from t1 where pk1 = 1 and pk2 < 80 and key1=0;
|
select * from t1 where pk1 = 1 and pk2 < 80 and key1=0;
|
||||||
pk1 pk2 key1 key2 pktail1ok pktail2ok pktail3bad pktail4bad pktail5bad pk2copy badkey filler1 filler2
|
pk1 pk2 key1 key2 pktail1ok pktail2ok pktail3bad pktail4bad pktail5bad pk2copy badkey filler1 filler2
|
||||||
1 10 0 0 0 0 0 0 0 10 0 filler-data-10 filler2
|
1 10 0 0 0 0 0 0 0 10 0 filler-data-10 filler2
|
||||||
|
|
|
@ -478,7 +478,7 @@ character_sets CREATE TEMPORARY TABLE `character_sets` (
|
||||||
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '',
|
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '',
|
||||||
`DESCRIPTION` varchar(60) NOT NULL default '',
|
`DESCRIPTION` varchar(60) NOT NULL default '',
|
||||||
`MAXLEN` bigint(3) NOT NULL default '0'
|
`MAXLEN` bigint(3) NOT NULL default '0'
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=utf8 MAX_ROWS=1818
|
) ENGINE=MEMORY DEFAULT CHARSET=utf8 MAX_ROWS=1818
|
||||||
set names latin2;
|
set names latin2;
|
||||||
SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets;
|
SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
|
@ -487,7 +487,7 @@ character_sets CREATE TEMPORARY TABLE `character_sets` (
|
||||||
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '',
|
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '',
|
||||||
`DESCRIPTION` varchar(60) NOT NULL default '',
|
`DESCRIPTION` varchar(60) NOT NULL default '',
|
||||||
`MAXLEN` bigint(3) NOT NULL default '0'
|
`MAXLEN` bigint(3) NOT NULL default '0'
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=utf8 MAX_ROWS=1818
|
) ENGINE=MEMORY DEFAULT CHARSET=utf8 MAX_ROWS=1818
|
||||||
set names latin1;
|
set names latin1;
|
||||||
create table t1 select * from information_schema.CHARACTER_SETS
|
create table t1 select * from information_schema.CHARACTER_SETS
|
||||||
where CHARACTER_SET_NAME like "latin1";
|
where CHARACTER_SET_NAME like "latin1";
|
||||||
|
@ -676,3 +676,6 @@ variable_name
|
||||||
character_set_database
|
character_set_database
|
||||||
collation_database
|
collation_database
|
||||||
skip_show_database
|
skip_show_database
|
||||||
|
show global status like "Threads_running";
|
||||||
|
Variable_name Value
|
||||||
|
Threads_running 1
|
||||||
|
|
|
@ -1326,8 +1326,8 @@ truncate table t1;
|
||||||
insert into t1 (a) values (NULL),(NULL);
|
insert into t1 (a) values (NULL),(NULL);
|
||||||
SELECT * from t1;
|
SELECT * from t1;
|
||||||
a
|
a
|
||||||
3
|
1
|
||||||
4
|
2
|
||||||
drop table t1;
|
drop table t1;
|
||||||
CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
|
CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
|
||||||
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB;
|
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB;
|
||||||
|
@ -1690,13 +1690,13 @@ Variable_name Value
|
||||||
Innodb_page_size 16384
|
Innodb_page_size 16384
|
||||||
show status like "Innodb_rows_deleted";
|
show status like "Innodb_rows_deleted";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Innodb_rows_deleted 2078
|
Innodb_rows_deleted 2070
|
||||||
show status like "Innodb_rows_inserted";
|
show status like "Innodb_rows_inserted";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Innodb_rows_inserted 31706
|
Innodb_rows_inserted 31706
|
||||||
show status like "Innodb_rows_read";
|
show status like "Innodb_rows_read";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Innodb_rows_read 80161
|
Innodb_rows_read 80153
|
||||||
show status like "Innodb_rows_updated";
|
show status like "Innodb_rows_updated";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Innodb_rows_updated 29530
|
Innodb_rows_updated 29530
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
drop table if exists t1,t2;
|
drop table if exists t1,t2;
|
||||||
select 1, 1.0, -1, "hello", NULL;
|
select 1, 1.0, -1, "hello", NULL;
|
||||||
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
||||||
def 1 8 1 1 N 32769 0 8
|
def 1 8 1 1 N 32897 0 63
|
||||||
def 1.0 5 3 3 N 32769 1 8
|
def 1.0 5 3 3 N 32897 1 63
|
||||||
def -1 8 2 2 N 32769 0 8
|
def -1 8 2 2 N 32897 0 63
|
||||||
def hello 253 5 5 N 1 31 8
|
def hello 253 5 5 N 1 31 8
|
||||||
def NULL 6 0 0 Y 32896 0 63
|
def NULL 6 0 0 Y 32896 0 63
|
||||||
1 1.0 -1 hello NULL
|
1 1.0 -1 hello NULL
|
||||||
|
|
|
@ -740,3 +740,41 @@ a b
|
||||||
1 2
|
1 2
|
||||||
1 1
|
1 1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 (
|
||||||
|
`sid` decimal(8,0) default null,
|
||||||
|
`wnid` varchar(11) not null default '',
|
||||||
|
key `wnid14` (`wnid`(4)),
|
||||||
|
key `wnid` (`wnid`)
|
||||||
|
) engine=myisam default charset=latin1;
|
||||||
|
insert into t1 (`sid`, `wnid`) values
|
||||||
|
('10100','01019000000'),('37986','01019000000'),('37987','01019010000'),
|
||||||
|
('39560','01019090000'),('37989','01019000000'),('37990','01019011000'),
|
||||||
|
('37991','01019011000'),('37992','01019019000'),('37993','01019030000'),
|
||||||
|
('37994','01019090000'),('475','02070000000'),('25253','02071100000'),
|
||||||
|
('25255','02071100000'),('25256','02071110000'),('25258','02071130000'),
|
||||||
|
('25259','02071190000'),('25260','02071200000'),('25261','02071210000'),
|
||||||
|
('25262','02071290000'),('25263','02071300000'),('25264','02071310000'),
|
||||||
|
('25265','02071310000'),('25266','02071320000'),('25267','02071320000'),
|
||||||
|
('25269','02071330000'),('25270','02071340000'),('25271','02071350000'),
|
||||||
|
('25272','02071360000'),('25273','02071370000'),('25281','02071391000'),
|
||||||
|
('25282','02071391000'),('25283','02071399000'),('25284','02071400000'),
|
||||||
|
('25285','02071410000'),('25286','02071410000'),('25287','02071420000'),
|
||||||
|
('25288','02071420000'),('25291','02071430000'),('25290','02071440000'),
|
||||||
|
('25292','02071450000'),('25293','02071460000'),('25294','02071470000'),
|
||||||
|
('25295','02071491000'),('25296','02071491000'),('25297','02071499000');
|
||||||
|
explain select * from t1 where wnid like '0101%' order by wnid;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 range wnid14,wnid wnid 13 NULL 10 Using where
|
||||||
|
select * from t1 where wnid like '0101%' order by wnid;
|
||||||
|
sid wnid
|
||||||
|
10100 01019000000
|
||||||
|
37986 01019000000
|
||||||
|
37989 01019000000
|
||||||
|
37987 01019010000
|
||||||
|
37990 01019011000
|
||||||
|
37991 01019011000
|
||||||
|
37992 01019019000
|
||||||
|
37993 01019030000
|
||||||
|
39560 01019090000
|
||||||
|
37994 01019090000
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -471,7 +471,7 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye
|
||||||
prepare stmt1 from ' explain select a from t1 order by b ';
|
prepare stmt1 from ' explain select a from t1 order by b ';
|
||||||
execute stmt1;
|
execute stmt1;
|
||||||
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
||||||
def id 8 3 1 N 32801 0 8
|
def id 8 3 1 N 32929 0 63
|
||||||
def select_type 253 19 6 N 1 31 8
|
def select_type 253 19 6 N 1 31 8
|
||||||
def table 253 64 2 N 1 31 8
|
def table 253 64 2 N 1 31 8
|
||||||
def type 253 10 3 N 1 31 8
|
def type 253 10 3 N 1 31 8
|
||||||
|
@ -479,7 +479,7 @@ def possible_keys 253 4096 0 Y 0 31 8
|
||||||
def key 253 64 0 Y 0 31 8
|
def key 253 64 0 Y 0 31 8
|
||||||
def key_len 253 4096 0 Y 128 31 63
|
def key_len 253 4096 0 Y 128 31 63
|
||||||
def ref 253 1024 0 Y 0 31 8
|
def ref 253 1024 0 Y 0 31 8
|
||||||
def rows 8 10 1 N 32801 0 8
|
def rows 8 10 1 N 32929 0 63
|
||||||
def Extra 253 255 14 N 1 31 8
|
def Extra 253 255 14 N 1 31 8
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort
|
||||||
|
@ -487,7 +487,7 @@ SET @arg00=1 ;
|
||||||
prepare stmt1 from ' explain select a from t1 where a > ? order by b ';
|
prepare stmt1 from ' explain select a from t1 where a > ? order by b ';
|
||||||
execute stmt1 using @arg00;
|
execute stmt1 using @arg00;
|
||||||
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
||||||
def id 8 3 1 N 32801 0 8
|
def id 8 3 1 N 32929 0 63
|
||||||
def select_type 253 19 6 N 1 31 8
|
def select_type 253 19 6 N 1 31 8
|
||||||
def table 253 64 2 N 1 31 8
|
def table 253 64 2 N 1 31 8
|
||||||
def type 253 10 5 N 1 31 8
|
def type 253 10 5 N 1 31 8
|
||||||
|
@ -495,7 +495,7 @@ def possible_keys 253 4096 7 Y 0 31 8
|
||||||
def key 253 64 7 Y 0 31 8
|
def key 253 64 7 Y 0 31 8
|
||||||
def key_len 253 4096 1 Y 128 31 63
|
def key_len 253 4096 1 Y 128 31 63
|
||||||
def ref 253 1024 0 Y 0 31 8
|
def ref 253 1024 0 Y 0 31 8
|
||||||
def rows 8 10 1 N 32801 0 8
|
def rows 8 10 1 N 32929 0 63
|
||||||
def Extra 253 255 27 N 1 31 8
|
def Extra 253 255 27 N 1 31 8
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using filesort
|
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using filesort
|
||||||
|
|
|
@ -1145,7 +1145,7 @@ test_sequence
|
||||||
prepare stmt1 from ' explain select * from t9 ' ;
|
prepare stmt1 from ' explain select * from t9 ' ;
|
||||||
execute stmt1;
|
execute stmt1;
|
||||||
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
||||||
def id 8 3 1 N 32801 0 8
|
def id 8 3 1 N 32929 0 63
|
||||||
def select_type 253 19 6 N 1 31 8
|
def select_type 253 19 6 N 1 31 8
|
||||||
def table 253 64 2 N 1 31 8
|
def table 253 64 2 N 1 31 8
|
||||||
def type 253 10 3 N 1 31 8
|
def type 253 10 3 N 1 31 8
|
||||||
|
@ -1153,7 +1153,7 @@ def possible_keys 253 4096 0 Y 0 31 8
|
||||||
def key 253 64 0 Y 0 31 8
|
def key 253 64 0 Y 0 31 8
|
||||||
def key_len 253 4096 0 Y 128 31 63
|
def key_len 253 4096 0 Y 128 31 63
|
||||||
def ref 253 1024 0 Y 0 31 8
|
def ref 253 1024 0 Y 0 31 8
|
||||||
def rows 8 10 1 N 32801 0 8
|
def rows 8 10 1 N 32929 0 63
|
||||||
def Extra 253 255 0 N 1 31 8
|
def Extra 253 255 0 N 1 31 8
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t9 ALL NULL NULL NULL NULL 2
|
1 SIMPLE t9 ALL NULL NULL NULL NULL 2
|
||||||
|
|
|
@ -1145,7 +1145,7 @@ test_sequence
|
||||||
prepare stmt1 from ' explain select * from t9 ' ;
|
prepare stmt1 from ' explain select * from t9 ' ;
|
||||||
execute stmt1;
|
execute stmt1;
|
||||||
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
||||||
def id 8 3 1 N 32801 0 8
|
def id 8 3 1 N 32929 0 63
|
||||||
def select_type 253 19 6 N 1 31 8
|
def select_type 253 19 6 N 1 31 8
|
||||||
def table 253 64 2 N 1 31 8
|
def table 253 64 2 N 1 31 8
|
||||||
def type 253 10 3 N 1 31 8
|
def type 253 10 3 N 1 31 8
|
||||||
|
@ -1153,7 +1153,7 @@ def possible_keys 253 4096 0 Y 0 31 8
|
||||||
def key 253 64 0 Y 0 31 8
|
def key 253 64 0 Y 0 31 8
|
||||||
def key_len 253 4096 0 Y 128 31 63
|
def key_len 253 4096 0 Y 128 31 63
|
||||||
def ref 253 1024 0 Y 0 31 8
|
def ref 253 1024 0 Y 0 31 8
|
||||||
def rows 8 10 1 N 32801 0 8
|
def rows 8 10 1 N 32929 0 63
|
||||||
def Extra 253 255 0 N 1 31 8
|
def Extra 253 255 0 N 1 31 8
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t9 ALL NULL NULL NULL NULL 2
|
1 SIMPLE t9 ALL NULL NULL NULL NULL 2
|
||||||
|
|
|
@ -1146,7 +1146,7 @@ test_sequence
|
||||||
prepare stmt1 from ' explain select * from t9 ' ;
|
prepare stmt1 from ' explain select * from t9 ' ;
|
||||||
execute stmt1;
|
execute stmt1;
|
||||||
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
||||||
def id 8 3 1 N 32801 0 8
|
def id 8 3 1 N 32929 0 63
|
||||||
def select_type 253 19 6 N 1 31 8
|
def select_type 253 19 6 N 1 31 8
|
||||||
def table 253 64 2 N 1 31 8
|
def table 253 64 2 N 1 31 8
|
||||||
def type 253 10 3 N 1 31 8
|
def type 253 10 3 N 1 31 8
|
||||||
|
@ -1154,7 +1154,7 @@ def possible_keys 253 4096 0 Y 0 31 8
|
||||||
def key 253 64 0 Y 0 31 8
|
def key 253 64 0 Y 0 31 8
|
||||||
def key_len 253 4096 0 Y 128 31 63
|
def key_len 253 4096 0 Y 128 31 63
|
||||||
def ref 253 1024 0 Y 0 31 8
|
def ref 253 1024 0 Y 0 31 8
|
||||||
def rows 8 10 1 N 32801 0 8
|
def rows 8 10 1 N 32929 0 63
|
||||||
def Extra 253 255 0 N 1 31 8
|
def Extra 253 255 0 N 1 31 8
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t9 ALL NULL NULL NULL NULL 2
|
1 SIMPLE t9 ALL NULL NULL NULL NULL 2
|
||||||
|
|
|
@ -1188,7 +1188,7 @@ test_sequence
|
||||||
prepare stmt1 from ' explain select * from t9 ' ;
|
prepare stmt1 from ' explain select * from t9 ' ;
|
||||||
execute stmt1;
|
execute stmt1;
|
||||||
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
||||||
def id 8 3 1 N 32801 0 8
|
def id 8 3 1 N 32929 0 63
|
||||||
def select_type 253 19 6 N 1 31 8
|
def select_type 253 19 6 N 1 31 8
|
||||||
def table 253 64 2 N 1 31 8
|
def table 253 64 2 N 1 31 8
|
||||||
def type 253 10 3 N 1 31 8
|
def type 253 10 3 N 1 31 8
|
||||||
|
@ -1196,7 +1196,7 @@ def possible_keys 253 4096 0 Y 0 31 8
|
||||||
def key 253 64 0 Y 0 31 8
|
def key 253 64 0 Y 0 31 8
|
||||||
def key_len 253 4096 0 Y 128 31 63
|
def key_len 253 4096 0 Y 128 31 63
|
||||||
def ref 253 1024 0 Y 0 31 8
|
def ref 253 1024 0 Y 0 31 8
|
||||||
def rows 8 10 1 N 32801 0 8
|
def rows 8 10 1 N 32929 0 63
|
||||||
def Extra 253 255 0 N 1 31 8
|
def Extra 253 255 0 N 1 31 8
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t9 ALL NULL NULL NULL NULL 2
|
1 SIMPLE t9 ALL NULL NULL NULL NULL 2
|
||||||
|
@ -4197,7 +4197,7 @@ test_sequence
|
||||||
prepare stmt1 from ' explain select * from t9 ' ;
|
prepare stmt1 from ' explain select * from t9 ' ;
|
||||||
execute stmt1;
|
execute stmt1;
|
||||||
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
||||||
def id 8 3 1 N 32801 0 8
|
def id 8 3 1 N 32929 0 63
|
||||||
def select_type 253 19 6 N 1 31 8
|
def select_type 253 19 6 N 1 31 8
|
||||||
def table 253 64 2 N 1 31 8
|
def table 253 64 2 N 1 31 8
|
||||||
def type 253 10 3 N 1 31 8
|
def type 253 10 3 N 1 31 8
|
||||||
|
@ -4205,7 +4205,7 @@ def possible_keys 253 4096 0 Y 0 31 8
|
||||||
def key 253 64 0 Y 0 31 8
|
def key 253 64 0 Y 0 31 8
|
||||||
def key_len 253 4096 0 Y 128 31 63
|
def key_len 253 4096 0 Y 128 31 63
|
||||||
def ref 253 1024 0 Y 0 31 8
|
def ref 253 1024 0 Y 0 31 8
|
||||||
def rows 8 10 1 N 32801 0 8
|
def rows 8 10 1 N 32929 0 63
|
||||||
def Extra 253 255 0 N 1 31 8
|
def Extra 253 255 0 N 1 31 8
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t9 ALL NULL NULL NULL NULL 2
|
1 SIMPLE t9 ALL NULL NULL NULL NULL 2
|
||||||
|
|
|
@ -1145,7 +1145,7 @@ test_sequence
|
||||||
prepare stmt1 from ' explain select * from t9 ' ;
|
prepare stmt1 from ' explain select * from t9 ' ;
|
||||||
execute stmt1;
|
execute stmt1;
|
||||||
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
||||||
def id 8 3 1 N 32801 0 8
|
def id 8 3 1 N 32929 0 63
|
||||||
def select_type 253 19 6 N 1 31 8
|
def select_type 253 19 6 N 1 31 8
|
||||||
def table 253 64 2 N 1 31 8
|
def table 253 64 2 N 1 31 8
|
||||||
def type 253 10 3 N 1 31 8
|
def type 253 10 3 N 1 31 8
|
||||||
|
@ -1153,7 +1153,7 @@ def possible_keys 253 4096 0 Y 0 31 8
|
||||||
def key 253 64 0 Y 0 31 8
|
def key 253 64 0 Y 0 31 8
|
||||||
def key_len 253 4096 0 Y 128 31 63
|
def key_len 253 4096 0 Y 128 31 63
|
||||||
def ref 253 1024 0 Y 0 31 8
|
def ref 253 1024 0 Y 0 31 8
|
||||||
def rows 8 10 1 N 32801 0 8
|
def rows 8 10 1 N 32929 0 63
|
||||||
def Extra 253 255 0 N 1 31 8
|
def Extra 253 255 0 N 1 31 8
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t9 ALL NULL NULL NULL NULL 3
|
1 SIMPLE t9 ALL NULL NULL NULL NULL 3
|
||||||
|
|
|
@ -1145,7 +1145,7 @@ test_sequence
|
||||||
prepare stmt1 from ' explain select * from t9 ' ;
|
prepare stmt1 from ' explain select * from t9 ' ;
|
||||||
execute stmt1;
|
execute stmt1;
|
||||||
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
|
||||||
def id 8 3 1 N 32801 0 8
|
def id 8 3 1 N 32929 0 63
|
||||||
def select_type 253 19 6 N 1 31 8
|
def select_type 253 19 6 N 1 31 8
|
||||||
def table 253 64 2 N 1 31 8
|
def table 253 64 2 N 1 31 8
|
||||||
def type 253 10 3 N 1 31 8
|
def type 253 10 3 N 1 31 8
|
||||||
|
@ -1153,7 +1153,7 @@ def possible_keys 253 4096 0 Y 0 31 8
|
||||||
def key 253 64 0 Y 0 31 8
|
def key 253 64 0 Y 0 31 8
|
||||||
def key_len 253 4096 0 Y 128 31 63
|
def key_len 253 4096 0 Y 128 31 63
|
||||||
def ref 253 1024 0 Y 0 31 8
|
def ref 253 1024 0 Y 0 31 8
|
||||||
def rows 8 10 1 N 32801 0 8
|
def rows 8 10 1 N 32929 0 63
|
||||||
def Extra 253 255 0 N 1 31 8
|
def Extra 253 255 0 N 1 31 8
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t9 ALL NULL NULL NULL NULL 2
|
1 SIMPLE t9 ALL NULL NULL NULL NULL 2
|
||||||
|
|
|
@ -315,57 +315,57 @@ insert into t2 values (1),(2);
|
||||||
insert into t3 values (1,1),(2,2);
|
insert into t3 values (1,1),(2,2);
|
||||||
show table status;
|
show table status;
|
||||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
t1 HEAP 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t1 MEMORY 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t2 HEAP 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t2 MEMORY 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t3 HEAP 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t3 MEMORY 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
insert into t1 values (3),(4);
|
insert into t1 values (3),(4);
|
||||||
insert into t2 values (3),(4);
|
insert into t2 values (3),(4);
|
||||||
insert into t3 values (3,3),(4,4);
|
insert into t3 values (3,3),(4,4);
|
||||||
show table status;
|
show table status;
|
||||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
t1 HEAP 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t1 MEMORY 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t2 HEAP 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t2 MEMORY 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t3 HEAP 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t3 MEMORY 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
insert into t1 values (5);
|
insert into t1 values (5);
|
||||||
insert into t2 values (5);
|
insert into t2 values (5);
|
||||||
insert into t3 values (5,5);
|
insert into t3 values (5,5);
|
||||||
show table status;
|
show table status;
|
||||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
t1 HEAP 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t1 MEMORY 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t2 HEAP 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t2 MEMORY 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t3 HEAP 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t3 MEMORY 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
delete from t1 where a=3;
|
delete from t1 where a=3;
|
||||||
delete from t2 where b=3;
|
delete from t2 where b=3;
|
||||||
delete from t3 where a=3;
|
delete from t3 where a=3;
|
||||||
show table status;
|
show table status;
|
||||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
t1 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
|
t1 MEMORY 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t2 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
|
t2 MEMORY 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t3 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
|
t3 MEMORY 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
delete from t1;
|
delete from t1;
|
||||||
delete from t2;
|
delete from t2;
|
||||||
delete from t3;
|
delete from t3;
|
||||||
show table status;
|
show table status;
|
||||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
t1 HEAP 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t1 MEMORY 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t2 HEAP 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t2 MEMORY 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t3 HEAP 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t3 MEMORY 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
insert into t1 values (5);
|
insert into t1 values (5);
|
||||||
insert into t2 values (5);
|
insert into t2 values (5);
|
||||||
insert into t3 values (5,5);
|
insert into t3 values (5,5);
|
||||||
show table status;
|
show table status;
|
||||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
t1 HEAP 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t1 MEMORY 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t2 HEAP 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t2 MEMORY 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t3 HEAP 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
t3 MEMORY 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
delete from t1 where a=5;
|
delete from t1 where a=5;
|
||||||
delete from t2 where b=5;
|
delete from t2 where b=5;
|
||||||
delete from t3 where a=5;
|
delete from t3 where a=5;
|
||||||
show table status;
|
show table status;
|
||||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
t1 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
|
t1 MEMORY 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t2 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
|
t2 MEMORY 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
t3 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
|
t3 MEMORY 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
drop table t1, t2, t3;
|
drop table t1, t2, t3;
|
||||||
create database mysqltest;
|
create database mysqltest;
|
||||||
show create database mysqltest;
|
show create database mysqltest;
|
||||||
|
@ -412,7 +412,7 @@ Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`i` int(11) default NULL,
|
`i` int(11) default NULL,
|
||||||
KEY `i` (`i`)
|
KEY `i` (`i`)
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
|
CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
|
@ -420,7 +420,7 @@ Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`i` int(11) default NULL,
|
`i` int(11) default NULL,
|
||||||
KEY `i` USING HASH (`i`)
|
KEY `i` USING HASH (`i`)
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
|
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
|
@ -428,7 +428,7 @@ Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`i` int(11) default NULL,
|
`i` int(11) default NULL,
|
||||||
KEY `i` USING BTREE (`i`)
|
KEY `i` USING BTREE (`i`)
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
|
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
|
@ -459,7 +459,7 @@ Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`i` int(11) default NULL,
|
`i` int(11) default NULL,
|
||||||
KEY `i` (`i`)
|
KEY `i` (`i`)
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
|
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
|
@ -474,5 +474,5 @@ Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`i` int(11) default NULL,
|
`i` int(11) default NULL,
|
||||||
KEY `i` USING BTREE (`i`)
|
KEY `i` USING BTREE (`i`)
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
|
@ -18,7 +18,7 @@ t1 CREATE TABLE `t1` (
|
||||||
`email` varchar(60) character set latin2 NOT NULL default '',
|
`email` varchar(60) character set latin2 NOT NULL default '',
|
||||||
PRIMARY KEY (`a`),
|
PRIMARY KEY (`a`),
|
||||||
UNIQUE KEY `email` USING BTREE (`email`)
|
UNIQUE KEY `email` USING BTREE (`email`)
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||||
set @@sql_mode="ansi_quotes";
|
set @@sql_mode="ansi_quotes";
|
||||||
show variables like 'sql_mode';
|
show variables like 'sql_mode';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
|
@ -31,7 +31,7 @@ t1 CREATE TABLE "t1" (
|
||||||
"email" varchar(60) character set latin2 NOT NULL default '',
|
"email" varchar(60) character set latin2 NOT NULL default '',
|
||||||
PRIMARY KEY ("a"),
|
PRIMARY KEY ("a"),
|
||||||
UNIQUE KEY "email" USING BTREE ("email")
|
UNIQUE KEY "email" USING BTREE ("email")
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||||
set @@sql_mode="no_table_options";
|
set @@sql_mode="no_table_options";
|
||||||
show variables like 'sql_mode';
|
show variables like 'sql_mode';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
|
@ -57,7 +57,7 @@ t1 CREATE TABLE `t1` (
|
||||||
`email` varchar(60) character set latin2 NOT NULL default '',
|
`email` varchar(60) character set latin2 NOT NULL default '',
|
||||||
PRIMARY KEY (`a`),
|
PRIMARY KEY (`a`),
|
||||||
UNIQUE KEY `email` (`email`)
|
UNIQUE KEY `email` (`email`)
|
||||||
) ENGINE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||||
set @@sql_mode="no_field_options,mysql323,mysql40";
|
set @@sql_mode="no_field_options,mysql323,mysql40";
|
||||||
show variables like 'sql_mode';
|
show variables like 'sql_mode';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
|
|
|
@ -768,7 +768,7 @@ INSERT INTO t1 VALUES (-2.2E-307,0),(+1.7E+308,+1.7E+308);
|
||||||
INSERT INTO t1 VALUES ('-2.2E-307',0),('+1.7E+308','+1.7E+308');
|
INSERT INTO t1 VALUES ('-2.2E-307',0),('+1.7E+308','+1.7E+308');
|
||||||
INSERT INTO t1 (col1) VALUES (-2.2E-330);
|
INSERT INTO t1 (col1) VALUES (-2.2E-330);
|
||||||
INSERT INTO t1 (col1) VALUES (+1.7E+309);
|
INSERT INTO t1 (col1) VALUES (+1.7E+309);
|
||||||
ERROR 22007: Illegal double '1.7E+309' value found during parsing
|
Got one of the listed errors
|
||||||
INSERT INTO t1 (col2) VALUES (-1.1E-3);
|
INSERT INTO t1 (col2) VALUES (-1.1E-3);
|
||||||
ERROR 22003: Out of range value adjusted for column 'col2' at row 1
|
ERROR 22003: Out of range value adjusted for column 'col2' at row 1
|
||||||
INSERT INTO t1 (col1) VALUES ('+1.8E+309');
|
INSERT INTO t1 (col1) VALUES ('+1.8E+309');
|
||||||
|
|
|
@ -45,6 +45,15 @@ alter table t9 rename t8, add column d int not null;
|
||||||
alter table t8 rename t7;
|
alter table t8 rename t7;
|
||||||
rename table t7 to t9;
|
rename table t7 to t9;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
SHOW CREATE TABLE t9;
|
||||||
|
Table Create Table
|
||||||
|
t9 CREATE TABLE `t9` (
|
||||||
|
`a` int(11) NOT NULL auto_increment,
|
||||||
|
`b` char(16) NOT NULL,
|
||||||
|
`c` int(11) NOT NULL,
|
||||||
|
`d` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`a`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
|
|
|
@ -368,3 +368,14 @@ a+0
|
||||||
44
|
44
|
||||||
57
|
57
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 (a bit(3), b bit(12));
|
||||||
|
insert into t1 values (7,(1<<12)-2), (0x01,0x01ff);
|
||||||
|
select hex(a),hex(b) from t1;
|
||||||
|
hex(a) hex(b)
|
||||||
|
7 FFE
|
||||||
|
1 1FF
|
||||||
|
select hex(concat(a)),hex(concat(b)) from t1;
|
||||||
|
hex(concat(a)) hex(concat(b))
|
||||||
|
07 0FFE
|
||||||
|
01 01FF
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
drop table if exists t1;
|
drop table if exists t1,t2;
|
||||||
SELECT 10,10.0,10.,.1e+2,100.0e-1;
|
SELECT 10,10.0,10.,.1e+2,100.0e-1;
|
||||||
10 10.0 10. .1e+2 100.0e-1
|
10 10.0 10. .1e+2 100.0e-1
|
||||||
10 10.0 10 10 10
|
10 10.0 10 10 10
|
||||||
|
@ -8,6 +8,9 @@ SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000;
|
||||||
SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
|
SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
|
||||||
1e1 1.e1 1.0e1 1e+1 1.e+1 1.0e+1 1e-1 1.e-1 1.0e-1
|
1e1 1.e1 1.0e1 1e+1 1.e+1 1.0e+1 1e-1 1.e-1 1.0e-1
|
||||||
10 10 10 10 10 10 0.1 0.1 0.1
|
10 10 10 10 10 10 0.1 0.1 0.1
|
||||||
|
SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01;
|
||||||
|
0.001e+1 0.001e-1 -0.001e+01 -0.001e-01
|
||||||
|
0.01 0.0001 -0.01 -0.0001
|
||||||
create table t1 (f1 float(24),f2 float(52));
|
create table t1 (f1 float(24),f2 float(52));
|
||||||
show full columns from t1;
|
show full columns from t1;
|
||||||
Field Type Collation Null Key Default Extra Privileges Comment
|
Field Type Collation Null Key Default Extra Privileges Comment
|
||||||
|
@ -143,6 +146,15 @@ drop table t1;
|
||||||
create table t1 (f float(54));
|
create table t1 (f float(54));
|
||||||
ERROR 42000: Incorrect column specifier for column 'f'
|
ERROR 42000: Incorrect column specifier for column 'f'
|
||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
|
create table t1 (d1 double, d2 double unsigned);
|
||||||
|
insert into t1 set d1 = -1.0;
|
||||||
|
update t1 set d2 = d1;
|
||||||
|
Warnings:
|
||||||
|
Warning 1264 Out of range value adjusted for column 'd2' at row 1
|
||||||
|
select * from t1;
|
||||||
|
d1 d2
|
||||||
|
-1 0
|
||||||
|
drop table t1;
|
||||||
create table t1 (f float(4,3));
|
create table t1 (f float(4,3));
|
||||||
insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11");
|
insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11");
|
||||||
Warnings:
|
Warnings:
|
||||||
|
|
|
@ -426,3 +426,13 @@ max(t)
|
||||||
2004-01-01 01:00:00
|
2004-01-01 01:00:00
|
||||||
2004-02-01 00:00:00
|
2004-02-01 00:00:00
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
set sql_mode='maxdb';
|
||||||
|
create table t1 (a timestamp, b timestamp(19));
|
||||||
|
show create table t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE "t1" (
|
||||||
|
"a" datetime default NULL,
|
||||||
|
"b" datetime default NULL
|
||||||
|
)
|
||||||
|
set sql_mode='';
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -554,7 +554,7 @@ aa
|
||||||
show create table t1;
|
show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`a` varchar(20) NOT NULL default ''
|
`a` varbinary(20) NOT NULL default ''
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 SELECT 12 as a UNION select 12.2 as a;
|
create table t1 SELECT 12 as a UNION select 12.2 as a;
|
||||||
|
@ -872,6 +872,22 @@ count(*)
|
||||||
show status like 'Slow_queries';
|
show status like 'Slow_queries';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Slow_queries 7
|
Slow_queries 7
|
||||||
|
flush status;
|
||||||
|
select a from t1 where b not in (1,2,3) union select a from t1 where b not in (4,5,6);
|
||||||
|
a
|
||||||
|
4
|
||||||
|
5
|
||||||
|
3
|
||||||
|
6
|
||||||
|
7
|
||||||
|
8
|
||||||
|
9
|
||||||
|
10
|
||||||
|
1
|
||||||
|
2
|
||||||
|
show status like 'Slow_queries';
|
||||||
|
Variable_name Value
|
||||||
|
Slow_queries 1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 ( RID int(11) not null default '0', IID int(11) not null default '0', nada varchar(50) not null,NAME varchar(50) not null,PHONE varchar(50) not null) engine=MyISAM;
|
create table t1 ( RID int(11) not null default '0', IID int(11) not null default '0', nada varchar(50) not null,NAME varchar(50) not null,PHONE varchar(50) not null) engine=MyISAM;
|
||||||
insert into t1 ( RID,IID,nada,NAME,PHONE) values (1, 1, 'main', 'a', '111'), (2, 1, 'main', 'b', '222'), (3, 1, 'main', 'c', '333'), (4, 1, 'main', 'd', '444'), (5, 1, 'main', 'e', '555'), (6, 2, 'main', 'c', '333'), (7, 2, 'main', 'd', '454'), (8, 2, 'main', 'e', '555'), (9, 2, 'main', 'f', '666'), (10, 2, 'main', 'g', '777');
|
insert into t1 ( RID,IID,nada,NAME,PHONE) values (1, 1, 'main', 'a', '111'), (2, 1, 'main', 'b', '222'), (3, 1, 'main', 'c', '333'), (4, 1, 'main', 'd', '444'), (5, 1, 'main', 'e', '555'), (6, 2, 'main', 'c', '333'), (7, 2, 'main', 'd', '454'), (8, 2, 'main', 'e', '555'), (9, 2, 'main', 'f', '666'), (10, 2, 'main', 'g', '777');
|
||||||
|
|
|
@ -172,23 +172,26 @@ SET TIMESTAMP=10000;
|
||||||
SET @`a b`='hello';
|
SET @`a b`='hello';
|
||||||
INSERT INTO t1 VALUES(@`a b`);
|
INSERT INTO t1 VALUES(@`a b`);
|
||||||
set @var1= "';aaa";
|
set @var1= "';aaa";
|
||||||
insert into t1 values (@var1);
|
SET @var2=char(ascii('a'));
|
||||||
|
insert into t1 values (@var1),(@var2);
|
||||||
show binlog events from 95;
|
show binlog events from 95;
|
||||||
Log_name Pos Event_type Server_id End_log_pos Info
|
Log_name Pos Event_type Server_id End_log_pos Info
|
||||||
master-bin.000001 95 User var 1 136 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
|
master-bin.000001 95 User var 1 136 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
|
||||||
master-bin.000001 136 Query 1 222 use `test`; INSERT INTO t1 VALUES(@`a b`)
|
master-bin.000001 136 Query 1 222 use `test`; INSERT INTO t1 VALUES(@`a b`)
|
||||||
master-bin.000001 222 User var 1 264 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
|
master-bin.000001 222 User var 1 264 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
|
||||||
master-bin.000001 264 Query 1 350 use `test`; insert into t1 values (@var1)
|
master-bin.000001 264 User var 1 302 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci
|
||||||
|
master-bin.000001 302 Query 1 396 use `test`; insert into t1 values (@var1),(@var2)
|
||||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||||
SET @`a b`:=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci;
|
SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`;
|
||||||
use test;
|
use test;
|
||||||
SET TIMESTAMP=10000;
|
SET TIMESTAMP=10000;
|
||||||
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
|
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
|
||||||
SET @@session.sql_mode=0;
|
SET @@session.sql_mode=0;
|
||||||
INSERT INTO t1 VALUES(@`a b`);
|
INSERT INTO t1 VALUES(@`a b`);
|
||||||
SET @`var1`:=_latin1 0x273B616161 COLLATE latin1_swedish_ci;
|
SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`;
|
||||||
|
SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`;
|
||||||
SET TIMESTAMP=10000;
|
SET TIMESTAMP=10000;
|
||||||
insert into t1 values (@var1);
|
insert into t1 values (@var1),(@var2);
|
||||||
drop table t1;
|
drop table t1;
|
||||||
set @var= NULL ;
|
set @var= NULL ;
|
||||||
select FIELD( @var,'1it','Hit') as my_column;
|
select FIELD( @var,'1it','Hit') as my_column;
|
||||||
|
|
|
@ -336,3 +336,14 @@ select hex(a) from t1;
|
||||||
alter table t1 convert to character set cp1251;
|
alter table t1 convert to character set cp1251;
|
||||||
select hex(a) from t1;
|
select hex(a) from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test for bug #7884 "Able to add invalid unique index on TIMESTAMP prefix"
|
||||||
|
# MySQL should not think that packed field with non-zero decimals is
|
||||||
|
# geometry field and allow to create prefix index which is
|
||||||
|
# shorter than packed field length.
|
||||||
|
#
|
||||||
|
create table t1 ( a timestamp );
|
||||||
|
--error 1089
|
||||||
|
alter table t1 add unique ( a(1) );
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -294,7 +294,7 @@ select * from t2;
|
||||||
create table t3 like t1;
|
create table t3 like t1;
|
||||||
--error 1050
|
--error 1050
|
||||||
create table t3 like mysqltest.t3;
|
create table t3 like mysqltest.t3;
|
||||||
--error 1044,1
|
--error ER_DBACCESS_DENIED_ERROR,1
|
||||||
create table non_existing_database.t1 like t1;
|
create table non_existing_database.t1 like t1;
|
||||||
--error 1051
|
--error 1051
|
||||||
create table t3 like non_existing_table;
|
create table t3 like non_existing_table;
|
||||||
|
|
|
@ -395,3 +395,9 @@ DROP TABLE t1;
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
DROP TABLE t3;
|
DROP TABLE t3;
|
||||||
DROP TABLE t4;
|
DROP TABLE t4;
|
||||||
|
|
||||||
|
|
||||||
|
SET collation_connection='cp932_japanese_ci';
|
||||||
|
-- source include/ctype_filesort.inc
|
||||||
|
SET collation_connection='cp932_bin';
|
||||||
|
-- source include/ctype_filesort.inc
|
||||||
|
|
|
@ -342,3 +342,9 @@ DROP TABLE t1;
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
DROP TABLE t3;
|
DROP TABLE t3;
|
||||||
DROP TABLE t4;
|
DROP TABLE t4;
|
||||||
|
|
||||||
|
|
||||||
|
SET collation_connection='eucjpms_japanese_ci';
|
||||||
|
-- source include/ctype_filesort.inc
|
||||||
|
SET collation_connection='eucjpms_bin';
|
||||||
|
-- source include/ctype_filesort.inc
|
||||||
|
|
|
@ -681,3 +681,15 @@ SET collation_connection='utf8_general_ci';
|
||||||
-- source include/ctype_filesort.inc
|
-- source include/ctype_filesort.inc
|
||||||
SET collation_connection='utf8_bin';
|
SET collation_connection='utf8_bin';
|
||||||
-- source include/ctype_filesort.inc
|
-- source include/ctype_filesort.inc
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #7874 CONCAT() gives wrong results mixing
|
||||||
|
# latin1 field and utf8 string literals
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
user varchar(255) NOT NULL default ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
INSERT INTO t1 VALUES ('one'),('two');
|
||||||
|
SELECT CHARSET('a');
|
||||||
|
SELECT user, CONCAT('<', user, '>') AS c FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
|
@ -278,6 +278,13 @@ select group_concat(distinct b order by b) from t1 group by a;
|
||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# bug #7769: group_concat returning null is checked in having
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (id int);
|
||||||
|
SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug #6475
|
# Bug #6475
|
||||||
#
|
#
|
||||||
|
|
|
@ -60,6 +60,7 @@ select timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002");
|
||||||
select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002");
|
select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002");
|
||||||
select timediff("1997-12-31 23:59:59.000001","23:59:59.000001");
|
select timediff("1997-12-31 23:59:59.000001","23:59:59.000001");
|
||||||
select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001");
|
select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001");
|
||||||
|
select timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50");
|
||||||
--enable_ps_protocol
|
--enable_ps_protocol
|
||||||
|
|
||||||
select maketime(10,11,12);
|
select maketime(10,11,12);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
-- source include/have_innodb.inc
|
-- source include/have_innodb.inc
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
drop table if exists t1;
|
drop table if exists t1,t2;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
create table t1
|
create table t1
|
||||||
|
|
|
@ -354,3 +354,8 @@ show open tables where `table` like "user";
|
||||||
show status variable_name where variable_name like "%database%";
|
show status variable_name where variable_name like "%database%";
|
||||||
# test for 'show variables ... where'
|
# test for 'show variables ... where'
|
||||||
show variables variable_name where variable_name like "%database%";
|
show variables variable_name where variable_name like "%database%";
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #7981:SHOW GLOBAL STATUS crashes server
|
||||||
|
#
|
||||||
|
show global status like "Threads_running";
|
||||||
|
|
|
@ -506,3 +506,36 @@ insert t1 values (1,1,1),(1,1,2),(1,2,1);
|
||||||
select a, b from t1 group by a, b order by sum(c);
|
select a, b from t1 group by a, b order by sum(c);
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #7331
|
||||||
|
#
|
||||||
|
|
||||||
|
create table t1 (
|
||||||
|
`sid` decimal(8,0) default null,
|
||||||
|
`wnid` varchar(11) not null default '',
|
||||||
|
key `wnid14` (`wnid`(4)),
|
||||||
|
key `wnid` (`wnid`)
|
||||||
|
) engine=myisam default charset=latin1;
|
||||||
|
|
||||||
|
insert into t1 (`sid`, `wnid`) values
|
||||||
|
('10100','01019000000'),('37986','01019000000'),('37987','01019010000'),
|
||||||
|
('39560','01019090000'),('37989','01019000000'),('37990','01019011000'),
|
||||||
|
('37991','01019011000'),('37992','01019019000'),('37993','01019030000'),
|
||||||
|
('37994','01019090000'),('475','02070000000'),('25253','02071100000'),
|
||||||
|
('25255','02071100000'),('25256','02071110000'),('25258','02071130000'),
|
||||||
|
('25259','02071190000'),('25260','02071200000'),('25261','02071210000'),
|
||||||
|
('25262','02071290000'),('25263','02071300000'),('25264','02071310000'),
|
||||||
|
('25265','02071310000'),('25266','02071320000'),('25267','02071320000'),
|
||||||
|
('25269','02071330000'),('25270','02071340000'),('25271','02071350000'),
|
||||||
|
('25272','02071360000'),('25273','02071370000'),('25281','02071391000'),
|
||||||
|
('25282','02071391000'),('25283','02071399000'),('25284','02071400000'),
|
||||||
|
('25285','02071410000'),('25286','02071410000'),('25287','02071420000'),
|
||||||
|
('25288','02071420000'),('25291','02071430000'),('25290','02071440000'),
|
||||||
|
('25292','02071450000'),('25293','02071460000'),('25294','02071470000'),
|
||||||
|
('25295','02071491000'),('25296','02071491000'),('25297','02071499000');
|
||||||
|
|
||||||
|
explain select * from t1 where wnid like '0101%' order by wnid;
|
||||||
|
|
||||||
|
select * from t1 where wnid like '0101%' order by wnid;
|
||||||
|
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -1761,9 +1761,9 @@ DO benchmark(100,1+1),1,1;
|
||||||
# Bug #6449: do default;
|
# Bug #6449: do default;
|
||||||
#
|
#
|
||||||
|
|
||||||
--error 1064
|
--error ER_PARSE_ERROR
|
||||||
do default;
|
do default;
|
||||||
--error 1054
|
--error ER_BAD_FIELD_ERROR
|
||||||
do foobar;
|
do foobar;
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -531,7 +531,7 @@ INSERT INTO t1 VALUES (-2.2E-307,0),(+1.7E+308,+1.7E+308);
|
||||||
INSERT INTO t1 VALUES ('-2.2E-307',0),('+1.7E+308','+1.7E+308');
|
INSERT INTO t1 VALUES ('-2.2E-307',0),('+1.7E+308','+1.7E+308');
|
||||||
# We don't give warnings for underflow
|
# We don't give warnings for underflow
|
||||||
INSERT INTO t1 (col1) VALUES (-2.2E-330);
|
INSERT INTO t1 (col1) VALUES (-2.2E-330);
|
||||||
--error 1367
|
--error 1367,1264
|
||||||
INSERT INTO t1 (col1) VALUES (+1.7E+309);
|
INSERT INTO t1 (col1) VALUES (+1.7E+309);
|
||||||
--error 1264
|
--error 1264
|
||||||
INSERT INTO t1 (col2) VALUES (-1.1E-3);
|
INSERT INTO t1 (col2) VALUES (-1.1E-3);
|
||||||
|
|
|
@ -49,6 +49,7 @@ check table t9;
|
||||||
optimize table t9;
|
optimize table t9;
|
||||||
repair table t9;
|
repair table t9;
|
||||||
alter table t9 add column c int not null;
|
alter table t9 add column c int not null;
|
||||||
|
|
||||||
--replace_result $MYSQL_TEST_DIR TEST_DIR
|
--replace_result $MYSQL_TEST_DIR TEST_DIR
|
||||||
show create table t9;
|
show create table t9;
|
||||||
|
|
||||||
|
@ -64,6 +65,9 @@ drop table t1;
|
||||||
# Note that we are using the above table t9 here!
|
# Note that we are using the above table t9 here!
|
||||||
#
|
#
|
||||||
|
|
||||||
|
--replace_result $MYSQL_TEST_DIR TEST_DIR
|
||||||
|
SHOW CREATE TABLE t9;
|
||||||
|
|
||||||
disable_query_log;
|
disable_query_log;
|
||||||
--error 1103,1103
|
--error 1103,1103
|
||||||
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="tmp";
|
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="tmp";
|
||||||
|
@ -78,9 +82,11 @@ create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, p
|
||||||
--error 1103,1103
|
--error 1103,1103
|
||||||
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="not-hard-path";
|
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="not-hard-path";
|
||||||
|
|
||||||
|
# Should fail becasue the file t9.MYI already exist in 'run'
|
||||||
--error 1,1
|
--error 1,1
|
||||||
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQL_TEST_DIR/var/run";
|
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQL_TEST_DIR/var/run";
|
||||||
|
|
||||||
|
# Should fail becasue the file t9.MYD already exist in 'tmp'
|
||||||
--error 1,1
|
--error 1,1
|
||||||
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQL_TEST_DIR/var/tmp";
|
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQL_TEST_DIR/var/tmp";
|
||||||
enable_query_log;
|
enable_query_log;
|
||||||
|
|
|
@ -106,3 +106,12 @@ create table t1 (a bit(7), key(a));
|
||||||
insert into t1 values (44), (57);
|
insert into t1 values (44), (57);
|
||||||
select a+0 from t1;
|
select a+0 from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test conversion to and from strings
|
||||||
|
#
|
||||||
|
create table t1 (a bit(3), b bit(12));
|
||||||
|
insert into t1 values (7,(1<<12)-2), (0x01,0x01ff);
|
||||||
|
select hex(a),hex(b) from t1;
|
||||||
|
select hex(concat(a)),hex(concat(b)) from t1;
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Numeric floating point.
|
# Numeric floating point.
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
drop table if exists t1;
|
drop table if exists t1,t2;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
--replace_result e-0 e- e+0 e+
|
--replace_result e-0 e- e+0 e+
|
||||||
|
@ -11,6 +11,7 @@ SELECT 10,10.0,10.,.1e+2,100.0e-1;
|
||||||
--replace_result e-00 e-0
|
--replace_result e-00 e-0
|
||||||
SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000;
|
SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000;
|
||||||
SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
|
SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
|
||||||
|
SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01;
|
||||||
|
|
||||||
create table t1 (f1 float(24),f2 float(52));
|
create table t1 (f1 float(24),f2 float(52));
|
||||||
show full columns from t1;
|
show full columns from t1;
|
||||||
|
@ -93,6 +94,13 @@ create table t1 (f float(54)); # Should give an error
|
||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
|
# Don't allow 'double unsigned' to be set to a negative value (Bug #7700)
|
||||||
|
create table t1 (d1 double, d2 double unsigned);
|
||||||
|
insert into t1 set d1 = -1.0;
|
||||||
|
update t1 set d2 = d1;
|
||||||
|
select * from t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
# Ensure that maximum values as the result of number of decimals
|
# Ensure that maximum values as the result of number of decimals
|
||||||
# being specified in table schema are enforced (Bug #7361)
|
# being specified in table schema are enforced (Bug #7361)
|
||||||
create table t1 (f float(4,3));
|
create table t1 (f float(4,3));
|
||||||
|
|
|
@ -288,3 +288,15 @@ insert into t1 values ('a', '2004-01-01 00:00:00'), ('a', '2004-01-01 01:00:00')
|
||||||
('b', '2004-02-01 00:00:00');
|
('b', '2004-02-01 00:00:00');
|
||||||
select max(t) from t1 group by a;
|
select max(t) from t1 group by a;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test for bug #7418 "TIMESTAMP not always converted to DATETIME in MAXDB
|
||||||
|
# mode". TIMESTAMP columns should be converted DATETIME columns in MAXDB
|
||||||
|
# mode regardless of whether a display width is given.
|
||||||
|
#
|
||||||
|
set sql_mode='maxdb';
|
||||||
|
create table t1 (a timestamp, b timestamp(19));
|
||||||
|
show create table t1;
|
||||||
|
# restore default mode
|
||||||
|
set sql_mode='';
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -499,6 +499,10 @@ select count(*) from t1 where b=13 union select count(*) from t1 where a=7;
|
||||||
show status like 'Slow_queries';
|
show status like 'Slow_queries';
|
||||||
select count(*) from t1 where a=7 union select count(*) from t1 where b=13;
|
select count(*) from t1 where a=7 union select count(*) from t1 where b=13;
|
||||||
show status like 'Slow_queries';
|
show status like 'Slow_queries';
|
||||||
|
# additional test for examined rows
|
||||||
|
flush status;
|
||||||
|
select a from t1 where b not in (1,2,3) union select a from t1 where b not in (4,5,6);
|
||||||
|
show status like 'Slow_queries';
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -108,7 +108,8 @@ SET TIMESTAMP=10000;
|
||||||
SET @`a b`='hello';
|
SET @`a b`='hello';
|
||||||
INSERT INTO t1 VALUES(@`a b`);
|
INSERT INTO t1 VALUES(@`a b`);
|
||||||
set @var1= "';aaa";
|
set @var1= "';aaa";
|
||||||
insert into t1 values (@var1);
|
SET @var2=char(ascii('a'));
|
||||||
|
insert into t1 values (@var1),(@var2);
|
||||||
show binlog events from 95;
|
show binlog events from 95;
|
||||||
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
|
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
|
||||||
# absolutely need variables names to be quoted and strings to be
|
# absolutely need variables names to be quoted and strings to be
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
also info->read_pos is set to info->read_end.
|
also info->read_pos is set to info->read_end.
|
||||||
If called through open_cached_file(), then the temporary file will
|
If called through open_cached_file(), then the temporary file will
|
||||||
only be created if a write exeeds the file buffer or if one calls
|
only be created if a write exeeds the file buffer or if one calls
|
||||||
flush_io_cache().
|
my_b_flush_io_cache().
|
||||||
|
|
||||||
If one uses SEQ_READ_APPEND, then two buffers are allocated, one for
|
If one uses SEQ_READ_APPEND, then two buffers are allocated, one for
|
||||||
reading and another for writing. Reads are first done from disk and
|
reading and another for writing. Reads are first done from disk and
|
||||||
|
@ -43,7 +43,7 @@ TODO:
|
||||||
each time the write buffer gets full and it's written to disk, we will
|
each time the write buffer gets full and it's written to disk, we will
|
||||||
always do a disk read to read a part of the buffer from disk to the
|
always do a disk read to read a part of the buffer from disk to the
|
||||||
read buffer.
|
read buffer.
|
||||||
This should be fixed so that when we do a flush_io_cache() and
|
This should be fixed so that when we do a my_b_flush_io_cache() and
|
||||||
we have been reading the write buffer, we should transfer the rest of the
|
we have been reading the write buffer, we should transfer the rest of the
|
||||||
write buffer to the read buffer before we start to reuse it.
|
write buffer to the read buffer before we start to reuse it.
|
||||||
*/
|
*/
|
||||||
|
@ -70,9 +70,40 @@ static void my_aiowait(my_aio_result *result);
|
||||||
#define IO_ROUND_UP(X) (((X)+IO_SIZE-1) & ~(IO_SIZE-1))
|
#define IO_ROUND_UP(X) (((X)+IO_SIZE-1) & ~(IO_SIZE-1))
|
||||||
#define IO_ROUND_DN(X) ( (X) & ~(IO_SIZE-1))
|
#define IO_ROUND_DN(X) ( (X) & ~(IO_SIZE-1))
|
||||||
|
|
||||||
static void
|
|
||||||
init_functions(IO_CACHE* info, enum cache_type type)
|
/*
|
||||||
|
Setup internal pointers inside IO_CACHE
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
setup_io_cache()
|
||||||
|
info IO_CACHE handler
|
||||||
|
|
||||||
|
NOTES
|
||||||
|
This is called on automaticly on init or reinit of IO_CACHE
|
||||||
|
It must be called externally if one moves or copies an IO_CACHE
|
||||||
|
object.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void setup_io_cache(IO_CACHE* info)
|
||||||
{
|
{
|
||||||
|
/* Ensure that my_b_tell() and my_b_bytes_in_cache works */
|
||||||
|
if (info->type == WRITE_CACHE)
|
||||||
|
{
|
||||||
|
info->current_pos= &info->write_pos;
|
||||||
|
info->current_end= &info->write_end;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
info->current_pos= &info->read_pos;
|
||||||
|
info->current_end= &info->read_end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
init_functions(IO_CACHE* info)
|
||||||
|
{
|
||||||
|
enum cache_type type= info->type;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case READ_NET:
|
case READ_NET:
|
||||||
/*
|
/*
|
||||||
|
@ -96,17 +127,7 @@ init_functions(IO_CACHE* info, enum cache_type type)
|
||||||
info->write_function = _my_b_write;
|
info->write_function = _my_b_write;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure that my_b_tell() and my_b_bytes_in_cache works */
|
setup_io_cache(info);
|
||||||
if (type == WRITE_CACHE)
|
|
||||||
{
|
|
||||||
info->current_pos= &info->write_pos;
|
|
||||||
info->current_end= &info->write_end;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
info->current_pos= &info->read_pos;
|
|
||||||
info->current_end= &info->read_end;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -236,7 +257,7 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
|
||||||
info->end_of_file= end_of_file;
|
info->end_of_file= end_of_file;
|
||||||
info->error=0;
|
info->error=0;
|
||||||
info->type= type;
|
info->type= type;
|
||||||
init_functions(info,type);
|
init_functions(info);
|
||||||
#ifdef HAVE_AIOWAIT
|
#ifdef HAVE_AIOWAIT
|
||||||
if (use_async_io && ! my_disable_async_io)
|
if (use_async_io && ! my_disable_async_io)
|
||||||
{
|
{
|
||||||
|
@ -339,7 +360,7 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
|
||||||
if (info->type == WRITE_CACHE && type == READ_CACHE)
|
if (info->type == WRITE_CACHE && type == READ_CACHE)
|
||||||
info->end_of_file=my_b_tell(info);
|
info->end_of_file=my_b_tell(info);
|
||||||
/* flush cache if we want to reuse it */
|
/* flush cache if we want to reuse it */
|
||||||
if (!clear_cache && flush_io_cache(info))
|
if (!clear_cache && my_b_flush_io_cache(info,1))
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
info->pos_in_file=seek_offset;
|
info->pos_in_file=seek_offset;
|
||||||
/* Better to do always do a seek */
|
/* Better to do always do a seek */
|
||||||
|
@ -358,7 +379,7 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
|
||||||
}
|
}
|
||||||
info->type=type;
|
info->type=type;
|
||||||
info->error=0;
|
info->error=0;
|
||||||
init_functions(info,type);
|
init_functions(info);
|
||||||
|
|
||||||
#ifdef HAVE_AIOWAIT
|
#ifdef HAVE_AIOWAIT
|
||||||
if (use_async_io && ! my_disable_async_io &&
|
if (use_async_io && ! my_disable_async_io &&
|
||||||
|
@ -948,7 +969,7 @@ int _my_b_write(register IO_CACHE *info, const byte *Buffer, uint Count)
|
||||||
Buffer+=rest_length;
|
Buffer+=rest_length;
|
||||||
Count-=rest_length;
|
Count-=rest_length;
|
||||||
info->write_pos+=rest_length;
|
info->write_pos+=rest_length;
|
||||||
if (flush_io_cache(info))
|
if (my_b_flush_io_cache(info,1))
|
||||||
return 1;
|
return 1;
|
||||||
if (Count >= IO_SIZE)
|
if (Count >= IO_SIZE)
|
||||||
{ /* Fill first intern buffer */
|
{ /* Fill first intern buffer */
|
||||||
|
@ -1191,6 +1212,7 @@ int end_io_cache(IO_CACHE *info)
|
||||||
int error=0;
|
int error=0;
|
||||||
IO_CACHE_CALLBACK pre_close;
|
IO_CACHE_CALLBACK pre_close;
|
||||||
DBUG_ENTER("end_io_cache");
|
DBUG_ENTER("end_io_cache");
|
||||||
|
DBUG_PRINT("enter",("cache: 0x%lx", (ulong) info));
|
||||||
|
|
||||||
#ifdef THREAD
|
#ifdef THREAD
|
||||||
/*
|
/*
|
||||||
|
@ -1200,7 +1222,7 @@ int end_io_cache(IO_CACHE *info)
|
||||||
*/
|
*/
|
||||||
if (info->share)
|
if (info->share)
|
||||||
{
|
{
|
||||||
pthread_cond_destroy (&info->share->cond);
|
pthread_cond_destroy(&info->share->cond);
|
||||||
pthread_mutex_destroy(&info->share->mutex);
|
pthread_mutex_destroy(&info->share->mutex);
|
||||||
info->share=0;
|
info->share=0;
|
||||||
}
|
}
|
||||||
|
@ -1215,7 +1237,7 @@ int end_io_cache(IO_CACHE *info)
|
||||||
{
|
{
|
||||||
info->alloced_buffer=0;
|
info->alloced_buffer=0;
|
||||||
if (info->file != -1) /* File doesn't exist */
|
if (info->file != -1) /* File doesn't exist */
|
||||||
error=flush_io_cache(info);
|
error= my_b_flush_io_cache(info,1);
|
||||||
my_free((gptr) info->buffer,MYF(MY_WME));
|
my_free((gptr) info->buffer,MYF(MY_WME));
|
||||||
info->buffer=info->read_pos=(byte*) 0;
|
info->buffer=info->read_pos=(byte*) 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,6 +245,19 @@ static inline void mark_blocks_free(MEM_ROOT* root)
|
||||||
/*
|
/*
|
||||||
Deallocate everything used by alloc_root or just move
|
Deallocate everything used by alloc_root or just move
|
||||||
used blocks to free list if called with MY_USED_TO_FREE
|
used blocks to free list if called with MY_USED_TO_FREE
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
free_root()
|
||||||
|
root Memory root
|
||||||
|
MyFlags Flags for what should be freed:
|
||||||
|
|
||||||
|
MY_MARK_BLOCKS_FREED Don't free blocks, just mark them free
|
||||||
|
MY_KEEP_PREALLOC If this is not set, then free also the
|
||||||
|
preallocated block
|
||||||
|
|
||||||
|
NOTES
|
||||||
|
One can call this function either with root block initialised with
|
||||||
|
init_alloc_root() or with a bzero()-ed block.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void free_root(MEM_ROOT *root, myf MyFlags)
|
void free_root(MEM_ROOT *root, myf MyFlags)
|
||||||
|
|
|
@ -26,9 +26,11 @@
|
||||||
/*
|
/*
|
||||||
Reads the content of a symbolic link
|
Reads the content of a symbolic link
|
||||||
If the file is not a symbolic link, return the original file name in to.
|
If the file is not a symbolic link, return the original file name in to.
|
||||||
Returns: 0 if table was a symlink,
|
|
||||||
1 if table was a normal file
|
RETURN
|
||||||
-1 on error.
|
0 If filename was a symlink, (to will be set to value of symlink)
|
||||||
|
1 If filename was a normal file (to will be set to filename)
|
||||||
|
-1 on error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int my_readlink(char *to, const char *filename, myf MyFlags)
|
int my_readlink(char *to, const char *filename, myf MyFlags)
|
||||||
|
@ -58,6 +60,7 @@ int my_readlink(char *to, const char *filename, myf MyFlags)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
to[length]=0;
|
to[length]=0;
|
||||||
|
DBUG_PRINT("exit" ,("result: %d", result));
|
||||||
DBUG_RETURN(result);
|
DBUG_RETURN(result);
|
||||||
#endif /* HAVE_READLINK */
|
#endif /* HAVE_READLINK */
|
||||||
}
|
}
|
||||||
|
|
|
@ -523,8 +523,10 @@ int thr_lock(THR_LOCK_DATA *data,enum thr_lock_type lock_type)
|
||||||
data->prev=lock->write_wait.last;
|
data->prev=lock->write_wait.last;
|
||||||
lock->write_wait.last= &data->next;
|
lock->write_wait.last= &data->next;
|
||||||
data->cond=get_cond();
|
data->cond=get_cond();
|
||||||
if (lock->get_status)
|
/*
|
||||||
(*lock->get_status)(data->status_param);
|
We don't have to do get_status here as we will do it when we change
|
||||||
|
the delayed lock to a real write lock
|
||||||
|
*/
|
||||||
statistic_increment(locks_immediate,&THR_LOCK_lock);
|
statistic_increment(locks_immediate,&THR_LOCK_lock);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ ndbapidoc-pdf: ndbapi.pdf
|
||||||
|
|
||||||
ndbapi.html: $(noinst_HEADERS)
|
ndbapi.html: $(noinst_HEADERS)
|
||||||
@set -x; \
|
@set -x; \
|
||||||
export NDB_RELEASE=$(NDB_RELEASE) \
|
export NDB_RELEASE=$(NDB_RELEASE); \
|
||||||
@RM@ -f ndbapi.pdf ndbapi.html; \
|
@RM@ -f ndbapi.pdf ndbapi.html; \
|
||||||
@RM@ -rf $(DOXYTMP) $(DOXYOUT); \
|
@RM@ -rf $(DOXYTMP) $(DOXYOUT); \
|
||||||
mkdir -p $(DOXYTMP) $(DOXYOUT); \
|
mkdir -p $(DOXYTMP) $(DOXYOUT); \
|
||||||
|
@ -70,7 +70,7 @@ mgmapidoc-pdf: mgmapi.pdf
|
||||||
|
|
||||||
mgmapi.html: $(noinst_HEADERS)
|
mgmapi.html: $(noinst_HEADERS)
|
||||||
@set -x; \
|
@set -x; \
|
||||||
export NDB_RELEASE=$(NDB_RELEASE) \
|
export NDB_RELEASE=$(NDB_RELEASE); \
|
||||||
@RM@ -f mgmapi.pdf mgmapi.html; \
|
@RM@ -f mgmapi.pdf mgmapi.html; \
|
||||||
@RM@ -rf $(DOXYTMP) $(DOXYOUT); \
|
@RM@ -rf $(DOXYTMP) $(DOXYOUT); \
|
||||||
mkdir -p $(DOXYTMP) $(DOXYOUT); \
|
mkdir -p $(DOXYTMP) $(DOXYOUT); \
|
||||||
|
|
|
@ -34,7 +34,7 @@ OPT_NDB_OPTIMIZED_NODE_SELECTION
|
||||||
|
|
||||||
#define OPT_NDB_CONNECTSTRING 'c'
|
#define OPT_NDB_CONNECTSTRING 'c'
|
||||||
|
|
||||||
#if defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000
|
#if defined(NOT_ENOUGH_TESTED) && defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000
|
||||||
#define OPT_NDB_SHM_DEFAULT 1
|
#define OPT_NDB_SHM_DEFAULT 1
|
||||||
#else
|
#else
|
||||||
#define OPT_NDB_SHM_DEFAULT 0
|
#define OPT_NDB_SHM_DEFAULT 0
|
||||||
|
|
|
@ -28,8 +28,24 @@ struct NdbThread
|
||||||
{
|
{
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
char thread_name[MAX_THREAD_NAME];
|
char thread_name[MAX_THREAD_NAME];
|
||||||
|
NDB_THREAD_FUNC * func;
|
||||||
|
void * object;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static
|
||||||
|
void*
|
||||||
|
ndb_thread_wrapper(void* _ss){
|
||||||
|
void * ret;
|
||||||
|
struct NdbThread * ss = (struct NdbThread *)_ss;
|
||||||
|
#ifdef NDB_SHM_TRANSPORTER
|
||||||
|
sigset_t mask;
|
||||||
|
sigemptyset(&mask);
|
||||||
|
sigaddset(&mask, SIGUSR1);
|
||||||
|
pthread_sigmask(SIG_BLOCK, &mask, 0);
|
||||||
|
#endif
|
||||||
|
ret= (* ss->func)(ss->object);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
|
struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
|
||||||
|
@ -67,10 +83,12 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
|
||||||
#ifdef PTHREAD_CREATE_JOINABLE /* needed on SCO */
|
#ifdef PTHREAD_CREATE_JOINABLE /* needed on SCO */
|
||||||
pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
|
pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
|
||||||
#endif
|
#endif
|
||||||
|
tmpThread->func= p_thread_func;
|
||||||
|
tmpThread->object= p_thread_arg;
|
||||||
result = pthread_create(&tmpThread->thread,
|
result = pthread_create(&tmpThread->thread,
|
||||||
&thread_attr,
|
&thread_attr,
|
||||||
p_thread_func,
|
ndb_thread_wrapper,
|
||||||
p_thread_arg);
|
tmpThread);
|
||||||
assert(result==0);
|
assert(result==0);
|
||||||
|
|
||||||
pthread_attr_destroy(&thread_attr);
|
pthread_attr_destroy(&thread_attr);
|
||||||
|
|
|
@ -157,8 +157,17 @@ TransporterRegistry::init(NodeId nodeId) {
|
||||||
|
|
||||||
DEBUG("TransporterRegistry started node: " << localNodeId);
|
DEBUG("TransporterRegistry started node: " << localNodeId);
|
||||||
|
|
||||||
// return allocateLongSignalMemoryPool(nLargeSegments);
|
#ifdef NDB_SHM_TRANSPORTER
|
||||||
return true;
|
/**
|
||||||
|
* Make sure to block SIGUSR1
|
||||||
|
* TransporterRegistry::init is run from "main" thread
|
||||||
|
*/
|
||||||
|
sigset_t mask;
|
||||||
|
sigemptyset(&mask);
|
||||||
|
sigaddset(&mask, SIGUSR1);
|
||||||
|
pthread_sigmask(SIG_BLOCK, &mask, 0);
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -1347,6 +1356,9 @@ TransporterRegistry::startReceiving()
|
||||||
#ifdef NDB_SHM_TRANSPORTER
|
#ifdef NDB_SHM_TRANSPORTER
|
||||||
m_shm_own_pid = getpid();
|
m_shm_own_pid = getpid();
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
|
sigemptyset(&sa.sa_mask);
|
||||||
|
sigaddset(&sa.sa_mask, SIGUSR1);
|
||||||
|
pthread_sigmask(SIG_UNBLOCK, &sa.sa_mask, 0);
|
||||||
sa.sa_handler = shm_sig_handler;
|
sa.sa_handler = shm_sig_handler;
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
sa.sa_flags = 0;
|
sa.sa_flags = 0;
|
||||||
|
|
|
@ -1540,4 +1540,3 @@ MgmApiSession::check_connection(Parser_t::Context &ctx,
|
||||||
|
|
||||||
template class MutexVector<int>;
|
template class MutexVector<int>;
|
||||||
template class Vector<ParserRow<MgmApiSession> const*>;
|
template class Vector<ParserRow<MgmApiSession> const*>;
|
||||||
template class Vector<unsigned short>;
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue