Commit 2118de03 authored by unknown's avatar unknown

Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb

into mysql.com:/home/jonas/src/mysql-5.0-ndb


BitKeeper/etc/logging_ok:
  auto-union
mysql-test/mysql-test-run.sh:
  Auto merged
ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
parents d89676d8 b395f235
...@@ -56,6 +56,7 @@ georg@beethoven.local ...@@ -56,6 +56,7 @@ georg@beethoven.local
georg@beethoven.site georg@beethoven.site
georg@lmy002.wdf.sap.corp georg@lmy002.wdf.sap.corp
gerberb@ou800.zenez.com gerberb@ou800.zenez.com
gluh@eagle.intranet.mysql.r18.ru
gluh@gluh.(none) gluh@gluh.(none)
gluh@gluh.mysql.r18.ru gluh@gluh.mysql.r18.ru
gordon@zero.local.lan gordon@zero.local.lan
...@@ -120,6 +121,7 @@ kostja@oak.local ...@@ -120,6 +121,7 @@ kostja@oak.local
lars@mysql.com lars@mysql.com
lenz@kallisto.mysql.com lenz@kallisto.mysql.com
lenz@mysql.com lenz@mysql.com
magnus@msdesk.mysql.com
magnus@neptunus.(none) magnus@neptunus.(none)
magnus@shellback.(none) magnus@shellback.(none)
marko@hundin.mysql.fi marko@hundin.mysql.fi
......
...@@ -240,40 +240,52 @@ if (defined $opt_changelog) ...@@ -240,40 +240,52 @@ if (defined $opt_changelog)
# the last tagged ChangeSet (this relies heavily on our current tagging # the last tagged ChangeSet (this relies heavily on our current tagging
# practice!) # practice!)
# #
my $revision= ""; $opt_changelog=~ s/^=//; # Sometimes, a leading '=' was not stripped.
my $log_base= $opt_changelog;
my $changelogfile;
if ($target_dir =~ m:^/:) # we need an absolute path, as we change directory
{
$changelogfile= $target_dir. "/ChangeLog";
}
else
{
$changelogfile= cwd() . "/" . $target_dir . "/ChangeLog";
}
if ($opt_changelog eq "last") if ($opt_changelog eq "last")
{ {
if (!$opt_revision) if (!$opt_revision)
{ {
$revision= `bk changes -t -d':REV:::TAG:' -n $REPO | grep mysql-$major.$minor | head -1 | cut -f1 -d ":"`; $log_base= `bk changes -t -d':REV:::TAG:' -n $REPO | grep mysql-$major.$minor | head -1 | cut -f1 -d ":"`;
} }
else else
{ {
$revision= `bk changes -r..$opt_revision -t -d':REV:' -n $REPO | head -2 | tail -1`; $log_base= `bk changes -r..$opt_revision -t -d':REV:' -n $REPO | head -2 | tail -1`;
} }
chomp($revision); chomp($log_base);
$opt_changelog= $revision;
} }
$msg= "Adding $target_dir/ChangeLog"; $msg= "Adding $changelogfile";
$msg.= " (down to revision $opt_changelog)" if $opt_changelog ne ""; $msg.= " (down to revision $log_base)" if $log_base ne "";
&logger($msg); &logger($msg);
$command= "bk changes -v"; # Due to a BK error, "bk changes" must be run in $REPO !
$command.= " -r" if ($opt_changelog ne "" || $opt_revision); $command= "cd $REPO ; ";
$command.= $opt_changelog if $opt_changelog ne ""; $command.= "bk changes -v";
$command.= ".." if ($opt_changelog ne "" && !$opt_revision); $command.= " -r" if ($log_base ne "" || $opt_revision);
$command.= $log_base if $log_base ne "";
$command.= ".." if ($log_base ne "" && !$opt_revision);
$command.= ".." . $opt_revision if $opt_revision; $command.= ".." . $opt_revision if $opt_revision;
$command.= " " . $REPO . " > $target_dir/ChangeLog"; $command.= " > $changelogfile";
&logger($command); &logger($command);
# We cannot use run_command here because of output redirection # We cannot use run_command here because of output redirection
unless ($opt_dry_run) unless ($opt_dry_run)
{ {
system($command) == 0 or &abort("Could not create $target_dir/ChangeLog!"); system($command) == 0 or &abort("Could not create $changelogfile!");
} }
} }
# #
# Add the latest manual from the mysqldoc tree # Add the latest manual and tool from the mysqldoc tree
# #
unless ($opt_skip_manual) unless ($opt_skip_manual)
{ {
...@@ -283,6 +295,8 @@ unless ($opt_skip_manual) ...@@ -283,6 +295,8 @@ unless ($opt_skip_manual)
system ("bk cat $opt_docdir/Docs/$file.texi > $target_dir/Docs/$file.texi") == 0 system ("bk cat $opt_docdir/Docs/$file.texi > $target_dir/Docs/$file.texi") == 0
or &abort("Could not update $file.texi in $target_dir/Docs/!"); or &abort("Could not update $file.texi in $target_dir/Docs/!");
} }
&run_command("cp $opt_docdir/Docs/Support/texi2html $target_dir/Docs/Support",
"Could not copy $opt_docdir/Docs/Support/texi2html!");
&run_command("rm -f $target_dir/Docs/Images/Makefile*", &run_command("rm -f $target_dir/Docs/Images/Makefile*",
"Could not remove Makefiles in $target_dir/Docs/Images/!"); "Could not remove Makefiles in $target_dir/Docs/Images/!");
......
...@@ -10,8 +10,8 @@ use Sys::Hostname; ...@@ -10,8 +10,8 @@ use Sys::Hostname;
$opt_comment=$opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_comment=$opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env="";
$opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix="";
$opt_tmp=$opt_version_suffix=""; $opt_tmp=$opt_version_suffix="";
$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; $opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=$opt_with_blackhole=0;
$opt_skip_embedded_test=$opt_skip_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=$opt_with_federated=0; $opt_skip_embedded_test=$opt_skip_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=$opt_with_federated=$opt_with_big_tables=0;
$global_step=""; $global_step="";
GetOptions( GetOptions(
...@@ -58,11 +58,13 @@ GetOptions( ...@@ -58,11 +58,13 @@ GetOptions(
"user=s", "user=s",
"version-suffix=s", "version-suffix=s",
"with-archive", "with-archive",
"with-big-tables",
"with-blackhole",
"with-cluster", "with-cluster",
"with-csv", "with-csv",
"with-debug", "with-debug",
"with-example", "with-example",
"with-federated", "with-federated",
"with-low-memory", "with-low-memory",
"with-other-libc=s", "with-other-libc=s",
"with-small-disk", "with-small-disk",
...@@ -275,6 +277,7 @@ if ($opt_stage <= 1) ...@@ -275,6 +277,7 @@ if ($opt_stage <= 1)
$opt_config_options.= " --without-ndb-debug" if ($opt_with_debug && $opt_with_cluster); $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-big-tables" if ($opt_with_big_tables);
$opt_config_options.= " --with-mysqld-ldflags=-all-static" if ($opt_static_server); $opt_config_options.= " --with-mysqld-ldflags=-all-static" if ($opt_static_server);
$opt_config_options.= " --with-raid" if ($opt_raid); $opt_config_options.= " --with-raid" if ($opt_raid);
if ($opt_readline) if ($opt_readline)
...@@ -288,6 +291,7 @@ if ($opt_stage <= 1) ...@@ -288,6 +291,7 @@ if ($opt_stage <= 1)
$opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded); $opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded);
$opt_skip_embedded_test= 1 if ($opt_without_embedded); $opt_skip_embedded_test= 1 if ($opt_without_embedded);
$opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive); $opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive);
$opt_config_options.= " --with-blackhole-storage-engine" if ($opt_with_blackhole);
$opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster); $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster);
$opt_config_options.= " --with-csv-storage-engine" if ($opt_with_csv); $opt_config_options.= " --with-csv-storage-engine" if ($opt_with_csv);
$opt_config_options.= " --with-example-storage-engine" if ($opt_with_example); $opt_config_options.= " --with-example-storage-engine" if ($opt_with_example);
......
...@@ -58,7 +58,7 @@ BSC32=bscmake.exe ...@@ -58,7 +58,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=xilink6.exe LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-opt.exe" # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld.exe"
# SUBTRACT LINK32 /debug # SUBTRACT LINK32 /debug
!ELSEIF "$(CFG)" == "mysqld - Win32 Debug" !ELSEIF "$(CFG)" == "mysqld - Win32 Debug"
...@@ -84,7 +84,7 @@ BSC32=bscmake.exe ...@@ -84,7 +84,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=xilink6.exe LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld-debug.exe" /pdbtype:sept
!ELSEIF "$(CFG)" == "mysqld - Win32 nt" !ELSEIF "$(CFG)" == "mysqld - Win32 nt"
......
...@@ -23,7 +23,8 @@ LIBS = @CLIENT_LIBS@ ...@@ -23,7 +23,8 @@ LIBS = @CLIENT_LIBS@
LDADD= @CLIENT_EXTRA_LDFLAGS@ \ LDADD= @CLIENT_EXTRA_LDFLAGS@ \
$(top_builddir)/libmysql/libmysqlclient.la $(top_builddir)/libmysql/libmysqlclient.la
bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \ bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \
mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen mysqldump mysqlimport mysqltest mysqlbinlog \
mysqltestmanagerc mysqltestmanager-pwgen
noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \ noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
client_priv.h client_priv.h
mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc
...@@ -33,7 +34,8 @@ mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS) ...@@ -33,7 +34,8 @@ mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
mysqltest_SOURCES= mysqltest.c $(top_srcdir)/mysys/my_getsystime.c mysqltest_SOURCES= mysqltest.c $(top_srcdir)/mysys/my_getsystime.c
mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD) mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD)
mysqlbinlog_SOURCES = mysqlbinlog.cc $(top_srcdir)/mysys/mf_tempdir.c mysqlbinlog_SOURCES = mysqlbinlog.cc $(top_srcdir)/mysys/mf_tempdir.c
mysqlmanagerc_SOURCES = mysqlmanagerc.c mysqltestmanagerc_SOURCES = mysqlmanagerc.c
mysqltestmanager_pwgen_SOURCES = mysqlmanager-pwgen.c
sql_src=log_event.h mysql_priv.h log_event.cc my_decimal.h my_decimal.cc sql_src=log_event.h mysql_priv.h log_event.cc my_decimal.h my_decimal.cc
strings_src=decimal.c strings_src=decimal.c
......
This diff is collapsed.
...@@ -636,3 +636,31 @@ fi ...@@ -636,3 +636,31 @@ fi
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_BIG_TABLES
dnl Sets BIG_TABLES if --with-big-tables is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_BIG_TABLES], [
AC_ARG_WITH([big-tables],
[
--with-big-tables Support tables with more than 4 G rows even on 32 bit platforms],
[bigtables="$withval"],
[bigtables=no])
AC_MSG_CHECKING([for big tables support])
case "$bigtables" in
yes )
AC_DEFINE([BIG_TABLES], [1], [Support big tables])
AC_MSG_RESULT([yes])
;;
* )
AC_MSG_RESULT([no])
;;
esac
])
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_BIG_TABLES SECTION
dnl ---------------------------------------------------------------------------
...@@ -351,10 +351,21 @@ then ...@@ -351,10 +351,21 @@ then
if echo $CXX | grep gcc > /dev/null 2>&1 if echo $CXX | grep gcc > /dev/null 2>&1
then then
if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1 GCC_VERSION=`gcc -v 2>&1 | grep version | sed -e 's/[[^0-9. ]]//g; s/^ *//g; s/ .*//g'`
then echo "Using gcc version '$GCC_VERSION'"
CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL" case "$GCC_VERSION" in
fi 3.4.*|3.5.*)
# Statically link the language support function's found in libsupc++.a
LIBS="$LIBS -lsupc++"
echo "Using -libsupc++ for static linking with gcc"
;;
*)
# Using -lsupc++ doesn't work in gcc 3.3 on SuSE 9.2
# (causes link failures when linking things staticly)
CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL"
echo "Using MYSYS_NEW for static linking with gcc"
;;
esac
fi fi
fi fi
...@@ -2373,6 +2384,7 @@ AC_SUBST(readline_basedir) ...@@ -2373,6 +2384,7 @@ AC_SUBST(readline_basedir)
AC_SUBST(readline_link) AC_SUBST(readline_link)
AC_SUBST(readline_h_ln_cmd) AC_SUBST(readline_h_ln_cmd)
MYSQL_CHECK_BIG_TABLES
MYSQL_CHECK_BDB MYSQL_CHECK_BDB
MYSQL_CHECK_INNODB MYSQL_CHECK_INNODB
MYSQL_CHECK_EXAMPLEDB MYSQL_CHECK_EXAMPLEDB
......
...@@ -144,8 +144,8 @@ int vio_close_shared_memory(Vio * vio); ...@@ -144,8 +144,8 @@ int vio_close_shared_memory(Vio * vio);
#if !defined(DONT_MAP_VIO) #if !defined(DONT_MAP_VIO)
#define vio_delete(vio) (vio)->viodelete(vio) #define vio_delete(vio) (vio)->viodelete(vio)
#define vio_errno(vio) (vio)->vioerrno(vio) #define vio_errno(vio) (vio)->vioerrno(vio)
#define vio_read(vio, buf, size) (vio)->read(vio,buf,size) #define vio_read(vio, buf, size) ((vio)->read)(vio,buf,size)
#define vio_write(vio, buf, size) (vio)->write(vio, buf, size) #define vio_write(vio, buf, size) ((vio)->write)(vio, buf, size)
#define vio_blocking(vio, set_blocking_mode, old_mode)\ #define vio_blocking(vio, set_blocking_mode, old_mode)\
(vio)->vioblocking(vio, set_blocking_mode, old_mode) (vio)->vioblocking(vio, set_blocking_mode, old_mode)
#define vio_is_blocking(vio) (vio)->is_blocking(vio) #define vio_is_blocking(vio) (vio)->is_blocking(vio)
......
...@@ -2145,12 +2145,16 @@ row_sel_convert_mysql_key_to_innobase( ...@@ -2145,12 +2145,16 @@ row_sel_convert_mysql_key_to_innobase(
} }
if (dtype_get_mysql_type(dfield_get_type(dfield)) if (dtype_get_mysql_type(dfield_get_type(dfield))
== DATA_MYSQL_TRUE_VARCHAR) { == DATA_MYSQL_TRUE_VARCHAR
&& dfield_get_type(dfield)->mtype != DATA_INT) {
/* In a MySQL key value format, a true VARCHAR is /* In a MySQL key value format, a true VARCHAR is
always preceded by 2 bytes of a length field. always preceded by 2 bytes of a length field.
dfield_get_type(dfield)->len returns the maximum dfield_get_type(dfield)->len returns the maximum
'payload' len in bytes. That does not include the 'payload' len in bytes. That does not include the
2 bytes that tell the actual data length. */ 2 bytes that tell the actual data length.
We added the check != DATA_INT to make sure we do
not treat MySQL ENUM or SET as a true VARCHAR! */
data_len += 2; data_len += 2;
data_field_len += 2; data_field_len += 2;
......
...@@ -4258,6 +4258,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field) ...@@ -4258,6 +4258,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field)
case MYSQL_TYPE_MEDIUM_BLOB: case MYSQL_TYPE_MEDIUM_BLOB:
case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_LONG_BLOB:
case MYSQL_TYPE_BLOB: case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_BIT:
DBUG_ASSERT(param->buffer_length != 0); DBUG_ASSERT(param->buffer_length != 0);
param->fetch_result= fetch_result_bin; param->fetch_result= fetch_result_bin;
break; break;
...@@ -4334,6 +4335,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field) ...@@ -4334,6 +4335,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field)
case MYSQL_TYPE_BLOB: case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_VAR_STRING: case MYSQL_TYPE_VAR_STRING:
case MYSQL_TYPE_STRING: case MYSQL_TYPE_STRING:
case MYSQL_TYPE_BIT:
param->skip_result= skip_result_string; param->skip_result= skip_result_string;
break; break;
default: default:
......
...@@ -421,6 +421,11 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where ...@@ -421,6 +421,11 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
b=? and a = (select ? from t1 where b = ? ) ' ; b=? and a = (select ? from t1 where b = ? ) ' ;
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
# Bug#8807
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
######## correlated subquery ######## correlated subquery
# no parameter # no parameter
prepare stmt1 from ' select a, b FROM t1 outer_table where prepare stmt1 from ' select a, b FROM t1 outer_table where
......
...@@ -84,6 +84,7 @@ CREATE TABLE user ( ...@@ -84,6 +84,7 @@ CREATE TABLE user (
Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
ssl_cipher BLOB NOT NULL, ssl_cipher BLOB NOT NULL,
x509_issuer BLOB NOT NULL, x509_issuer BLOB NOT NULL,
...@@ -98,9 +99,9 @@ CHARACTER SET utf8 COLLATE utf8_bin ...@@ -98,9 +99,9 @@ CHARACTER SET utf8 COLLATE utf8_bin
comment='Users and global privileges'; comment='Users and global privileges';
INSERT INTO user VALUES ('localhost' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user VALUES ('localhost' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
INSERT INTO user VALUES ('@HOSTNAME@%' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user VALUES ('@HOSTNAME@%' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
REPLACE INTO user VALUES ('127.0.0.1' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); REPLACE INTO user VALUES ('127.0.0.1' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
INSERT INTO user (host,user) VALUES ('localhost',''); INSERT INTO user (host,user) VALUES ('localhost','');
INSERT INTO user (host,user) VALUES ('@HOSTNAME@%',''); INSERT INTO user (host,user) VALUES ('@HOSTNAME@%','');
...@@ -147,11 +148,11 @@ comment='Column privileges'; ...@@ -147,11 +148,11 @@ comment='Column privileges';
CREATE TABLE help_topic ( CREATE TABLE help_topic (
help_topic_id int unsigned not null, help_topic_id int unsigned not null,
name varchar(64) not null, name char(64) not null,
help_category_id smallint unsigned not null, help_category_id smallint unsigned not null,
description text not null, description text not null,
example text not null, example text not null,
url varchar(128) not null, url char(128) not null,
primary key (help_topic_id), primary key (help_topic_id),
unique index (name) unique index (name)
) engine=MyISAM ) engine=MyISAM
...@@ -161,9 +162,9 @@ comment='help topics'; ...@@ -161,9 +162,9 @@ comment='help topics';
CREATE TABLE help_category ( CREATE TABLE help_category (
help_category_id smallint unsigned not null, help_category_id smallint unsigned not null,
name varchar(64) not null, name char(64) not null,
parent_category_id smallint unsigned null, parent_category_id smallint unsigned null,
url varchar(128) not null, url char(128) not null,
primary key (help_category_id),unique index (name) primary key (help_category_id),unique index (name)
) engine=MyISAM ) engine=MyISAM
CHARACTER SET utf8 CHARACTER SET utf8
...@@ -172,7 +173,7 @@ comment='help categories'; ...@@ -172,7 +173,7 @@ comment='help categories';
CREATE TABLE help_keyword ( CREATE TABLE help_keyword (
help_keyword_id int unsigned not null, help_keyword_id int unsigned not null,
name varchar(64) not null, name char(64) not null,
primary key (help_keyword_id),unique index (name) primary key (help_keyword_id),unique index (name)
) engine=MyISAM ) engine=MyISAM
CHARACTER SET utf8 CHARACTER SET utf8
......
# -*- cperl -*-
# This is a library file used by the Perl version of mysql-test-run,
# and is part of the translation of the Bourne shell script with the
# same name.
#use Data::Dumper;
use strict;
# $Data::Dumper::Indent= 1;
sub mtr_diff($$);
##############################################################################
#
# This is a simplified unified diff, with some special handling
# of unsorted result sets
#
##############################################################################
# FIXME replace die with mtr_error
#require "mtr_report.pl";
#mtr_diff("a.txt","b.txt");
sub mtr_diff ($$) {
my $file1 = shift;
my $file2 = shift;
# ----------------------------------------------------------------------
# We read in all of the files at once
# ----------------------------------------------------------------------
unless ( open(FILE1, $file1) )
{
mtr_warning("can't open \"$file1\": $!");
return;
}
unless ( open(FILE2, $file2) )
{
mtr_warning("can't open \"$file2\": $!");
return;
}
my $lines1= collect_lines(<FILE1>);
my $lines2= collect_lines(<FILE2>);
close FILE1;
close FILE2;
# print Dumper($lines1);
# print Dumper($lines2);
# ----------------------------------------------------------------------
# We compare line by line, but don't shift off elements until we know
# what to do. This way we use the "restart" method, do simple change
# and restart by entering the diff loop from the beginning again.
# ----------------------------------------------------------------------
my @context;
my @info; # Collect information, and output later
my $lno1= 1;
my $lno2= 1;
while ( @$lines1 or @$lines2 )
{
unless ( @$lines1 )
{
push(@info, map {['+',$lno1,$lno2++,$_]} @$lines2);
last;
}
unless ( @$lines2 )
{
push(@info, map {['-',$lno1++,$lno2,$_]} @$lines1);
last;
}
# ----------------------------------------------------------------------
# We know both have lines
# ----------------------------------------------------------------------
if ( $lines1->[0] eq $lines2->[0] )
{
# Simple case, first line match and all is well
push(@info, ['',$lno1++,$lno2++,$lines1->[0]]);
shift @$lines1;
shift @$lines2;
next;
}
# ----------------------------------------------------------------------
# Now, we know they differ
# ----------------------------------------------------------------------
# How far in the other one, is there a match?
my $idx2= find_next_match($lines1->[0], $lines2);
my $idx1= find_next_match($lines2->[0], $lines1);
# Here we could test "if ( !defined $idx2 or !defined $idx1 )" and
# use a more complicated diff algorithm in the case both contains
# each others lines, just dislocated. But for this application, there
# should be no need.
if ( !defined $idx2 )
{
push(@info, ['-',$lno1++,$lno2,$lines1->[0]]);
shift @$lines1;
}
else
{
push(@info, ['+',$lno1,$lno2++,$lines2->[0]]);
shift @$lines2;
}
}
# ----------------------------------------------------------------------
# Try to output nicely
# ----------------------------------------------------------------------
# print Dumper(\@info);
# We divide into "chunks" to output
# We want at least three lines of context
my @chunks;
my @chunk;
my $state= 'pre'; # 'pre', 'in' and 'post' difference
my $post_count= 0;
foreach my $info ( @info )
{
if ( $info->[0] eq '' and $state eq 'pre' )
{
# Collect no more than three lines of context before diff
push(@chunk, $info);
shift(@chunk) if @chunk > 3;
next;
}
if ( $info->[0] =~ /(\+|\-)/ and $state =~ /(pre|in)/ )
{
# Start/continue collecting diff
$state= 'in';
push(@chunk, $info);
next;
}
if ( $info->[0] eq '' and $state eq 'in' )
{
# Stop collecting diff, and collect context after diff
$state= 'post';
$post_count= 1;
push(@chunk, $info);
next;
}
if ( $info->[0] eq '' and $state eq 'post' and $post_count < 6 )
{
# We might find a new diff sequence soon, continue to collect
# non diffs but five up on 6.
$post_count++;
push(@chunk, $info);
next;
}
if ( $info->[0] eq '' and $state eq 'post' )
{
# We put an end to this, giving three non diff lines to
# the old chunk, and three to the new one.
my @left= splice(@chunk, -3, 3);
push(@chunks, [@chunk]);
$state= 'pre';
$post_count= 0;
@chunk= @left;
next;
}
if ( $info->[0] =~ /(\+|\-)/ and $state eq 'post' )
{
# We didn't split, continue collect diff
$state= 'in';
push(@chunk, $info);
next;
}
}
if ( $post_count > 3 )
{
$post_count -= 3;
splice(@chunk, -$post_count, $post_count);
}
push(@chunks, [@chunk]) if @chunk and $state ne 'pre';
foreach my $chunk ( @chunks )
{
my $from_file_start= $chunk->[0]->[1];
my $to_file_start= $chunk->[0]->[2];
my $from_file_offset= $chunk->[$#$chunk]->[1] - $from_file_start;
my $to_file_offset= $chunk->[$#$chunk]->[2] - $to_file_start;
print "\@\@ -$from_file_start,$from_file_offset ",
"+$to_file_start,$to_file_offset \@\@\n";
foreach my $info ( @$chunk )
{
if ( $info->[0] eq '' )
{
print " $info->[3]\n";
}
elsif ( $info->[0] eq '-' )
{
print "- $info->[3]\n";
}
elsif ( $info->[0] eq '+' )
{
print "+ $info->[3]\n";
}
}
}
# print Dumper(\@chunks);
}
##############################################################################
# Find if the string is found in the array, return the index if found,
# if not found, return "undef"
##############################################################################
sub find_next_match {
my $line= shift;
my $lines= shift;
for ( my $idx= 0; $idx < @$lines; $idx++ )
{
return $idx if $lines->[$idx] eq $line;
}
return undef; # No match found
}
##############################################################################
# Just read the lines, but handle "sets" of lines that are unordered
##############################################################################
sub collect_lines {
my @recordset;
my @lines;
while (@_)
{
my $line= shift @_;
chomp($line);
if ( $line =~ /^\Q%unordered%\E\t/ )
{
push(@recordset, $line);
}
elsif ( @recordset )
{
push(@lines, sort @recordset);
@recordset= (); # Clear it
}
else
{
push(@lines, $line);
}
}
if ( @recordset )
{
push(@lines, sort @recordset);
@recordset= (); # Clear it
}
return \@lines;
}
1;
...@@ -94,6 +94,7 @@ require "lib/mtr_io.pl"; ...@@ -94,6 +94,7 @@ require "lib/mtr_io.pl";
require "lib/mtr_gcov.pl"; require "lib/mtr_gcov.pl";
require "lib/mtr_gprof.pl"; require "lib/mtr_gprof.pl";
require "lib/mtr_report.pl"; require "lib/mtr_report.pl";
require "lib/mtr_diff.pl";
require "lib/mtr_match.pl"; require "lib/mtr_match.pl";
require "lib/mtr_misc.pl"; require "lib/mtr_misc.pl";
...@@ -1665,13 +1666,13 @@ sub mysqld_arguments ($$$$$) { ...@@ -1665,13 +1666,13 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--datadir=%s", $prefix, mtr_add_arg($args, "%s--datadir=%s", $prefix,
$slave->[$idx]->{'path_myddir'}); $slave->[$idx]->{'path_myddir'});
% FIXME slave get this option twice?! # FIXME slave get this option twice?!
mtr_add_arg($args, "%s--exit-info=256", $prefix); mtr_add_arg($args, "%s--exit-info=256", $prefix);
mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix); mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix);
mtr_add_arg($args, "%s--log-bin=%s/var/log/slave%s-bin", $prefix, mtr_add_arg($args, "%s--log-bin=%s/var/log/slave%s-bin", $prefix,
$glob_mysql_test_dir, $sidx); # FIXME use own dir for binlogs $glob_mysql_test_dir, $sidx); # FIXME use own dir for binlogs
mtr_add_arg($args, "%s--log-slave-updates", $prefix); mtr_add_arg($args, "%s--log-slave-updates", $prefix);
% FIXME option duplicated for slave # FIXME option duplicated for slave
mtr_add_arg($args, "%s--log=%s", $prefix, mtr_add_arg($args, "%s--log=%s", $prefix,
$slave->[$idx]->{'path_mylog'}); $slave->[$idx]->{'path_mylog'});
mtr_add_arg($args, "%s--master-retry-count=10", $prefix); mtr_add_arg($args, "%s--master-retry-count=10", $prefix);
......
...@@ -247,7 +247,6 @@ STOP_WAIT_TIMEOUT=10 ...@@ -247,7 +247,6 @@ STOP_WAIT_TIMEOUT=10
MYSQL_TEST_SSL_OPTS="" MYSQL_TEST_SSL_OPTS=""
USE_TIMER="" USE_TIMER=""
USE_EMBEDDED_SERVER="" USE_EMBEDDED_SERVER=""
RESULT_EXT=""
TEST_MODE="" TEST_MODE=""
NDB_MGM_EXTRA_OPTS= NDB_MGM_EXTRA_OPTS=
...@@ -260,7 +259,6 @@ while test $# -gt 0; do ...@@ -260,7 +259,6 @@ while test $# -gt 0; do
USE_EMBEDDED_SERVER=1 USE_EMBEDDED_SERVER=1
USE_MANAGER=0 NO_SLAVE=1 USE_MANAGER=0 NO_SLAVE=1
USE_RUNNING_SERVER=0 USE_RUNNING_SERVER=0
RESULT_EXT=".es"
TEST_MODE="$TEST_MODE embedded" ;; TEST_MODE="$TEST_MODE embedded" ;;
--purify) --purify)
USE_PURIFY=1 USE_PURIFY=1
...@@ -576,9 +574,9 @@ if [ x$SOURCE_DIST = x1 ] ; then ...@@ -576,9 +574,9 @@ if [ x$SOURCE_DIST = x1 ] ; then
CLIENT_BINDIR="$BASEDIR/client" CLIENT_BINDIR="$BASEDIR/client"
MYSQLADMIN="$CLIENT_BINDIR/mysqladmin" MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
WAIT_PID="$BASEDIR/extra/mysql_waitpid" WAIT_PID="$BASEDIR/extra/mysql_waitpid"
MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqlmanagerc" MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqltestmanagerc"
MYSQL_MANAGER="$BASEDIR/tools/mysqlmanager" MYSQL_MANAGER="$BASEDIR/tools/mysqltestmanager"
MYSQL_MANAGER_PWGEN="$CLIENT_BINDIR/mysqlmanager-pwgen" MYSQL_MANAGER_PWGEN="$CLIENT_BINDIR/mysqltestmanager-pwgen"
MYSQL="$CLIENT_BINDIR/mysql" MYSQL="$CLIENT_BINDIR/mysql"
LANGUAGE="$BASEDIR/sql/share/english/" LANGUAGE="$BASEDIR/sql/share/english/"
CHARSETSDIR="$BASEDIR/sql/share/charsets" CHARSETSDIR="$BASEDIR/sql/share/charsets"
...@@ -639,9 +637,9 @@ else ...@@ -639,9 +637,9 @@ else
MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog" MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog"
MYSQLADMIN="$CLIENT_BINDIR/mysqladmin" MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
WAIT_PID="$CLIENT_BINDIR/mysql_waitpid" WAIT_PID="$CLIENT_BINDIR/mysql_waitpid"
MYSQL_MANAGER="$CLIENT_BINDIR/mysqlmanager" MYSQL_MANAGER="$CLIENT_BINDIR/mysqltestmanager"
MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqlmanagerc" MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqltestmanagerc"
MYSQL_MANAGER_PWGEN="$CLIENT_BINDIR/mysqlmanager-pwgen" MYSQL_MANAGER_PWGEN="$CLIENT_BINDIR/mysqltestmanager-pwgen"
MYSQL="$CLIENT_BINDIR/mysql" MYSQL="$CLIENT_BINDIR/mysql"
INSTALL_DB="./install_test_db --bin" INSTALL_DB="./install_test_db --bin"
MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables" MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables"
...@@ -761,13 +759,6 @@ show_failed_diff () ...@@ -761,13 +759,6 @@ show_failed_diff ()
result_file=r/$1.result result_file=r/$1.result
eval_file=r/$1.eval eval_file=r/$1.eval
# If we have an special externsion for result files we use it if we are recording
# or a result file with that extension exists.
if [ -n "$RESULT_EXT" -a \( x$RECORD = x1 -o -f "$result_file$RESULT_EXT" \) ]
then
result_file="$result_file$RESULT_EXT"
fi
if [ -f $eval_file ] if [ -f $eval_file ]
then then
result_file=$eval_file result_file=$eval_file
...@@ -1513,9 +1504,6 @@ run_testcase () ...@@ -1513,9 +1504,6 @@ run_testcase ()
result_file="r/$tname.result" result_file="r/$tname.result"
echo $tname > $CURRENT_TEST echo $tname > $CURRENT_TEST
SKIP_SLAVE=`$EXPR \( $tname : rpl \) = 0 \& \( $tname : federated \) = 0` SKIP_SLAVE=`$EXPR \( $tname : rpl \) = 0 \& \( $tname : federated \) = 0`
if [ -n "$RESULT_EXT" -a \( x$RECORD = x1 -o -f "$result_file$RESULT_EXT" \) ] ; then
result_file="$result_file$RESULT_EXT"
fi
if [ "$USE_MANAGER" = 1 ] ; then if [ "$USE_MANAGER" = 1 ] ; then
many_slaves=`$EXPR \( \( $tname : rpl_failsafe \) != 0 \) \| \( \( $tname : rpl_chain_temp_table \) != 0 \)` many_slaves=`$EXPR \( \( $tname : rpl_failsafe \) != 0 \) \| \( \( $tname : rpl_chain_temp_table \) != 0 \)`
fi fi
...@@ -1573,33 +1561,8 @@ run_testcase () ...@@ -1573,33 +1561,8 @@ run_testcase ()
# script soon anyway so it is not worth it spending the time # script soon anyway so it is not worth it spending the time
if [ "x$USE_EMBEDDED_SERVER" = "x1" -a -z "$DO_TEST" ] ; then if [ "x$USE_EMBEDDED_SERVER" = "x1" -a -z "$DO_TEST" ] ; then
for t in \ for t in \
"alter_table" \ "init_connect" \
"bdb-deadlock" \ "init_file"
"connect" \
"ctype_latin1_de" \
"ctype_ucs" \
"flush_block_commit" \
"grant2" \
"grant_cache" \
"grant" \
"init_connect" \
"init_file" \
"innodb" \
"innodb-deadlock" \
"innodb-lock" \
"mix_innodb_myisam_binlog" \
"mysqlbinlog2" \
"mysqlbinlog" \
"mysqldump" \
"mysql_protocols" \
"packet" \
"ps_1general" \
"rename" \
"show_check" \
"system_mysql_db_fix" \
"timezone2" \
"user_var" \
"variables"
do do
if [ "$tname" = "$t" ] ; then if [ "$tname" = "$t" ] ; then
skip_test $tname skip_test $tname
...@@ -1623,10 +1586,8 @@ run_testcase () ...@@ -1623,10 +1586,8 @@ run_testcase ()
--result-file=*) --result-file=*)
result_file=`$ECHO "$EXTRA_MASTER_OPT" | $SED -e "s;--result-file=;;"` result_file=`$ECHO "$EXTRA_MASTER_OPT" | $SED -e "s;--result-file=;;"`
result_file="r/$result_file.result" result_file="r/$result_file.result"
if [ -n "$RESULT_EXT" -a \( x$RECORD = x1 -o -f "$result_file$RESULT_EXT" \) ] ; then # Note that this must be set to space, not "" for test-reset to
result_file="$result_file$RESULT_EXT" # work
fi
# Note that this must be set to space, not "" for test-reset to work
EXTRA_MASTER_OPT=" " EXTRA_MASTER_OPT=" "
;; ;;
esac esac
......
...@@ -52,9 +52,9 @@ KEY NAME (NAME)); ...@@ -52,9 +52,9 @@ KEY NAME (NAME));
ALTER TABLE t1 CHANGE NAME NAME CHAR(80) not null; ALTER TABLE t1 CHANGE NAME NAME CHAR(80) not null;
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
GROUP_ID int(10) unsigned NULL NO PRI 0 select,insert,update,references GROUP_ID int(10) unsigned NULL NO PRI 0 #
LANG_ID smallint(5) unsigned NULL NO PRI 0 select,insert,update,references LANG_ID smallint(5) unsigned NULL NO PRI 0 #
NAME char(80) latin1_swedish_ci NO MUL select,insert,update,references NAME char(80) latin1_swedish_ci NO MUL #
DROP TABLE t1; DROP TABLE t1;
create table t1 (n int); create table t1 (n int);
insert into t1 values(9),(3),(12),(10); insert into t1 values(9),(3),(12),(10);
...@@ -117,14 +117,6 @@ name ...@@ -117,14 +117,6 @@ name
mysqltest mysqltest
drop table t1; drop table t1;
drop database mysqltest; drop database mysqltest;
create database mysqltest;
create table mysqltest.t1 (a int,b int,c int);
grant all on mysqltest.t1 to mysqltest_1@localhost;
alter table t1 rename t2;
ERROR 42000: INSERT,CREATE command denied to user 'mysqltest_1'@'localhost' for table 't2'
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
create table t1 (n1 int not null, n2 int, n3 int, n4 float, create table t1 (n1 int not null, n2 int, n3 int, n4 float,
unique(n1), unique(n1),
key (n1, n2, n3, n4), key (n1, n2, n3, n4),
......
This diff is collapsed.
...@@ -87,6 +87,8 @@ drop table t1; ...@@ -87,6 +87,8 @@ drop table t1;
SELECT '0x8000000000000001'+0; SELECT '0x8000000000000001'+0;
'0x8000000000000001'+0 '0x8000000000000001'+0
0 0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: '0x8000000000000001'
create table t1 ( create table t1 (
value64 bigint unsigned not null, value64 bigint unsigned not null,
value32 integer not null, value32 integer not null,
......
...@@ -7,6 +7,9 @@ CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER) ...@@ -7,6 +7,9 @@ CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER)
select CONVERT('-1',UNSIGNED); select CONVERT('-1',UNSIGNED);
CONVERT('-1',UNSIGNED) CONVERT('-1',UNSIGNED)
18446744073709551615 18446744073709551615
select CAST('10 ' as unsigned integer);
CAST('10 ' as unsigned integer)
10
select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1; select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1;
cast(-5 as unsigned) | 1 cast(-5 as unsigned) & -1 cast(-5 as unsigned) | 1 cast(-5 as unsigned) & -1
18446744073709551611 18446744073709551611 18446744073709551611 18446744073709551611
...@@ -42,6 +45,15 @@ cast("1:2:3" as TIME) ...@@ -42,6 +45,15 @@ cast("1:2:3" as TIME)
select CONVERT("2004-01-22 21:45:33",DATE); select CONVERT("2004-01-22 21:45:33",DATE);
CONVERT("2004-01-22 21:45:33",DATE) CONVERT("2004-01-22 21:45:33",DATE)
2004-01-22 2004-01-22
select 10+'10';
10+'10'
20
select 10.0+'10';
10.0+'10'
20
select 10E+0+'10';
10E+0+'10'
20
select CONVERT(DATE "2004-01-22 21:45:33" USING latin1); select CONVERT(DATE "2004-01-22 21:45:33" USING latin1);
CONVERT(DATE "2004-01-22 21:45:33" USING latin1) CONVERT(DATE "2004-01-22 21:45:33" USING latin1)
2004-01-22 21:45:33 2004-01-22 21:45:33
...@@ -51,12 +63,43 @@ CONVERT(DATE "2004-01-22 21:45:33",CHAR) ...@@ -51,12 +63,43 @@ CONVERT(DATE "2004-01-22 21:45:33",CHAR)
select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4)); select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4));
CONVERT(DATE "2004-01-22 21:45:33",CHAR(4)) CONVERT(DATE "2004-01-22 21:45:33",CHAR(4))
2004 2004
Warnings:
Warning 1292 Truncated incorrect CHAR(4) value: '2004-01-22 21:45:33'
select CONVERT(DATE "2004-01-22 21:45:33",BINARY(4)); select CONVERT(DATE "2004-01-22 21:45:33",BINARY(4));
CONVERT(DATE "2004-01-22 21:45:33",BINARY(4)) CONVERT(DATE "2004-01-22 21:45:33",BINARY(4))
2004 2004
Warnings:
Warning 1292 Truncated incorrect CHAR(4) value: '2004-01-22 21:45:33'
select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4)); select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4));
CAST(DATE "2004-01-22 21:45:33" AS BINARY(4)) CAST(DATE "2004-01-22 21:45:33" AS BINARY(4))
2004 2004
Warnings:
Warning 1292 Truncated incorrect CHAR(4) value: '2004-01-22 21:45:33'
select cast('-10a' as signed integer);
cast('-10a' as signed integer)
-10
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '-10a'
select cast('a10' as unsigned integer);
cast('a10' as unsigned integer)
0
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'a10'
select 10+'a';
10+'a'
10
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'a'
select 10.0+cast('a' as decimal);
10.0+cast('a' as decimal)
10.00
Warnings:
Error 1366 Incorrect decimal value: '' for column '' at row -1
select 10E+0+'a';
10E+0+'a'
10
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'a'
set names binary; set names binary;
select cast(_latin1'test' as char character set latin2); select cast(_latin1'test' as char character set latin2);
cast(_latin1'test' as char character set latin2) cast(_latin1'test' as char character set latin2)
...@@ -79,12 +122,23 @@ cast(_latin1'a ' AS char(2)) as c4, ...@@ -79,12 +122,23 @@ cast(_latin1'a ' AS char(2)) as c4,
cast(_latin1'a' AS char(2)) as c5; cast(_latin1'a' AS char(2)) as c5;
c1 c2 c3 c4 c5 c1 c2 c3 c4 c5
ab a ab a a ab a ab a a
Warnings:
Warning 1292 Truncated incorrect CHAR(2) value: 'abc'
Warning 1292 Truncated incorrect CHAR(2) value: 'a '
select cast(1000 as CHAR(3));
cast(1000 as CHAR(3))
100
Warnings:
Warning 1292 Truncated incorrect CHAR(3) value: '1000'
create table t1 select create table t1 select
cast(_latin1'ab' AS char) as c1, cast(_latin1'ab' AS char) as c1,
cast(_latin1'a ' AS char) as c2, cast(_latin1'a ' AS char) as c2,
cast(_latin1'abc' AS char(2)) as c3, cast(_latin1'abc' AS char(2)) as c3,
cast(_latin1'a ' AS char(2)) as c4, cast(_latin1'a ' AS char(2)) as c4,
cast(_latin1'a' AS char(2)) as c5; cast(_latin1'a' AS char(2)) as c5;
Warnings:
Warning 1292 Truncated incorrect CHAR(2) value: 'abc'
Warning 1292 Truncated incorrect CHAR(2) value: 'a '
select * from t1; select * from t1;
c1 c2 c3 c4 c5 c1 c2 c3 c4 c5
ab a ab a a ab a ab a a
...@@ -106,12 +160,18 @@ cast(_koi8r' ...@@ -106,12 +160,18 @@ cast(_koi8r'
cast(_koi8r'' AS nchar(2)) as c5; cast(_koi8r'' AS nchar(2)) as c5;
c1 c2 c3 c4 c5 c1 c2 c3 c4 c5
фг ф фг ф ф фг ф фг ф ф
Warnings:
Warning 1292 Truncated incorrect CHAR(4) value: 'фгх'
Warning 1292 Truncated incorrect CHAR(3) value: 'ф '
create table t1 select create table t1 select
cast(_koi8r'' AS nchar) as c1, cast(_koi8r'' AS nchar) as c1,
cast(_koi8r' ' AS nchar) as c2, cast(_koi8r' ' AS nchar) as c2,
cast(_koi8r'' AS nchar(2)) as c3, cast(_koi8r'' AS nchar(2)) as c3,
cast(_koi8r' ' AS nchar(2)) as c4, cast(_koi8r' ' AS nchar(2)) as c4,
cast(_koi8r'' AS nchar(2)) as c5; cast(_koi8r'' AS nchar(2)) as c5;
Warnings:
Warning 1292 Truncated incorrect CHAR(4) value: 'фгх'
Warning 1292 Truncated incorrect CHAR(3) value: 'ф '
select * from t1; select * from t1;
c1 c2 c3 c4 c5 c1 c2 c3 c4 c5
фг ф фг ф ф фг ф фг ф ф
...@@ -167,6 +227,10 @@ a CAST(a AS CHAR(3)) ...@@ -167,6 +227,10 @@ a CAST(a AS CHAR(3))
aac aac aac aac
aab aab aab aab
aaa aaa aaa aaa
Warnings:
Warning 1292 Truncated incorrect CHAR(2) value: 'aaa'
Warning 1292 Truncated incorrect CHAR(2) value: 'aab'
Warning 1292 Truncated incorrect CHAR(2) value: 'aac'
SELECT a, CAST(a AS UNSIGNED) FROM t1 ORDER BY CAST(a AS CHAR) ; SELECT a, CAST(a AS UNSIGNED) FROM t1 ORDER BY CAST(a AS CHAR) ;
a CAST(a AS UNSIGNED) a CAST(a AS UNSIGNED)
aaa 3 aaa 3
...@@ -177,6 +241,10 @@ a CAST(a AS CHAR(2)) ...@@ -177,6 +241,10 @@ a CAST(a AS CHAR(2))
aaa aa aaa aa
aab aa aab aa
aac aa aac aa
Warnings:
Warning 1292 Truncated incorrect CHAR(2) value: 'aaa'
Warning 1292 Truncated incorrect CHAR(2) value: 'aab'
Warning 1292 Truncated incorrect CHAR(2) value: 'aac'
DROP TABLE t1; DROP TABLE t1;
select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour); select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour);
date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour) date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour)
......
...@@ -44,12 +44,24 @@ create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ...@@ -44,12 +44,24 @@ create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ERROR 42000: Incorrect table name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ERROR 42000: Incorrect table name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int); create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int);
ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long
create table test (a datetime default now()); create table t1 (a datetime default now());
ERROR 42000: Invalid default value for 'a' ERROR 42000: Invalid default value for 'a'
create table test (a datetime on update now()); create table t1 (a datetime on update now());
ERROR HY000: Invalid ON UPDATE clause for 'a' column ERROR HY000: Invalid ON UPDATE clause for 'a' column
create table test (a int default 100 auto_increment); create table t1 (a int default 100 auto_increment);
ERROR 42000: Invalid default value for 'a' ERROR 42000: Invalid default value for 'a'
create table t1 (a tinyint default 1000);
ERROR 42000: Invalid default value for 'a'
create table t1 (a varchar(5) default 'abcdef');
ERROR 42000: Invalid default value for 'a'
create table t1 (a varchar(5) default 'abcde');
insert into t1 values();
select * from t1;
a
abcde
alter table t1 alter column a set default 'abcdef';
ERROR 42000: Invalid default value for 'a'
drop table t1;
create table 1ea10 (1a20 int,1e int); create table 1ea10 (1a20 int,1e int);
insert into 1ea10 values(1,1); insert into 1ea10 values(1,1);
select 1ea10.1a20,1e+ 1e+10 from 1ea10; select 1ea10.1a20,1e+ 1e+10 from 1ea10;
......
drop table if exists t1; drop table if exists t1;
SET NAMES cp1251; SET NAMES cp1251;
create table t1 (a varchar(10) not null); create table t1 (a varchar(10) not null) character set cp1251;
insert into t1 values ("a"),("ab"),("abc"); insert into t1 values ("a"),("ab"),("abc");
select * from t1; select * from t1;
a a
...@@ -23,7 +23,7 @@ a ...@@ -23,7 +23,7 @@ a
b b
c c
drop table t1; drop table t1;
create table t1 (a char(15) binary, b binary(15)); create table t1 (a char(15) binary, b binary(15)) character set cp1251;
insert into t1 values ('aaa','bbb'),('AAA','BBB'); insert into t1 values ('aaa','bbb'),('AAA','BBB');
select upper(a),upper(b) from t1; select upper(a),upper(b) from t1;
upper(a) upper(b) upper(a) upper(b)
......
...@@ -1759,8 +1759,8 @@ P,p ...@@ -1759,8 +1759,8 @@ P,p
Ƥ,ƥ Ƥ,ƥ
Q,q Q,q
ĸ ĸ
R,RR,Rr,r,rr,Ŕ,ŕ,Ŗ,ŗ,Ř,ř R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
rR RR,Rr,rR,rr
Ʀ Ʀ
S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ
SS,Ss,sS,ss,ß SS,Ss,sS,ss,ß
......
...@@ -518,28 +518,6 @@ prepare stmt1 from @str2; ...@@ -518,28 +518,6 @@ prepare stmt1 from @str2;
execute stmt1 using @ivar; execute stmt1 using @ivar;
? ?
1234 1234
SET TIMESTAMP=10000;
create table t2 (c char(30)) charset=ucs2;
set @v=convert('abc' using ucs2);
reset master;
insert into t2 values (@v);
show binlog events from 98;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # User var 1 # @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
master-bin.000001 # Query 1 # use `test`; insert into t2 values (@v)
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
ROLLBACK;
SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`;
use test;
SET TIMESTAMP=10000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t2 values (@v);
ROLLBACK;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
drop table t2;
set names latin1; set names latin1;
create table t1 (a enum('x','y','z') character set ucs2); create table t1 (a enum('x','y','z') character set ucs2);
show create table t1; show create table t1;
......
SET TIMESTAMP=10000;
create table t2 (c char(30)) charset=ucs2;
set @v=convert('abc' using ucs2);
reset master;
insert into t2 values (@v);
show binlog events from 98;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 User var 1 138 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
master-bin.000001 138 Query 1 227 use `test`; insert into t2 values (@v)
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
ROLLBACK;
SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`;
use test;
SET TIMESTAMP=10000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t2 values (@v);
ROLLBACK;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
drop table t2;
...@@ -79,6 +79,11 @@ concat('%d-%m-%Y',' ','%H:%i:%s.%f')); ...@@ -79,6 +79,11 @@ concat('%d-%m-%Y',' ','%H:%i:%s.%f'));
str_to_date(concat('15-01-2001',' 2:59:58.999'), str_to_date(concat('15-01-2001',' 2:59:58.999'),
concat('%d-%m-%Y',' ','%H:%i:%s.%f')) concat('%d-%m-%Y',' ','%H:%i:%s.%f'))
2001-01-15 02:59:58.999000 2001-01-15 02:59:58.999000
select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T');
STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T')
NULL
Warnings:
Error 1411 Incorrect time value: '22.30.61' for function str_to_time
create table t1 (date char(30), format char(30) not null); create table t1 (date char(30), format char(30) not null);
insert into t1 values insert into t1 values
('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'), ('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'),
...@@ -335,6 +340,22 @@ Tuesday 52 2001 %W %V %Y NULL ...@@ -335,6 +340,22 @@ Tuesday 52 2001 %W %V %Y NULL
Tuesday 52 2001 %W %u %x NULL Tuesday 52 2001 %W %u %x NULL
7 53 1998 %w %u %Y NULL 7 53 1998 %w %u %Y NULL
NULL %m.%d.%Y NULL NULL %m.%d.%Y NULL
Warnings:
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_time
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_time
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_time
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time
Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_time
Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_time
Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_time
Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_time
Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_time
Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_time
Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time
Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time
Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time
Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_time
select date,format,concat(str_to_date(date, format),'') as con from t1; select date,format,concat(str_to_date(date, format),'') as con from t1;
date format con date format con
2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL 2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL
...@@ -353,6 +374,22 @@ Tuesday 52 2001 %W %V %Y NULL ...@@ -353,6 +374,22 @@ Tuesday 52 2001 %W %V %Y NULL
Tuesday 52 2001 %W %u %x NULL Tuesday 52 2001 %W %u %x NULL
7 53 1998 %w %u %Y NULL 7 53 1998 %w %u %Y NULL
NULL %m.%d.%Y NULL NULL %m.%d.%Y NULL
Warnings:
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_time
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_time
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_time
Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time
Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_time
Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_time
Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_time
Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_time
Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_time
Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_time
Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time
Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time
Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time
Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_time
truncate table t1; truncate table t1;
insert into t1 values insert into t1 values
('10:20:10AM', '%h:%i:%s'), ('10:20:10AM', '%h:%i:%s'),
...@@ -391,6 +428,8 @@ NULL ...@@ -391,6 +428,8 @@ NULL
select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')); select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA'));
str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')) str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA'))
NULL NULL
Warnings:
Error 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_time
explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001"); explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001");
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 NULL NULL NULL NULL NULL NULL NULL No tables used 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
......
...@@ -24,6 +24,20 @@ n ...@@ -24,6 +24,20 @@ n
drop database if exists mysqltest; drop database if exists mysqltest;
affected rows: 1 affected rows: 1
create database mysqltest; create database mysqltest;
use mysqltest;
drop table table1, table2, table3, table4, table5, table6,
table7, table8, table9, table10, table11, table12, table13,
table14, table15, table16, table17, table18, table19, table20,
table21, table22, table23, table24, table25, table26, table27,
table28;
ERROR 42S02: Unknown table 'table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12,table13,table14,table15,table16,table17,table18,table19,table20,table21,table22,table23,table'
drop table table1, table2, table3, table4, table5, table6,
table7, table8, table9, table10, table11, table12, table13,
table14, table15, table16, table17, table18, table19, table20,
table21, table22, table23, table24, table25, table26, table27,
table28, table29, table30;
ERROR 42S02: Unknown table 'table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12,table13,table14,table15,table16,table17,table18,table19,table20,table21,table22,table23,table'
use test;
drop database mysqltest; drop database mysqltest;
flush tables with read lock; flush tables with read lock;
create database mysqltest; create database mysqltest;
......
reset master;
create database `drop-temp+table-test`;
use `drop-temp+table-test`;
create temporary table `table:name` (a int);
select get_lock("a",10);
get_lock("a",10)
1
select get_lock("a",10);
get_lock("a",10)
1
show binlog events;
drop database `drop-temp+table-test`;
...@@ -783,7 +783,7 @@ insert into t1 values (now()); ...@@ -783,7 +783,7 @@ insert into t1 values (now());
create table t2 select f2 from (select max(now()) f2 from t1) a; create table t2 select f2 from (select max(now()) f2 from t1) a;
show columns from t2; show columns from t2;
Field Type Null Key Default Extra Field Type Null Key Default Extra
f2 datetime NO 0000-00-00 00:00:00 f2 datetime YES NULL
drop table t2; drop table t2;
create table t2 select f2 from (select now() f2 from t1) a; create table t2 select f2 from (select now() f2 from t1) a;
show columns from t2; show columns from t2;
......
...@@ -44,21 +44,26 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -44,21 +44,26 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using filesort 1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using filesort
Warnings: Warnings:
Note 1003 select if((`test`.`t1`.`u` = 1),`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary)) AS `s` from `test`.`t1` where (`test`.`t1`.`st` like _latin1'%a%') order by if((`test`.`t1`.`u` = 1),`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary)) Note 1003 select if((`test`.`t1`.`u` = 1),`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary)) AS `s` from `test`.`t1` where (`test`.`t1`.`st` like _latin1'%a%') order by if((`test`.`t1`.`u` = 1),`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary))
select nullif(u=0, 'test') from t1; select nullif(u, 1) from t1;
nullif(u=0, 'test') nullif(u, 1)
NULL NULL
NULL NULL
NULL NULL
NULL NULL
NULL NULL
1 0
1 0
explain extended select nullif(u=0, 'test') from t1; explain extended select nullif(u, 1) from t1;
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 7 1 SIMPLE t1 ALL NULL NULL NULL NULL 7
Warnings: Warnings:
Note 1003 select nullif((`test`.`t1`.`u` = 0),_latin1'test') AS `nullif(u=0, 'test')` from `test`.`t1` Note 1003 select nullif(`test`.`t1`.`u`,1) AS `nullif(u, 1)` from `test`.`t1`
drop table t1; drop table t1;
select nullif(1,'test');
nullif(1,'test')
1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'test'
select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test"); select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test");
NULLIF(NULL,NULL) NULLIF(NULL,1) NULLIF(NULL,1.0) NULLIF(NULL,"test") NULLIF(NULL,NULL) NULLIF(NULL,1) NULLIF(NULL,1.0) NULLIF(NULL,"test")
NULL NULL NULL NULL NULL NULL NULL NULL
......
...@@ -25,6 +25,8 @@ length(uuid()) charset(uuid()) length(unhex(replace(uuid(),_utf8'-',_utf8''))) ...@@ -25,6 +25,8 @@ length(uuid()) charset(uuid()) length(unhex(replace(uuid(),_utf8'-',_utf8'')))
select length(format('nan', 2)) > 0; select length(format('nan', 2)) > 0;
length(format('nan', 2)) > 0 length(format('nan', 2)) > 0
1 1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'nan'
select concat("$",format(2500,2)); select concat("$",format(2500,2));
concat("$",format(2500,2)) concat("$",format(2500,2))
$2,500.00 $2,500.00
......
drop table if exists t1; drop table if exists t1,t2;
set names latin1; set names latin1;
select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo'; select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo';
hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo
...@@ -236,6 +236,8 @@ Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - t ...@@ -236,6 +236,8 @@ Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - t
select position("0" in "baaa" in (1)),position("0" in "1" in (1,2,3)),position("sql" in ("mysql")); select position("0" in "baaa" in (1)),position("0" in "1" in (1,2,3)),position("sql" in ("mysql"));
position("0" in "baaa" in (1)) position("0" in "1" in (1,2,3)) position("sql" in ("mysql")) position("0" in "baaa" in (1)) position("0" in "1" in (1,2,3)) position("sql" in ("mysql"))
1 0 3 1 0 3
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'baaa'
select position(("1" in (1,2,3)) in "01"); select position(("1" in (1,2,3)) in "01");
position(("1" in (1,2,3)) in "01") position(("1" in (1,2,3)) in "01")
2 2
...@@ -393,9 +395,9 @@ select FIELD(_latin2'b','A','B'); ...@@ -393,9 +395,9 @@ select FIELD(_latin2'b','A','B');
ERROR HY000: Illegal mix of collations (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'field' ERROR HY000: Illegal mix of collations (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'field'
select FIELD('b',_latin2'A','B'); select FIELD('b',_latin2'A','B');
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'field' ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'field'
select FIELD('b',_latin2'A','B',1); select FIELD('1',_latin2'3','2',1);
FIELD('b',_latin2'A','B',1) FIELD('1',_latin2'3','2',1)
1 3
select POSITION(_latin1'B' IN _latin1'abcd'); select POSITION(_latin1'B' IN _latin1'abcd');
POSITION(_latin1'B' IN _latin1'abcd') POSITION(_latin1'B' IN _latin1'abcd')
2 2
......
...@@ -304,6 +304,8 @@ NULL ...@@ -304,6 +304,8 @@ NULL
select date_sub("0000-00-00 00:00:00",INTERVAL 1 SECOND); select date_sub("0000-00-00 00:00:00",INTERVAL 1 SECOND);
date_sub("0000-00-00 00:00:00",INTERVAL 1 SECOND) date_sub("0000-00-00 00:00:00",INTERVAL 1 SECOND)
NULL NULL
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00 00:00:00'
select date_add('1998-01-30',Interval 1 month); select date_add('1998-01-30',Interval 1 month);
date_add('1998-01-30',Interval 1 month) date_add('1998-01-30',Interval 1 month)
1998-02-28 1998-02-28
...@@ -424,6 +426,9 @@ insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00"); ...@@ -424,6 +426,9 @@ insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00");
select dayofyear("0000-00-00"),dayofyear(d),dayofyear(dt),dayofyear(t),dayofyear(c) from t1; select dayofyear("0000-00-00"),dayofyear(d),dayofyear(dt),dayofyear(t),dayofyear(c) from t1;
dayofyear("0000-00-00") dayofyear(d) dayofyear(dt) dayofyear(t) dayofyear(c) dayofyear("0000-00-00") dayofyear(d) dayofyear(dt) dayofyear(t) dayofyear(c)
NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00'
Warning 1292 Truncated incorrect datetime value: '0000-00-00'
select dayofmonth("0000-00-00"),dayofmonth(d),dayofmonth(dt),dayofmonth(t),dayofmonth(c) from t1; select dayofmonth("0000-00-00"),dayofmonth(d),dayofmonth(dt),dayofmonth(t),dayofmonth(c) from t1;
dayofmonth("0000-00-00") dayofmonth(d) dayofmonth(dt) dayofmonth(t) dayofmonth(c) dayofmonth("0000-00-00") dayofmonth(d) dayofmonth(dt) dayofmonth(t) dayofmonth(c)
0 0 0 0 0 0 0 0 0 0
...@@ -436,15 +441,24 @@ quarter("0000-00-00") quarter(d) quarter(dt) quarter(t) quarter(c) ...@@ -436,15 +441,24 @@ quarter("0000-00-00") quarter(d) quarter(dt) quarter(t) quarter(c)
select week("0000-00-00"),week(d),week(dt),week(t),week(c) from t1; select week("0000-00-00"),week(d),week(dt),week(t),week(c) from t1;
week("0000-00-00") week(d) week(dt) week(t) week(c) week("0000-00-00") week(d) week(dt) week(t) week(c)
NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00'
Warning 1292 Truncated incorrect datetime value: '0000-00-00'
select year("0000-00-00"),year(d),year(dt),year(t),year(c) from t1; select year("0000-00-00"),year(d),year(dt),year(t),year(c) from t1;
year("0000-00-00") year(d) year(dt) year(t) year(c) year("0000-00-00") year(d) year(dt) year(t) year(c)
0 0 0 0 0 0 0 0 0 0
select yearweek("0000-00-00"),yearweek(d),yearweek(dt),yearweek(t),yearweek(c) from t1; select yearweek("0000-00-00"),yearweek(d),yearweek(dt),yearweek(t),yearweek(c) from t1;
yearweek("0000-00-00") yearweek(d) yearweek(dt) yearweek(t) yearweek(c) yearweek("0000-00-00") yearweek(d) yearweek(dt) yearweek(t) yearweek(c)
NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00'
Warning 1292 Truncated incorrect datetime value: '0000-00-00'
select to_days("0000-00-00"),to_days(d),to_days(dt),to_days(t),to_days(c) from t1; select to_days("0000-00-00"),to_days(d),to_days(dt),to_days(t),to_days(c) from t1;
to_days("0000-00-00") to_days(d) to_days(dt) to_days(t) to_days(c) to_days("0000-00-00") to_days(d) to_days(dt) to_days(t) to_days(c)
NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
Warnings:
Warning 1292 Truncated incorrect datetime value: '0000-00-00'
Warning 1292 Truncated incorrect datetime value: '0000-00-00'
select extract(MONTH FROM "0000-00-00"),extract(MONTH FROM d),extract(MONTH FROM dt),extract(MONTH FROM t),extract(MONTH FROM c) from t1; select extract(MONTH FROM "0000-00-00"),extract(MONTH FROM d),extract(MONTH FROM dt),extract(MONTH FROM t),extract(MONTH FROM c) from t1;
extract(MONTH FROM "0000-00-00") extract(MONTH FROM d) extract(MONTH FROM dt) extract(MONTH FROM t) extract(MONTH FROM c) extract(MONTH FROM "0000-00-00") extract(MONTH FROM d) extract(MONTH FROM dt) extract(MONTH FROM t) extract(MONTH FROM c)
0 0 0 0 0 0 0 0 0 0
......
...@@ -461,3 +461,11 @@ Shutdown Server Admin To shut down the server ...@@ -461,3 +461,11 @@ Shutdown Server Admin To shut down the server
Super Server Admin To use KILL thread, SET GLOBAL, CHANGE MASTER, etc. Super Server Admin To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.
Update Tables To update existing rows Update Tables To update existing rows
Usage Server Admin No privileges - allow connect only Usage Server Admin No privileges - allow connect only
create database mysqltest;
create table mysqltest.t1 (a int,b int,c int);
grant all on mysqltest.t1 to mysqltest_1@localhost;
alter table t1 rename t2;
ERROR 42000: INSERT,CREATE command denied to user 'mysqltest_1'@'localhost' for table 't2'
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
...@@ -59,6 +59,7 @@ current_user() ...@@ -59,6 +59,7 @@ current_user()
mysqltest_1@localhost mysqltest_1@localhost
show databases; show databases;
Database Database
information_schema
mysqltest_1 mysqltest_1
test test
grant all privileges on `mysqltest_1`.* to mysqltest_1@localhost with grant option; grant all privileges on `mysqltest_1`.* to mysqltest_1@localhost with grant option;
......
...@@ -677,3 +677,28 @@ select sum(a)*sum(b) as d from t1 where a=1 group by c having d > 0; ...@@ -677,3 +677,28 @@ select sum(a)*sum(b) as d from t1 where a=1 group by c having d > 0;
d d
10 10
drop table t1; drop table t1;
create table t1(a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(8),(9);
create table t2 (
a int,
b varchar(200) NOT NULL,
c varchar(50) NOT NULL,
d varchar(100) NOT NULL,
primary key (a,b(132),c,d),
key a (a,b)
) charset=utf8;
insert into t2 select
x3.a, -- 3
concat('val-', x3.a + 3*x4.a), -- 12
concat('val-', @a:=x3.a + 3*x4.a + 12*C.a), -- 120
concat('val-', @a + 120*D.a)
from t1 x3, t1 x4, t1 C, t1 D where x3.a < 3 and x4.a < 4 and D.a < 4;
delete from t2 where a = 2 and b = 'val-2' order by a,b,c,d limit 30;
explain select c from t2 where a = 2 and b = 'val-2' group by c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref PRIMARY,a PRIMARY 402 const,const 6 Using where
select c from t2 where a = 2 and b = 'val-2' group by c;
c
val-74
val-98
drop table t1,t2;
...@@ -133,7 +133,7 @@ c varchar(64) utf8_general_ci NO select,insert,update,references ...@@ -133,7 +133,7 @@ c varchar(64) utf8_general_ci NO select,insert,update,references
select * from information_schema.COLUMNS where table_name="t1" select * from information_schema.COLUMNS where table_name="t1"
and column_name= "a"; and column_name= "a";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME 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 TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME 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
NULL testtets t1 a 1 NULL YES int 11 11 11 0 NULL NULL int(11) select,insert,update,references NULL testtets t1 a 1 NULL YES int NULL NULL 11 0 NULL NULL int(11) select,insert,update,references
show columns from testtets.t1 where field like "%a%"; show columns from testtets.t1 where field like "%a%";
Field Type Null Key Default Extra Field Type Null Key Default Extra
a int(11) YES NULL a int(11) YES NULL
...@@ -476,15 +476,15 @@ select COLUMN_NAME,COLUMN_TYPE, CHARACTER_MAXIMUM_LENGTH, ...@@ -476,15 +476,15 @@ select COLUMN_NAME,COLUMN_TYPE, CHARACTER_MAXIMUM_LENGTH,
CHARACTER_OCTET_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE CHARACTER_OCTET_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE
from information_schema.columns where table_name= 't1'; from information_schema.columns where table_name= 't1';
COLUMN_NAME COLUMN_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE COLUMN_NAME COLUMN_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE
a decimal(5,3) 7 7 5 3 a decimal(5,3) NULL NULL 5 3
b decimal(5,1) 7 7 5 1 b decimal(5,1) NULL NULL 5 1
c float(5,2) 5 5 5 2 c float(5,2) NULL NULL 5 2
d decimal(6,4) 8 8 6 4 d decimal(6,4) NULL NULL 6 4
e float 12 12 12 NULL e float NULL NULL 12 NULL
f decimal(6,3) 8 8 6 3 f decimal(6,3) NULL NULL 6 3
g int(11) 11 11 11 0 g int(11) NULL NULL 11 0
h double(10,3) 10 10 10 3 h double(10,3) NULL NULL 10 3
i double 22 22 22 NULL i double NULL NULL 22 NULL
drop table t1; drop table t1;
create table t115 as select table_name, column_name, column_type create table t115 as select table_name, column_name, column_type
from information_schema.columns where table_name = 'proc'; from information_schema.columns where table_name = 'proc';
...@@ -678,3 +678,25 @@ WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA ...@@ -678,3 +678,25 @@ WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
AND A.TABLE_NAME = B.TABLE_NAME); AND A.TABLE_NAME = B.TABLE_NAME);
COUNT(*) COUNT(*)
0 0
create table t1
( x_bigint BIGINT,
x_integer INTEGER,
x_smallint SMALLINT,
x_decimal DECIMAL(5,3),
x_numeric NUMERIC(5,3),
x_real REAL,
x_float FLOAT,
x_double_precision DOUBLE PRECISION );
SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME= 't1';
COLUMN_NAME CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH
x_bigint NULL NULL
x_integer NULL NULL
x_smallint NULL NULL
x_decimal NULL NULL
x_numeric NULL NULL
x_real NULL NULL
x_float NULL NULL
x_double_precision NULL NULL
drop table t1;
create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=innodb;
select * from t1;
c1 c2 stamp
replace delayed into t1 (c1, c2) values ( "text1","11"),( "text2","12");
ERROR HY000: Table storage engine for 't1' doesn't have this option
select * from t1;
c1 c2 stamp
replace delayed into t1 (c1, c2) values ( "text1","12"),( "text2","13"),( "text3","14", "a" ),( "text4","15", "b" );
ERROR HY000: Table storage engine for 't1' doesn't have this option
select * from t1;
c1 c2 stamp
drop table t1;
...@@ -1437,18 +1437,6 @@ id label ...@@ -1437,18 +1437,6 @@ id label
3524 Societe Test 3524 Societe Test
3525 Fournisseur Test 3525 Fournisseur Test
drop table t1,t2; drop table t1,t2;
create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=innodb;
select * from t1;
c1 c2 stamp
replace delayed into t1 (c1, c2) values ( "text1","11"),( "text2","12");
ERROR HY000: Table storage engine for 't1' doesn't have this option
select * from t1;
c1 c2 stamp
replace delayed into t1 (c1, c2) values ( "text1","12"),( "text2","13"),( "text3","14", "a" ),( "text4","15", "b" );
ERROR HY000: Table storage engine for 't1' doesn't have this option
select * from t1;
c1 c2 stamp
drop table t1;
create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=myisam; create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=myisam;
create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=innodb; create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=innodb;
create table t3 (a int, b varchar(200), c text not null) checksum=1 engine=innodb; create table t3 (a int, b varchar(200), c text not null) checksum=1 engine=innodb;
...@@ -1618,7 +1606,7 @@ t2 CREATE TABLE `t2` ( ...@@ -1618,7 +1606,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2; drop table t2;
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
ERROR HY000: Can't create table './test/t2.frm' (errno: 150) ERROR HY000: Can't create table './test/t2' (errno: 150)
create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb; create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
show create table t2; show create table t2;
Table Create Table Table Create Table
...@@ -2372,7 +2360,7 @@ length(v) ...@@ -2372,7 +2360,7 @@ length(v)
65530 65530
drop table t1; drop table t1;
create table t1 (v varchar(65530), key(v)); create table t1 (v varchar(65530), key(v));
ERROR HY000: Can't create table './test/t1.frm' (errno: 139) ERROR HY000: Can't create table './test/t1' (errno: 139)
create table t1 (v varchar(65536)); create table t1 (v varchar(65536));
Warnings: Warnings:
Note 1246 Converting column 'v' from VARCHAR to TEXT Note 1246 Converting column 'v' from VARCHAR to TEXT
......
This diff is collapsed.
create table t1(a int, unique(a));
insert into t1 values(2);
create table t2(a int);
insert into t2 values(1),(2);
reset master;
insert into t1 select * from t2;
ERROR 23000: Duplicate entry '2' for key 1
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
master-bin.000001 98 Query 1 192 use `test`; insert into t1 select * from t2
select * from t1;
a
1
2
drop table t1, t2;
create table t1(a int);
insert into t1 values(1),(1);
reset master;
create table t2(unique(a)) select a from t1;
ERROR 23000: Duplicate entry '1' for key 1
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
drop table t1;
...@@ -65,31 +65,6 @@ INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip) ...@@ -65,31 +65,6 @@ INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM t2 SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC; WHERE numeropost=9 ORDER BY numreponse ASC;
DROP TABLE t1,t2; DROP TABLE t1,t2;
create table t1(a int, unique(a));
insert into t1 values(2);
create table t2(a int);
insert into t2 values(1),(2);
reset master;
insert into t1 select * from t2;
ERROR 23000: Duplicate entry '2' for key 1
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query 1 # use `test`; insert into t1 select * from t2
select * from t1;
a
1
2
drop table t1, t2;
create table t1(a int);
insert into t1 values(1),(1);
reset master;
create table t2(unique(a)) select a from t1;
ERROR 23000: Duplicate entry '1' for key 1
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
drop table t1;
create table t1 (a int not null); create table t1 (a int not null);
create table t2 (a int not null); create table t2 (a int not null);
insert into t1 values (1); insert into t1 values (1);
......
drop table if exists t1,t2;
create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLINT UNSIGNED NOT NULL);
insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12);
create table t2 (payoutID SMALLINT UNSIGNED NOT NULL PRIMARY KEY);
insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1;
insert into t2 (payoutID) SELECT payoutID+10 FROM t1;
ERROR 23000: Duplicate entry '16' for key 1
insert ignore into t2 (payoutID) SELECT payoutID+10 FROM t1;
select * from t2;
payoutID
1
4
6
9
10
11
12
14
16
19
20
22
drop table t1,t2;
CREATE TABLE `t1` (
`numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0',
`numreponse` bigint(20) unsigned NOT NULL auto_increment,
`contenu` text NOT NULL,
`pseudo` varchar(50) NOT NULL default '',
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`ip` bigint(11) NOT NULL default '0',
`signature` tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (`numeropost`,`numreponse`)
,KEY `ip` (`ip`),
KEY `date` (`date`),
KEY `pseudo` (`pseudo`),
KEY `numreponse` (`numreponse`)
) ENGINE=MyISAM;
CREATE TABLE `t2` (
`numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0',
`numreponse` bigint(20) unsigned NOT NULL auto_increment,
`contenu` text NOT NULL,
`pseudo` varchar(50) NOT NULL default '',
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`ip` bigint(11) NOT NULL default '0',
`signature` tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (`numeropost`,`numreponse`),
KEY `ip` (`ip`),
KEY `date` (`date`),
KEY `pseudo` (`pseudo`),
KEY `numreponse` (`numreponse`)
) ENGINE=MyISAM;
INSERT INTO t2
(numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES
(9,1,56,'test','joce','2001-07-25 13:50:53'
,3649052399,0);
INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC;
show variables like '%bulk%';
Variable_name Value
bulk_insert_buffer_size 8388608
INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC;
DROP TABLE t1,t2;
create table t1(a int, unique(a));
insert into t1 values(2);
create table t2(a int);
insert into t2 values(1),(2);
reset master;
insert into t1 select * from t2;
ERROR 23000: Duplicate entry '2' for key 1
show binlog events;
select * from t1;
a
1
2
drop table t1, t2;
create table t1(a int);
insert into t1 values(1),(1);
reset master;
create table t2(unique(a)) select a from t1;
ERROR 23000: Duplicate entry '1' for key 1
show binlog events;
drop table t1;
create table t1 (a int not null);
create table t2 (a int not null);
insert into t1 values (1);
insert into t1 values (a+2);
insert into t1 values (a+3);
insert into t1 values (4),(a+5);
insert into t1 select * from t1;
select * from t1;
a
1
2
3
4
5
1
2
3
4
5
insert into t1 select * from t1 as t2;
select * from t1;
a
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
insert into t2 select * from t1 as t2;
select * from t1;
a
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
insert into t1 select t2.a from t1,t2;
select * from t1;
a
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
insert into t1 select * from t1,t1;
ERROR 42000: Not unique table/alias: 't1'
drop table t1,t2;
create table t1 (a int not null primary key, b char(10));
create table t2 (a int not null, b char(10));
insert into t1 values (1,"t1:1"),(3,"t1:3");
insert into t2 values (2,"t2:2"), (3,"t2:3");
insert into t1 select * from t2;
ERROR 23000: Duplicate entry '3' for key 1
select * from t1;
a b
1 t1:1
3 t1:3
2 t2:2
replace into t1 select * from t2;
select * from t1;
a b
1 t1:1
3 t2:3
2 t2:2
drop table t1,t2;
CREATE TABLE t1 ( USID INTEGER UNSIGNED, ServerID TINYINT UNSIGNED, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User CHAR(32) NOT NULL DEFAULT '<UNKNOWN>', NASAddr INTEGER UNSIGNED, NASPort INTEGER UNSIGNED, NASPortType INTEGER UNSIGNED, ConnectSpeed INTEGER UNSIGNED, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER UNSIGNED, SessionTime INTEGER UNSIGNED, PacketsIn INTEGER UNSIGNED, OctetsIn INTEGER UNSIGNED, PacketsOut INTEGER UNSIGNED, OctetsOut INTEGER UNSIGNED, TerminateCause INTEGER UNSIGNED, UnauthTime TINYINT UNSIGNED, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL);
CREATE TABLE t2 ( USID INTEGER UNSIGNED AUTO_INCREMENT, ServerID TINYINT UNSIGNED, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User TEXT NOT NULL, NASAddr INTEGER UNSIGNED, NASPort INTEGER UNSIGNED, NASPortType INTEGER UNSIGNED, ConnectSpeed INTEGER UNSIGNED, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER UNSIGNED, SessionTime INTEGER UNSIGNED, PacketsIn INTEGER UNSIGNED, OctetsIn INTEGER UNSIGNED, PacketsOut INTEGER UNSIGNED, OctetsOut INTEGER UNSIGNED, TerminateCause INTEGER UNSIGNED, UnauthTime TINYINT UNSIGNED, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL, INDEX(USID,ServerID,NASAddr,SessionID), INDEX(AssignedAddr));
INSERT INTO t1 VALUES (39,42,'Access-Granted','46','491721000045',2130706433,17690,NULL,NULL,'Localnet','491721000045','49172200000',754974766,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2003-07-18 00:11:21',NULL,NULL,20030718001121);
INSERT INTO t2 SELECT USID, ServerID, State, SessionID, User, NASAddr, NASPort, NASPortType, ConnectSpeed, CarrierType, CallingStationID, CalledStationID, AssignedAddr, SessionTime, PacketsIn, OctetsIn, PacketsOut, OctetsOut, TerminateCause, UnauthTime, AccessRequestTime, AcctStartTime, AcctLastTime, LastModification from t1 LIMIT 1;
drop table t1,t2;
CREATE TABLE t1(
Month date NOT NULL,
Type tinyint(3) unsigned NOT NULL auto_increment,
Field int(10) unsigned NOT NULL,
Count int(10) unsigned NOT NULL,
UNIQUE KEY Month (Month,Type,Field)
);
insert into t1 Values
(20030901, 1, 1, 100),
(20030901, 1, 2, 100),
(20030901, 2, 1, 100),
(20030901, 2, 2, 100),
(20030901, 3, 1, 100);
select * from t1;
Month Type Field Count
2003-09-01 1 1 100
2003-09-01 1 2 100
2003-09-01 2 1 100
2003-09-01 2 2 100
2003-09-01 3 1 100
Select null, Field, Count From t1 Where Month=20030901 and Type=2;
NULL Field Count
NULL 1 100
NULL 2 100
create table t2(No int not null, Field int not null, Count int not null);
insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2;
Warnings:
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'No' at row 1
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'No' at row 2
select * from t2;
No Field Count
0 1 100
0 2 100
drop table t1, t2;
CREATE TABLE t1 (
ID int(11) NOT NULL auto_increment,
NO int(11) NOT NULL default '0',
SEQ int(11) NOT NULL default '0',
PRIMARY KEY (ID),
KEY t1$NO (SEQ,NO)
) ENGINE=MyISAM;
INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1);
select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1);
ID NO SEQ
1 1 1
drop table t1;
...@@ -11,16 +11,109 @@ vie CREATE ALGORITHM=UNDEFINED VIEW `mysqltest`.`vie` AS select `mysqltest`.`tab ...@@ -11,16 +11,109 @@ vie CREATE ALGORITHM=UNDEFINED VIEW `mysqltest`.`vie` AS select `mysqltest`.`tab
drop database MySQLTest; drop database MySQLTest;
use test; use test;
create table t1Aa (col1 int); create table t1Aa (col1 int);
create table t2Aa (col1 int); create table t2aA (col1 int);
create view v1Aa as select * from t1Aa; create view v1Aa as select * from t1aA;
create view v2Aa as select * from v1Aa; create view v2aA as select * from v1aA;
update v2aA set col1 = (select max(col1) from v1aA); create view v3Aa as select v2Aa.col1 from v2aA,t2Aa where v2Aa.col1 = t2aA.col1;
update v2aA set col1 = (select max(col1) from v1Aa);
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
delete from v2aA where col1 = (select max(col1) from v1aA); update v2Aa set col1 = (select max(col1) from t1Aa);
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
update v2aA set col1 = (select max(col1) from v2Aa);
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
update v2aA,t2Aa set v2Aa.col1 = (select max(col1) from v1aA) where v2aA.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
update t1aA,t2Aa set t1Aa.col1 = (select max(col1) from v1Aa) where t1aA.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't1aa' for update in FROM clause
update v1aA,t2Aa set v1Aa.col1 = (select max(col1) from v1aA) where v1Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 'v1aa' for update in FROM clause
update t2Aa,v2Aa set v2aA.col1 = (select max(col1) from v1aA) where v2Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't2aa' for update in FROM clause
update t2Aa,t1Aa set t1aA.col1 = (select max(col1) from v1Aa) where t1Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't2aa' for update in FROM clause
update t2Aa,v1aA set v1Aa.col1 = (select max(col1) from v1aA) where v1Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't2aa' for update in FROM clause
update v2aA,t2Aa set v2Aa.col1 = (select max(col1) from t1aA) where v2aA.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
update t1Aa,t2Aa set t1aA.col1 = (select max(col1) from t1Aa) where t1aA.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't1aa' for update in FROM clause
update v1aA,t2Aa set v1Aa.col1 = (select max(col1) from t1Aa) where v1aA.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 'v1aa' for update in FROM clause
update t2Aa,v2Aa set v2aA.col1 = (select max(col1) from t1aA) where v2Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't2aa' for update in FROM clause
update t2Aa,t1Aa set t1aA.col1 = (select max(col1) from t1Aa) where t1aA.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't2aa' for update in FROM clause
update t2Aa,v1Aa set v1aA.col1 = (select max(col1) from t1Aa) where v1Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't2aa' for update in FROM clause
update v2aA,t2Aa set v2Aa.col1 = (select max(col1) from v2aA) where v2Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
update t1aA,t2Aa set t1Aa.col1 = (select max(col1) from v2aA) where t1aA.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't1aa' for update in FROM clause
update v1aA,t2Aa set v1Aa.col1 = (select max(col1) from v2Aa) where v1aA.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 'v1aa' for update in FROM clause
update t2Aa,v2aA set v2Aa.col1 = (select max(col1) from v2aA) where v2Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't2aa' for update in FROM clause
update t2Aa,t1Aa set t1aA.col1 = (select max(col1) from v2aA) where t1Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't2aa' for update in FROM clause
update t2Aa,v1Aa set v1aA.col1 = (select max(col1) from v2Aa) where v1Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't2aa' for update in FROM clause
update v3aA set v3Aa.col1 = (select max(col1) from v1aA);
ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause
update v3aA set v3Aa.col1 = (select max(col1) from t1aA);
ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause
update v3aA set v3Aa.col1 = (select max(col1) from v2aA);
ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause
update v3aA set v3Aa.col1 = (select max(col1) from v3aA);
ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause
delete from v2Aa where col1 = (select max(col1) from v1Aa);
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
delete from v2aA where col1 = (select max(col1) from t1Aa);
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
delete from v2Aa where col1 = (select max(col1) from v2aA);
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
delete v2Aa from v2aA,t2Aa where (select max(col1) from v1aA) > 0 and v2Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
delete t1aA from t1Aa,t2Aa where (select max(col1) from v1Aa) > 0 and t1aA.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't1aa' for update in FROM clause
delete v1aA from v1Aa,t2Aa where (select max(col1) from v1aA) > 0 and v1Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 'v1aa' for update in FROM clause
delete v2aA from v2Aa,t2Aa where (select max(col1) from t1Aa) > 0 and v2aA.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
delete t1aA from t1Aa,t2Aa where (select max(col1) from t1aA) > 0 and t1Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't1aa' for update in FROM clause
delete v1aA from v1Aa,t2Aa where (select max(col1) from t1aA) > 0 and v1aA.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 'v1aa' for update in FROM clause
delete v2Aa from v2aA,t2Aa where (select max(col1) from v2Aa) > 0 and v2aA.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
delete t1Aa from t1aA,t2Aa where (select max(col1) from v2Aa) > 0 and t1Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 't1aa' for update in FROM clause
delete v1Aa from v1aA,t2Aa where (select max(col1) from v2aA) > 0 and v1Aa.col1 = t2aA.col1;
ERROR HY000: You can't specify target table 'v1aa' for update in FROM clause
insert into v2Aa values ((select max(col1) from v1aA));
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
insert into t1aA values ((select max(col1) from v1Aa));
ERROR HY000: You can't specify target table 't1aa' for update in FROM clause
insert into v2aA values ((select max(col1) from v1aA)); insert into v2aA values ((select max(col1) from v1aA));
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
drop view v2Aa,v1Aa; insert into v2Aa values ((select max(col1) from t1Aa));
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
insert into t1aA values ((select max(col1) from t1Aa));
ERROR HY000: You can't specify target table 't1aa' for update in FROM clause
insert into v2aA values ((select max(col1) from t1aA));
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
insert into v2Aa values ((select max(col1) from v2aA));
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
insert into t1Aa values ((select max(col1) from v2Aa));
ERROR HY000: You can't specify target table 't1aa' for update in FROM clause
insert into v2aA values ((select max(col1) from v2Aa));
ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause
insert into v3Aa (col1) values ((select max(col1) from v1Aa));
ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause
insert into v3aA (col1) values ((select max(col1) from t1aA));
ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause
insert into v3Aa (col1) values ((select max(col1) from v2aA));
ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause
drop view v3aA,v2Aa,v1aA;
drop table t1Aa,t2Aa; drop table t1Aa,t2Aa;
create table t1Aa (col1 int); create table t1Aa (col1 int);
create view v1Aa as select col1 from t1Aa as AaA; create view v1Aa as select col1 from t1Aa as AaA;
......
...@@ -55,8 +55,33 @@ id data data ...@@ -55,8 +55,33 @@ id data data
2 female no 2 female no
select t1.id from t1 union select t2.id from t2; select t1.id from t1 union select t2.id from t2;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 id id 1 3 1 Y 32768 0 63 def id id 1 4 1 Y 32768 0 63
id id
1 1
2 2
drop table t1,t2; drop table t1,t2;
create table t1 ( a int, b varchar(30), primary key(a));
insert into t1 values (1,'one');
insert into t1 values (2,'two');
set @arg00=1 ;
select @arg00 FROM t1 where a=1 union distinct select 1 FROM t1 where a=1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def @arg00 @arg00 8 20 1 Y 32768 0 63
@arg00
1
select * from (select @arg00) aaa;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def aaa @arg00 @arg00 8 20 1 Y 32768 0 63
@arg00
1
select 1 union select 1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def 1 1 8 20 1 N 32769 0 63
1
1
select * from (select 1 union select 1) aaa;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def aaa 1 1 8 20 1 N 32769 0 63
1
1
drop table t1;
...@@ -11,7 +11,7 @@ Log_name Pos Event_type Server_id End_log_pos Info ...@@ -11,7 +11,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 # use `test`; BEGIN master-bin.000001 98 Query 1 # use `test`; BEGIN
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(1) master-bin.000001 166 Query 1 # use `test`; insert into t1 values(1)
master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 347 Xid 1 # COMMIT /* xid=7 */ master-bin.000001 347 Xid 1 # COMMIT /* xid=8 */
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -47,7 +47,7 @@ master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint ...@@ -47,7 +47,7 @@ master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint
master-bin.000001 338 Query 1 # use `test`; insert into t1 values(4) master-bin.000001 338 Query 1 # use `test`; insert into t1 values(4)
master-bin.000001 425 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 425 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 519 Query 1 # use `test`; rollback to savepoint my_savepoint master-bin.000001 519 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 616 Xid 1 # COMMIT /* xid=24 */ master-bin.000001 616 Xid 1 # COMMIT /* xid=25 */
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -74,7 +74,7 @@ master-bin.000001 338 Query 1 # use `test`; insert into t1 values(6) ...@@ -74,7 +74,7 @@ master-bin.000001 338 Query 1 # use `test`; insert into t1 values(6)
master-bin.000001 425 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 425 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 519 Query 1 # use `test`; rollback to savepoint my_savepoint master-bin.000001 519 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 616 Query 1 # use `test`; insert into t1 values(7) master-bin.000001 616 Query 1 # use `test`; insert into t1 values(7)
master-bin.000001 703 Xid 1 # COMMIT /* xid=36 */ master-bin.000001 703 Xid 1 # COMMIT /* xid=37 */
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -101,7 +101,7 @@ insert into t2 select * from t1; ...@@ -101,7 +101,7 @@ insert into t2 select * from t1;
show binlog events from 98; show binlog events from 98;
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 98 Query 1 # use `test`; insert into t1 values(9) master-bin.000001 98 Query 1 # use `test`; insert into t1 values(9)
master-bin.000001 185 Xid 1 # COMMIT /* xid=59 */ master-bin.000001 185 Xid 1 # COMMIT /* xid=60 */
master-bin.000001 212 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 212 Query 1 # use `test`; insert into t2 select * from t1
delete from t1; delete from t1;
delete from t2; delete from t2;
...@@ -112,18 +112,18 @@ insert into t2 select * from t1; ...@@ -112,18 +112,18 @@ insert into t2 select * from t1;
show binlog events from 98; show binlog events from 98;
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 98 Query 1 # use `test`; insert into t1 values(10) master-bin.000001 98 Query 1 # use `test`; insert into t1 values(10)
master-bin.000001 186 Xid 1 # COMMIT /* xid=65 */ master-bin.000001 186 Xid 1 # COMMIT /* xid=66 */
master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1
insert into t1 values(11); insert into t1 values(11);
commit; commit;
show binlog events from 98; show binlog events from 98;
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 98 Query 1 # use `test`; insert into t1 values(10) master-bin.000001 98 Query 1 # use `test`; insert into t1 values(10)
master-bin.000001 186 Xid 1 # COMMIT /* xid=65 */ master-bin.000001 186 Xid 1 # COMMIT /* xid=66 */
master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 307 Query 1 # use `test`; BEGIN master-bin.000001 307 Query 1 # use `test`; BEGIN
master-bin.000001 375 Query 1 # use `test`; insert into t1 values(11) master-bin.000001 375 Query 1 # use `test`; insert into t1 values(11)
master-bin.000001 463 Xid 1 # COMMIT /* xid=67 */ master-bin.000001 463 Xid 1 # COMMIT /* xid=68 */
alter table t2 engine=INNODB; alter table t2 engine=INNODB;
delete from t1; delete from t1;
delete from t2; delete from t2;
...@@ -137,7 +137,7 @@ Log_name Pos Event_type Server_id End_log_pos Info ...@@ -137,7 +137,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 # use `test`; BEGIN master-bin.000001 98 Query 1 # use `test`; BEGIN
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(12) master-bin.000001 166 Query 1 # use `test`; insert into t1 values(12)
master-bin.000001 254 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 254 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 348 Xid 1 # COMMIT /* xid=77 */ master-bin.000001 348 Xid 1 # COMMIT /* xid=78 */
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -161,7 +161,7 @@ show binlog events from 98; ...@@ -161,7 +161,7 @@ show binlog events from 98;
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 98 Query 1 # use `test`; BEGIN master-bin.000001 98 Query 1 # use `test`; BEGIN
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(14) master-bin.000001 166 Query 1 # use `test`; insert into t1 values(14)
master-bin.000001 254 Xid 1 # COMMIT /* xid=93 */ master-bin.000001 254 Xid 1 # COMMIT /* xid=94 */
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -182,7 +182,7 @@ Log_name Pos Event_type Server_id End_log_pos Info ...@@ -182,7 +182,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 Query 1 # use `test`; BEGIN master-bin.000001 98 Query 1 # use `test`; BEGIN
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(16) master-bin.000001 166 Query 1 # use `test`; insert into t1 values(16)
master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18) master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18)
master-bin.000001 342 Xid 1 # COMMIT /* xid=104 */ master-bin.000001 342 Xid 1 # COMMIT /* xid=105 */
delete from t1; delete from t1;
delete from t2; delete from t2;
alter table t2 type=MyISAM; alter table t2 type=MyISAM;
......
drop table if exists t1;
CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam;
INSERT INTO t1 (data) VALUES (NULL);
UPDATE t1 set data=repeat('a',18*1024*1024);
Warnings:
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
select length(data) from t1;
length(data)
NULL
delete from t1 where left(data,1)='a';
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
truncate table t1;
INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024));
Warnings:
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024));
Warnings:
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
delete from t1 where left(data,1)='b';
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
UPDATE t1 set data=repeat('c',17*1024*1024);
Warnings:
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
delete from t1 where left(data,1)='c';
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
INSERT INTO t1 set data=repeat('a',18*1024*1024);
Warnings:
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
select length(data) from t1;
length(data)
NULL
NULL
NULL
alter table t1 modify data blob;
select length(data) from t1;
length(data)
NULL
NULL
NULL
drop table t1;
CREATE TABLE t1 (data BLOB) ENGINE=myisam;
INSERT INTO t1 (data) VALUES (NULL);
UPDATE t1 set data=repeat('a',18*1024*1024);
Warnings:
Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated
select length(data) from t1;
length(data)
NULL
drop table t1;
...@@ -248,8 +248,8 @@ INSERT INTO t3 VALUES (1,'V1',NULL); ...@@ -248,8 +248,8 @@ INSERT INTO t3 VALUES (1,'V1',NULL);
CREATE TABLE t4 ( CREATE TABLE t4 (
uid bigint(20) unsigned NOT NULL default '0', uid bigint(20) unsigned NOT NULL default '0',
gid bigint(20) unsigned NOT NULL, gid bigint(20) unsigned NOT NULL,
rid bigint(20) unsigned NOT NULL default '-1', rid bigint(20) unsigned NOT NULL,
cid bigint(20) unsigned NOT NULL default '-1', cid bigint(20) unsigned NOT NULL,
UNIQUE KEY m (uid,gid,rid,cid) UNIQUE KEY m (uid,gid,rid,cid)
) engine=ndbcluster; ) engine=ndbcluster;
INSERT INTO t4 VALUES (1,1,2,4); INSERT INTO t4 VALUES (1,1,2,4);
...@@ -275,8 +275,8 @@ CREATE TABLE t7 ( ...@@ -275,8 +275,8 @@ CREATE TABLE t7 (
mid bigint(20) unsigned NOT NULL PRIMARY KEY, mid bigint(20) unsigned NOT NULL PRIMARY KEY,
uid bigint(20) unsigned NOT NULL default '0', uid bigint(20) unsigned NOT NULL default '0',
gid bigint(20) unsigned NOT NULL, gid bigint(20) unsigned NOT NULL,
rid bigint(20) unsigned NOT NULL default '-1', rid bigint(20) unsigned NOT NULL,
cid bigint(20) unsigned NOT NULL default '-1', cid bigint(20) unsigned NOT NULL,
UNIQUE KEY m (uid,gid,rid,cid) UNIQUE KEY m (uid,gid,rid,cid)
) engine=ndbcluster; ) engine=ndbcluster;
INSERT INTO t7 VALUES(1, 1, 1, 1, 1); INSERT INTO t7 VALUES(1, 1, 1, 1, 1);
......
...@@ -2,6 +2,9 @@ DROP TABLE IF EXISTS t1; ...@@ -2,6 +2,9 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
auto int(5) unsigned NOT NULL auto_increment, auto int(5) unsigned NOT NULL auto_increment,
string char(10) default "hello", string char(10) default "hello",
vstring varchar(10) default "hello",
bin binary(7),
vbin varbinary(7),
tiny tinyint(4) DEFAULT '0' NOT NULL , tiny tinyint(4) DEFAULT '0' NOT NULL ,
short smallint(6) DEFAULT '1' NOT NULL , short smallint(6) DEFAULT '1' NOT NULL ,
medium mediumint(8) DEFAULT '0' NOT NULL, medium mediumint(8) DEFAULT '0' NOT NULL,
...@@ -9,17 +12,20 @@ long_int int(11) DEFAULT '0' NOT NULL, ...@@ -9,17 +12,20 @@ long_int int(11) DEFAULT '0' NOT NULL,
longlong bigint(13) DEFAULT '0' NOT NULL, longlong bigint(13) DEFAULT '0' NOT NULL,
real_float float(13,1) DEFAULT 0.0 NOT NULL, real_float float(13,1) DEFAULT 0.0 NOT NULL,
real_double double(16,4), real_double double(16,4),
real_decimal decimal(16,4),
utiny tinyint(3) unsigned DEFAULT '0' NOT NULL, utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL, ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
umedium mediumint(8) unsigned DEFAULT '0' NOT NULL, umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
ulong int(11) unsigned DEFAULT '0' NOT NULL, ulong int(11) unsigned DEFAULT '0' NOT NULL,
ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL, ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
time_stamp timestamp, bits bit(3),
options enum('one','two','tree') not null,
flags set('one','two','tree') not null,
date_field date, date_field date,
year_field year,
time_field time, time_field time,
date_time datetime, date_time datetime,
options enum('one','two','tree') not null, time_stamp timestamp not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
flags set('one','two','tree') not null,
PRIMARY KEY (auto), PRIMARY KEY (auto),
KEY (utiny), KEY (utiny),
KEY (tiny), KEY (tiny),
...@@ -33,4 +39,37 @@ KEY (ulong), ...@@ -33,4 +39,37 @@ KEY (ulong),
KEY (ulonglong,ulong), KEY (ulonglong,ulong),
KEY (options,flags) KEY (options,flags)
); );
set @now = now();
insert into t1
(string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
real_float,real_double, real_decimal,utiny, ushort, umedium,ulong,ulonglong,
bits,options,flags,date_field,year_field,time_field,date_time)
values
("aaaa","aaaa",0xAAAA,0xAAAA,-1,-1,-1,-1,-1,1.1,1.1,1.1,1,1,1,1,1,
b'001','one','one', '1901-01-01','1901','01:01:01','1901-01-01 01:01:01');
select auto,string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
real_float,real_double,real_decimal,utiny,ushort,umedium,ulong,ulonglong,
bits,options,flags,date_field,year_field,time_field,date_time
from t1;
auto string vstring bin vbin tiny short medium long_int longlong real_float real_double real_decimal utiny ushort umedium ulong ulonglong bits options flags date_field year_field time_field date_time
1 aaaa aaaa -1 -1 -1 -1 -1 1.1 1.1000 1.1000 1 00001 1 1 1  one one 1901-01-01 1901 01:01:01 1901-01-01 01:01:01
select time_stamp>@now from t1;
time_stamp>@now
1
set @now = now();
update t1 set string="bbbb",vstring="bbbb",bin=0xBBBB,vbin=0xBBBB,
tiny=-2,short=-2,medium=-2,long_int=-2,longlong=-2,real_float=2.2,
real_double=2.2,real_decimal=2.2,utiny=2,ushort=2,umedium=2,ulong=2,
ulonglong=2, bits=b'010',
options='one',flags='one', date_field='1902-02-02',year_field='1902',
time_field='02:02:02',date_time='1902-02-02 02:02:02' where auto=1;
select auto,string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
real_float,real_double,real_decimal,utiny,ushort,umedium,ulong,ulonglong,
bits,options,flags,date_field,year_field,time_field,date_time
from t1;
auto string vstring bin vbin tiny short medium long_int longlong real_float real_double real_decimal utiny ushort umedium ulong ulonglong bits options flags date_field year_field time_field date_time
1 bbbb bbbb -2 -2 -2 -2 -2 2.2 2.2000 2.2000 2 00002 2 2 2  one one 1902-02-02 1902 02:02:02 1902-02-02 02:02:02
select time_stamp>@now from t1;
time_stamp>@now
1
drop table t1; drop table t1;
...@@ -10,22 +10,22 @@ select * from t1; ...@@ -10,22 +10,22 @@ select * from t1;
f1 f1
5 5
delete from t1; delete from t1;
ERROR 42000: Access denied for user 'ssl_user1'@'localhost' to database 'test' ERROR 42000: DELETE command denied to user 'ssl_user1'@'localhost' for table 't1'
select * from t1; select * from t1;
f1 f1
5 5
delete from t1; delete from t1;
ERROR 42000: Access denied for user 'ssl_user2'@'localhost' to database 'test' ERROR 42000: DELETE command denied to user 'ssl_user2'@'localhost' for table 't1'
select * from t1; select * from t1;
f1 f1
5 5
delete from t1; delete from t1;
ERROR 42000: Access denied for user 'ssl_user3'@'localhost' to database 'test' ERROR 42000: DELETE command denied to user 'ssl_user3'@'localhost' for table 't1'
select * from t1; select * from t1;
f1 f1
5 5
delete from t1; delete from t1;
ERROR 42000: Access denied for user 'ssl_user4'@'localhost' to database 'test' ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1'
delete from mysql.user where user='ssl_user%'; delete from mysql.user where user='ssl_user%';
delete from mysql.db where user='ssl_user%'; delete from mysql.db where user='ssl_user%';
flush privileges; flush privileges;
......
set global max_allowed_packet=100;
set max_allowed_packet=100;
set global net_buffer_length=100;
set net_buffer_length=100;
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
len
1024
select repeat('a',2000);
repeat('a',2000)
NULL
Warnings:
Warning 1301 Result of repeat() was larger than max_allowed_packet (1024) - truncated
select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet
1024 1024
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
set global max_allowed_packet=default;
set max_allowed_packet=default;
set global net_buffer_length=default;
set net_buffer_length=default;
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
len
100
select length(repeat('a',2000));
length(repeat('a',2000))
2000
This diff is collapsed.
...@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where ...@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b a ? b
2 1 two 2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a '; a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ; execute stmt1 ;
......
...@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where ...@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b a ? b
2 1 two 2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a '; a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ; execute stmt1 ;
......
...@@ -769,6 +769,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where ...@@ -769,6 +769,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b a ? b
2 1 two 2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a '; a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ; execute stmt1 ;
......
...@@ -811,6 +811,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where ...@@ -811,6 +811,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b a ? b
2 1 two 2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a '; a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ; execute stmt1 ;
...@@ -3820,6 +3824,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where ...@@ -3820,6 +3824,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b a ? b
2 1 two 2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a '; a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ; execute stmt1 ;
......
...@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where ...@@ -768,6 +768,10 @@ prepare stmt1 from ' select a, ?, b FROM t1 outer_table where
execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; execute stmt1 using @arg00, @arg01, @arg02, @arg03 ;
a ? b a ? b
2 1 two 2 1 two
prepare stmt1 from 'select c4 FROM t9 where
c13 = (select MAX(b) from t1 where a = ?) and c22 = ? ' ;
execute stmt1 using @arg01, @arg02;
c4
prepare stmt1 from ' select a, b FROM t1 outer_table where prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a '; a = (select a from t1 where b = outer_table.b ) order by a ';
execute stmt1 ; execute stmt1 ;
......
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.
--default-character-set=cp1251 --new
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.
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