Commit fb1561dd authored by Alexander Barkov's avatar Alexander Barkov

Merging latest changes.

parents f4ddf415 54a2d225
......@@ -176,7 +176,7 @@ check_cpu () {
fi
cc_ver=`$cc --version | sed 1q`
cc_verno=`echo $cc_ver | sed -e 's/^.*gcc/gcc/g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
cc_verno=`echo $cc_ver | sed -e 's/^.*(GCC)//g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
set -- `echo $cc_verno | tr '.' ' '`
cc_major=$1
cc_minor=$2
......
......@@ -49,7 +49,7 @@ bin-dist: all
$(top_builddir)/scripts/make_binary_distribution @MAKE_BINARY_DISTRIBUTION_OPTIONS@
# Remove BK's "SCCS" subdirectories from source distribution
# Create initial database files for Windows installations.
# Create initial database files for Windows installations and check them.
dist-hook:
rm -rf `find $(distdir) -type d -name SCCS -print`
mkdir -p $(distdir)/win
......@@ -57,6 +57,7 @@ dist-hook:
--builddir=$(top_builddir) \
--datadir=$(distdir)/win/data \
--srcdir=$(top_srcdir)
storage/myisam/myisamchk --silent --fast $(distdir)/win/data/mysql/*.MYI
tags:
support-files/build-tags
......
......@@ -88,11 +88,12 @@ mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
mysqltest_SOURCES= mysqltest.c
mysqltest_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
mysqltest_LDADD = $(CXXLDFLAGS) \
@CLIENT_EXTRA_LDFLAGS@ \
$(LIBMYSQLCLIENT_LA) \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/regex/libregex.a
$(top_builddir)/regex/libregex.a \
$(CLIENT_THREAD_LIBS)
mysql_upgrade_SOURCES= mysql_upgrade.c \
$(top_srcdir)/mysys/my_getpagesize.c
......
......@@ -269,6 +269,10 @@ get_one_option(int optid, const struct my_option *opt,
}
/**
Run a command using the shell, storing its output in the supplied dynamic
string.
*/
static int run_command(char* cmd,
DYNAMIC_STRING *ds_res)
{
......@@ -341,37 +345,15 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...)
}
/*
Try to get the full path to this exceutable
Return 0 if path found
*/
static my_bool get_full_path_to_executable(char* path)
{
my_bool ret;
DBUG_ENTER("get_full_path_to_executable");
#ifdef __WIN__
ret= (GetModuleFileName(NULL, path, FN_REFLEN) == 0);
#else
/* my_readlink returns 0 if a symlink was read */
ret= (my_readlink(path, "/proc/self/exe", MYF(0)) != 0);
/* Might also want to try with /proc/$$/exe if the above fails */
#endif
DBUG_PRINT("exit", ("path: %s", path));
DBUG_RETURN(ret);
}
/*
Look for the tool in the same directory as mysql_upgrade.
/**
Look for the filename of given tool, with the presumption that it is in the
same directory as mysql_upgrade and that the same executable-searching
mechanism will be used when we run our sub-shells with popen() later.
*/
static void find_tool(char *tool_path, const char *tool_name)
static void find_tool(char *tool_executable_name, const char *tool_name,
const char *self_name)
{
size_t path_len;
char path[FN_REFLEN];
char *last_fn_libchar;
DYNAMIC_STRING ds_tmp;
DBUG_ENTER("find_tool");
DBUG_PRINT("enter", ("progname: %s", my_progname));
......@@ -379,77 +361,59 @@ static void find_tool(char *tool_path, const char *tool_name)
if (init_dynamic_string(&ds_tmp, "", 32, 32))
die("Out of memory");
/* Initialize path with the full path to this program */
if (get_full_path_to_executable(path))
last_fn_libchar= strrchr(self_name, FN_LIBCHAR);
if (last_fn_libchar == NULL)
{
/*
Easy way to get full executable path failed, try
other methods
mysql_upgrade was found by the shell searching the path. A sibling
next to us should be found the same way.
*/
if (my_progname[0] == FN_LIBCHAR)
{
/* 1. my_progname contains full path */
strmake(path, my_progname, FN_REFLEN);
}
else if (my_progname[0] == '.')
{
/* 2. my_progname contains relative path, prepend wd */
char buf[FN_REFLEN];
my_getwd(buf, FN_REFLEN, MYF(0));
my_snprintf(path, FN_REFLEN, "%s%s", buf, my_progname);
}
else
{
/* 3. Just go for it and hope tool is in path */
path[0]= 0;
}
strncpy(tool_executable_name, tool_name, FN_REFLEN);
}
DBUG_PRINT("info", ("path: '%s'", path));
/* Chop off binary name (i.e mysql-upgrade) from path */
dirname_part(path, path, &path_len);
/*
When running in a not yet installed build and using libtool,
the program(mysql_upgrade) will be in .libs/ and executed
through a libtool wrapper in order to use the dynamic libraries
from this build. The same must be done for the tools(mysql and
mysqlcheck). Thus if path ends in .libs/, step up one directory
and execute the tools from there
*/
path[max(path_len-1, 0)]= 0; /* Chop off last / */
if (strncmp(path + dirname_length(path), ".libs", 5) == 0)
else
{
DBUG_PRINT("info", ("Chopping off .libs from '%s'", path));
/* Chop off .libs */
dirname_part(path, path, &path_len);
}
int len;
/*
mysql_upgrade was run absolutely or relatively. We can find a sibling
by replacing our name after the LIBCHAR with the new tool name.
*/
DBUG_PRINT("info", ("path: '%s'", path));
/*
When running in a not yet installed build and using libtool,
the program(mysql_upgrade) will be in .libs/ and executed
through a libtool wrapper in order to use the dynamic libraries
from this build. The same must be done for the tools(mysql and
mysqlcheck). Thus if path ends in .libs/, step up one directory
and execute the tools from there
*/
if (((last_fn_libchar - 6) >= self_name) &&
(strncmp(last_fn_libchar - 5, ".libs", 5) == 0) &&
(*(last_fn_libchar - 6) == FN_LIBCHAR))
{
DBUG_PRINT("info", ("Chopping off \".libs\" from end of path"));
last_fn_libchar -= 6;
}
/* Format name of the tool to search for */
fn_format(tool_path, tool_name,
path, "", MYF(MY_REPLACE_DIR));
len= last_fn_libchar - self_name;
verbose("Looking for '%s' in: %s", tool_name, tool_path);
my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s",
len, self_name, FN_LIBCHAR, tool_name);
}
/* Make sure the tool exists */
if (my_access(tool_path, F_OK) != 0)
die("Can't find '%s'", tool_path);
verbose("Looking for '%s' as: %s", tool_name, tool_executable_name);
/*
Make sure it can be executed
*/
if (run_tool(tool_path,
if (run_tool(tool_executable_name,
&ds_tmp, /* Get output from command, discard*/
"--help",
"2>&1",
IF_WIN("> NUL", "> /dev/null"),
NULL))
die("Can't execute '%s'", tool_path);
die("Can't execute '%s'", tool_executable_name);
dynstr_free(&ds_tmp);
......@@ -759,11 +723,20 @@ static const char *load_default_groups[]=
int main(int argc, char **argv)
{
char self_name[FN_REFLEN];
MY_INIT(argv[0]);
#ifdef __NETWARE__
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
#endif
#if __WIN__
if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)
#endif
{
strncpy(self_name, argv[0], FN_REFLEN);
}
if (init_dynamic_string(&ds_args, "", 512, 256))
die("Out of memory");
......@@ -789,10 +762,10 @@ int main(int argc, char **argv)
dynstr_append(&ds_args, " ");
/* Find mysql */
find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"));
find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name);
/* Find mysqlcheck */
find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"));
find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name);
/*
Read the mysql_upgrade_info file to check if mysql_upgrade
......
......@@ -246,7 +246,7 @@ extern int NEAR my_umask, /* Default creation mask */
NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
NEAR my_dont_interrupt; /* call remember_intr when set */
extern my_bool NEAR mysys_uses_curses, my_use_symdir;
extern ulong sf_malloc_cur_memory, sf_malloc_max_memory;
extern size_t sf_malloc_cur_memory, sf_malloc_max_memory;
extern ulong my_default_record_cache_size;
extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io,
......@@ -577,6 +577,7 @@ extern int my_close(File Filedes,myf MyFlags);
extern File my_dup(File file, myf MyFlags);
extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
extern int my_readlink(char *to, const char *filename, myf MyFlags);
extern int my_is_symlink(const char *filename);
extern int my_realpath(char *to, const char *filename, myf MyFlags);
extern File my_create_with_symlink(const char *linkname, const char *filename,
int createflags, int access_flags,
......
......@@ -256,6 +256,10 @@ extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user;
extern my_off_t myisam_max_temp_length;
extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size;
/* usually used to check if a symlink points into the mysql data home */
/* which is normally forbidden */
extern int (*myisam_test_invalid_symlink)(const char *filename);
/* Prototypes for myisam-functions */
extern int mi_close(struct st_myisam_info *file);
......
......@@ -1103,6 +1103,9 @@ void Protocol_text::prepare_for_resend()
data->embedded_info->prev_ptr= &cur->next;
next_field=cur->data;
next_mysql_field= data->embedded_info->fields_list;
#ifndef DBUG_OFF
field_pos= 0;
#endif
DBUG_VOID_RETURN;
}
......
......@@ -77,6 +77,7 @@ dist-hook:
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(distdir)/std_data/ndb_backup51_data_be
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(distdir)/std_data/ndb_backup51_data_le
$(INSTALL_DATA) $(srcdir)/std_data/parts/part_* $(distdir)/std_data/parts
$(INSTALL_DATA) $(srcdir)/std_data/parts/*.MY* $(distdir)/std_data/parts
$(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(distdir)/std_data/funcs_1
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
$(INSTALL_DATA) $(srcdir)/lib/My/*.pm $(distdir)/lib/My
......@@ -132,6 +133,7 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le
$(INSTALL_DATA) $(srcdir)/std_data/parts/part_* $(DESTDIR)$(testdir)/std_data/parts
$(INSTALL_DATA) $(srcdir)/std_data/parts/*.MY* $(DESTDIR)$(testdir)/std_data/parts
$(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(DESTDIR)$(testdir)/std_data/funcs_1
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
$(INSTALL_DATA) $(srcdir)/lib/My/*.pm $(DESTDIR)$(testdir)/lib/My
......
# Test of binlogging of INSERT_ID with INSERT DELAYED
# ==== Purpose ====
#
# Verify that INSERT DELAYED in mixed or row mode writes events to the
# binlog, and that AUTO_INCREMENT works correctly.
#
# ==== Method ====
#
# Insert both single and multiple rows into an autoincrement column,
# both with specified value and with NULL.
#
# With INSERT DELAYED, the rows do not show up in the table
# immediately, so we must do source include/wait_until_rows_count.inc
# between any two INSERT DELAYED statements. Moreover, if mixed or
# row-based logging is used, there is also a delay between when rows
# show up in the table and when they show up in the binlog. To ensure
# that the rows show up in the binlog, we call FLUSH TABLES, which
# waits until the delayed_insert thread has finished.
#
# We cannot read the binlog after executing INSERT DELAYED statements
# that insert multiple rows, because that is nondeterministic. More
# precisely, rows may be written in batches to the binlog, where each
# batch has one Table_map_log_event and one or more
# Write_rows_log_event. The number of rows included in each batch is
# nondeterministic.
#
# ==== Related bugs ====
#
# BUG#20627: INSERT DELAYED does not honour auto_increment_* variables
# Bug in this test: BUG#38068: binlog_stm_binlog fails sporadically in pushbuild
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
# First, avoid BUG#20627:
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
# Verify that only one INSERT_ID event is binlogged.
# Note, that because of WL#3368 mixed mode binlog records RBR events for the delayed
let $table=t1;
let $rows_inserted=11; # total number of inserted rows in this test
insert delayed into t1 values (207);
let $count=1;
# use this macro instead of sleeps.
let $table=t1;
let $count=0;
insert delayed into t1 values (207);
inc $count;
--source include/wait_until_rows_count.inc
insert delayed into t1 values (null);
inc $count;
--source include/wait_until_rows_count.inc
......@@ -20,9 +46,10 @@ insert delayed into t1 values (300);
inc $count;
--source include/wait_until_rows_count.inc
# moving binlog check affront of multi-rows queries which work is indeterministic (extra table_maps)
# todo: better check is to substitute SHOW BINLOG with reading from binlog, probably bug#19459 is in
# the way
# It is not enough to wait until all rows have been inserted into the
# table. FLUSH TABLES ensures that they are in the binlog too. See
# comment above.
FLUSH TABLES;
source include/show_binlog_events.inc;
insert delayed into t1 values (null),(null),(null),(null);
......@@ -33,8 +60,5 @@ insert delayed into t1 values (null),(null),(400),(null);
inc $count; inc $count; inc $count; inc $count;
--source include/wait_until_rows_count.inc
#check this assertion about $count calculation
--echo $count == $rows_inserted
select * from t1;
drop table t1;
......@@ -309,46 +309,46 @@ sync_slave_with_master;
# 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8
connection master;
CREATE TABLE t1 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
eval CREATE TABLE t1 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = $type ;
CREATE TABLE t2 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
eval CREATE TABLE t2 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = $type ;
sync_slave_with_master;
ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
connection master;
CREATE TABLE t3 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
eval CREATE TABLE t3 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = $type ;
sync_slave_with_master;
ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
connection master;
CREATE TABLE t4 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
eval CREATE TABLE t4 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = $type ;
CREATE TABLE t5 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
eval CREATE TABLE t5 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = $type ;
sync_slave_with_master;
ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
connection master;
CREATE TABLE t6 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
eval CREATE TABLE t6 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = $type ;
sync_slave_with_master;
ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
connection master;
CREATE TABLE t7 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL);
eval CREATE TABLE t7 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = $type ;
--echo [expecting slave to replicate correctly]
connection master;
......@@ -381,7 +381,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
connection master;
RESET MASTER;
connection slave;
STOP SLAVE;
RESET SLAVE;
START SLAVE;
source include/wait_for_slave_to_start.inc;
......@@ -406,7 +410,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
connection master;
RESET MASTER;
connection slave;
STOP SLAVE;
RESET SLAVE;
START SLAVE;
source include/wait_for_slave_to_start.inc;
......@@ -421,7 +429,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
connection master;
RESET MASTER;
connection slave;
STOP SLAVE;
RESET SLAVE;
START SLAVE;
source include/wait_for_slave_to_start.inc;
......
This diff is collapsed.
--require r/case_insensitive_file_system.require
--disable_query_log
show variables like "lower_case_file_system";
--enable_query_log
--require r/lowercase0.require
--disable_query_log
show variables like 'lower_case_%';
show variables like "lower_case_table_names";
--enable_query_log
--require r/lowercase2.require
--disable_query_log
show variables like 'lower_case_table_names';
--enable_query_log
# include/ps_ddl_1.inc
#
# Auxiliary script to be used in ps_ddl.test
#
prepare stmt_sf from 'select f_12093();';
prepare stmt_sp from 'call p_12093(f_12093())';
execute stmt_sf;
execute stmt_sp;
connection con1;
eval $my_drop;
#
connection default;
--echo # XXX: used to be a bug
execute stmt_sf;
--echo # XXX: used to be a bug
execute stmt_sp;
#
--echo # XXX: used to be a bug
execute stmt_sf;
--echo # XXX: used to be a bug
execute stmt_sp;
connection default;
......@@ -4,7 +4,7 @@ if (!$binlog_start)
{
let $binlog_start=106;
}
--replace_result $binlog_start <binlog_start>
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
--eval show binlog events from $binlog_start
......@@ -327,7 +327,6 @@ sub mtr_report_stats ($) {
/Sort aborted/ or
/Time-out in NDB/ or
/One can only use the --user.*root/ or
/Setting lower_case_table_names=2/ or
/Table:.* on (delete|rename)/ or
/You have an error in your SQL syntax/ or
/deprecated/ or
......@@ -402,7 +401,18 @@ sub mtr_report_stats ($) {
)) or
# Test case for Bug#31590 produces the following error:
/Out of sort memory; increase server sort buffer size/
/Out of sort memory; increase server sort buffer size/ or
# Bug#35161, test of auto repair --myisam-recover
/able.*_will_crash/ or
# lowercase_table3 using case sensitive option on
# case insensitive filesystem (InnoDB error).
/Cannot find or open table test\/BUG29839 from/ or
# When trying to set lower_case_table_names = 2
# on a case sensitive file system. Bug#37402.
/lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./
)
{
next; # Skip these lines
......
Variable_name Value
lower_case_file_system ON
This diff is collapsed.
......@@ -5388,4 +5388,10 @@ select * from t1;
c1
That
drop table t1;
create table t1 (a int not null) engine=csv;
lock tables t1 read;
select * from t1;
ERROR HY000: File './test/t1.CSV' not found (Errcode: 2)
unlock tables;
drop table t1;
End of 5.1 tests
......@@ -1009,13 +1009,13 @@ Warning 1101 BLOB/TEXT column 'blurb' can't have a default value
INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values.");
INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.");
INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. ");
INSERT INTO federated.t1 VALUES(4, "Die bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest fr jemanden, der seine Zielsprache ernst nimmt:");
INSERT INTO federated.t1 VALUES(4, "Die �bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest f�r jemanden, der seine Zielsprache ernst nimmt:");
SELECT * FROM federated.t1;
blurb_id blurb
1 MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values.
2 All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.
3 A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined.
4 Die bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest fr jemanden, der seine Zielsprache ernst nimmt:
4 Die �bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest f�r jemanden, der seine Zielsprache ernst nimmt:
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`a` int NOT NULL,
......@@ -2118,6 +2118,17 @@ DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://';
DROP TABLE t1;
CREATE TABLE t1 (a LONGBLOB, b LONGBLOB);
INSERT INTO t1 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaa', NULL);
CREATE TABLE t1
(a LONGBLOB, b LONGBLOB) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
CHECKSUM TABLE t1;
Table Checksum
test.t1 2465757603
DROP TABLE t1;
DROP TABLE t1;
End of 5.0 tests
create server 's1' foreign data wrapper 'mysql' options (port 3306);
drop server 's1';
End of 5.1 tests
......@@ -2125,4 +2136,3 @@ DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_CONCURRENT_INSERT;
......@@ -131,3 +131,49 @@ drop table t1;
select if(0, 18446744073709551610, 18446744073709551610);
if(0, 18446744073709551610, 18446744073709551610)
18446744073709551610
CREATE TABLE t1(a DECIMAL(10,3));
SELECT t1.a,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,0)))))))))))))))))))))))))))))) + 1
FROM t1;
a IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((R
DROP TABLE t1;
End of 5.0 tests
......@@ -115,3 +115,21 @@ SELECT 1 REGEXP NULL;
1 REGEXP NULL
NULL
End of 5.0 tests
CREATE TABLE t1(a INT, b CHAR(4));
INSERT INTO t1 VALUES (1, '6.1'), (1, '7.0'), (1, '8.0');
PREPARE stmt1 FROM "SELECT a FROM t1 WHERE a=1 AND '7.0' REGEXP b LIMIT 1";
EXECUTE stmt1;
a
1
EXECUTE stmt1;
a
1
EXECUTE stmt1;
a
1
EXECUTE stmt1;
a
1
DEALLOCATE PREPARE stmt1;
DROP TABLE t1;
End of 5.1 tests
......@@ -484,6 +484,7 @@ c1
handler t1 close;
read the result from the other connection
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
proceed with the normal connection
drop table t1;
......@@ -698,6 +699,7 @@ handler a2 read a first;
a
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
handler a1 close;
ERROR 42S02: Unknown table 'a1' in HANDLER
......
drop table if exists t1;
create table t1(a int not null auto_increment primary key) engine=innodb;
insert into t1 set a = -1;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
drop table if exists t1;
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (9223372036854775807, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
9223372036854775807 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (127, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
127 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (255, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
255 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (32767, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
32767 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (65535, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
65535 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (8388607, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
8388607 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (16777215, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
16777215 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (2147483647, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
2147483647 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (4294967295, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
4294967295 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (9223372036854775807, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
9223372036854775807 NULL
DROP TABLE t1;
CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (18446744073709551615, null);
INSERT INTO t1 (c2) VALUES ('innodb');
Got one of the listed errors
SELECT * FROM t1;
c1 c2
18446744073709551615 NULL
DROP TABLE t1;
CREATE TABLE t1(c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2), (3);
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
SELECT c1 FROM t1;
c1
1
2
3
4
5
6
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
TRUNCATE TABLE t1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1), (2), (3);
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
SELECT c1 FROM t1;
c1
1
2
3
4
5
6
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2), (3);
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
SELECT c1 FROM t1;
c1
1
2
3
4
5
6
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
DELETE FROM t1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1), (2), (3);
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
SELECT c1 FROM t1;
c1
1
2
3
7
8
9
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
DROP TABLE t1;
......@@ -166,6 +166,7 @@ level id parent_id
1 1007 101
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
......@@ -190,6 +191,7 @@ create table t1 (a int) engine=innodb;
insert into t1 values (1), (2);
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
delete from t1 where a = 1;
select * from t1;
......@@ -738,6 +740,7 @@ world 2
hello 1
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
......@@ -3109,6 +3112,7 @@ BEGIN;
INSERT INTO t1 VALUES (1);
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
DROP TABLE t1;
CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB;
......@@ -3263,3 +3267,14 @@ AUTO_INCREMENT
200
DROP TABLE t2;
DROP TABLE t1;
CREATE TABLE t1 (c1 int default NULL,
c2 int default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
TRUNCATE TABLE t1;
affected rows: 0
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
affected rows: 5
info: Records: 5 Duplicates: 0 Warnings: 0
TRUNCATE TABLE t1;
affected rows: 0
DROP TABLE t1;
f4 f8
xxx zzz
f4 f8
xxx zzz
SET storage_engine=InnoDB;
......@@ -577,6 +577,7 @@ id select_type table type possible_keys key key_len ref rows Extra
INSERT INTO t2 SELECT * FROM t1;
OPTIMIZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
test.t2 optimize status OK
EXPLAIN SELECT COUNT(*) FROM t2 WHERE stat_id IN (1,3) AND acct_id=785;
id select_type table type possible_keys key key_len ref rows Extra
......
......@@ -750,8 +750,8 @@ ERROR 42S22: Unknown column 't1.b' in 'on clause'
select * from information_schema.statistics join information_schema.columns
using(table_name,column_name) where table_name='user';
TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
user Host NULL mysql 0 mysql PRIMARY 1 A NULL NULL NULL BTREE NULL mysql 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI #
user User NULL mysql 0 mysql PRIMARY 2 A 3 NULL NULL BTREE NULL mysql 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI #
user Host NULL mysql 0 mysql PRIMARY 1 A # NULL NULL BTREE NULL mysql 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI #
user User NULL mysql 0 mysql PRIMARY 2 A # NULL NULL BTREE NULL mysql 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI #
drop table t1;
drop table t2;
drop table t3;
......
Variable_name Value
lower_case_file_system ON
lower_case_table_names 0
......@@ -108,11 +108,11 @@ id
1
select * from v1 group by id limit 0;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 v1 id id 3 10 0 Y 32768 0 63
def test v1 v1 id id 3 10 0 Y 32768 0 63
id
select * from v1 where id=1000 group by id;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 v1 id id 3 10 0 Y 32768 0 63
def test v1 v1 id id 3 10 0 Y 32768 0 63
id
select * from v1 where id=1 group by id;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
......@@ -126,7 +126,7 @@ renamed
1
select * from v3 where renamed=1 group by renamed;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def v3 renamed 8 12 0 Y 32896 0 63
def v3 v3 renamed renamed 8 12 0 Y 32896 0 63
renamed
drop table t1;
drop view v1,v2,v3;
......@@ -156,8 +156,8 @@ c1
3
SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 v1 c1 c1 254 1 1 Y 0 0 8
def test t2 v2 c2 c2 254 1 1 Y 0 0 8
def test v1 v1 c1 c1 254 1 1 Y 0 0 8
def test v2 v2 c2 c2 254 1 1 Y 0 0 8
c1 c2
1 1
2 2
......
......@@ -538,7 +538,7 @@ PARTITION BY LIST (a)
(PARTITION x1 VALUES IN (10), PARTITION x2 VALUES IN (20));
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status OK
drop table t1;
create table t1
(a int)
......@@ -1239,7 +1239,11 @@ 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
t1 MyISAM 10 Fixed 1 14 14 0 0 7 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
ALTER TABLE t1 OPTIMIZE PARTITION p0;
ERROR 42000: The storage engine for the table doesn't support optimize partition
Table Op Msg_type Msg_text
test.t1 optimize status OK
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
t1 MyISAM 10 Fixed 1 7 7 0 1024 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
DROP TABLE t1;
CREATE TABLE t1 (a int, index(a)) PARTITION BY KEY(a);
ALTER TABLE t1 DISABLE KEYS;
......@@ -1499,13 +1503,17 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTENDED' at line 1
ALTER TABLE t1 ANALYZE PARTITION p1;
ERROR 42000: The storage engine for the table doesn't support analyze partition
Table Op Msg_type Msg_text
test.t1 analyze status OK
ALTER TABLE t1 CHECK PARTITION p1;
ERROR 42000: The storage engine for the table doesn't support check partition
Table Op Msg_type Msg_text
test.t1 check status OK
ALTER TABLE t1 REPAIR PARTITION p1;
ERROR 42000: The storage engine for the table doesn't support repair partition
Table Op Msg_type Msg_text
test.t1 repair status OK
ALTER TABLE t1 OPTIMIZE PARTITION p1;
ERROR 42000: The storage engine for the table doesn't support optimize partition
Table Op Msg_type Msg_text
test.t1 optimize status OK
DROP TABLE t1;
CREATE TABLE t1 (s1 BIGINT UNSIGNED)
PARTITION BY RANGE (s1) (
......@@ -1604,4 +1612,29 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
drop table t1;
CREATE TABLE t1 (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`createdDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`number` int,
PRIMARY KEY (`ID`, number)
)
PARTITION BY RANGE (number) (
PARTITION p0 VALUES LESS THAN (6),
PARTITION p1 VALUES LESS THAN (11)
);
create table t2 (
`ID` bigint(20),
`createdDate` TIMESTAMP,
`number` int
);
INSERT INTO t1 SET number=1;
insert into t2 select * from t1;
SELECT SLEEP(1);
SLEEP(1)
0
UPDATE t1 SET number=6;
select count(*) from t1, t2 where t1.createdDate = t2.createdDate;
count(*)
1
drop table t1, t2;
End of 5.1 tests
......@@ -113,9 +113,9 @@ set @@sql_mode=@org_mode;
create table t1 (a int)
partition by key (a)
(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
ERROR 42000: Incorrect table name 'part-data'
ERROR HY000: Incorrect arguments to DATA DIRECTORY
create table t1 (a int)
partition by key (a)
(partition p0,
partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
ERROR 42000: Incorrect table name 'part-data'
ERROR HY000: Incorrect arguments to DATA DIRECTORY
......@@ -445,7 +445,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
def key_len 253 1365 0 Y 0 31 8
def key_len 253 4096 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 14 N 1 31 8
......@@ -461,7 +461,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 5 Y 0 31 8
def possible_keys 253 4096 7 Y 0 31 8
def key 253 64 7 Y 0 31 8
def key_len 253 1365 1 Y 0 31 8
def key_len 253 4096 1 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 27 N 1 31 8
......
......@@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
def key_len 253 1365 0 Y 0 31 8
def key_len 253 4096 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
......
......@@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
def key_len 253 1365 0 Y 0 31 8
def key_len 253 4096 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
......
......@@ -1159,7 +1159,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
def key_len 253 1365 0 Y 0 31 8
def key_len 253 4096 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
......
......@@ -1201,7 +1201,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
def key_len 253 1365 0 Y 0 31 8
def key_len 253 4096 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
......@@ -4222,7 +4222,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
def key_len 253 1365 0 Y 0 31 8
def key_len 253 4096 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
......
......@@ -1567,11 +1567,13 @@ drop table if exists t_12093;
drop function if exists f_12093;
drop function if exists f_12093_unrelated;
drop procedure if exists p_12093;
drop view if exists v_12093_unrelated;
create table t_12093 (a int);
create function f_12093() returns int return (select count(*) from t_12093);
create procedure p_12093(a int) select * from t_12093;
create function f_12093_unrelated() returns int return 2;
create procedure p_12093_unrelated() begin end;
create view v_12093_unrelated as select * from t_12093;
prepare stmt_sf from 'select f_12093();';
prepare stmt_sp from 'call p_12093(f_12093())';
execute stmt_sf;
......@@ -1580,6 +1582,27 @@ f_12093()
execute stmt_sp;
a
drop function f_12093_unrelated;
# XXX: used to be a bug
execute stmt_sf;
f_12093()
0
# XXX: used to be a bug
execute stmt_sp;
a
# XXX: used to be a bug
execute stmt_sf;
f_12093()
0
# XXX: used to be a bug
execute stmt_sp;
a
prepare stmt_sf from 'select f_12093();';
prepare stmt_sp from 'call p_12093(f_12093())';
execute stmt_sf;
f_12093()
0
execute stmt_sp;
a
drop procedure p_12093_unrelated;
# XXX: used to be a bug
execute stmt_sf;
......@@ -1595,7 +1618,29 @@ f_12093()
# XXX: used to be a bug
execute stmt_sp;
a
call p_verify_reprepare_count(2);
prepare stmt_sf from 'select f_12093();';
prepare stmt_sp from 'call p_12093(f_12093())';
execute stmt_sf;
f_12093()
0
execute stmt_sp;
a
drop view v_12093_unrelated;
# XXX: used to be a bug
execute stmt_sf;
f_12093()
0
# XXX: used to be a bug
execute stmt_sp;
a
# XXX: used to be a bug
execute stmt_sf;
f_12093()
0
# XXX: used to be a bug
execute stmt_sp;
a
call p_verify_reprepare_count(6);
SUCCESS
drop table t_12093;
......
......@@ -12,51 +12,51 @@ insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
-- after Bug#29394 is implemented.
check table t1 fast;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Table 253 42 7 Y 0 31 8
def Op 253 3 5 Y 0 31 8
def Msg_type 253 3 6 Y 0 31 8
def Msg_text 253 85 27 Y 0 31 8
def Table 253 128 7 Y 0 31 8
def Op 253 10 5 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
def Msg_text 253 255 27 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status Table is already up to date
check table t1 fast;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Table 253 42 7 Y 0 31 8
def Op 253 3 5 Y 0 31 8
def Msg_type 253 3 6 Y 0 31 8
def Msg_text 253 85 27 Y 0 31 8
def Table 253 128 7 Y 0 31 8
def Op 253 10 5 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
def Msg_text 253 255 27 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status Table is already up to date
check table t1 changed;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Table 253 42 7 Y 0 31 8
def Op 253 3 5 Y 0 31 8
def Msg_type 253 3 6 Y 0 31 8
def Msg_text 253 85 2 Y 0 31 8
def Table 253 128 7 Y 0 31 8
def Op 253 10 5 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
def Msg_text 253 255 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status OK
insert into t1 values (5,5,5);
check table t1 changed;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Table 253 42 7 Y 0 31 8
def Op 253 3 5 Y 0 31 8
def Msg_type 253 3 6 Y 0 31 8
def Msg_text 253 85 2 Y 0 31 8
def Table 253 128 7 Y 0 31 8
def Op 253 10 5 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
def Msg_text 253 255 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status OK
check table t1 medium;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Table 253 42 7 Y 0 31 8
def Op 253 3 5 Y 0 31 8
def Msg_type 253 3 6 Y 0 31 8
def Msg_text 253 85 2 Y 0 31 8
def Table 253 128 7 Y 0 31 8
def Op 253 10 5 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
def Msg_text 253 255 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status OK
check table t1 extended;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Table 253 42 7 Y 0 31 8
def Op 253 3 5 Y 0 31 8
def Msg_type 253 3 6 Y 0 31 8
def Msg_text 253 85 2 Y 0 31 8
def Table 253 128 7 Y 0 31 8
def Op 253 10 5 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
def Msg_text 253 255 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 check status OK
show index from t1;
......@@ -84,10 +84,10 @@ ERROR 23000: Duplicate entry '5' for key 'PRIMARY'
-- after Bug#29394 is implemented.
optimize table t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Table 253 42 7 Y 0 31 8
def Op 253 3 8 Y 0 31 8
def Msg_type 253 3 6 Y 0 31 8
def Msg_text 253 85 2 Y 0 31 8
def Table 253 128 7 Y 0 31 8
def Op 253 10 8 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
def Msg_text 253 255 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 optimize status OK
optimize table t1;
......@@ -154,10 +154,10 @@ insert into t1 values (1,1,1,0),(1,1,2,0),(1,1,3,0),(1,2,1,0),(1,2,2,0),(1,2,3,0
-- after Bug#29394 is implemented.
analyze table t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Table 253 42 7 Y 0 31 8
def Op 253 3 7 Y 0 31 8
def Msg_type 253 3 6 Y 0 31 8
def Msg_text 253 85 2 Y 0 31 8
def Table 253 128 7 Y 0 31 8
def Op 253 10 7 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
def Msg_text 253 255 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 analyze status OK
show index from t1;
......@@ -171,10 +171,10 @@ t1 0 PRIMARY 4 f4 A 18 NULL NULL BTREE
-- after Bug#29394 is implemented.
repair table t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Table 253 42 7 Y 0 31 8
def Op 253 3 6 Y 0 31 8
def Msg_type 253 3 6 Y 0 31 8
def Msg_text 253 85 2 Y 0 31 8
def Table 253 128 7 Y 0 31 8
def Op 253 10 6 Y 0 31 8
def Msg_type 253 10 6 Y 0 31 8
def Msg_text 253 255 2 Y 0 31 8
Table Op Msg_type Msg_text
test.t1 repair status OK
show index from t1;
......@@ -878,8 +878,8 @@ latin1_bin latin1 47 Yes 1
----------------------------------------------------------------
SHOW CREATE DATABASE mysqltest1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Database 253 63 10 N 1 31 33
def Create Database 253 1023 69 N 1 31 33
def Database 253 192 10 N 1 31 33
def Create Database 253 3072 69 N 1 31 33
Database Create Database
mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */
----------------------------------------------------------------
......@@ -891,8 +891,8 @@ mysqltest1
----------------------------------------------------------------
SHOW CREATE TABLE t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Table 253 63 2 N 1 31 33
def Create Table 253 1023 102 N 1 31 33
def Table 253 192 2 N 1 31 33
def Create Table 253 3072 102 N 1 31 33
Table Create Table
t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL,
......@@ -1052,10 +1052,10 @@ NULL test t1_bi INSERT NULL test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW
----------------------------------------------------------------
SHOW CREATE VIEW v1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def View 253 63 2 N 1 31 33
def Create View 253 1023 103 N 1 31 33
def character_set_client 253 30 6 N 1 31 33
def collation_connection 253 30 6 N 1 31 33
def View 253 192 2 N 1 31 33
def Create View 253 3072 103 N 1 31 33
def character_set_client 253 96 6 N 1 31 33
def collation_connection 253 96 6 N 1 31 33
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` binary binary
----------------------------------------------------------------
......@@ -1078,12 +1078,12 @@ NULL test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary
----------------------------------------------------------------
SHOW CREATE PROCEDURE p1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Procedure 253 63 2 N 1 31 33
def Procedure 253 192 2 N 1 31 33
def sql_mode 253 0 0 N 1 31 33
def Create Procedure 253 1023 59 Y 0 31 33
def character_set_client 253 30 6 N 1 31 33
def collation_connection 253 30 6 N 1 31 33
def Database Collation 253 30 17 N 1 31 33
def Create Procedure 253 3072 59 Y 0 31 33
def character_set_client 253 96 6 N 1 31 33
def collation_connection 253 96 6 N 1 31 33
def Database Collation 253 96 17 N 1 31 33
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
SELECT 1 binary binary latin1_swedish_ci
......@@ -1133,12 +1133,12 @@ p1 NULL test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL D
----------------------------------------------------------------
SHOW CREATE FUNCTION f1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Function 253 63 2 N 1 31 33
def Function 253 192 2 N 1 31 33
def sql_mode 253 0 0 N 1 31 33
def Create Function 253 1023 74 Y 0 31 33
def character_set_client 253 30 6 N 1 31 33
def collation_connection 253 30 6 N 1 31 33
def Database Collation 253 30 17 N 1 31 33
def Create Function 253 3072 74 Y 0 31 33
def character_set_client 253 96 6 N 1 31 33
def collation_connection 253 96 6 N 1 31 33
def Database Collation 253 96 17 N 1 31 33
Function sql_mode Create Function character_set_client collation_connection Database Collation
f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
RETURN 1 binary binary latin1_swedish_ci
......@@ -1244,6 +1244,36 @@ Slow_queries 2
show variables like 'myisam_recover_options';
Variable_name Value
myisam_recover_options OFF
CREATE TABLE t1 (
Codigo int(10) unsigned NOT NULL auto_increment,
Nombre varchar(255) default NULL,
Telefono varchar(255) default NULL,
Observaciones longtext,
Direccion varchar(255) default NULL,
Dni varchar(255) default NULL,
CP int(11) default NULL,
Provincia varchar(255) default NULL,
Poblacion varchar(255) default NULL,
PRIMARY KEY (Codigo)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
show create table t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Table 253 64 2 N 1 31 7
def Create Table 253 1024 445 N 1 31 7
Table Create Table
t1 CREATE TABLE `t1` (
`Codigo` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Nombre` varchar(255) DEFAULT NULL,
`Telefono` varchar(255) DEFAULT NULL,
`Observaciones` longtext,
`Direccion` varchar(255) DEFAULT NULL,
`Dni` varchar(255) DEFAULT NULL,
`CP` int(11) DEFAULT NULL,
`Provincia` varchar(255) DEFAULT NULL,
`Poblacion` varchar(255) DEFAULT NULL,
PRIMARY KEY (`Codigo`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8
drop table t1;
End of 5.0 tests
SHOW AUTHORS;
create database mysqltest;
......
......@@ -6820,6 +6820,22 @@ ttt
2
drop function func30787;
drop table t1;
create table t1(c1 INT);
create function f1(p1 int) returns varchar(32)
return 'aaa';
create view v1 as select f1(c1) as parent_control_name from t1;
create procedure p1()
begin
select parent_control_name as c1 from v1;
end //
call p1();
c1
call p1();
c1
drop procedure p1;
drop function f1;
drop view v1;
drop table t1;
# ------------------------------------------------------------------
# -- End of 5.0 tests
# ------------------------------------------------------------------
......
......@@ -4398,4 +4398,15 @@ INSERT INTO t1 VALUES (1), (3);
SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
a b
DROP TABLE t1,t2;
End of 5.0 tests.
CREATE TABLE t1(pk int PRIMARY KEY, a int, INDEX idx(a));
INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20);
CREATE TABLE t2(pk int PRIMARY KEY, a int, b int, INDEX idxa(a));
INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100);
SELECT * FROM t1
WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b);
pk a
1 10
3 30
2 20
DROP TABLE t1,t2;
End of 5.1 tests.
drop table if exists t0, t1, t2, t3, t4;
drop table if exists t0, t1, t2, t3, t4, t5;
create table t1 (oref int, grp int, ie int) ;
insert into t1 (oref, grp, ie) values
(1, 1, 1),
......@@ -780,3 +780,29 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN (SELECT 1 FROM t1, t2 WHERE 0);
1
DROP TABLE t1, t2;
End of 5.0 tests
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (
a int(11) default null,
b int(11) default null,
key (a)
);
insert into t1 select A.a+10*(B.a+10*C.a),A.a+10*(B.a+10*C.a) from t0 A, t0 B, t0 C;
create table t2 (a int(11) default null);
insert into t2 values (0),(1);
create table t3 (a int(11) default null);
insert into t3 values (0),(1);
create table t4 (a int(11) default null);
insert into t4 values (0),(1);
create table t5 (a int(11) default null);
insert into t5 values (0),(1),(0),(1);
select * from t2, t3
where
t2.a < 10 and
t3.a+1 = 2 and
t3.a in (select t1.b from t1
where t1.a+1=t1.a+1 and
t1.a < (select t4.a+10
from t4, t5 limit 2));
ERROR 21000: Subquery returns more than 1 row
drop table t0, t1, t2, t3, t4, t5;
......@@ -19,6 +19,7 @@ a b
THE LION 13
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
select trigger_schema, trigger_name, event_object_schema,
event_object_table, action_statement from information_schema.triggers
......
......@@ -1529,6 +1529,11 @@ SELECT f1 FROM t1;
f1
99999999999999999999999999999.999999999999999999999999999999
DROP TABLE t1;
select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
1.01500000 * 1.01500000 * 0.99500000);
(1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
1.01500000 * 1.01500000 * 0.99500000)
0.812988073953673124592306939480
End of 5.0 tests
select cast(143.481 as decimal(4,1));
cast(143.481 as decimal(4,1))
......
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -18,7 +18,7 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "kil
ERROR 70100: Query execution was interrupted
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=#
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
......
......@@ -1141,10 +1141,10 @@ master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `mysql`; COMMIT
drop table t1,t2,t3,tt1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207);
insert delayed into t1 values (null);
insert delayed into t1 values (300);
FLUSH TABLES;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
......@@ -1188,9 +1188,9 @@ master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; FLUSH TABLES
insert delayed into t1 values (null),(null),(null),(null);
insert delayed into t1 values (null),(null),(400),(null);
11 == 11
select * from t1;
a
207
......
......@@ -926,7 +926,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
......
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207);
insert delayed into t1 values (null);
insert delayed into t1 values (300);
FLUSH TABLES;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
......@@ -10,9 +10,9 @@ master-bin.000001 # Query # # use `test`; insert delayed into t1 values (207)
master-bin.000001 # Intvar # # INSERT_ID=208
master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null)
master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300)
master-bin.000001 # Query # # use `test`; FLUSH TABLES
insert delayed into t1 values (null),(null),(null),(null);
insert delayed into t1 values (null),(null),(400),(null);
11 == 11
select * from t1;
a
207
......
......@@ -629,10 +629,10 @@ master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('An
master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
drop table t1,t2,t3,tt1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207);
insert delayed into t1 values (null);
insert delayed into t1 values (300);
FLUSH TABLES;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
......@@ -660,9 +660,9 @@ master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; FLUSH TABLES
insert delayed into t1 values (null),(null),(null),(null);
insert delayed into t1 values (null),(null),(400),(null);
11 == 11
select * from t1;
a
207
......
......@@ -623,7 +623,7 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # use `test`; ROLLBACK
......@@ -858,7 +858,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -192,14 +192,30 @@ DROP TABLE t1;
CREATE TABLE t1 (a int primary key)
ENGINE=NDB
PARTITION BY KEY(a);
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair note The storage engine for the table doesn't support repair
ALTER TABLE t1 OPTIMIZE PARTITION p0;
ERROR HY000: Table storage engine for 't1' doesn't have this option
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
ALTER TABLE t1 CHECK PARTITION p0;
ERROR HY000: Table storage engine for 't1' doesn't have this option
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
ALTER TABLE t1 REPAIR PARTITION p0;
ERROR HY000: Table storage engine for 't1' doesn't have this option
Table Op Msg_type Msg_text
test.t1 repair note The storage engine for the table doesn't support repair
ALTER TABLE t1 ANALYZE PARTITION p0;
ERROR HY000: Table storage engine for 't1' doesn't have this option
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
ALTER TABLE t1 REBUILD PARTITION p0;
ERROR HY000: Table storage engine for 't1' doesn't have this option
DROP TABLE t1;
......
......@@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8
def type 253 10 3 Y 0 31 8
def possible_keys 253 4096 0 Y 0 31 8
def key 253 64 0 Y 0 31 8
def key_len 253 1365 0 Y 0 31 8
def key_len 253 4096 0 Y 0 31 8
def ref 253 1024 0 Y 0 31 8
def rows 8 10 1 Y 32928 0 63
def Extra 253 255 0 N 1 31 8
......
......@@ -175,15 +175,15 @@ DROP TABLE t1;
CREATE TABLE t1 (a int primary key)
ENGINE=NDB
PARTITION BY KEY(a);
--error 1031
ANALYZE TABLE t1;
CHECK TABLE t1;
OPTIMIZE TABLE t1;
REPAIR TABLE t1;
ALTER TABLE t1 OPTIMIZE PARTITION p0;
--error 1031
ALTER TABLE t1 CHECK PARTITION p0;
--error 1031
ALTER TABLE t1 REPAIR PARTITION p0;
--error 1031
ALTER TABLE t1 ANALYZE PARTITION p0;
--error 1031
--error ER_ILLEGAL_HA
ALTER TABLE t1 REBUILD PARTITION p0;
DROP TABLE t1;
......
......@@ -31,6 +31,9 @@ let $alter= ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10
--echo # 1.4 ALTER ... ANALYZE PARTITION part_1,part_1,part_1;
let $alter= ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1;
--source suite/parts/inc/partition_alter_41.inc
--echo # 1.5 ALTER ... ANALYZE PARTITION ALL;
let $alter= ALTER TABLE t1 ANALYZE PARTITION ALL;
--source suite/parts/inc/partition_alter_41.inc
--echo #------------------------------------------------------------------------
--echo # 2 ALTER ... CHECK PARTITION
......@@ -47,6 +50,9 @@ let $alter= ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10;
--echo # 2.4 ALTER ... CHECK PARTITION part_1,part_1,part_1;
let $alter= ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1;
--source suite/parts/inc/partition_alter_41.inc
--echo # 2.5 ALTER ... CHECK PARTITION ALL;
let $alter= ALTER TABLE t1 CHECK PARTITION ALL;
--source suite/parts/inc/partition_alter_41.inc
--echo #------------------------------------------------------------------------
--echo # 3 ALTER ... OPTIMIZE PARTITION
......@@ -63,6 +69,9 @@ let $alter= ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_1
--echo # 3.4 ALTER ... OPTIMIZE PARTITION part_1,part_1,part_1;
let $alter= ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1;
--source suite/parts/inc/partition_alter_41.inc
--echo # 3.5 ALTER ... OPTIMIZE PARTITION ALL;
let $alter= ALTER TABLE t1 OPTIMIZE PARTITION ALL;
--source suite/parts/inc/partition_alter_41.inc
--echo #------------------------------------------------------------------------
--echo # 4 ALTER ... REBUILD PARTITION
......@@ -79,6 +88,9 @@ let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10
--echo # 4.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1;
let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1;
--source suite/parts/inc/partition_alter_41.inc
--echo # 4.5 ALTER ... REBUILD PARTITION ALL;
let $alter= ALTER TABLE t1 REBUILD PARTITION ALL;
--source suite/parts/inc/partition_alter_41.inc
--echo #------------------------------------------------------------------------
--echo # 5 ALTER ... REPAIR PARTITION
......@@ -95,6 +107,9 @@ let $alter= ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10;
--echo # 5.4 ALTER ... REPAIR PARTITION part_1,part_1,part_1;
let $alter= ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1;
--source suite/parts/inc/partition_alter_41.inc
--echo # 5.5 ALTER ... REPAIR PARTITION ALL;
let $alter= ALTER TABLE t1 REPAIR PARTITION ALL;
--source suite/parts/inc/partition_alter_41.inc
--echo #------------------------------------------------------------------------
--echo # 6 ALTER ... REMOVE PARTITIONING
......
This diff is collapsed.
......@@ -473,16 +473,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
test.t1 check status OK
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
......@@ -927,16 +928,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
test.t1 check status OK
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
......@@ -1380,16 +1382,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
test.t1 check status OK
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
......@@ -1896,16 +1899,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
test.t1 check status OK
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
......@@ -2388,16 +2392,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
test.t1 check status OK
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
......@@ -2841,16 +2846,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
test.t1 check status OK
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
......@@ -3296,16 +3302,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
test.t1 check status OK
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
......@@ -3749,16 +3756,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
test.t1 check status OK
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
......@@ -4205,16 +4213,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
test.t1 check status OK
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
......@@ -4656,16 +4665,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
test.t1 check status OK
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
......@@ -5105,16 +5115,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT)
AND f_charbig = '####updated per insert trigger####';
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze note The storage engine for the table doesn't support analyze
test.t1 analyze status OK
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check note The storage engine for the table doesn't support check
test.t1 check status OK
CHECKSUM TABLE t1 EXTENDED;
Table Checksum
test.t1 <some_value>
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
# check layout success: 1
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment