mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
merge blob code
This commit is contained in:
@ -14,6 +14,6 @@ extra_configs="$pentium_configs"
|
|||||||
# fail
|
# fail
|
||||||
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
|
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
|
||||||
--with-embedded-server --enable-thread-safe-client \
|
--with-embedded-server --enable-thread-safe-client \
|
||||||
--with-openssl --with-vio --with-raid --without-ndbcluster"
|
--with-openssl --with-vio --with-raid --with-ndbcluster"
|
||||||
|
|
||||||
. "$path/FINISH.sh"
|
. "$path/FINISH.sh"
|
||||||
|
@ -93,6 +93,7 @@ miguel@hegel.local
|
|||||||
miguel@light.
|
miguel@light.
|
||||||
miguel@light.local
|
miguel@light.local
|
||||||
miguel@sartre.local
|
miguel@sartre.local
|
||||||
|
mikron@mikael-ronstr-ms-dator.local
|
||||||
mmatthew@markslaptop.
|
mmatthew@markslaptop.
|
||||||
monty@bitch.mysql.fi
|
monty@bitch.mysql.fi
|
||||||
monty@butch.
|
monty@butch.
|
||||||
|
@ -11,7 +11,7 @@ $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_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$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_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
|
$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$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_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
|
||||||
$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=$opt_without_ndbcluster=0;
|
$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0;
|
||||||
|
|
||||||
GetOptions(
|
GetOptions(
|
||||||
"bdb",
|
"bdb",
|
||||||
@ -57,8 +57,7 @@ GetOptions(
|
|||||||
"with-other-libc=s",
|
"with-other-libc=s",
|
||||||
"with-small-disk",
|
"with-small-disk",
|
||||||
"without-embedded",
|
"without-embedded",
|
||||||
"clearlogs",
|
"clearlogs",
|
||||||
"without-ndbcluster",
|
|
||||||
) || usage();
|
) || usage();
|
||||||
|
|
||||||
usage() if ($opt_help);
|
usage() if ($opt_help);
|
||||||
@ -252,7 +251,6 @@ if ($opt_stage <= 1)
|
|||||||
$opt_config_options.= " --with-raid" if ($opt_raid);
|
$opt_config_options.= " --with-raid" if ($opt_raid);
|
||||||
$opt_config_options.= " --with-readline" if ($opt_readline);
|
$opt_config_options.= " --with-readline" if ($opt_readline);
|
||||||
$opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded);
|
$opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded);
|
||||||
$opt_config_options.= " --without-ndbcluster" if ($opt_without_ndbcluster);
|
|
||||||
$opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster);
|
$opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster);
|
||||||
|
|
||||||
# Only enable InnoDB when requested (required to be able to
|
# Only enable InnoDB when requested (required to be able to
|
||||||
@ -308,7 +306,7 @@ if ($opt_stage <= 3)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$flags.= " --no-strip" if ($opt_no_strip || $opt_with_debug);
|
$flags.= " --no-strip" if ($opt_no_strip || $opt_with_debug);
|
||||||
$flags.= " --with-ndbcluster" if ($opt__with_ndbcluster);
|
$flags.= " --with-ndbcluster" if ($opt_with_cluster);
|
||||||
check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created");
|
check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created");
|
||||||
safe_system("mv mysql*.t*gz $pwd/$host");
|
safe_system("mv mysql*.t*gz $pwd/$host");
|
||||||
if (-f "client/.libs/mysqladmin")
|
if (-f "client/.libs/mysqladmin")
|
||||||
@ -347,10 +345,12 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" .
|
|||||||
#
|
#
|
||||||
if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
|
if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
|
||||||
{
|
{
|
||||||
|
my $flags= "";
|
||||||
|
$flags.= " --with-ndbcluster" if ($opt_with_cluster);
|
||||||
log_timestamp();
|
log_timestamp();
|
||||||
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
|
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
|
||||||
safe_cd("${test_dir}/mysql-test");
|
safe_cd("${test_dir}/mysql-test");
|
||||||
check_system("./mysql-test-run --warnings --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
|
check_system("./mysql-test-run $flags --warnings --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -571,7 +571,7 @@ If user is empty then no mail is sent.
|
|||||||
Set name suffix (e.g. 'com' or '-max') for a distribution
|
Set name suffix (e.g. 'com' or '-max') for a distribution
|
||||||
|
|
||||||
--with cluster
|
--with cluster
|
||||||
Compile with NDB Cluster
|
Compile and test with NDB Cluster enabled
|
||||||
|
|
||||||
--with-debug
|
--with-debug
|
||||||
Build binaries with debug information (implies "--no-strip")
|
Build binaries with debug information (implies "--no-strip")
|
||||||
|
@ -12,15 +12,17 @@ use Getopt::Long;
|
|||||||
|
|
||||||
$opt_help = 0;
|
$opt_help = 0;
|
||||||
$opt_version = 0;
|
$opt_version = 0;
|
||||||
|
$opt_verbose = 0;
|
||||||
$opt_target = "mysql-copyright-target-";
|
$opt_target = "mysql-copyright-target-";
|
||||||
$opt_target .= `date +%d%m%y-%H%M%S`;
|
$opt_target .= `date +%d%m%y-%H%M%S`;
|
||||||
chop $opt_target;
|
chop $opt_target;
|
||||||
|
|
||||||
GetOptions("help","version","target=s") || error();
|
GetOptions("help","version","target=s", "verbose") || error();
|
||||||
|
|
||||||
# fix the directory prefix for target dir
|
# fix the directory prefix for target dir
|
||||||
|
|
||||||
$WD= cwd();
|
$WD= cwd();
|
||||||
|
my $win_flag = 0;
|
||||||
$opt_target= $WD . '/' . $opt_target;
|
$opt_target= $WD . '/' . $opt_target;
|
||||||
|
|
||||||
&main();
|
&main();
|
||||||
@ -50,6 +52,7 @@ sub main
|
|||||||
for ($i=0; $ARGV[$i]; $i++)
|
for ($i=0; $ARGV[$i]; $i++)
|
||||||
{
|
{
|
||||||
my $distfile= $ARGV[$i];
|
my $distfile= $ARGV[$i];
|
||||||
|
$win_flag = ($distfile =~ /win-src/) ? 1 : 0;
|
||||||
my $dir;
|
my $dir;
|
||||||
|
|
||||||
$dir= "mysql-copyright-";
|
$dir= "mysql-copyright-";
|
||||||
@ -66,20 +69,19 @@ sub main
|
|||||||
}
|
}
|
||||||
# if the distfile is mysql-3.22.22-alpha.tar.gz, then
|
# if the distfile is mysql-3.22.22-alpha.tar.gz, then
|
||||||
# distname is 'mysql-3.22.22-alpha' and suffix '.tar.gz'
|
# distname is 'mysql-3.22.22-alpha' and suffix '.tar.gz'
|
||||||
if ($distfile =~ m/^($REG_BASENAME)([\-\_])
|
if ($distfile =~
|
||||||
($REG_VERSION){1}([\.\-\+])
|
m/^($REG_BASENAME)([\-\_])($REG_VERSION){1}([\.\-\+]\w+\-\w+)?[\.\-\+](.*)?$/xo)
|
||||||
(.*)?$/xo)
|
|
||||||
{
|
{
|
||||||
$distname= $1.$2.$3;
|
$distname= $1.$2.$3;
|
||||||
$suffix= $5.$6;
|
$suffix= $5;
|
||||||
|
$fileext = $6;
|
||||||
$newdistname= $1."com".$2.$3;
|
$newdistname= $1."com".$2.$3;
|
||||||
|
$newdistname .= $suffix if $win_flag;
|
||||||
}
|
}
|
||||||
# find out the extract path (should be same as distname!)
|
# find out the extract path (should be same as distname!)
|
||||||
chomp($destdir= `tar ztf ../$distfile | head -1`);
|
chomp($destdir= `tar ztf ../$distfile | head -1`);
|
||||||
# remove slash from the end
|
# remove slash from the end
|
||||||
$destdir= substr($destdir, 0, -1);
|
$destdir= substr($destdir, 0, -1);
|
||||||
print "destdir: $destdir\n";
|
|
||||||
print "distname: $distname\n";
|
|
||||||
|
|
||||||
if ("$destdir" ne "$distname")
|
if ("$destdir" ne "$distname")
|
||||||
{
|
{
|
||||||
@ -103,26 +105,49 @@ sub main
|
|||||||
|
|
||||||
# remove readline subdir and update configure accordingly
|
# remove readline subdir and update configure accordingly
|
||||||
system("rm -rf $destdir/cmd-line-utils/readline");
|
system("rm -rf $destdir/cmd-line-utils/readline");
|
||||||
unlink ("$destdir/configure") or die "Can't delete $destdir/configure: $!\n";
|
if ($win_flag) {
|
||||||
`(cd $destdir ; sed -e 's!\ cmd-line-utils\/readline\/Makefile\ dnl!!g' < configure.in > configure.in.new)`;
|
chdir("$destdir") or (print "$! Unable to change directory to $desdir!\n" && exit(0));
|
||||||
rename ("$destdir/configure.in.new","$destdir/configure.in") or die "Can't rename $destdir/configure.in.new: $!\n";;
|
} else {
|
||||||
`(cd $destdir ; autoconf)`;
|
chdir("$destdir");
|
||||||
|
unlink ("configure") or die "Can't delete $destdir/configure: $!\n";
|
||||||
|
open(CONFIGURE,"<configure.in") or die "$! Unable to open configure.in to read from!\n";
|
||||||
|
undef $/;
|
||||||
|
my $configure = <CONFIGURE>;
|
||||||
|
close(CONFIGURE);
|
||||||
|
$configure =~ s|cmd\-line\-utils/readline/Makefile dnl\n?||g;
|
||||||
|
open(CONFIGURE,">configure.in") or die "$! Unable to open configure.in to write to!\n";
|
||||||
|
print CONFIGURE $configure;
|
||||||
|
close(CONFIGURE);
|
||||||
|
`autoconf`;
|
||||||
|
if (! -f "configure") {
|
||||||
|
print "\"./configure\" was not produced, exiting!\n";
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# fix file copyrights
|
# fix file copyrights
|
||||||
&fix_usage_copyright();
|
&fix_usage_copyright();
|
||||||
&add_copyright();
|
&add_copyright();
|
||||||
|
|
||||||
# rename the directory with new distribution name
|
# rename the directory with new distribution name
|
||||||
|
chdir("$WD/$dir");
|
||||||
|
print "renaming $destdir $newdistname\n" if $opt_verbose;
|
||||||
rename($destdir, $newdistname);
|
rename($destdir, $newdistname);
|
||||||
|
|
||||||
# tar the new distribution
|
# tar the new distribution
|
||||||
`tar cz -f $opt_target/$newdistname.tar.gz *`;
|
`tar cz -f $WD/$newdistname.tar.gz $newdistname`;
|
||||||
$pec= $? >> 8;
|
$pec= $? >> 8;
|
||||||
abort($dir, "Making new tar archive failed!\n") if ($pec);
|
abort($dir, "Making new tar archive failed!\n") if ($pec);
|
||||||
|
|
||||||
# remove temporary directory
|
# remove temporary directory
|
||||||
chdir "..";
|
chdir($WD) or print "$! Unable to move up one dir\n";
|
||||||
`rm -rf $dir/`;
|
my $cwd = getcwd();
|
||||||
|
print "current dir is $cwd\n" if $opt_verbose ;
|
||||||
|
print "deleting temp dir $dir\n" if $opt_verbose;
|
||||||
|
if (-d $dir) {
|
||||||
|
system("rm -rf $dir") or print "$! Unable to delete $dir!\n";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
@ -138,7 +163,7 @@ sub fix_usage_copyright
|
|||||||
foreach my $Cfile (@Cfiles)
|
foreach my $Cfile (@Cfiles)
|
||||||
{
|
{
|
||||||
chop $Cfile;
|
chop $Cfile;
|
||||||
`replace "This is free software," "This is commercial software," "and you are welcome to modify and redistribute it under the GPL license" "please see the file MySQLEULA.txt for details" -- $Cfile`;
|
`replace "This is free software," "This is commercial software," "and you are welcome to modify and redistribute it under the GPL license" "please see the file MySQLEULA.txt for details" -- "$Cfile"` if -f $Cfile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +177,9 @@ sub add_copyright
|
|||||||
foreach my $file (@files)
|
foreach my $file (@files)
|
||||||
{
|
{
|
||||||
chop $file;
|
chop $file;
|
||||||
`$WD/Build-tools/mysql-copyright-2 $file`;
|
next if ! -f $file;
|
||||||
|
next if -B $file;
|
||||||
|
`$WD/Build-tools/mysql-copyright-2 "$file"`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
17
acinclude.m4
17
acinclude.m4
@ -1383,6 +1383,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
|
|||||||
--with-ndb-test Include the NDB Cluster ndbapi test programs],
|
--with-ndb-test Include the NDB Cluster ndbapi test programs],
|
||||||
[ndb_test="$withval"],
|
[ndb_test="$withval"],
|
||||||
[ndb_test=no])
|
[ndb_test=no])
|
||||||
|
AC_ARG_WITH([ndb-docs],
|
||||||
|
[
|
||||||
|
--with-ndb-docs Include the NDB Cluster ndbapi and mgmapi documentation],
|
||||||
|
[ndb_docs="$withval"],
|
||||||
|
[ndb_docs=no])
|
||||||
|
|
||||||
AC_MSG_CHECKING([for NDB Cluster options])
|
AC_MSG_CHECKING([for NDB Cluster options])
|
||||||
AC_MSG_RESULT([])
|
AC_MSG_RESULT([])
|
||||||
@ -1422,6 +1427,17 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
have_ndb_docs=no
|
||||||
|
case "$ndb_docs" in
|
||||||
|
yes )
|
||||||
|
AC_MSG_RESULT([-- including ndbapi and mgmapi documentation])
|
||||||
|
have_ndb_docs="yes"
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
AC_MSG_RESULT([-- not including ndbapi and mgmapi documentation])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
AC_MSG_RESULT([done.])
|
AC_MSG_RESULT([done.])
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -1452,6 +1468,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
AM_CONDITIONAL([HAVE_NDBCLUSTER_DB], [ test "$have_ndbcluster" = "yes" ])
|
||||||
AC_SUBST(ndbcluster_includes)
|
AC_SUBST(ndbcluster_includes)
|
||||||
AC_SUBST(ndbcluster_libs)
|
AC_SUBST(ndbcluster_libs)
|
||||||
AC_SUBST(ndbcluster_system_libs)
|
AC_SUBST(ndbcluster_system_libs)
|
||||||
|
@ -318,6 +318,7 @@ TYPELIB command_typelib= {array_elements(command_names),"",
|
|||||||
DYNAMIC_STRING ds_res;
|
DYNAMIC_STRING ds_res;
|
||||||
static void die(const char *fmt, ...);
|
static void die(const char *fmt, ...);
|
||||||
static void init_var_hash();
|
static void init_var_hash();
|
||||||
|
static VAR* var_from_env(const char *, const char *);
|
||||||
static byte* get_var_key(const byte* rec, uint* len,
|
static byte* get_var_key(const byte* rec, uint* len,
|
||||||
my_bool __attribute__((unused)) t);
|
my_bool __attribute__((unused)) t);
|
||||||
static VAR* var_init(VAR* v, const char *name, int name_len, const char *val,
|
static VAR* var_init(VAR* v, const char *name, int name_len, const char *val,
|
||||||
@ -654,11 +655,10 @@ VAR* var_get(const char* var_name, const char** var_name_end, my_bool raw,
|
|||||||
if (!(v = (VAR*) hash_search(&var_hash, save_var_name,
|
if (!(v = (VAR*) hash_search(&var_hash, save_var_name,
|
||||||
var_name - save_var_name)))
|
var_name - save_var_name)))
|
||||||
{
|
{
|
||||||
if (ignore_not_existing)
|
char c=*var_name, *s=(char*)var_name;;
|
||||||
DBUG_RETURN(0);
|
*s=0;
|
||||||
if (end)
|
v=var_from_env(save_var_name, "");
|
||||||
*(char*) end = 0;
|
*s=c;
|
||||||
die("Variable '%s' used uninitialized", save_var_name);
|
|
||||||
}
|
}
|
||||||
--var_name; /* Point at last character */
|
--var_name; /* Point at last character */
|
||||||
}
|
}
|
||||||
@ -2580,7 +2580,7 @@ static void var_free(void *v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void var_from_env(const char *name, const char *def_val)
|
static VAR* var_from_env(const char *name, const char *def_val)
|
||||||
{
|
{
|
||||||
const char *tmp;
|
const char *tmp;
|
||||||
VAR *v;
|
VAR *v;
|
||||||
@ -2589,6 +2589,7 @@ static void var_from_env(const char *name, const char *def_val)
|
|||||||
|
|
||||||
v = var_init(0, name, 0, tmp, 0);
|
v = var_init(0, name, 0, tmp, 0);
|
||||||
my_hash_insert(&var_hash, (byte*)v);
|
my_hash_insert(&var_hash, (byte*)v);
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2599,10 +2600,8 @@ static void init_var_hash(MYSQL *mysql)
|
|||||||
if (hash_init(&var_hash, charset_info,
|
if (hash_init(&var_hash, charset_info,
|
||||||
1024, 0, 0, get_var_key, var_free, MYF(0)))
|
1024, 0, 0, get_var_key, var_free, MYF(0)))
|
||||||
die("Variable hash initialization failed");
|
die("Variable hash initialization failed");
|
||||||
var_from_env("MASTER_MYPORT", "9306");
|
if (opt_big_test)
|
||||||
var_from_env("SLAVE_MYPORT", "9307");
|
my_hash_insert(&var_hash, (byte*) var_init(0,"BIG_TEST", 0, "1",0));
|
||||||
var_from_env("MYSQL_TEST_DIR", "/tmp");
|
|
||||||
var_from_env("BIG_TEST", opt_big_test ? "1" : "0");
|
|
||||||
v= var_init(0,"MAX_TABLES", 0, (sizeof(ulong) == 4) ? "31" : "62",0);
|
v= var_init(0,"MAX_TABLES", 0, (sizeof(ulong) == 4) ? "31" : "62",0);
|
||||||
my_hash_insert(&var_hash, (byte*) v);
|
my_hash_insert(&var_hash, (byte*) v);
|
||||||
v= var_init(0,"SERVER_VERSION", 0, mysql_get_server_info(mysql), 0);
|
v= var_init(0,"SERVER_VERSION", 0, mysql_get_server_info(mysql), 0);
|
||||||
|
46
configure.in
46
configure.in
@ -370,12 +370,15 @@ AC_SUBST(INSTALL_SCRIPT)
|
|||||||
|
|
||||||
export CC CXX CFLAGS LD LDFLAGS AR
|
export CC CXX CFLAGS LD LDFLAGS AR
|
||||||
|
|
||||||
|
ndb_cxxflags_fix=
|
||||||
if test "$GXX" = "yes"
|
if test "$GXX" = "yes"
|
||||||
then
|
then
|
||||||
# mysqld requires -fno-implicit-templates.
|
# mysqld requires -fno-implicit-templates.
|
||||||
# Disable exceptions as they seams to create problems with gcc and threads.
|
# Disable exceptions as they seams to create problems with gcc and threads.
|
||||||
# mysqld doesn't use run-time-type-checking, so we disable it.
|
# mysqld doesn't use run-time-type-checking, so we disable it.
|
||||||
CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
|
CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
|
||||||
|
# ndb cannot be compiled with -fno-implicit-templaces
|
||||||
|
ndb_cxxflags_fix=-fimplicit-templates
|
||||||
|
|
||||||
# If you are using 'gcc' 3.0 (not g++) to compile C++ programs on Linux,
|
# If you are using 'gcc' 3.0 (not g++) to compile C++ programs on Linux,
|
||||||
# we will gets some problems when linking static programs.
|
# we will gets some problems when linking static programs.
|
||||||
@ -2892,22 +2895,20 @@ if test X"$have_ndbcluster" = Xyes
|
|||||||
then
|
then
|
||||||
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
|
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
|
||||||
|
|
||||||
|
CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)"
|
||||||
if test "$with_debug" = "yes"
|
if test "$with_debug" = "yes"
|
||||||
then
|
then
|
||||||
# Medium debug.
|
# Medium debug.
|
||||||
NDB_DEFS="-DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
|
NDB_DEFS="-DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
|
||||||
CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS) \$(NDB_CXXFLAGS_LOC) \$(NDB_CXXFLAGS_DEBUG_LOC)"
|
|
||||||
elif test "$with_debug" = "full"
|
elif test "$with_debug" = "full"
|
||||||
then
|
then
|
||||||
NDB_DEFS="-DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
|
NDB_DEFS="-DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
|
||||||
CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS) \$(NDB_CXXFLAGS_LOC) \$(NDB_CXXFLAGS_DEBUG_LOC)"
|
|
||||||
else
|
else
|
||||||
NDB_DEFS="-DNDEBUG"
|
NDB_DEFS="-DNDEBUG"
|
||||||
CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS) \$(NDB_CXXFLAGS_LOC) \$(NDB_CXXFLAGS_RELEASE_LOC)"
|
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
AC_SUBST([NDB_DEFS])
|
AC_SUBST([NDB_DEFS])
|
||||||
|
AC_SUBST([ndb_cxxflags_fix])
|
||||||
|
|
||||||
ndb_transporter_opt_objs=""
|
ndb_transporter_opt_objs=""
|
||||||
if test X"$have_ndb_shm" = Xyes
|
if test X"$have_ndb_shm" = Xyes
|
||||||
@ -2920,22 +2921,23 @@ then
|
|||||||
fi
|
fi
|
||||||
AC_SUBST([ndb_transporter_opt_objs])
|
AC_SUBST([ndb_transporter_opt_objs])
|
||||||
|
|
||||||
|
ndb_opt_subdirs=
|
||||||
ndb_bin_am_ldflags="-static"
|
ndb_bin_am_ldflags="-static"
|
||||||
if test X"$have_ndb_test" = Xyes
|
if test X"$have_ndb_test" = Xyes
|
||||||
then
|
then
|
||||||
ndb_opt_test_subdirs="test"
|
ndb_opt_subdirs="test"
|
||||||
|
ndb_bin_am_ldflags=""
|
||||||
|
fi
|
||||||
|
if test X"$have_ndb_docs" = Xyes
|
||||||
|
then
|
||||||
|
ndb_opt_subdirs="$ndb_opt_subdirs docs"
|
||||||
ndb_bin_am_ldflags=""
|
ndb_bin_am_ldflags=""
|
||||||
fi
|
fi
|
||||||
AC_SUBST([ndb_bin_am_ldflags])
|
AC_SUBST([ndb_bin_am_ldflags])
|
||||||
AC_SUBST([ndb_opt_test_subdirs])
|
AC_SUBST([ndb_opt_subdirs])
|
||||||
|
AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl
|
||||||
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
|
|
||||||
|
|
||||||
# Output results
|
|
||||||
AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
|
|
||||||
ndb/docs/Makefile dnl
|
|
||||||
ndb/Makefile ndb/include/Makefile dnl
|
|
||||||
ndb/src/Makefile ndb/src/common/Makefile dnl
|
ndb/src/Makefile ndb/src/common/Makefile dnl
|
||||||
|
ndb/docs/Makefile dnl
|
||||||
ndb/tools/Makefile dnl
|
ndb/tools/Makefile dnl
|
||||||
ndb/src/common/debugger/Makefile ndb/src/common/debugger/signaldata/Makefile dnl
|
ndb/src/common/debugger/Makefile ndb/src/common/debugger/signaldata/Makefile dnl
|
||||||
ndb/src/common/portlib/Makefile dnl
|
ndb/src/common/portlib/Makefile dnl
|
||||||
@ -2976,7 +2978,14 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
|
|||||||
ndb/test/ndbapi/Makefile dnl
|
ndb/test/ndbapi/Makefile dnl
|
||||||
ndb/test/ndbapi/bank/Makefile dnl
|
ndb/test/ndbapi/bank/Makefile dnl
|
||||||
ndb/test/tools/Makefile dnl
|
ndb/test/tools/Makefile dnl
|
||||||
ndb/test/run-test/Makefile dnl
|
ndb/test/run-test/Makefile mysql-test/ndb/Makefile dnl
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
|
||||||
|
|
||||||
|
# Output results
|
||||||
|
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
|
||||||
strings/Makefile regex/Makefile heap/Makefile dnl
|
strings/Makefile regex/Makefile heap/Makefile dnl
|
||||||
bdb/Makefile dnl
|
bdb/Makefile dnl
|
||||||
myisam/Makefile myisammrg/Makefile dnl
|
myisam/Makefile myisammrg/Makefile dnl
|
||||||
@ -2989,15 +2998,14 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
|
|||||||
merge/Makefile dbug/Makefile scripts/Makefile dnl
|
merge/Makefile dbug/Makefile scripts/Makefile dnl
|
||||||
include/Makefile sql-bench/Makefile tools/Makefile dnl
|
include/Makefile sql-bench/Makefile tools/Makefile dnl
|
||||||
tests/Makefile Docs/Makefile support-files/Makefile dnl
|
tests/Makefile Docs/Makefile support-files/Makefile dnl
|
||||||
support-files/MacOSX/Makefile mysql-test/Makefile mysql-test/ndb/Makefile dnl
|
support-files/MacOSX/Makefile mysql-test/Makefile dnl
|
||||||
netware/Makefile dnl
|
netware/Makefile dnl
|
||||||
include/mysql_version.h dnl
|
include/mysql_version.h dnl
|
||||||
cmd-line-utils/Makefile dnl
|
cmd-line-utils/Makefile dnl
|
||||||
cmd-line-utils/libedit/Makefile dnl
|
cmd-line-utils/libedit/Makefile dnl
|
||||||
cmd-line-utils/readline/Makefile dnl
|
cmd-line-utils/readline/Makefile)
|
||||||
, , [
|
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
|
||||||
test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
|
AC_OUTPUT
|
||||||
])
|
|
||||||
|
|
||||||
rm -f $AVAILABLE_LANGUAGES_ERRORS_RULES
|
rm -f $AVAILABLE_LANGUAGES_ERRORS_RULES
|
||||||
echo
|
echo
|
||||||
|
@ -104,7 +104,7 @@ typedef struct my_collation_handler_st
|
|||||||
my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
|
my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
|
||||||
/* Collation routines */
|
/* Collation routines */
|
||||||
int (*strnncoll)(struct charset_info_st *,
|
int (*strnncoll)(struct charset_info_st *,
|
||||||
const uchar *, uint, const uchar *, uint);
|
const uchar *, uint, const uchar *, uint, my_bool);
|
||||||
int (*strnncollsp)(struct charset_info_st *,
|
int (*strnncollsp)(struct charset_info_st *,
|
||||||
const uchar *, uint, const uchar *, uint);
|
const uchar *, uint, const uchar *, uint);
|
||||||
int (*strnxfrm)(struct charset_info_st *,
|
int (*strnxfrm)(struct charset_info_st *,
|
||||||
@ -206,6 +206,7 @@ typedef struct charset_info_st
|
|||||||
uchar *to_lower;
|
uchar *to_lower;
|
||||||
uchar *to_upper;
|
uchar *to_upper;
|
||||||
uchar *sort_order;
|
uchar *sort_order;
|
||||||
|
uint16 *contractions;
|
||||||
uint16 **sort_order_big;
|
uint16 **sort_order_big;
|
||||||
uint16 *tab_to_uni;
|
uint16 *tab_to_uni;
|
||||||
MY_UNI_IDX *tab_from_uni;
|
MY_UNI_IDX *tab_from_uni;
|
||||||
@ -253,7 +254,7 @@ extern CHARSET_INFO my_charset_cp1250_czech_ci;
|
|||||||
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
|
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
|
||||||
uint);
|
uint);
|
||||||
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
|
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
|
||||||
const uchar *, uint);
|
const uchar *, uint, my_bool);
|
||||||
|
|
||||||
extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint,
|
extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint,
|
||||||
const uchar *, uint);
|
const uchar *, uint);
|
||||||
@ -387,7 +388,7 @@ extern my_bool my_parse_charset_xml(const char *bug, uint len,
|
|||||||
#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
|
#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
|
||||||
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
|
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
|
||||||
#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d)))
|
#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d)))
|
||||||
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d)))
|
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0))
|
||||||
#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
|
#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
|
||||||
((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
|
((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
|
||||||
#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
|
#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
|
|
||||||
#ifndef _dbug_h
|
#ifndef _dbug_h
|
||||||
#define _dbug_h
|
#define _dbug_h
|
||||||
|
#ifdef DBUG_OFF
|
||||||
|
#define NDEBUG /* for assert.h */
|
||||||
|
#endif
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -558,7 +558,7 @@ typedef struct st_mysql_bind
|
|||||||
enum enum_field_types buffer_type; /* buffer type */
|
enum enum_field_types buffer_type; /* buffer type */
|
||||||
unsigned long buffer_length; /* buffer length, must be set for str/binary */
|
unsigned long buffer_length; /* buffer length, must be set for str/binary */
|
||||||
|
|
||||||
/* Following are for internal use. Set by mysql_bind_param */
|
/* Following are for internal use. Set by mysql_stmt_bind_param */
|
||||||
unsigned char *inter_buffer; /* for the current data position */
|
unsigned char *inter_buffer; /* for the current data position */
|
||||||
unsigned long offset; /* offset position for char/binary fetch */
|
unsigned long offset; /* offset position for char/binary fetch */
|
||||||
unsigned long internal_length; /* Used if length is 0 */
|
unsigned long internal_length; /* Used if length is 0 */
|
||||||
|
@ -23,10 +23,10 @@
|
|||||||
the second column is the ODBC state (which the 4.1 server sends out by
|
the second column is the ODBC state (which the 4.1 server sends out by
|
||||||
default) and the last is the state used by the JDBC driver.
|
default) and the last is the state used by the JDBC driver.
|
||||||
If the last column is "" then it means that the JDBC driver is using the
|
If the last column is "" then it means that the JDBC driver is using the
|
||||||
ODBC state
|
ODBC state.
|
||||||
|
|
||||||
The errors in this file is sorted in the same order as in mysqld_error.h
|
The errors in this file are sorted in the same order as in mysqld_error.h
|
||||||
to allow on to do binary searches for the sqlstate.
|
to allow one to do binary searches for the sqlstate.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ER_DUP_KEY, "23000", "",
|
ER_DUP_KEY, "23000", "",
|
||||||
|
@ -2220,6 +2220,7 @@ fil_create_new_single_table_tablespace(
|
|||||||
ut_free(buf2);
|
ut_free(buf2);
|
||||||
error_exit:
|
error_exit:
|
||||||
os_file_close(file);
|
os_file_close(file);
|
||||||
|
error_exit2:
|
||||||
os_file_delete(path);
|
os_file_delete(path);
|
||||||
|
|
||||||
mem_free(path);
|
mem_free(path);
|
||||||
@ -2262,10 +2263,7 @@ fil_create_new_single_table_tablespace(
|
|||||||
os_file_close(file);
|
os_file_close(file);
|
||||||
|
|
||||||
if (*space_id == ULINT_UNDEFINED) {
|
if (*space_id == ULINT_UNDEFINED) {
|
||||||
os_file_delete(path);
|
goto error_exit2;
|
||||||
error_exit2:
|
|
||||||
mem_free(path);
|
|
||||||
return(DB_ERROR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
success = fil_space_create(path, *space_id, FIL_TABLESPACE);
|
success = fil_space_create(path, *space_id, FIL_TABLESPACE);
|
||||||
@ -2822,12 +2820,11 @@ fil_load_single_table_tablespaces(void)
|
|||||||
if (len > dbpath_len) {
|
if (len > dbpath_len) {
|
||||||
dbpath_len = len;
|
dbpath_len = len;
|
||||||
|
|
||||||
if (!dbpath) {
|
if (dbpath) {
|
||||||
dbpath = mem_alloc(dbpath_len);
|
mem_free(dbpath);
|
||||||
} else {
|
|
||||||
dbpath = mem_realloc(dbpath, dbpath_len,
|
|
||||||
__FILE__, __LINE__);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dbpath = mem_alloc(dbpath_len);
|
||||||
}
|
}
|
||||||
sprintf(dbpath, "%s/%s", fil_path_to_mysql_datadir,
|
sprintf(dbpath, "%s/%s", fil_path_to_mysql_datadir,
|
||||||
dbinfo.name);
|
dbinfo.name);
|
||||||
|
@ -42,14 +42,13 @@ extern
|
|||||||
void
|
void
|
||||||
innobase_invalidate_query_cache(
|
innobase_invalidate_query_cache(
|
||||||
/*============================*/
|
/*============================*/
|
||||||
trx_t* trx, /* in: transaction which modifies
|
trx_t* trx, /* in: transaction which modifies the table */
|
||||||
the table */
|
char* full_name, /* in: concatenation of database name, null
|
||||||
const char* full_name, /* in: concatenation of database name,
|
char '\0', table name, null char'\0';
|
||||||
null char '\0', table name, null char
|
NOTE that in Windows this is always
|
||||||
'\0'; NOTE that in Windows this is
|
in LOWER CASE! */
|
||||||
always in LOWER CASE! */
|
ulint full_name_len); /* in: full name length where also the null
|
||||||
ulint full_name_len); /* in: full name length where also the
|
chars count */
|
||||||
null chars count */
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@ -652,24 +651,27 @@ row_ins_foreign_check_on_constraint(
|
|||||||
ulint n_to_update;
|
ulint n_to_update;
|
||||||
ulint err;
|
ulint err;
|
||||||
ulint i;
|
ulint i;
|
||||||
const char* ptr;
|
char* ptr;
|
||||||
char* table_name;
|
char* table_name_buf;
|
||||||
|
|
||||||
ut_a(thr && foreign && pcur && mtr);
|
ut_a(thr && foreign && pcur && mtr);
|
||||||
|
|
||||||
#ifndef UNIV_HOTBACKUP
|
|
||||||
/* Since we are going to delete or update a row, we have to invalidate
|
/* Since we are going to delete or update a row, we have to invalidate
|
||||||
the MySQL query cache for table */
|
the MySQL query cache for table */
|
||||||
|
|
||||||
ptr = strchr(table->name, '/');
|
table_name_buf = mem_strdup(table->name);
|
||||||
|
|
||||||
|
ptr = strchr(table_name_buf, '/');
|
||||||
ut_a(ptr);
|
ut_a(ptr);
|
||||||
table_name = mem_strdupl(table->name, ptr - table->name);
|
*ptr = '\0';
|
||||||
|
|
||||||
|
#ifndef UNIV_HOTBACKUP
|
||||||
/* We call a function in ha_innodb.cc */
|
/* We call a function in ha_innodb.cc */
|
||||||
innobase_invalidate_query_cache(thr_get_trx(thr), table_name,
|
innobase_invalidate_query_cache(thr_get_trx(thr), table_name_buf,
|
||||||
ptr - table->name + 1);
|
strlen(table->name) + 1);
|
||||||
mem_free(table_name);
|
|
||||||
#endif
|
#endif
|
||||||
|
mem_free(table_name_buf);
|
||||||
|
|
||||||
node = thr->run_node;
|
node = thr->run_node;
|
||||||
|
|
||||||
if (node->is_delete && 0 == (foreign->type &
|
if (node->is_delete && 0 == (foreign->type &
|
||||||
|
@ -84,7 +84,6 @@ my_bool net_flush(NET *net);
|
|||||||
#define MAX_LONG_DATA_LENGTH 8192
|
#define MAX_LONG_DATA_LENGTH 8192
|
||||||
#define unsigned_field(A) ((A)->flags & UNSIGNED_FLAG)
|
#define unsigned_field(A) ((A)->flags & UNSIGNED_FLAG)
|
||||||
|
|
||||||
static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data);
|
|
||||||
static void append_wild(char *to,char *end,const char *wild);
|
static void append_wild(char *to,char *end,const char *wild);
|
||||||
sig_handler pipe_sig_handler(int sig);
|
sig_handler pipe_sig_handler(int sig);
|
||||||
|
|
||||||
@ -1665,6 +1664,11 @@ static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row);
|
|||||||
static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row);
|
static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row);
|
||||||
static int stmt_read_row_no_data(MYSQL_STMT *stmt, unsigned char **row);
|
static int stmt_read_row_no_data(MYSQL_STMT *stmt, unsigned char **row);
|
||||||
|
|
||||||
|
/*
|
||||||
|
This function is used in mysql_stmt_store_result if
|
||||||
|
STMT_ATTR_UPDATE_MAX_LENGTH attribute is set.
|
||||||
|
*/
|
||||||
|
static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Maximum sizes of MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME
|
Maximum sizes of MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME
|
||||||
@ -1672,19 +1676,19 @@ static int stmt_read_row_no_data(MYSQL_STMT *stmt, unsigned char **row);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* 1 (length) + 2 (year) + 1 (month) + 1 (day) */
|
/* 1 (length) + 2 (year) + 1 (month) + 1 (day) */
|
||||||
static const unsigned MAX_DATE_REP_LENGTH= 5;
|
#define MAX_DATE_REP_LENGTH 5
|
||||||
|
|
||||||
/*
|
/*
|
||||||
1 (length) + 1 (is negative) + 4 (day count) + 1 (hour)
|
1 (length) + 1 (is negative) + 4 (day count) + 1 (hour)
|
||||||
+ 1 (minute) + 1 (seconds) + 4 (microseconds)
|
+ 1 (minute) + 1 (seconds) + 4 (microseconds)
|
||||||
*/
|
*/
|
||||||
static const unsigned MAX_TIME_REP_LENGTH= 13;
|
#define MAX_TIME_REP_LENGTH 13
|
||||||
|
|
||||||
/*
|
/*
|
||||||
1 (length) + 2 (year) + 1 (month) + 1 (day) +
|
1 (length) + 2 (year) + 1 (month) + 1 (day) +
|
||||||
1 (hour) + 1 (minute) + 1 (second) + 4 (microseconds)
|
1 (hour) + 1 (minute) + 1 (second) + 4 (microseconds)
|
||||||
*/
|
*/
|
||||||
static const unsigned MAX_DATETIME_REP_LENGTH= 12;
|
#define MAX_DATETIME_REP_LENGTH 12
|
||||||
|
|
||||||
|
|
||||||
/**************** Misc utility functions ****************************/
|
/**************** Misc utility functions ****************************/
|
||||||
@ -1945,7 +1949,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
|
|||||||
|
|
||||||
mysql_stmt_free_result(stmt);
|
mysql_stmt_free_result(stmt);
|
||||||
/*
|
/*
|
||||||
These members must be reset for API to
|
These members must be reset for API to
|
||||||
function in case of error or misuse.
|
function in case of error or misuse.
|
||||||
*/
|
*/
|
||||||
stmt->bind_param_done= stmt->bind_result_done= FALSE;
|
stmt->bind_param_done= stmt->bind_result_done= FALSE;
|
||||||
@ -1984,14 +1988,14 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
alloc_root will return valid address even in case param_count
|
alloc_root will return valid address even in case param_count
|
||||||
and field_count are zero. Thus we should never rely on stmt->bind
|
and field_count are zero. Thus we should never rely on stmt->bind
|
||||||
or stmt->params when checking for existence of placeholders or
|
or stmt->params when checking for existence of placeholders or
|
||||||
result set.
|
result set.
|
||||||
*/
|
*/
|
||||||
if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root,
|
if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root,
|
||||||
sizeof(MYSQL_BIND)*
|
sizeof(MYSQL_BIND)*
|
||||||
(stmt->param_count +
|
(stmt->param_count +
|
||||||
stmt->field_count))))
|
stmt->field_count))))
|
||||||
{
|
{
|
||||||
set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate);
|
set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate);
|
||||||
@ -2015,22 +2019,22 @@ static unsigned int alloc_stmt_fields(MYSQL_STMT *stmt)
|
|||||||
MYSQL_FIELD *fields, *field, *end;
|
MYSQL_FIELD *fields, *field, *end;
|
||||||
MEM_ROOT *alloc= &stmt->mem_root;
|
MEM_ROOT *alloc= &stmt->mem_root;
|
||||||
MYSQL *mysql= stmt->mysql->last_used_con;
|
MYSQL *mysql= stmt->mysql->last_used_con;
|
||||||
|
|
||||||
stmt->field_count= mysql->field_count;
|
stmt->field_count= mysql->field_count;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Get the field information for non-select statements
|
Get the field information for non-select statements
|
||||||
like SHOW and DESCRIBE commands
|
like SHOW and DESCRIBE commands
|
||||||
*/
|
*/
|
||||||
if (!(stmt->fields= (MYSQL_FIELD *) alloc_root(alloc,
|
if (!(stmt->fields= (MYSQL_FIELD *) alloc_root(alloc,
|
||||||
sizeof(MYSQL_FIELD) *
|
sizeof(MYSQL_FIELD) *
|
||||||
stmt->field_count)) ||
|
stmt->field_count)) ||
|
||||||
!(stmt->bind= (MYSQL_BIND *) alloc_root(alloc,
|
!(stmt->bind= (MYSQL_BIND *) alloc_root(alloc,
|
||||||
sizeof(MYSQL_BIND) *
|
sizeof(MYSQL_BIND) *
|
||||||
stmt->field_count)))
|
stmt->field_count)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (fields= mysql->fields, end= fields+stmt->field_count,
|
for (fields= mysql->fields, end= fields+stmt->field_count,
|
||||||
field= stmt->fields;
|
field= stmt->fields;
|
||||||
field && fields < end; fields++, field++)
|
field && fields < end; fields++, field++)
|
||||||
{
|
{
|
||||||
@ -2107,7 +2111,7 @@ mysql_stmt_result_metadata(MYSQL_STMT *stmt)
|
|||||||
{
|
{
|
||||||
MYSQL_RES *result;
|
MYSQL_RES *result;
|
||||||
DBUG_ENTER("mysql_stmt_result_metadata");
|
DBUG_ENTER("mysql_stmt_result_metadata");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
stmt->fields is only defined if stmt->field_count is not null;
|
stmt->fields is only defined if stmt->field_count is not null;
|
||||||
stmt->field_count is initialized in prepare.
|
stmt->field_count is initialized in prepare.
|
||||||
@ -2130,41 +2134,65 @@ mysql_stmt_result_metadata(MYSQL_STMT *stmt)
|
|||||||
DBUG_RETURN(result);
|
DBUG_RETURN(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Returns parameter columns meta information in the form of
|
Returns parameter columns meta information in the form of
|
||||||
result set.
|
result set.
|
||||||
XXX: not implemented yet.
|
|
||||||
|
SYNOPSYS
|
||||||
|
mysql_stmt_param_metadata()
|
||||||
|
stmt statement handle
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
This function can be called after you prepared the statement handle
|
||||||
|
with mysql_stmt_prepare().
|
||||||
|
XXX: not implemented yet.
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
MYSQL_RES on success, 0 if there is no metadata.
|
||||||
|
Currently this function always returns 0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MYSQL_RES * STDCALL
|
MYSQL_RES * STDCALL
|
||||||
mysql_stmt_param_metadata(MYSQL_STMT *stmt)
|
mysql_stmt_param_metadata(MYSQL_STMT *stmt)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("mysql_stmt_param_metadata");
|
DBUG_ENTER("mysql_stmt_param_metadata");
|
||||||
|
|
||||||
if (!stmt->param_count)
|
if (!stmt->param_count)
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TODO: Fix this when server sends the information.
|
TODO: Fix this when server sends the information.
|
||||||
Till then keep a dummy prototype
|
Till then keep a dummy prototype.
|
||||||
*/
|
*/
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Store type of parameter in network buffer. */
|
||||||
|
|
||||||
|
static void store_param_type(char **pos, MYSQL_BIND *param)
|
||||||
|
{
|
||||||
|
uint typecode= param->buffer_type | (param->is_unsigned ? 32768 : 0);
|
||||||
|
int2store(*pos, typecode);
|
||||||
|
*pos+= 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Functions to store parameter data in network packet.
|
Functions to store parameter data in network packet.
|
||||||
|
|
||||||
All functions have the following characteristics:
|
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
store_param_xxx()
|
store_param_xxx()
|
||||||
net MySQL NET connection
|
net MySQL NET connection
|
||||||
param MySQL bind param
|
param MySQL bind param
|
||||||
|
|
||||||
RETURN VALUES
|
DESCRIPTION
|
||||||
0 ok
|
These funtions are invoked from mysql_stmt_execute by
|
||||||
1 Error (Can't alloc net->buffer)
|
MYSQL_BIND::store_param_func pointer. This pointer is set once per many
|
||||||
|
executions in mysql_stmt_bind_param. The caller must ensure that network
|
||||||
|
buffer have enough capacity to store parameter (MYSQL_BIND::buffer_length
|
||||||
|
contains needed number of bytes).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void store_param_tinyint(NET *net, MYSQL_BIND *param)
|
static void store_param_tinyint(NET *net, MYSQL_BIND *param)
|
||||||
@ -2253,7 +2281,7 @@ static void net_store_datetime(NET *net, MYSQL_TIME *tm)
|
|||||||
length= 4;
|
length= 4;
|
||||||
else
|
else
|
||||||
length= 0;
|
length= 0;
|
||||||
buff[0]= (char) length++;
|
buff[0]= (char) length++;
|
||||||
memcpy((char *)net->write_pos, buff, length);
|
memcpy((char *)net->write_pos, buff, length);
|
||||||
net->write_pos+= length;
|
net->write_pos+= length;
|
||||||
}
|
}
|
||||||
@ -2271,7 +2299,7 @@ static void store_param_datetime(NET *net, MYSQL_BIND *param)
|
|||||||
MYSQL_TIME *tm= (MYSQL_TIME *) param->buffer;
|
MYSQL_TIME *tm= (MYSQL_TIME *) param->buffer;
|
||||||
net_store_datetime(net, tm);
|
net_store_datetime(net, tm);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void store_param_str(NET *net, MYSQL_BIND *param)
|
static void store_param_str(NET *net, MYSQL_BIND *param)
|
||||||
{
|
{
|
||||||
/* param->length is always set in mysql_stmt_bind_param */
|
/* param->length is always set in mysql_stmt_bind_param */
|
||||||
@ -2292,7 +2320,8 @@ static void store_param_str(NET *net, MYSQL_BIND *param)
|
|||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
A data package starts with a string of bits where we set a bit
|
A data package starts with a string of bits where we set a bit
|
||||||
if a parameter is NULL
|
if a parameter is NULL. Unlike bit string in result set row, here
|
||||||
|
we don't have reserved bits for OK/error packet.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void store_param_null(NET *net, MYSQL_BIND *param)
|
static void store_param_null(NET *net, MYSQL_BIND *param)
|
||||||
@ -2303,8 +2332,9 @@ static void store_param_null(NET *net, MYSQL_BIND *param)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Set parameter data by reading from input buffers from the
|
Store one parameter in network packet: data is read from
|
||||||
client application
|
client buffer and saved in network packet by means of one
|
||||||
|
of store_param_xxxx functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param)
|
static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param)
|
||||||
@ -2336,14 +2366,15 @@ static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Send the prepared query to server for execution
|
Auxilary function to send COM_EXECUTE packet to server and read reply.
|
||||||
|
Used from cli_stmt_execute, which is in turn used by mysql_stmt_execute.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length)
|
static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
|
||||||
{
|
{
|
||||||
MYSQL *mysql= stmt->mysql;
|
MYSQL *mysql= stmt->mysql;
|
||||||
NET *net= &mysql->net;
|
NET *net= &mysql->net;
|
||||||
char buff[4 /* size of stmt id */ +
|
char buff[4 /* size of stmt id */ +
|
||||||
5 /* execution flags */];
|
5 /* execution flags */];
|
||||||
DBUG_ENTER("execute");
|
DBUG_ENTER("execute");
|
||||||
DBUG_PRINT("enter",("packet: %s, length :%d",packet ? packet :" ", length));
|
DBUG_PRINT("enter",("packet: %s, length :%d",packet ? packet :" ", length));
|
||||||
@ -2363,14 +2394,6 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length)
|
|||||||
stmt->insert_id= mysql->insert_id;
|
stmt->insert_id= mysql->insert_id;
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void store_param_type(char **pos, MYSQL_BIND *param)
|
|
||||||
{
|
|
||||||
uint typecode= param->buffer_type | (param->is_unsigned ? 32768 : 0);
|
|
||||||
int2store(*pos, typecode);
|
|
||||||
*pos+= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int cli_stmt_execute(MYSQL_STMT *stmt)
|
int cli_stmt_execute(MYSQL_STMT *stmt)
|
||||||
@ -2413,7 +2436,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt)
|
|||||||
|
|
||||||
for (param= stmt->params; param < param_end; param++)
|
for (param= stmt->params; param < param_end; param++)
|
||||||
{
|
{
|
||||||
/* check if mysql_long_data() was used */
|
/* check if mysql_stmt_send_long_data() was used */
|
||||||
if (param->long_data_used)
|
if (param->long_data_used)
|
||||||
param->long_data_used= 0; /* Clear for next execute call */
|
param->long_data_used= 0; /* Clear for next execute call */
|
||||||
else if (store_param(stmt, param))
|
else if (store_param(stmt, param))
|
||||||
@ -2472,16 +2495,16 @@ static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row)
|
|||||||
0 - success; *row contains valid address of a row;
|
0 - success; *row contains valid address of a row;
|
||||||
row data is stored in network buffer
|
row data is stored in network buffer
|
||||||
1 - error; error code is written to
|
1 - error; error code is written to
|
||||||
stmt->last_{errno,error}; *row is not changed
|
stmt->last_{errno,error}; *row is not changed
|
||||||
MYSQL_NO_DATA - end of file was read from network;
|
MYSQL_NO_DATA - end of file was read from network;
|
||||||
*row is to NULL
|
*row is set to NULL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row)
|
static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row)
|
||||||
{
|
{
|
||||||
int rc= 1;
|
int rc= 1;
|
||||||
MYSQL *mysql= stmt->mysql;
|
MYSQL *mysql= stmt->mysql;
|
||||||
/*
|
/*
|
||||||
This function won't be called if stmt->field_count is zero
|
This function won't be called if stmt->field_count is zero
|
||||||
or execution wasn't done: this is ensured by mysql_stmt_execute.
|
or execution wasn't done: this is ensured by mysql_stmt_execute.
|
||||||
*/
|
*/
|
||||||
@ -2555,7 +2578,7 @@ stmt_read_row_no_data(MYSQL_STMT *stmt __attribute__((unused)),
|
|||||||
0 success
|
0 success
|
||||||
!0 wrong attribute type
|
!0 wrong attribute type
|
||||||
*/
|
*/
|
||||||
|
|
||||||
my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt,
|
my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt,
|
||||||
enum enum_stmt_attr_type attr_type,
|
enum enum_stmt_attr_type attr_type,
|
||||||
const void *value)
|
const void *value)
|
||||||
@ -2564,14 +2587,14 @@ my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt,
|
|||||||
case STMT_ATTR_UPDATE_MAX_LENGTH:
|
case STMT_ATTR_UPDATE_MAX_LENGTH:
|
||||||
stmt->update_max_length= value ? *(const my_bool*) value : 0;
|
stmt->update_max_length= value ? *(const my_bool*) value : 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
|
my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
|
||||||
enum enum_stmt_attr_type attr_type,
|
enum enum_stmt_attr_type attr_type,
|
||||||
void *value)
|
void *value)
|
||||||
{
|
{
|
||||||
@ -2579,7 +2602,7 @@ my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
|
|||||||
case STMT_ATTR_UPDATE_MAX_LENGTH:
|
case STMT_ATTR_UPDATE_MAX_LENGTH:
|
||||||
*(unsigned long *) value= stmt->update_max_length;
|
*(unsigned long *) value= stmt->update_max_length;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -2587,7 +2610,47 @@ my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Execute the prepared query
|
Send placeholders data to server (if there are placeholders)
|
||||||
|
and execute prepared statement.
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
mysql_stmt_execute()
|
||||||
|
stmt statement handle. The handle must be created
|
||||||
|
with mysql_stmt_init() and prepared with
|
||||||
|
mysql_stmt_prepare(). If there are placeholders
|
||||||
|
in the statement they must be bound to local
|
||||||
|
variables with mysql_stmt_bind_param().
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
This function will automatically flush pending result
|
||||||
|
set (if there is one), send parameters data to the server
|
||||||
|
and read result of statement execution.
|
||||||
|
If previous result set was cached with mysql_stmt_store_result()
|
||||||
|
it will also be freed in the beginning of this call.
|
||||||
|
The server can return 3 types of responses to this command:
|
||||||
|
- error, can be retrieved with mysql_stmt_error()
|
||||||
|
- ok, no result set pending. In this case we just update
|
||||||
|
stmt->insert_id and stmt->affected_rows.
|
||||||
|
- the query returns a result set: there could be 0 .. N
|
||||||
|
rows in it. In this case the server can also send updated
|
||||||
|
result set metadata.
|
||||||
|
|
||||||
|
Next steps you may want to make:
|
||||||
|
- find out if there is result set with mysql_stmt_field_count().
|
||||||
|
If there is one:
|
||||||
|
- optionally, cache entire result set on client to unblock
|
||||||
|
connection with mysql_stmt_store_result()
|
||||||
|
- bind client variables to result set columns and start read rows
|
||||||
|
with mysql_stmt_fetch().
|
||||||
|
- reset statement with mysql_stmt_reset() or close it with
|
||||||
|
mysql_stmt_close()
|
||||||
|
Otherwise:
|
||||||
|
- find out last insert id and number of affected rows with
|
||||||
|
mysql_stmt_insert_id(), mysql_stmt_affected_rows()
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
0 success
|
||||||
|
1 error, message can be retrieved with mysql_stmt_error().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
|
int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
|
||||||
@ -2681,7 +2744,19 @@ unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Return last inserted id for auto_increment columns
|
Return last inserted id for auto_increment columns.
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
mysql_stmt_insert_id()
|
||||||
|
stmt statement handle
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
Current implementation of this call has a caveat: stmt->insert_id is
|
||||||
|
unconditionally updated from mysql->insert_id in the end of each
|
||||||
|
mysql_stmt_execute(). This works OK if mysql->insert_id contains new
|
||||||
|
value (sent in reply to mysql_stmt_execute()), otherwise stmt->insert_id
|
||||||
|
value gets undefined, as it's updated from some arbitrary value saved in
|
||||||
|
connection structure during some other call.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt)
|
my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt)
|
||||||
@ -2693,11 +2768,24 @@ my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt)
|
|||||||
static my_bool int_is_null_true= 1; /* Used for MYSQL_TYPE_NULL */
|
static my_bool int_is_null_true= 1; /* Used for MYSQL_TYPE_NULL */
|
||||||
static my_bool int_is_null_false= 0;
|
static my_bool int_is_null_false= 0;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Setup the parameter data buffers from application
|
Setup the input parameter data buffers from application
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
mysql_stmt_bind_param()
|
||||||
|
stmt statement handle
|
||||||
|
The statement must be prepared with mysql_stmt_prepare().
|
||||||
|
bind Array of mysql_stmt_param_count() bind parameters.
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
0 success
|
||||||
|
1 error, can be retrieved with mysql_stmt_error.
|
||||||
|
Note, that this function doesn't check that size of MYSQL_BIND
|
||||||
|
array is >= mysql_stmt_field_count(),
|
||||||
*/
|
*/
|
||||||
|
|
||||||
my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
|
my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *bind)
|
||||||
{
|
{
|
||||||
uint count=0;
|
uint count=0;
|
||||||
MYSQL_BIND *param, *end;
|
MYSQL_BIND *param, *end;
|
||||||
@ -2785,9 +2873,8 @@ my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
|
|||||||
case MYSQL_TYPE_STRING:
|
case MYSQL_TYPE_STRING:
|
||||||
param->store_param_func= store_param_str;
|
param->store_param_func= store_param_str;
|
||||||
/*
|
/*
|
||||||
For variable length types we expect user to set
|
For variable length types user must set either length or
|
||||||
length or buffer_length. Otherwise mysql_stmt_execute
|
buffer_length.
|
||||||
will just fail.
|
|
||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -2804,7 +2891,7 @@ my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
|
|||||||
if (!param->length)
|
if (!param->length)
|
||||||
param->length= ¶m->buffer_length;
|
param->length= ¶m->buffer_length;
|
||||||
}
|
}
|
||||||
/* We have to send/resendtype information to MySQL */
|
/* We have to send/resend type information to MySQL */
|
||||||
stmt->send_types_to_server= TRUE;
|
stmt->send_types_to_server= TRUE;
|
||||||
stmt->bind_param_done= TRUE;
|
stmt->bind_param_done= TRUE;
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
@ -2825,6 +2912,30 @@ my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
|
|||||||
data Data to send to server
|
data Data to send to server
|
||||||
length Length of data to send (may be 0)
|
length Length of data to send (may be 0)
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
This call can be used repeatedly to send long data in pieces
|
||||||
|
for any string/binary placeholder. Data supplied for
|
||||||
|
a placeholder is saved at server side till execute, and then
|
||||||
|
used instead of value from MYSQL_BIND object. More precisely,
|
||||||
|
if long data for a parameter was supplied, MYSQL_BIND object
|
||||||
|
corresponding to this parameter is not sent to server. In the
|
||||||
|
end of execution long data states of placeholders are reset,
|
||||||
|
so next time values of such placeholders will be taken again
|
||||||
|
from MYSQL_BIND array.
|
||||||
|
The server does not reply to this call: if there was an error
|
||||||
|
in data handling (which now only can happen if server run out
|
||||||
|
of memory) it would be returned in reply to
|
||||||
|
mysql_stmt_execute().
|
||||||
|
You should choose type of long data carefully if you care
|
||||||
|
about character set conversions performed by server when the
|
||||||
|
statement is executed. No conversion is performed at all for
|
||||||
|
MYSQL_TYPE_BLOB and other binary typecodes. For
|
||||||
|
MYSQL_TYPE_STRING and the rest of text placeholders data is
|
||||||
|
converted from client character set to character set of
|
||||||
|
connection. If these character sets are different, this
|
||||||
|
conversion may require additional memory at server, equal to
|
||||||
|
total size of supplied pieces.
|
||||||
|
|
||||||
RETURN VALUES
|
RETURN VALUES
|
||||||
0 ok
|
0 ok
|
||||||
1 error
|
1 error
|
||||||
@ -2839,7 +2950,7 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
|||||||
DBUG_ASSERT(stmt != 0);
|
DBUG_ASSERT(stmt != 0);
|
||||||
DBUG_PRINT("enter",("param no : %d, data : %lx, length : %ld",
|
DBUG_PRINT("enter",("param no : %d, data : %lx, length : %ld",
|
||||||
param_number, data, length));
|
param_number, data, length));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
We only need to check for stmt->param_count, if it's not null
|
We only need to check for stmt->param_count, if it's not null
|
||||||
prepare was done.
|
prepare was done.
|
||||||
@ -2864,7 +2975,7 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
|||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Send long data packet if there is data or we're sending long data
|
Send long data packet if there is data or we're sending long data
|
||||||
for the first time.
|
for the first time.
|
||||||
*/
|
*/
|
||||||
@ -2872,8 +2983,8 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
|||||||
{
|
{
|
||||||
MYSQL *mysql= stmt->mysql;
|
MYSQL *mysql= stmt->mysql;
|
||||||
/* Packet header: stmt id (4 bytes), param no (2 bytes) */
|
/* Packet header: stmt id (4 bytes), param no (2 bytes) */
|
||||||
char buff[MYSQL_LONG_DATA_HEADER];
|
char buff[MYSQL_LONG_DATA_HEADER];
|
||||||
|
|
||||||
int4store(buff, stmt->stmt_id);
|
int4store(buff, stmt->stmt_id);
|
||||||
int2store(buff + 4, param_number);
|
int2store(buff + 4, param_number);
|
||||||
param->long_data_used= 1;
|
param->long_data_used= 1;
|
||||||
@ -2926,7 +3037,7 @@ static uint read_binary_time(MYSQL_TIME *tm, uchar **pos)
|
|||||||
{
|
{
|
||||||
uchar *to;
|
uchar *to;
|
||||||
uint length;
|
uint length;
|
||||||
|
|
||||||
/* net_field_length will set pos to the first byte of data */
|
/* net_field_length will set pos to the first byte of data */
|
||||||
if (!(length= net_field_length(pos)))
|
if (!(length= net_field_length(pos)))
|
||||||
{
|
{
|
||||||
@ -2983,14 +3094,14 @@ static uint read_binary_date(MYSQL_TIME *tm, uchar **pos)
|
|||||||
{
|
{
|
||||||
uchar *to;
|
uchar *to;
|
||||||
uint length;
|
uint length;
|
||||||
|
|
||||||
if (!(length= net_field_length(pos)))
|
if (!(length= net_field_length(pos)))
|
||||||
{
|
{
|
||||||
set_zero_time(tm);
|
set_zero_time(tm);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
to= *pos;
|
to= *pos;
|
||||||
tm->year = (uint) sint2korr(to);
|
tm->year = (uint) sint2korr(to);
|
||||||
tm->month= (uint) to[2];
|
tm->month= (uint) to[2];
|
||||||
tm->day= (uint) to[3];
|
tm->day= (uint) to[3];
|
||||||
@ -3004,7 +3115,7 @@ static uint read_binary_date(MYSQL_TIME *tm, uchar **pos)
|
|||||||
/* Convert Numeric to buffer types */
|
/* Convert Numeric to buffer types */
|
||||||
static void send_data_long(MYSQL_BIND *param, MYSQL_FIELD *field,
|
static void send_data_long(MYSQL_BIND *param, MYSQL_FIELD *field,
|
||||||
longlong value)
|
longlong value)
|
||||||
{
|
{
|
||||||
char *buffer= param->buffer;
|
char *buffer= param->buffer;
|
||||||
uint field_is_unsigned= (field->flags & UNSIGNED_FLAG);
|
uint field_is_unsigned= (field->flags & UNSIGNED_FLAG);
|
||||||
|
|
||||||
@ -3041,26 +3152,26 @@ static void send_data_long(MYSQL_BIND *param, MYSQL_FIELD *field,
|
|||||||
{
|
{
|
||||||
char tmp[22]; /* Enough for longlong */
|
char tmp[22]; /* Enough for longlong */
|
||||||
uint length= (uint)(longlong10_to_str(value,(char *)tmp,
|
uint length= (uint)(longlong10_to_str(value,(char *)tmp,
|
||||||
field_is_unsigned ? 10: -10) -
|
field_is_unsigned ? 10: -10) -
|
||||||
tmp);
|
tmp);
|
||||||
ulong copy_length= min((ulong)length-param->offset, param->buffer_length);
|
ulong copy_length= min((ulong)length-param->offset, param->buffer_length);
|
||||||
if ((long) copy_length < 0)
|
if ((long) copy_length < 0)
|
||||||
copy_length=0;
|
copy_length=0;
|
||||||
else
|
else
|
||||||
memcpy(buffer, (char *)tmp+param->offset, copy_length);
|
memcpy(buffer, (char *)tmp+param->offset, copy_length);
|
||||||
*param->length= length;
|
*param->length= length;
|
||||||
|
|
||||||
if (copy_length != param->buffer_length)
|
if (copy_length != param->buffer_length)
|
||||||
*(buffer+copy_length)= '\0';
|
*(buffer+copy_length)= '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Convert Double to buffer types */
|
/* Convert Double to buffer types */
|
||||||
|
|
||||||
static void send_data_double(MYSQL_BIND *param, double value)
|
static void send_data_double(MYSQL_BIND *param, double value)
|
||||||
{
|
{
|
||||||
char *buffer= param->buffer;
|
char *buffer= param->buffer;
|
||||||
|
|
||||||
switch(param->buffer_type) {
|
switch(param->buffer_type) {
|
||||||
@ -3099,19 +3210,19 @@ static void send_data_double(MYSQL_BIND *param, double value)
|
|||||||
copy_length=0;
|
copy_length=0;
|
||||||
else
|
else
|
||||||
memcpy(buffer, (char *)tmp+param->offset, copy_length);
|
memcpy(buffer, (char *)tmp+param->offset, copy_length);
|
||||||
*param->length= length;
|
*param->length= length;
|
||||||
|
|
||||||
if (copy_length != param->buffer_length)
|
if (copy_length != param->buffer_length)
|
||||||
*(buffer+copy_length)= '\0';
|
*(buffer+copy_length)= '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Convert string to buffer types */
|
/* Convert string to buffer types */
|
||||||
|
|
||||||
static void send_data_str(MYSQL_BIND *param, char *value, uint length)
|
static void send_data_str(MYSQL_BIND *param, char *value, uint length)
|
||||||
{
|
{
|
||||||
char *buffer= param->buffer;
|
char *buffer= param->buffer;
|
||||||
int err=0;
|
int err=0;
|
||||||
|
|
||||||
@ -3136,7 +3247,7 @@ static void send_data_str(MYSQL_BIND *param, char *value, uint length)
|
|||||||
{
|
{
|
||||||
int32 data= (int32)my_strntol(&my_charset_latin1,value,length,10,NULL,
|
int32 data= (int32)my_strntol(&my_charset_latin1,value,length,10,NULL,
|
||||||
&err);
|
&err);
|
||||||
int4store(buffer, data);
|
int4store(buffer, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MYSQL_TYPE_LONGLONG:
|
case MYSQL_TYPE_LONGLONG:
|
||||||
@ -3179,7 +3290,7 @@ static void send_data_str(MYSQL_BIND *param, char *value, uint length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void send_data_time(MYSQL_BIND *param, MYSQL_TIME ltime,
|
static void send_data_time(MYSQL_BIND *param, MYSQL_TIME ltime,
|
||||||
uint length)
|
uint length)
|
||||||
{
|
{
|
||||||
switch (param->buffer_type) {
|
switch (param->buffer_type) {
|
||||||
@ -3192,7 +3303,7 @@ static void send_data_time(MYSQL_BIND *param, MYSQL_TIME ltime,
|
|||||||
case MYSQL_TYPE_TIMESTAMP:
|
case MYSQL_TYPE_TIMESTAMP:
|
||||||
{
|
{
|
||||||
MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer;
|
MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer;
|
||||||
|
|
||||||
tm->year= ltime.year;
|
tm->year= ltime.year;
|
||||||
tm->month= ltime.month;
|
tm->month= ltime.month;
|
||||||
tm->day= ltime.day;
|
tm->day= ltime.day;
|
||||||
@ -3203,33 +3314,33 @@ static void send_data_time(MYSQL_BIND *param, MYSQL_TIME ltime,
|
|||||||
|
|
||||||
tm->second_part= ltime.second_part;
|
tm->second_part= ltime.second_part;
|
||||||
tm->neg= ltime.neg;
|
tm->neg= ltime.neg;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
char buff[25];
|
char buff[25];
|
||||||
|
|
||||||
if (!length)
|
if (!length)
|
||||||
ltime.time_type= MYSQL_TIMESTAMP_NONE;
|
ltime.time_type= MYSQL_TIMESTAMP_NONE;
|
||||||
switch (ltime.time_type) {
|
switch (ltime.time_type) {
|
||||||
case MYSQL_TIMESTAMP_DATE:
|
case MYSQL_TIMESTAMP_DATE:
|
||||||
length= my_sprintf(buff,(buff, "%04d-%02d-%02d", ltime.year,
|
length= my_sprintf(buff,(buff, "%04d-%02d-%02d", ltime.year,
|
||||||
ltime.month,ltime.day));
|
ltime.month,ltime.day));
|
||||||
break;
|
break;
|
||||||
case MYSQL_TIMESTAMP_FULL:
|
case MYSQL_TIMESTAMP_FULL:
|
||||||
length= my_sprintf(buff,(buff, "%04d-%02d-%02d %02d:%02d:%02d",
|
length= my_sprintf(buff,(buff, "%04d-%02d-%02d %02d:%02d:%02d",
|
||||||
ltime.year,ltime.month,ltime.day,
|
ltime.year,ltime.month,ltime.day,
|
||||||
ltime.hour,ltime.minute,ltime.second));
|
ltime.hour,ltime.minute,ltime.second));
|
||||||
break;
|
break;
|
||||||
case MYSQL_TIMESTAMP_TIME:
|
case MYSQL_TIMESTAMP_TIME:
|
||||||
length= my_sprintf(buff, (buff, "%02d:%02d:%02d",
|
length= my_sprintf(buff, (buff, "%02d:%02d:%02d",
|
||||||
ltime.hour,ltime.minute,ltime.second));
|
ltime.hour,ltime.minute,ltime.second));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
length= 0;
|
length= 0;
|
||||||
buff[0]='\0';
|
buff[0]='\0';
|
||||||
}
|
}
|
||||||
send_data_str(param, (char *)buff, length);
|
send_data_str(param, (char *)buff, length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3261,7 +3372,7 @@ static void fetch_results(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row)
|
|||||||
longlong data= ((field_is_unsigned) ? (longlong) (unsigned short) value:
|
longlong data= ((field_is_unsigned) ? (longlong) (unsigned short) value:
|
||||||
(longlong) value);
|
(longlong) value);
|
||||||
send_data_long(param, field, data);
|
send_data_long(param, field, data);
|
||||||
length= 2;
|
length= 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MYSQL_TYPE_LONG:
|
case MYSQL_TYPE_LONG:
|
||||||
@ -3300,7 +3411,7 @@ static void fetch_results(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row)
|
|||||||
case MYSQL_TYPE_DATE:
|
case MYSQL_TYPE_DATE:
|
||||||
{
|
{
|
||||||
MYSQL_TIME tm;
|
MYSQL_TIME tm;
|
||||||
|
|
||||||
length= read_binary_date(&tm, row);
|
length= read_binary_date(&tm, row);
|
||||||
tm.time_type= MYSQL_TIMESTAMP_DATE;
|
tm.time_type= MYSQL_TIMESTAMP_DATE;
|
||||||
send_data_time(param, tm, length);
|
send_data_time(param, tm, length);
|
||||||
@ -3309,7 +3420,7 @@ static void fetch_results(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row)
|
|||||||
case MYSQL_TYPE_TIME:
|
case MYSQL_TYPE_TIME:
|
||||||
{
|
{
|
||||||
MYSQL_TIME tm;
|
MYSQL_TIME tm;
|
||||||
|
|
||||||
length= read_binary_time(&tm, row);
|
length= read_binary_time(&tm, row);
|
||||||
tm.time_type= MYSQL_TIMESTAMP_TIME;
|
tm.time_type= MYSQL_TIMESTAMP_TIME;
|
||||||
send_data_time(param, tm, length);
|
send_data_time(param, tm, length);
|
||||||
@ -3319,14 +3430,14 @@ static void fetch_results(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row)
|
|||||||
case MYSQL_TYPE_TIMESTAMP:
|
case MYSQL_TYPE_TIMESTAMP:
|
||||||
{
|
{
|
||||||
MYSQL_TIME tm;
|
MYSQL_TIME tm;
|
||||||
|
|
||||||
length= read_binary_datetime(&tm, row);
|
length= read_binary_datetime(&tm, row);
|
||||||
tm.time_type= MYSQL_TIMESTAMP_FULL;
|
tm.time_type= MYSQL_TIMESTAMP_FULL;
|
||||||
send_data_time(param, tm, length);
|
send_data_time(param, tm, length);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
length= net_field_length(row);
|
length= net_field_length(row);
|
||||||
send_data_str(param,(char*) *row,length);
|
send_data_str(param,(char*) *row,length);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3355,7 +3466,7 @@ static void fetch_result_int32(MYSQL_BIND *param, uchar **row)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void fetch_result_int64(MYSQL_BIND *param, uchar **row)
|
static void fetch_result_int64(MYSQL_BIND *param, uchar **row)
|
||||||
{
|
{
|
||||||
longlong value= (longlong)sint8korr(*row);
|
longlong value= (longlong)sint8korr(*row);
|
||||||
longlongstore(param->buffer, value);
|
longlongstore(param->buffer, value);
|
||||||
*row+= 8;
|
*row+= 8;
|
||||||
@ -3396,11 +3507,11 @@ static void fetch_result_datetime(MYSQL_BIND *param, uchar **row)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void fetch_result_bin(MYSQL_BIND *param, uchar **row)
|
static void fetch_result_bin(MYSQL_BIND *param, uchar **row)
|
||||||
{
|
{
|
||||||
ulong length= net_field_length(row);
|
ulong length= net_field_length(row);
|
||||||
ulong copy_length= min(length, param->buffer_length);
|
ulong copy_length= min(length, param->buffer_length);
|
||||||
memcpy(param->buffer, (char *)*row, copy_length);
|
memcpy(param->buffer, (char *)*row, copy_length);
|
||||||
*param->length= length;
|
*param->length= length;
|
||||||
*row+= length;
|
*row+= length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3481,7 +3592,7 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
|
|||||||
We only need to check that stmt->field_count - if it is not null
|
We only need to check that stmt->field_count - if it is not null
|
||||||
stmt->bind was initialized in mysql_stmt_prepare
|
stmt->bind was initialized in mysql_stmt_prepare
|
||||||
*/
|
*/
|
||||||
|
|
||||||
memcpy((char*) stmt->bind, (char*) bind, sizeof(MYSQL_BIND) * bind_count);
|
memcpy((char*) stmt->bind, (char*) bind, sizeof(MYSQL_BIND) * bind_count);
|
||||||
|
|
||||||
for (param= stmt->bind, end= param + bind_count, field= stmt->fields ;
|
for (param= stmt->bind, end= param + bind_count, field= stmt->fields ;
|
||||||
@ -3643,16 +3754,16 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row)
|
|||||||
/* If output parameters were not bound we should just return success */
|
/* If output parameters were not bound we should just return success */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
null_ptr= row;
|
null_ptr= row;
|
||||||
row+= (stmt->field_count+9)/8; /* skip null bits */
|
row+= (stmt->field_count+9)/8; /* skip null bits */
|
||||||
bit= 4; /* first 2 bits are reserved */
|
bit= 4; /* first 2 bits are reserved */
|
||||||
|
|
||||||
/* Copy complete row to application buffers */
|
/* Copy complete row to application buffers */
|
||||||
for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ;
|
for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ;
|
||||||
bind < end ;
|
bind < end ;
|
||||||
bind++, field++)
|
bind++, field++)
|
||||||
{
|
{
|
||||||
if (*null_ptr & bit)
|
if (*null_ptr & bit)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -3666,12 +3777,12 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row)
|
|||||||
*bind->is_null= 1;
|
*bind->is_null= 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*bind->is_null= 0;
|
*bind->is_null= 0;
|
||||||
bind->inter_buffer= row;
|
bind->inter_buffer= row;
|
||||||
if (field->type == bind->buffer_type)
|
if (field->type == bind->buffer_type)
|
||||||
(*bind->fetch_result)(bind, &row);
|
(*bind->fetch_result)(bind, &row);
|
||||||
else
|
else
|
||||||
fetch_results(bind, field, &row);
|
fetch_results(bind, field, &row);
|
||||||
}
|
}
|
||||||
if (!((bit<<=1) & 255))
|
if (!((bit<<=1) & 255))
|
||||||
@ -3731,15 +3842,15 @@ int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt)
|
|||||||
column Column to fetch (first column is 0)
|
column Column to fetch (first column is 0)
|
||||||
ulong offset Offset in result data (to fetch blob in pieces)
|
ulong offset Offset in result data (to fetch blob in pieces)
|
||||||
This is normally 0
|
This is normally 0
|
||||||
RETURN
|
RETURN
|
||||||
0 ok
|
0 ok
|
||||||
1 error
|
1 error
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind,
|
int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind,
|
||||||
uint column, ulong offset)
|
uint column, ulong offset)
|
||||||
{
|
{
|
||||||
MYSQL_BIND *param= stmt->bind+column;
|
MYSQL_BIND *param= stmt->bind+column;
|
||||||
DBUG_ENTER("mysql_stmt_fetch_column");
|
DBUG_ENTER("mysql_stmt_fetch_column");
|
||||||
|
|
||||||
if ((int) stmt->state < (int) MYSQL_STMT_FETCH_DONE)
|
if ((int) stmt->state < (int) MYSQL_STMT_FETCH_DONE)
|
||||||
@ -3755,7 +3866,7 @@ int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind,
|
|||||||
|
|
||||||
if (param->inter_buffer)
|
if (param->inter_buffer)
|
||||||
{
|
{
|
||||||
MYSQL_FIELD *field= stmt->fields+column;
|
MYSQL_FIELD *field= stmt->fields+column;
|
||||||
uchar *row= param->inter_buffer;
|
uchar *row= param->inter_buffer;
|
||||||
bind->offset= offset;
|
bind->offset= offset;
|
||||||
if (bind->is_null)
|
if (bind->is_null)
|
||||||
@ -3825,6 +3936,49 @@ err:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Update meta data for statement
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
stmt_update_metadata()
|
||||||
|
stmt Statement handler
|
||||||
|
row Binary data
|
||||||
|
|
||||||
|
NOTES
|
||||||
|
Only updates MYSQL_FIELD->max_length for strings
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data)
|
||||||
|
{
|
||||||
|
MYSQL_BIND *bind, *end;
|
||||||
|
MYSQL_FIELD *field;
|
||||||
|
uchar *null_ptr, bit;
|
||||||
|
uchar *row= (uchar*) data->data;
|
||||||
|
#ifndef DBUG_OFF
|
||||||
|
uchar *row_end= row + data->length;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
null_ptr= row;
|
||||||
|
row+= (stmt->field_count+9)/8; /* skip null bits */
|
||||||
|
bit= 4; /* first 2 bits are reserved */
|
||||||
|
|
||||||
|
/* Go throw all fields and calculate metadata */
|
||||||
|
for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ;
|
||||||
|
bind < end ;
|
||||||
|
bind++, field++)
|
||||||
|
{
|
||||||
|
if (!(*null_ptr & bit))
|
||||||
|
(*bind->skip_result)(bind, field, &row);
|
||||||
|
DBUG_ASSERT(row <= row_end);
|
||||||
|
if (!((bit<<=1) & 255))
|
||||||
|
{
|
||||||
|
bit= 1; /* To next byte */
|
||||||
|
null_ptr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Store or buffer the binary results to stmt
|
Store or buffer the binary results to stmt
|
||||||
*/
|
*/
|
||||||
@ -3880,6 +4034,7 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
|
|||||||
free_root(&result->alloc, MYF(MY_KEEP_PREALLOC));
|
free_root(&result->alloc, MYF(MY_KEEP_PREALLOC));
|
||||||
result->data= NULL;
|
result->data= NULL;
|
||||||
result->rows= 0;
|
result->rows= 0;
|
||||||
|
mysql->status= MYSQL_STATUS_READY;
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3908,7 +4063,7 @@ mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row)
|
|||||||
{
|
{
|
||||||
MYSQL_ROW_OFFSET offset= stmt->data_cursor;
|
MYSQL_ROW_OFFSET offset= stmt->data_cursor;
|
||||||
DBUG_ENTER("mysql_stmt_row_seek");
|
DBUG_ENTER("mysql_stmt_row_seek");
|
||||||
|
|
||||||
stmt->data_cursor= row;
|
stmt->data_cursor= row;
|
||||||
DBUG_RETURN(offset);
|
DBUG_RETURN(offset);
|
||||||
}
|
}
|
||||||
@ -3918,11 +4073,11 @@ mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row)
|
|||||||
Return the current statement row cursor position
|
Return the current statement row cursor position
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MYSQL_ROW_OFFSET STDCALL
|
MYSQL_ROW_OFFSET STDCALL
|
||||||
mysql_stmt_row_tell(MYSQL_STMT *stmt)
|
mysql_stmt_row_tell(MYSQL_STMT *stmt)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("mysql_stmt_row_tell");
|
DBUG_ENTER("mysql_stmt_row_tell");
|
||||||
|
|
||||||
DBUG_RETURN(stmt->data_cursor);
|
DBUG_RETURN(stmt->data_cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3937,7 +4092,7 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
|
|||||||
MYSQL_ROWS *tmp= stmt->result.data;
|
MYSQL_ROWS *tmp= stmt->result.data;
|
||||||
DBUG_ENTER("mysql_stmt_data_seek");
|
DBUG_ENTER("mysql_stmt_data_seek");
|
||||||
DBUG_PRINT("enter",("row id to seek: %ld",(long) row));
|
DBUG_PRINT("enter",("row id to seek: %ld",(long) row));
|
||||||
|
|
||||||
for (; tmp && row; --row, tmp= tmp->next)
|
for (; tmp && row; --row, tmp= tmp->next)
|
||||||
;
|
;
|
||||||
stmt->data_cursor= tmp;
|
stmt->data_cursor= tmp;
|
||||||
@ -3952,7 +4107,7 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
|
|||||||
my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt)
|
my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("mysql_stmt_num_rows");
|
DBUG_ENTER("mysql_stmt_num_rows");
|
||||||
|
|
||||||
DBUG_RETURN(stmt->result.rows);
|
DBUG_RETURN(stmt->result.rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3962,7 +4117,7 @@ my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt)
|
|||||||
DBUG_ENTER("mysql_stmt_free_result");
|
DBUG_ENTER("mysql_stmt_free_result");
|
||||||
|
|
||||||
DBUG_ASSERT(stmt != 0);
|
DBUG_ASSERT(stmt != 0);
|
||||||
|
|
||||||
if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
|
if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
|
||||||
{
|
{
|
||||||
MYSQL *mysql= stmt->mysql;
|
MYSQL *mysql= stmt->mysql;
|
||||||
@ -4030,7 +4185,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
|
|||||||
mysql->unbuffered_fetch_owner= 0;
|
mysql->unbuffered_fetch_owner= 0;
|
||||||
if (mysql->status != MYSQL_STATUS_READY)
|
if (mysql->status != MYSQL_STATUS_READY)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Flush result set of the connection. If it does not belong
|
Flush result set of the connection. If it does not belong
|
||||||
to this statement, set a warning.
|
to this statement, set a warning.
|
||||||
*/
|
*/
|
||||||
@ -4068,13 +4223,13 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
|
|||||||
/* If statement hasnt been prepared there is nothing to reset */
|
/* If statement hasnt been prepared there is nothing to reset */
|
||||||
if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE)
|
if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE)
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
mysql= stmt->mysql->last_used_con;
|
mysql= stmt->mysql->last_used_con;
|
||||||
int4store(buff, stmt->stmt_id); /* Send stmt id to server */
|
int4store(buff, stmt->stmt_id); /* Send stmt id to server */
|
||||||
if ((*mysql->methods->advanced_command)(mysql, COM_RESET_STMT, buff,
|
if ((*mysql->methods->advanced_command)(mysql, COM_RESET_STMT, buff,
|
||||||
sizeof(buff), 0, 0, 0))
|
sizeof(buff), 0, 0, 0))
|
||||||
{
|
{
|
||||||
set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
|
set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
|
||||||
mysql->net.sqlstate);
|
mysql->net.sqlstate);
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
@ -4115,50 +4270,6 @@ const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
Update meta data for statement
|
|
||||||
|
|
||||||
SYNOPSIS
|
|
||||||
stmt_update_metadata()
|
|
||||||
stmt Statement handler
|
|
||||||
row Binary data
|
|
||||||
|
|
||||||
NOTES
|
|
||||||
Only updates MYSQL_FIELD->max_length for strings
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data)
|
|
||||||
{
|
|
||||||
MYSQL_BIND *bind, *end;
|
|
||||||
MYSQL_FIELD *field;
|
|
||||||
uchar *null_ptr, bit;
|
|
||||||
uchar *row= (uchar*) data->data;
|
|
||||||
#ifndef DBUG_OFF
|
|
||||||
uchar *row_end= row + data->length;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
null_ptr= row;
|
|
||||||
row+= (stmt->field_count+9)/8; /* skip null bits */
|
|
||||||
bit= 4; /* first 2 bits are reserved */
|
|
||||||
|
|
||||||
/* Go throw all fields and calculate metadata */
|
|
||||||
for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ;
|
|
||||||
bind < end ;
|
|
||||||
bind++, field++)
|
|
||||||
{
|
|
||||||
if (!(*null_ptr & bit))
|
|
||||||
(*bind->skip_result)(bind, field, &row);
|
|
||||||
DBUG_ASSERT(row <= row_end);
|
|
||||||
if (!((bit<<=1) & 255))
|
|
||||||
{
|
|
||||||
bit= 1; /* To next byte */
|
|
||||||
null_ptr++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
Transactional APIs
|
Transactional APIs
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
@ -4212,10 +4323,10 @@ my_bool STDCALL mysql_more_results(MYSQL *mysql)
|
|||||||
{
|
{
|
||||||
my_bool res;
|
my_bool res;
|
||||||
DBUG_ENTER("mysql_more_results");
|
DBUG_ENTER("mysql_more_results");
|
||||||
|
|
||||||
res= ((mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS) ?
|
res= ((mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS) ?
|
||||||
1: 0);
|
1: 0);
|
||||||
DBUG_PRINT("exit",("More results exists ? %d", res));
|
DBUG_PRINT("exit",("More results exists ? %d", res));
|
||||||
DBUG_RETURN(res);
|
DBUG_RETURN(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4226,7 +4337,7 @@ my_bool STDCALL mysql_more_results(MYSQL *mysql)
|
|||||||
int STDCALL mysql_next_result(MYSQL *mysql)
|
int STDCALL mysql_next_result(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("mysql_next_result");
|
DBUG_ENTER("mysql_next_result");
|
||||||
|
|
||||||
if (mysql->status != MYSQL_STATUS_READY)
|
if (mysql->status != MYSQL_STATUS_READY)
|
||||||
{
|
{
|
||||||
strmov(mysql->net.sqlstate, unknown_sqlstate);
|
strmov(mysql->net.sqlstate, unknown_sqlstate);
|
||||||
|
@ -511,6 +511,7 @@ int check_embedded_connection(MYSQL *mysql)
|
|||||||
thd->host= (char*)my_localhost;
|
thd->host= (char*)my_localhost;
|
||||||
thd->host_or_ip= thd->host;
|
thd->host_or_ip= thd->host;
|
||||||
thd->user= my_strdup(mysql->user, MYF(0));
|
thd->user= my_strdup(mysql->user, MYF(0));
|
||||||
|
thd->priv_user= thd->user;
|
||||||
return check_user(thd, COM_CONNECT, NULL, 0, thd->db, true);
|
return check_user(thd, COM_CONNECT, NULL, 0, thd->db, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,10 +53,10 @@ static double _nwghts[11]=
|
|||||||
-3.796875000000000};
|
-3.796875000000000};
|
||||||
static double *nwghts=_nwghts+5; /* nwghts[i] = -0.5*1.5**i */
|
static double *nwghts=_nwghts+5; /* nwghts[i] = -0.5*1.5**i */
|
||||||
|
|
||||||
#define FTB_FLAG_TRUNC 1 /* MUST be 1 */
|
#define FTB_FLAG_TRUNC 1 /* */
|
||||||
#define FTB_FLAG_YES 2 /* no two from these three */
|
#define FTB_FLAG_YES 2 /* no two from these three */
|
||||||
#define FTB_FLAG_NO 4 /* YES, NO, WONLY */
|
#define FTB_FLAG_NO 4 /* YES, NO, WONLY */
|
||||||
#define FTB_FLAG_WONLY 8 /* should be ever set both */
|
#define FTB_FLAG_WONLY 8 /* should be _ever_ set both */
|
||||||
|
|
||||||
typedef struct st_ftb_expr FTB_EXPR;
|
typedef struct st_ftb_expr FTB_EXPR;
|
||||||
struct st_ftb_expr
|
struct st_ftb_expr
|
||||||
@ -157,6 +157,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
|
|||||||
w.len+extra));
|
w.len+extra));
|
||||||
ftbw->len=w.len+1;
|
ftbw->len=w.len+1;
|
||||||
ftbw->flags=0;
|
ftbw->flags=0;
|
||||||
|
ftbw->off=0;
|
||||||
if (param.yesno>0) ftbw->flags|=FTB_FLAG_YES;
|
if (param.yesno>0) ftbw->flags|=FTB_FLAG_YES;
|
||||||
if (param.yesno<0) ftbw->flags|=FTB_FLAG_NO;
|
if (param.yesno<0) ftbw->flags|=FTB_FLAG_NO;
|
||||||
if (param.trunc) ftbw->flags|=FTB_FLAG_TRUNC;
|
if (param.trunc) ftbw->flags|=FTB_FLAG_TRUNC;
|
||||||
@ -203,23 +204,26 @@ static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)),
|
|||||||
static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
|
static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
uint off;
|
|
||||||
int subkeys=1;
|
int subkeys=1;
|
||||||
my_bool can_go_down;
|
my_bool can_go_down;
|
||||||
MI_INFO *info=ftb->info;
|
MI_INFO *info=ftb->info;
|
||||||
|
uint off, extra=HA_FT_WLEN+info->s->base.rec_reflength;
|
||||||
|
byte *lastkey_buf=ftbw->word+ftbw->off;
|
||||||
|
|
||||||
|
if (ftbw->flags & FTB_FLAG_TRUNC)
|
||||||
|
lastkey_buf+=ftbw->len;
|
||||||
|
|
||||||
if (init_search)
|
if (init_search)
|
||||||
{
|
{
|
||||||
ftbw->key_root=info->s->state.key_root[ftb->keynr];
|
ftbw->key_root=info->s->state.key_root[ftb->keynr];
|
||||||
ftbw->keyinfo=info->s->keyinfo+ftb->keynr;
|
ftbw->keyinfo=info->s->keyinfo+ftb->keynr;
|
||||||
ftbw->off=0;
|
|
||||||
|
|
||||||
r=_mi_search(info, ftbw->keyinfo, (uchar*) ftbw->word, ftbw->len,
|
r=_mi_search(info, ftbw->keyinfo, (uchar*) ftbw->word, ftbw->len,
|
||||||
SEARCH_FIND | SEARCH_BIGGER, ftbw->key_root);
|
SEARCH_FIND | SEARCH_BIGGER, ftbw->key_root);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
r=_mi_search(info, ftbw->keyinfo, (uchar*) ftbw->word+ftbw->off,
|
r=_mi_search(info, ftbw->keyinfo, (uchar*) lastkey_buf,
|
||||||
USE_WHOLE_KEY, SEARCH_BIGGER, ftbw->key_root);
|
USE_WHOLE_KEY, SEARCH_BIGGER, ftbw->key_root);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +234,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
|
|||||||
if (can_go_down)
|
if (can_go_down)
|
||||||
{
|
{
|
||||||
/* going down ? */
|
/* going down ? */
|
||||||
off=info->lastkey_length-HA_FT_WLEN-info->s->base.rec_reflength;
|
off=info->lastkey_length-extra;
|
||||||
subkeys=ft_sintXkorr(info->lastkey+off);
|
subkeys=ft_sintXkorr(info->lastkey+off);
|
||||||
}
|
}
|
||||||
if (subkeys<0 || info->lastpos < info->state->data_file_length)
|
if (subkeys<0 || info->lastpos < info->state->data_file_length)
|
||||||
@ -243,11 +247,11 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
|
|||||||
if (!r && !ftbw->off)
|
if (!r && !ftbw->off)
|
||||||
{
|
{
|
||||||
r= mi_compare_text(ftb->charset,
|
r= mi_compare_text(ftb->charset,
|
||||||
info->lastkey + (ftbw->flags & FTB_FLAG_TRUNC),
|
info->lastkey+1,
|
||||||
ftbw->len - (ftbw->flags & FTB_FLAG_TRUNC),
|
info->lastkey_length-extra-1,
|
||||||
(uchar*) ftbw->word + (ftbw->flags & FTB_FLAG_TRUNC),
|
(uchar*) ftbw->word+1,
|
||||||
ftbw->len - (ftbw->flags & FTB_FLAG_TRUNC),
|
ftbw->len-1,
|
||||||
0,0);
|
(my_bool) (ftbw->flags & FTB_FLAG_TRUNC),0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r) /* not found */
|
if (r) /* not found */
|
||||||
@ -269,8 +273,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* going up to the first-level tree to continue search there */
|
/* going up to the first-level tree to continue search there */
|
||||||
_mi_dpointer(info, (uchar*) (ftbw->word+ftbw->off+HA_FT_WLEN),
|
_mi_dpointer(info, (uchar*) (lastkey_buf+HA_FT_WLEN), ftbw->key_root);
|
||||||
ftbw->key_root);
|
|
||||||
ftbw->key_root=info->s->state.key_root[ftb->keynr];
|
ftbw->key_root=info->s->state.key_root[ftb->keynr];
|
||||||
ftbw->keyinfo=info->s->keyinfo+ftb->keynr;
|
ftbw->keyinfo=info->s->keyinfo+ftb->keynr;
|
||||||
ftbw->off=0;
|
ftbw->off=0;
|
||||||
@ -278,7 +281,10 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* matching key found */
|
/* matching key found */
|
||||||
memcpy(ftbw->word+ftbw->off, info->lastkey, info->lastkey_length);
|
memcpy(lastkey_buf, info->lastkey, info->lastkey_length);
|
||||||
|
if (lastkey_buf == ftbw->word)
|
||||||
|
ftbw->len=info->lastkey_length-extra;
|
||||||
|
|
||||||
/* going down ? */
|
/* going down ? */
|
||||||
if (subkeys<0)
|
if (subkeys<0)
|
||||||
{
|
{
|
||||||
@ -291,7 +297,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
|
|||||||
ftbw->keyinfo=& info->s->ft2_keyinfo;
|
ftbw->keyinfo=& info->s->ft2_keyinfo;
|
||||||
r=_mi_search_first(info, ftbw->keyinfo, ftbw->key_root);
|
r=_mi_search_first(info, ftbw->keyinfo, ftbw->key_root);
|
||||||
DBUG_ASSERT(r==0); /* found something */
|
DBUG_ASSERT(r==0); /* found something */
|
||||||
memcpy(ftbw->word+off, info->lastkey, info->lastkey_length);
|
memcpy(lastkey_buf+off, info->lastkey, info->lastkey_length);
|
||||||
}
|
}
|
||||||
ftbw->docid[0]=info->lastpos;
|
ftbw->docid[0]=info->lastpos;
|
||||||
return 0;
|
return 0;
|
||||||
@ -356,7 +362,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
|
|||||||
else
|
else
|
||||||
reset_tree(& ftb->no_dupes);
|
reset_tree(& ftb->no_dupes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_ft2_search(ftb, ftbw, 1))
|
if (_ft2_search(ftb, ftbw, 1))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -142,6 +142,8 @@ int chk_del(MI_CHECK *param, register MI_INFO *info, uint test_flag)
|
|||||||
empty=0;
|
empty=0;
|
||||||
for (i= info->state->del ; i > 0L && next_link != HA_OFFSET_ERROR ; i--)
|
for (i= info->state->del ; i > 0L && next_link != HA_OFFSET_ERROR ; i--)
|
||||||
{
|
{
|
||||||
|
if (*killed_ptr(param))
|
||||||
|
DBUG_RETURN(1);
|
||||||
if (test_flag & T_VERBOSE)
|
if (test_flag & T_VERBOSE)
|
||||||
printf(" %9s",llstr(next_link,buff));
|
printf(" %9s",llstr(next_link,buff));
|
||||||
if (next_link >= info->state->data_file_length)
|
if (next_link >= info->state->data_file_length)
|
||||||
@ -233,6 +235,8 @@ static int check_k_link(MI_CHECK *param, register MI_INFO *info, uint nr)
|
|||||||
records= (ha_rows) (info->state->key_file_length / block_size);
|
records= (ha_rows) (info->state->key_file_length / block_size);
|
||||||
while (next_link != HA_OFFSET_ERROR && records > 0)
|
while (next_link != HA_OFFSET_ERROR && records > 0)
|
||||||
{
|
{
|
||||||
|
if (*killed_ptr(param))
|
||||||
|
DBUG_RETURN(1);
|
||||||
if (param->testflag & T_VERBOSE)
|
if (param->testflag & T_VERBOSE)
|
||||||
printf("%16s",llstr(next_link,llbuff));
|
printf("%16s",llstr(next_link,llbuff));
|
||||||
if (next_link > info->state->key_file_length ||
|
if (next_link > info->state->key_file_length ||
|
||||||
@ -372,6 +376,8 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
|
|||||||
for (key= 0,keyinfo= &share->keyinfo[0]; key < share->base.keys ;
|
for (key= 0,keyinfo= &share->keyinfo[0]; key < share->base.keys ;
|
||||||
rec_per_key_part+=keyinfo->keysegs, key++, keyinfo++)
|
rec_per_key_part+=keyinfo->keysegs, key++, keyinfo++)
|
||||||
{
|
{
|
||||||
|
if (*killed_ptr(param))
|
||||||
|
DBUG_RETURN(-1);
|
||||||
param->key_crc[key]=0;
|
param->key_crc[key]=0;
|
||||||
if (!(((ulonglong) 1 << key) & share->state.key_map))
|
if (!(((ulonglong) 1 << key) & share->state.key_map))
|
||||||
{
|
{
|
||||||
@ -592,6 +598,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
|
|||||||
}
|
}
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
|
if (*killed_ptr(param))
|
||||||
|
goto err;
|
||||||
memcpy((char*) info->lastkey,(char*) key,key_length);
|
memcpy((char*) info->lastkey,(char*) key,key_length);
|
||||||
info->lastkey_length=key_length;
|
info->lastkey_length=key_length;
|
||||||
if (nod_flag)
|
if (nod_flag)
|
||||||
@ -782,6 +790,8 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
|
|||||||
bzero((char*) key_checksum, info->s->base.keys * sizeof(key_checksum[0]));
|
bzero((char*) key_checksum, info->s->base.keys * sizeof(key_checksum[0]));
|
||||||
while (pos < info->state->data_file_length)
|
while (pos < info->state->data_file_length)
|
||||||
{
|
{
|
||||||
|
if (*killed_ptr(param))
|
||||||
|
goto err2;
|
||||||
switch (info->s->data_file_type) {
|
switch (info->s->data_file_type) {
|
||||||
case STATIC_RECORD:
|
case STATIC_RECORD:
|
||||||
if (my_b_read(¶m->read_cache,(byte*) record,
|
if (my_b_read(¶m->read_cache,(byte*) record,
|
||||||
|
@ -69,9 +69,9 @@ my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, byte *record,
|
|||||||
ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
|
ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
|
||||||
{
|
{
|
||||||
const byte *pos, *end;
|
const byte *pos, *end;
|
||||||
ha_checksum crc=0;
|
ulong crc= 0;
|
||||||
HA_KEYSEG *keyseg;
|
|
||||||
ulong seed= 4;
|
ulong seed= 4;
|
||||||
|
HA_KEYSEG *keyseg;
|
||||||
|
|
||||||
for (keyseg=def->seg ; keyseg < def->end ; keyseg++)
|
for (keyseg=def->seg ; keyseg < def->end ; keyseg++)
|
||||||
{
|
{
|
||||||
@ -118,7 +118,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
|
|||||||
(((uchar) *(uchar*) pos++))) +
|
(((uchar) *(uchar*) pos++))) +
|
||||||
(crc >> (8*sizeof(ha_checksum)-8));
|
(crc >> (8*sizeof(ha_checksum)-8));
|
||||||
}
|
}
|
||||||
return crc;
|
return (ha_checksum)crc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -17,7 +17,9 @@
|
|||||||
|
|
||||||
## Process this file with automake to create Makefile.in
|
## Process this file with automake to create Makefile.in
|
||||||
|
|
||||||
|
if HAVE_NDBCLUSTER_DB
|
||||||
SUBDIRS = ndb
|
SUBDIRS = ndb
|
||||||
|
endif
|
||||||
|
|
||||||
benchdir_root= $(prefix)
|
benchdir_root= $(prefix)
|
||||||
testdir = $(benchdir_root)/mysql-test
|
testdir = $(benchdir_root)/mysql-test
|
||||||
@ -74,6 +76,7 @@ SUFFIXES = .sh
|
|||||||
-e 's!@''libexecdir''@!$(libexecdir)!g' \
|
-e 's!@''libexecdir''@!$(libexecdir)!g' \
|
||||||
-e 's!@''PERL''@!@PERL@!' \
|
-e 's!@''PERL''@!@PERL@!' \
|
||||||
-e 's!@''VERSION''@!@VERSION@!' \
|
-e 's!@''VERSION''@!@VERSION@!' \
|
||||||
|
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
|
||||||
-e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
|
-e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
|
||||||
-e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
|
-e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
|
||||||
-e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
|
-e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
|
||||||
|
@ -16,6 +16,7 @@ USE_MANAGER=0
|
|||||||
MY_TZ=GMT-3
|
MY_TZ=GMT-3
|
||||||
TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work
|
TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work
|
||||||
LOCAL_SOCKET=@MYSQL_UNIX_ADDR@
|
LOCAL_SOCKET=@MYSQL_UNIX_ADDR@
|
||||||
|
MYSQL_TCP_PORT=@MYSQL_TCP_PORT@; export MYSQL_TCP_PORT
|
||||||
|
|
||||||
# For query_cache test
|
# For query_cache test
|
||||||
case `uname` in
|
case `uname` in
|
||||||
@ -1438,7 +1439,7 @@ then
|
|||||||
if [ -z "$USE_RUNNING_NDBCLUSTER" ]
|
if [ -z "$USE_RUNNING_NDBCLUSTER" ]
|
||||||
then
|
then
|
||||||
echo "Starting ndbcluster"
|
echo "Starting ndbcluster"
|
||||||
./ndb/ndbcluster --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
|
./ndb/ndbcluster --small --discless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
|
||||||
export NDB_CONNECTSTRING=`cat Ndb.cfg`
|
export NDB_CONNECTSTRING=`cat Ndb.cfg`
|
||||||
else
|
else
|
||||||
export NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
|
export NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
|
||||||
|
@ -4,9 +4,9 @@ testdir = $(benchdir_root)/mysql-test/ndb
|
|||||||
|
|
||||||
test_SCRIPTS = ndbcluster
|
test_SCRIPTS = ndbcluster
|
||||||
|
|
||||||
EXTRA_SCRIPTS = ndbcluster.sh
|
noinst_HEADERS = ndbcluster.sh
|
||||||
|
|
||||||
test_DATA = ndb_config_2_node.ini
|
dist_test_DATA = ndb_config_2_node.ini
|
||||||
|
|
||||||
SUFFIXES = .sh
|
SUFFIXES = .sh
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
[DB DEFAULT]
|
[DB DEFAULT]
|
||||||
#NoOfFragmentLogfiles: 1
|
|
||||||
#TimeBetweenLocalCheckpoints: 31
|
|
||||||
NoOfReplicas: 2
|
NoOfReplicas: 2
|
||||||
MaxNoOfConcurrentOperations: 100000
|
MaxNoOfConcurrentOperations: CHOOSE_MaxNoOfConcurrentOperations
|
||||||
|
DataMemory: CHOOSE_DataMemory
|
||||||
|
IndexMemory: CHOOSE_IndexMemory
|
||||||
|
Discless: CHOOSE_Discless
|
||||||
|
|
||||||
[COMPUTER]
|
[COMPUTER]
|
||||||
Id: 1
|
Id: 1
|
||||||
|
44
mysql-test/ndb/ndbcluster.sh
Executable file → Normal file
44
mysql-test/ndb/ndbcluster.sh
Executable file → Normal file
@ -41,6 +41,12 @@ pidfile=ndbcluster.pid
|
|||||||
cfgfile=Ndb.cfg
|
cfgfile=Ndb.cfg
|
||||||
stop_ndb=
|
stop_ndb=
|
||||||
initial_ndb=
|
initial_ndb=
|
||||||
|
status_ndb=
|
||||||
|
ndb_discless=0
|
||||||
|
|
||||||
|
ndb_con_op=100000
|
||||||
|
ndb_dmem=80M
|
||||||
|
ndb_imem=24M
|
||||||
|
|
||||||
while test $# -gt 0; do
|
while test $# -gt 0; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -51,6 +57,17 @@ while test $# -gt 0; do
|
|||||||
flags_ndb=$flags_ndb" -i"
|
flags_ndb=$flags_ndb" -i"
|
||||||
initial_ndb=1
|
initial_ndb=1
|
||||||
;;
|
;;
|
||||||
|
--status)
|
||||||
|
status_ndb=1
|
||||||
|
;;
|
||||||
|
--small)
|
||||||
|
ndb_con_op=10000
|
||||||
|
ndb_dmem=40M
|
||||||
|
ndb_imem=12M
|
||||||
|
;;
|
||||||
|
--discless)
|
||||||
|
ndb_discless=1
|
||||||
|
;;
|
||||||
--data-dir=*)
|
--data-dir=*)
|
||||||
fsdir=`echo "$1" | sed -e "s;--data-dir=;;"`
|
fsdir=`echo "$1" | sed -e "s;--data-dir=;;"`
|
||||||
;;
|
;;
|
||||||
@ -121,6 +138,10 @@ NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
|||||||
|
|
||||||
if [ $initial_ndb ] ; then
|
if [ $initial_ndb ] ; then
|
||||||
sed \
|
sed \
|
||||||
|
-e s,"CHOOSE_MaxNoOfConcurrentOperations",$ndb_con_op,g \
|
||||||
|
-e s,"CHOOSE_DataMemory",$ndb_dmem,g \
|
||||||
|
-e s,"CHOOSE_IndexMemory",$ndb_imem,g \
|
||||||
|
-e s,"CHOOSE_Discless",$ndb_discless,g \
|
||||||
-e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \
|
-e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \
|
||||||
-e s,"CHOOSE_FILESYSTEM_NODE_2","$fs_name_2",g \
|
-e s,"CHOOSE_FILESYSTEM_NODE_2","$fs_name_2",g \
|
||||||
-e s,"CHOOSE_FILESYSTEM_NODE_3","$fs_name_3",g \
|
-e s,"CHOOSE_FILESYSTEM_NODE_3","$fs_name_3",g \
|
||||||
@ -140,6 +161,7 @@ cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
|||||||
|
|
||||||
NDB_ID="2"
|
NDB_ID="2"
|
||||||
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
||||||
|
echo "Starting ndbd connectstring=\""$NDB_CONNECTSTRING\"
|
||||||
( cd $fs_ndb_2 ; echo $NDB_CONNECTSTRING > $cfgfile ; $exec_ndb -d $flags_ndb & )
|
( cd $fs_ndb_2 ; echo $NDB_CONNECTSTRING > $cfgfile ; $exec_ndb -d $flags_ndb & )
|
||||||
|
|
||||||
cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
||||||
@ -148,17 +170,14 @@ cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
|||||||
|
|
||||||
NDB_ID="3"
|
NDB_ID="3"
|
||||||
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
||||||
|
echo "Starting ndbd connectstring=\""$NDB_CONNECTSTRING\"
|
||||||
( cd $fs_ndb_3 ; echo $NDB_CONNECTSTRING > $cfgfile ; $exec_ndb -d $flags_ndb & )
|
( cd $fs_ndb_3 ; echo $NDB_CONNECTSTRING > $cfgfile ; $exec_ndb -d $flags_ndb & )
|
||||||
|
|
||||||
cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
||||||
|
|
||||||
# Start management client
|
|
||||||
|
|
||||||
sleep 10
|
|
||||||
echo "show" | $exec_mgmtclient $ndb_host $ndb_port
|
|
||||||
|
|
||||||
# test if Ndb Cluster starts properly
|
# test if Ndb Cluster starts properly
|
||||||
|
|
||||||
|
echo "Waiting for started..."
|
||||||
NDB_ID="11"
|
NDB_ID="11"
|
||||||
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
||||||
if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK"; then :; else
|
if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK"; then :; else
|
||||||
@ -169,6 +188,14 @@ fi
|
|||||||
echo $NDB_CONNECTSTRING > $cfgfile
|
echo $NDB_CONNECTSTRING > $cfgfile
|
||||||
|
|
||||||
cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
cat `find $fs_ndb -name 'node*.pid'` > $pidfile
|
||||||
|
|
||||||
|
status_ndbcluster
|
||||||
|
}
|
||||||
|
|
||||||
|
status_ndbcluster() {
|
||||||
|
# Start management client
|
||||||
|
|
||||||
|
echo "show" | $exec_mgmtclient $ndb_host $ndb_port
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_default_ndbcluster() {
|
stop_default_ndbcluster() {
|
||||||
@ -195,12 +222,17 @@ echo "all stop" | $exec_mgmtclient
|
|||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
if [ -f $pidfile ] ; then
|
if [ -f $pidfile ] ; then
|
||||||
kill `cat $pidfile`
|
kill `cat $pidfile` 2> /dev/null
|
||||||
rm $pidfile
|
rm $pidfile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ $status_ndb ] ; then
|
||||||
|
status_ndbcluster
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $stop_ndb ] ; then
|
if [ $stop_ndb ] ; then
|
||||||
stop_default_ndbcluster
|
stop_default_ndbcluster
|
||||||
else
|
else
|
||||||
|
@ -121,7 +121,7 @@ create database mysqltest;
|
|||||||
create table mysqltest.t1 (a int,b int,c int);
|
create table mysqltest.t1 (a int,b int,c int);
|
||||||
grant all on mysqltest.t1 to mysqltest_1@localhost;
|
grant all on mysqltest.t1 to mysqltest_1@localhost;
|
||||||
alter table t1 rename t2;
|
alter table t1 rename t2;
|
||||||
ERROR 42000: insert command denied to user: 'mysqltest_1'@'localhost' for table 't2'
|
ERROR 42000: insert command denied to user 'mysqltest_1'@'localhost' for table 't2'
|
||||||
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
||||||
delete from mysql.user where user='mysqltest_1';
|
delete from mysql.user where user='mysqltest_1';
|
||||||
drop database mysqltest;
|
drop database mysqltest;
|
||||||
@ -468,5 +468,5 @@ t1 CREATE TABLE `t1` (
|
|||||||
UNIQUE KEY `b` (`b`)
|
UNIQUE KEY `b` (`b`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
ALTER TABLE t1 DROP PRIMARY KEY;
|
ALTER TABLE t1 DROP PRIMARY KEY;
|
||||||
ERROR 42000: Can't DROP 'PRIMARY'. Check that column/key exists
|
ERROR 42000: Can't DROP 'PRIMARY'; check that column/key exists
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
@ -162,7 +162,7 @@ last_insert_id()
|
|||||||
255
|
255
|
||||||
insert into t1 set i = null;
|
insert into t1 set i = null;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'i' at row 1
|
Warning 1264 Data truncated; out of range for column 'i' at row 1
|
||||||
select last_insert_id();
|
select last_insert_id();
|
||||||
last_insert_id()
|
last_insert_id()
|
||||||
255
|
255
|
||||||
@ -213,7 +213,7 @@ a b
|
|||||||
delete from t1 where a=0;
|
delete from t1 where a=0;
|
||||||
update t1 set a=NULL where b=6;
|
update t1 set a=NULL where b=6;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 4
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 4
|
||||||
update t1 set a=300 where b=7;
|
update t1 set a=300 where b=7;
|
||||||
SET SQL_MODE='';
|
SET SQL_MODE='';
|
||||||
insert into t1(a,b)values(NULL,8);
|
insert into t1(a,b)values(NULL,8);
|
||||||
@ -255,7 +255,7 @@ a b
|
|||||||
delete from t1 where a=0;
|
delete from t1 where a=0;
|
||||||
update t1 set a=NULL where b=13;
|
update t1 set a=NULL where b=13;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 9
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 9
|
||||||
update t1 set a=500 where b=14;
|
update t1 set a=500 where b=14;
|
||||||
select * from t1 order by b;
|
select * from t1 order by b;
|
||||||
a b
|
a b
|
||||||
|
@ -9,7 +9,7 @@ set autocommit=0;
|
|||||||
update t2 set x = 1 where id = 0;
|
update t2 set x = 1 where id = 0;
|
||||||
select x from t1 where id = 0;
|
select x from t1 where id = 0;
|
||||||
select x from t2 where id = 0;
|
select x from t2 where id = 0;
|
||||||
ERROR 40001: Deadlock found when trying to get lock; Try restarting transaction
|
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||||
commit;
|
commit;
|
||||||
x
|
x
|
||||||
1
|
1
|
||||||
|
@ -11,7 +11,7 @@ create table t1 (b char(0) not null);
|
|||||||
create table if not exists t1 (b char(0) not null);
|
create table if not exists t1 (b char(0) not null);
|
||||||
insert into t1 values (""),(null);
|
insert into t1 values (""),(null);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2
|
||||||
select * from t1;
|
select * from t1;
|
||||||
b
|
b
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ drop table if exists t1;
|
|||||||
Warnings:
|
Warnings:
|
||||||
Note 1051 Unknown table 't1'
|
Note 1051 Unknown table 't1'
|
||||||
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;
|
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;
|
||||||
ERROR 42000: Incorrect table definition; There can only be one auto column and it must be defined as a key
|
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
|
||||||
create table not_existing_database.test (a int);
|
create table not_existing_database.test (a int);
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
create table `a/a` (a int);
|
create table `a/a` (a int);
|
||||||
@ -47,7 +47,7 @@ ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|||||||
create table test (a datetime default now());
|
create table test (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 test (a datetime on update now());
|
||||||
ERROR HY000: Invalid ON UPDATE clause for 'a' field
|
ERROR HY000: Invalid ON UPDATE clause for 'a' column
|
||||||
create table test (a int default 100 auto_increment);
|
create table test (a int default 100 auto_increment);
|
||||||
ERROR 42000: Invalid default value for 'a'
|
ERROR 42000: Invalid default value for 'a'
|
||||||
create table 1ea10 (1a20 int,1e int);
|
create table 1ea10 (1a20 int,1e int);
|
||||||
@ -275,11 +275,11 @@ ERROR 42000: Incorrect database name 'db1 '
|
|||||||
create table t1(`a ` int);
|
create table t1(`a ` int);
|
||||||
ERROR 42000: Incorrect column name 'a '
|
ERROR 42000: Incorrect column name 'a '
|
||||||
create table t1 (a int,);
|
create table t1 (a int,);
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
|
||||||
create table t1 (a int,,b int);
|
create table t1 (a int,,b int);
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1
|
||||||
create table t1 (,b int);
|
create table t1 (,b int);
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1
|
||||||
create table t1 (a int, key(a));
|
create table t1 (a int, key(a));
|
||||||
create table t2 (b int, foreign key(b) references t1(a), key(b));
|
create table t2 (b int, foreign key(b) references t1(a), key(b));
|
||||||
drop table if exists t1,t2;
|
drop table if exists t1,t2;
|
||||||
|
1657
mysql-test/r/ctype_uca.result
Normal file
1657
mysql-test/r/ctype_uca.result
Normal file
File diff suppressed because it is too large
Load Diff
@ -303,14 +303,14 @@ date format str_to_date
|
|||||||
2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12
|
2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12
|
||||||
03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12
|
03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1292 Truncated wrong string value: '10:20:10AM'
|
Note 1292 Truncated incorrect string value: '10:20:10AM'
|
||||||
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
|
||||||
10:20:10AM %h:%i:%s 0000-00-00 10:20:10
|
10:20:10AM %h:%i:%s 0000-00-00 10:20:10
|
||||||
2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12
|
2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12
|
||||||
03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12
|
03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1292 Truncated wrong string value: '10:20:10AM'
|
Note 1292 Truncated incorrect string value: '10:20:10AM'
|
||||||
drop table t1;
|
drop table t1;
|
||||||
select get_format(DATE, 'USA') as a;
|
select get_format(DATE, 'USA') as a;
|
||||||
a
|
a
|
||||||
@ -374,7 +374,7 @@ str_to_date("02 10", "%d %f") as f6;
|
|||||||
f1 f2 f3 f4 f5 f6
|
f1 f2 f3 f4 f5 f6
|
||||||
2003-01-02 10:11:12.001200 2003-01-02 10:11:12 2003-01-02 58:11:12 58:11:12 48:00:00.100000
|
2003-01-02 10:11:12.001200 2003-01-02 10:11:12 2003-01-02 58:11:12 58:11:12 48:00:00.100000
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1292 Truncated wrong datetime value: '2003-01-02 10:11:12.0012'
|
Note 1292 Truncated incorrect datetime value: '2003-01-02 10:11:12.0012'
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
select str_to_date("2003-01-02 10:11:12.0012ABCD", "%Y-%m-%d %H:%i:%S.%f") as f1,
|
select str_to_date("2003-01-02 10:11:12.0012ABCD", "%Y-%m-%d %H:%i:%S.%f") as f1,
|
||||||
addtime("-01:01:01.01 GGG", "-23:59:59.1") as f2,
|
addtime("-01:01:01.01 GGG", "-23:59:59.1") as f2,
|
||||||
@ -382,13 +382,13 @@ microsecond("1997-12-31 23:59:59.01XXXX") as f3;
|
|||||||
f1 f2 f3
|
f1 f2 f3
|
||||||
2003-01-02 10:11:12.001200 -25:01:00.110000 10000
|
2003-01-02 10:11:12.001200 -25:01:00.110000 10000
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1292 Truncated wrong datetime value: '2003-01-02 10:11:12.0012ABCD'
|
Note 1292 Truncated incorrect datetime value: '2003-01-02 10:11:12.0012ABCD'
|
||||||
Note 1292 Truncated wrong time value: '-01:01:01.01 GG'
|
Note 1292 Truncated incorrect time value: '-01:01:01.01 GG'
|
||||||
Note 1292 Truncated wrong datetime value: '1997-12-31 23:59:59.01XXXX'
|
Note 1292 Truncated incorrect datetime value: '1997-12-31 23:59:59.01XXXX'
|
||||||
select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1,
|
select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1,
|
||||||
str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2;
|
str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2;
|
||||||
f1 f2
|
f1 f2
|
||||||
2003-04-05 2003-04-05 10:11:12.101010
|
2003-04-05 2003-04-05 10:11:12.101010
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1292 Truncated wrong date value: '2003-04-05 g'
|
Note 1292 Truncated incorrect date value: '2003-04-05 g'
|
||||||
Note 1292 Truncated wrong datetime value: '2003-04-05 10:11:12.101010234567'
|
Note 1292 Truncated incorrect datetime value: '2003-04-05 10:11:12.101010234567'
|
||||||
|
@ -27,7 +27,7 @@ a y
|
|||||||
SELECT a FROM (SELECT 1 FROM (SELECT 1) a HAVING a=1) b;
|
SELECT a FROM (SELECT 1 FROM (SELECT 1) a HAVING a=1) b;
|
||||||
ERROR 42S22: Unknown column 'a' in 'having clause'
|
ERROR 42S22: Unknown column 'a' in 'having clause'
|
||||||
SELECT a,b as a FROM (SELECT '1' as a,'2' as b) b HAVING a=1;
|
SELECT a,b as a FROM (SELECT '1' as a,'2' as b) b HAVING a=1;
|
||||||
ERROR 23000: Column: 'a' in having clause is ambiguous
|
ERROR 23000: Column 'a' in having clause is ambiguous
|
||||||
SELECT a,2 as a FROM (SELECT '1' as a) b HAVING a=2;
|
SELECT a,2 as a FROM (SELECT '1' as a) b HAVING a=2;
|
||||||
a a
|
a a
|
||||||
1 2
|
1 2
|
||||||
@ -204,22 +204,22 @@ x
|
|||||||
1
|
1
|
||||||
create table t1 select 1 as a;
|
create table t1 select 1 as a;
|
||||||
select 2 as a from (select * from t1) b;
|
select 2 as a from (select * from t1) b;
|
||||||
ERROR 3D000: No Database Selected
|
ERROR 3D000: No database selected
|
||||||
use test;
|
use test;
|
||||||
select 2 as a from (select * from t1) b;
|
select 2 as a from (select * from t1) b;
|
||||||
a
|
a
|
||||||
2
|
2
|
||||||
drop table t1;
|
drop table t1;
|
||||||
select mail_id, if(folder.f_description!='', folder.f_description, folder.f_name) as folder_name, date, address_id, phrase, address, subject from folder, (select mail.mail_id as mail_id, date_format(mail.h_date, '%b %e, %Y %h:%i') as date, mail.folder_id, sender.address_id as address_id, sender.phrase as phrase, sender.address as address, mail.h_subject as subject from mail left join mxa as mxa_sender on mail.mail_id=mxa_sender.mail_id and mxa_sender.type='from' left join address as sender on mxa_sender.address_id=sender.address_id mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_recipient.mail_id and mxa_recipient.address_id=recipient.address_id and mxa_recipient.type='to' and match(sender.phrase, sender.address, sender.comment) against ('jeremy' in boolean mode) and match(recipient.phrase, recipient.address, recipient.comment) against ('monty' in boolean mode) order by mail.h_date desc limit 0, 25 ) as query where query.folder_id=folder.folder_id;
|
select mail_id, if(folder.f_description!='', folder.f_description, folder.f_name) as folder_name, date, address_id, phrase, address, subject from folder, (select mail.mail_id as mail_id, date_format(mail.h_date, '%b %e, %Y %h:%i') as date, mail.folder_id, sender.address_id as address_id, sender.phrase as phrase, sender.address as address, mail.h_subject as subject from mail left join mxa as mxa_sender on mail.mail_id=mxa_sender.mail_id and mxa_sender.type='from' left join address as sender on mxa_sender.address_id=sender.address_id mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_recipient.mail_id and mxa_recipient.address_id=recipient.address_id and mxa_recipient.type='to' and match(sender.phrase, sender.address, sender.comment) against ('jeremy' in boolean mode) and match(recipient.phrase, recipient.address, recipient.comment) against ('monty' in boolean mode) order by mail.h_date desc limit 0, 25 ) as query where query.folder_id=folder.folder_id;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_r' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_r' at line 1
|
||||||
create table t1 (a int);
|
create table t1 (a int);
|
||||||
insert into t1 values (1),(2),(3);
|
insert into t1 values (1),(2),(3);
|
||||||
update (select * from t1) as t1 set a = 5;
|
update (select * from t1) as t1 set a = 5;
|
||||||
ERROR HY000: The target table t1 of the UPDATE is not updatable
|
ERROR HY000: The target table t1 of the UPDATE is not updatable
|
||||||
delete from (select * from t1);
|
delete from (select * from t1);
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1)' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1)' at line 1
|
||||||
insert into (select * from t1) values (5);
|
insert into (select * from t1) values (5);
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1) values (5)' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1) values (5)' at line 1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (E1 INTEGER UNSIGNED NOT NULL, E2 INTEGER UNSIGNED NOT NULL, E3 INTEGER UNSIGNED NOT NULL, PRIMARY KEY(E1)
|
create table t1 (E1 INTEGER UNSIGNED NOT NULL, E2 INTEGER UNSIGNED NOT NULL, E3 INTEGER UNSIGNED NOT NULL, PRIMARY KEY(E1)
|
||||||
);
|
);
|
||||||
|
@ -253,11 +253,11 @@ KEY tig (ticket),
|
|||||||
fulltext index tix (inhalt)
|
fulltext index tix (inhalt)
|
||||||
);
|
);
|
||||||
select * from t2 where MATCH inhalt AGAINST (t2.inhalt);
|
select * from t2 where MATCH inhalt AGAINST (t2.inhalt);
|
||||||
ERROR HY000: Wrong arguments to AGAINST
|
ERROR HY000: Incorrect arguments to AGAINST
|
||||||
select * from t2 where MATCH ticket AGAINST ('foobar');
|
select * from t2 where MATCH ticket AGAINST ('foobar');
|
||||||
ERROR HY000: Can't find FULLTEXT index matching the column list
|
ERROR HY000: Can't find FULLTEXT index matching the column list
|
||||||
select * from t2,t3 where MATCH (t2.inhalt,t3.inhalt) AGAINST ('foobar');
|
select * from t2,t3 where MATCH (t2.inhalt,t3.inhalt) AGAINST ('foobar');
|
||||||
ERROR HY000: Wrong arguments to MATCH
|
ERROR HY000: Incorrect arguments to MATCH
|
||||||
drop table t1,t2,t3;
|
drop table t1,t2,t3;
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
id int(11) auto_increment,
|
id int(11) auto_increment,
|
||||||
@ -363,3 +363,14 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
|
|||||||
t collation(t)
|
t collation(t)
|
||||||
aus Osnabr<62>ck latin1_german2_ci
|
aus Osnabr<62>ck latin1_german2_ci
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (s varchar(255), FULLTEXT (s)) DEFAULT CHARSET=utf8;
|
||||||
|
insert into t1 (s) values ('p<>ra para para'),('para para para');
|
||||||
|
select * from t1 where match(s) against('para' in boolean mode);
|
||||||
|
s
|
||||||
|
p<EFBFBD>ra para para
|
||||||
|
para para para
|
||||||
|
select * from t1 where match(s) against('par*' in boolean mode);
|
||||||
|
s
|
||||||
|
p<EFBFBD>ra para para
|
||||||
|
para para para
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -66,5 +66,5 @@ NULL
|
|||||||
NULL
|
NULL
|
||||||
Warnings:
|
Warnings:
|
||||||
Error 1259 ZLIB: Input data corrupted
|
Error 1259 ZLIB: Input data corrupted
|
||||||
Error 1256 Too big size of uncompressed data. The maximum size is 1048576. (probably, length of uncompressed data was corrupted)
|
Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
@ -157,11 +157,8 @@ grp group_concat(c)
|
|||||||
3 D,D,E
|
3 D,D,E
|
||||||
4
|
4
|
||||||
5 NULL
|
5 NULL
|
||||||
Warnings:
|
|
||||||
Warning 1260 1 line(s) was(were) cut by group_concat()
|
|
||||||
show warnings;
|
show warnings;
|
||||||
Level Code Message
|
Level Code Message
|
||||||
Warning 1260 1 line(s) was(were) cut by group_concat()
|
|
||||||
set group_concat_max_len = 1024;
|
set group_concat_max_len = 1024;
|
||||||
select group_concat(sum(a)) from t1 group by grp;
|
select group_concat(sum(a)) from t1 group by grp;
|
||||||
ERROR HY000: Invalid use of group function
|
ERROR HY000: Invalid use of group function
|
||||||
@ -310,3 +307,14 @@ GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a)
|
|||||||
1,2
|
1,2
|
||||||
2,4
|
2,4
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
CREATE TABLE t1 (a char(4));
|
||||||
|
INSERT INTO t1 VALUES ('John'), ('Anna'), ('Bill');
|
||||||
|
SELECT GROUP_CONCAT(a SEPARATOR '||') AS names FROM t1
|
||||||
|
HAVING names LIKE '%An%';
|
||||||
|
names
|
||||||
|
John||Anna||Bill
|
||||||
|
SELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1
|
||||||
|
HAVING LEFT(names, 1) ='J';
|
||||||
|
names
|
||||||
|
John###Anna###Bill
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -129,7 +129,7 @@ delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or
|
|||||||
flush privileges;
|
flush privileges;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
GRANT FILE on mysqltest.* to mysqltest_1@localhost;
|
GRANT FILE on mysqltest.* to mysqltest_1@localhost;
|
||||||
ERROR HY000: Wrong usage of DB GRANT and GLOBAL PRIVILEGES
|
ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
|
||||||
select 1;
|
select 1;
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
|
@ -10,7 +10,7 @@ current_user
|
|||||||
mysqltest_1@localhost
|
mysqltest_1@localhost
|
||||||
grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option;
|
grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option;
|
||||||
grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option;
|
grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option;
|
||||||
ERROR 42000: Access denied for user: 'mysqltest_1'@'localhost' to database 'my_%'
|
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'my_%'
|
||||||
show grants for mysqltest_1@localhost;
|
show grants for mysqltest_1@localhost;
|
||||||
Grants for mysqltest_1@localhost
|
Grants for mysqltest_1@localhost
|
||||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
||||||
|
@ -134,7 +134,7 @@ a b c a
|
|||||||
1 1 1 test.t1
|
1 1 1 test.t1
|
||||||
2 2 2 test.t1
|
2 2 2 test.t1
|
||||||
select * from t2;
|
select * from t2;
|
||||||
ERROR 42000: select command denied to user: 'mysqltest_2'@'localhost' for table 't2'
|
ERROR 42000: select command denied to user 'mysqltest_2'@'localhost' for table 't2'
|
||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_queries_in_cache 6
|
Qcache_queries_in_cache 6
|
||||||
@ -148,17 +148,17 @@ select "user3";
|
|||||||
user3
|
user3
|
||||||
user3
|
user3
|
||||||
select * from t1;
|
select * from t1;
|
||||||
ERROR 42000: select command denied to user: 'mysqltest_3'@'localhost' for column 'b' in table 't1'
|
ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1'
|
||||||
select a from t1;
|
select a from t1;
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
2
|
2
|
||||||
select c from t1;
|
select c from t1;
|
||||||
ERROR 42000: SELECT command denied to user: 'mysqltest_3'@'localhost' for column 'c' in table 't1'
|
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
|
||||||
select * from t2;
|
select * from t2;
|
||||||
ERROR 42000: select command denied to user: 'mysqltest_3'@'localhost' for table 't2'
|
ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for table 't2'
|
||||||
select mysqltest.t1.c from test.t1,mysqltest.t1;
|
select mysqltest.t1.c from test.t1,mysqltest.t1;
|
||||||
ERROR 42000: SELECT command denied to user: 'mysqltest_3'@'localhost' for column 'c' in table 't1'
|
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
|
||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_queries_in_cache 6
|
Qcache_queries_in_cache 6
|
||||||
@ -176,7 +176,7 @@ Grants for mysqltest_1@localhost
|
|||||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
||||||
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
|
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
|
||||||
select a from t1;
|
select a from t1;
|
||||||
ERROR 3D000: No Database Selected
|
ERROR 3D000: No database selected
|
||||||
select * from mysqltest.t1,test.t1;
|
select * from mysqltest.t1,test.t1;
|
||||||
a b c a
|
a b c a
|
||||||
1 1 1 test.t1
|
1 1 1 test.t1
|
||||||
|
@ -6,7 +6,7 @@ insert into t1 values
|
|||||||
(20,"ggg"),(21,"hhh"),(22,"iii");
|
(20,"ggg"),(21,"hhh"),(22,"iii");
|
||||||
handler t1 open as t2;
|
handler t1 open as t2;
|
||||||
handler t2 read a=(SELECT 1);
|
handler t2 read a=(SELECT 1);
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1)' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1)' at line 1
|
||||||
handler t2 read a first;
|
handler t2 read a first;
|
||||||
a b
|
a b
|
||||||
14 aaa
|
14 aaa
|
||||||
@ -51,7 +51,7 @@ handler t2 read a=(16);
|
|||||||
a b
|
a b
|
||||||
16 ccc
|
16 ccc
|
||||||
handler t2 read a=(19,"fff");
|
handler t2 read a=(19,"fff");
|
||||||
ERROR 42000: Too many key parts specified. Max 1 parts allowed
|
ERROR 42000: Too many key parts specified; max 1 parts allowed
|
||||||
handler t2 read b=(19,"fff");
|
handler t2 read b=(19,"fff");
|
||||||
a b
|
a b
|
||||||
19 fff
|
19 fff
|
||||||
@ -135,7 +135,7 @@ handler t2 read next;
|
|||||||
a b
|
a b
|
||||||
19 fff
|
19 fff
|
||||||
handler t2 read last;
|
handler t2 read last;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
||||||
handler t2 close;
|
handler t2 close;
|
||||||
handler t1 open as t2;
|
handler t1 open as t2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
@ -173,7 +173,7 @@ handler t1 open;
|
|||||||
handler t1 read a=(W);
|
handler t1 read a=(W);
|
||||||
ERROR 42S22: Unknown column 'W' in 'field list'
|
ERROR 42S22: Unknown column 'W' in 'field list'
|
||||||
handler t1 read a=(a);
|
handler t1 read a=(a);
|
||||||
ERROR HY000: Wrong arguments to HANDLER ... READ
|
ERROR HY000: Incorrect arguments to HANDLER ... READ
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (a char(5));
|
create table t1 (a char(5));
|
||||||
insert into t1 values ("Ok");
|
insert into t1 values ("Ok");
|
||||||
|
@ -49,7 +49,7 @@ handler t2 read a=(16);
|
|||||||
a b
|
a b
|
||||||
16 ccc
|
16 ccc
|
||||||
handler t2 read a=(19,"fff");
|
handler t2 read a=(19,"fff");
|
||||||
ERROR 42000: Too many key parts specified. Max 1 parts allowed
|
ERROR 42000: Too many key parts specified; max 1 parts allowed
|
||||||
handler t2 read b=(19,"fff");
|
handler t2 read b=(19,"fff");
|
||||||
a b
|
a b
|
||||||
19 fff
|
19 fff
|
||||||
@ -130,7 +130,7 @@ handler t2 read next;
|
|||||||
a b
|
a b
|
||||||
18 eee
|
18 eee
|
||||||
handler t2 read last;
|
handler t2 read last;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
||||||
handler t2 close;
|
handler t2 close;
|
||||||
handler t1 open as t2;
|
handler t1 open as t2;
|
||||||
handler t2 read first;
|
handler t2 read first;
|
||||||
|
@ -63,7 +63,7 @@ insert into t1 values(NULL);
|
|||||||
ERROR 23000: Column 'id' cannot be null
|
ERROR 23000: Column 'id' cannot be null
|
||||||
insert into t1 values (1), (NULL), (2);
|
insert into t1 values (1), (NULL), (2);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'id' at row 2
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'id' at row 2
|
||||||
select * from t1;
|
select * from t1;
|
||||||
id
|
id
|
||||||
1
|
1
|
||||||
@ -159,18 +159,18 @@ insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@val
|
|||||||
Warnings:
|
Warnings:
|
||||||
Warning 1265 Data truncated for column 'f_double' at row 1
|
Warning 1265 Data truncated for column 'f_double' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_float' at row 1
|
Warning 1265 Data truncated for column 'f_float' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_double_7_2' at row 1
|
Warning 1265 Data truncated for column 'f_double_7_2' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_float_4_3' at row 1
|
Warning 1265 Data truncated for column 'f_float_4_3' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_double_u' at row 1
|
Warning 1265 Data truncated for column 'f_double_u' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_float_u' at row 1
|
Warning 1265 Data truncated for column 'f_float_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1
|
Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1
|
Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
|
||||||
select * from t1 where number =last_insert_id();
|
select * from t1 where number =last_insert_id();
|
||||||
number 4
|
number 4
|
||||||
original_value 1e+1111111111a
|
original_value 1e+1111111111a
|
||||||
@ -187,19 +187,19 @@ insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@val
|
|||||||
Warnings:
|
Warnings:
|
||||||
Warning 1265 Data truncated for column 'f_double' at row 1
|
Warning 1265 Data truncated for column 'f_double' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_float' at row 1
|
Warning 1265 Data truncated for column 'f_float' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_double_7_2' at row 1
|
Warning 1265 Data truncated for column 'f_double_7_2' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_float_4_3' at row 1
|
Warning 1265 Data truncated for column 'f_float_4_3' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_double_u' at row 1
|
Warning 1265 Data truncated for column 'f_double_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_float_u' at row 1
|
Warning 1265 Data truncated for column 'f_float_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1
|
Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
|
||||||
Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1
|
Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
|
||||||
select * from t1 where number =last_insert_id();
|
select * from t1 where number =last_insert_id();
|
||||||
number 5
|
number 5
|
||||||
original_value -1e+1111111111a
|
original_value -1e+1111111111a
|
||||||
@ -214,12 +214,12 @@ f_float_3_1_u 0.0
|
|||||||
set @value= 1e+1111111111;
|
set @value= 1e+1111111111;
|
||||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
|
||||||
select * from t1 where number =last_insert_id();
|
select * from t1 where number =last_insert_id();
|
||||||
number 6
|
number 6
|
||||||
original_value 1.7976931348623e+308
|
original_value 1.7976931348623e+308
|
||||||
@ -234,13 +234,13 @@ f_float_3_1_u 99.9
|
|||||||
set @value= -1e+1111111111;
|
set @value= -1e+1111111111;
|
||||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
|
||||||
select * from t1 where number =last_insert_id();
|
select * from t1 where number =last_insert_id();
|
||||||
number 7
|
number 7
|
||||||
original_value -1.7976931348623e+308
|
original_value -1.7976931348623e+308
|
||||||
@ -255,12 +255,12 @@ f_float_3_1_u 0.0
|
|||||||
set @value= 1e+111;
|
set @value= 1e+111;
|
||||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
|
||||||
select * from t1 where number =last_insert_id();
|
select * from t1 where number =last_insert_id();
|
||||||
number 8
|
number 8
|
||||||
original_value 1e+111
|
original_value 1e+111
|
||||||
@ -275,13 +275,13 @@ f_float_3_1_u 99.9
|
|||||||
set @value= -1e+111;
|
set @value= -1e+111;
|
||||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
|
||||||
select * from t1 where number =last_insert_id();
|
select * from t1 where number =last_insert_id();
|
||||||
number 9
|
number 9
|
||||||
original_value -1e+111
|
original_value -1e+111
|
||||||
@ -309,10 +309,10 @@ f_float_3_1_u 1.0
|
|||||||
set @value= -1;
|
set @value= -1;
|
||||||
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1
|
Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1
|
||||||
select * from t1 where number =last_insert_id();
|
select * from t1 where number =last_insert_id();
|
||||||
number 11
|
number 11
|
||||||
original_value -1
|
original_value -1
|
||||||
|
@ -622,8 +622,8 @@ NULL 2 100
|
|||||||
create table t2(No int not null, Field int not null, Count int not null);
|
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;
|
insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2;
|
||||||
Warnings:
|
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 1
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'No' at row 2
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'No' at row 2
|
||||||
select * from t2;
|
select * from t2;
|
||||||
No Field Count
|
No Field Count
|
||||||
0 1 100
|
0 1 100
|
||||||
|
@ -34,7 +34,7 @@ ERROR 42000: Column 'a' is used with UNIQUE or INDEX but is not defined as NOT N
|
|||||||
create table t1 (a int,b text, index(b)) engine=isam;
|
create table t1 (a int,b text, index(b)) engine=isam;
|
||||||
ERROR 42000: BLOB column 'b' can't be used in key specification with the used table type
|
ERROR 42000: BLOB column 'b' can't be used in key specification with the used table type
|
||||||
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=isam;
|
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=isam;
|
||||||
ERROR 42000: Incorrect table definition; There can only be one auto column and it must be defined as a key
|
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
|
||||||
create table t1 (ordid int(8), unique (ordid)) engine=isam;
|
create table t1 (ordid int(8), unique (ordid)) engine=isam;
|
||||||
ERROR 42000: Column 'ordid' is used with UNIQUE or INDEX but is not defined as NOT NULL
|
ERROR 42000: Column 'ordid' is used with UNIQUE or INDEX but is not defined as NOT NULL
|
||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
|
@ -126,7 +126,7 @@ a
|
|||||||
1
|
1
|
||||||
2
|
2
|
||||||
select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) left join t1 as t32 using (a) left join t1 as t33 using (a) left join t1 as t34 using (a) left join t1 as t35 using (a) left join t1 as t36 using (a) left join t1 as t37 using (a) left join t1 as t38 using (a) left join t1 as t39 using (a) left join t1 as t40 using (a) left join t1 as t41 using (a) left join t1 as t42 using (a) left join t1 as t43 using (a) left join t1 as t44 using (a) left join t1 as t45 using (a) left join t1 as t46 using (a) left join t1 as t47 using (a) left join t1 as t48 using (a) left join t1 as t49 using (a) left join t1 as t50 using (a) left join t1 as t51 using (a) left join t1 as t52 using (a) left join t1 as t53 using (a) left join t1 as t54 using (a) left join t1 as t55 using (a) left join t1 as t56 using (a) left join t1 as t57 using (a) left join t1 as t58 using (a) left join t1 as t59 using (a) left join t1 as t60 using (a) left join t1 as t61 using (a) left join t1 as t62 using (a) left join t1 as t63 using (a) left join t1 as t64 using (a) left join t1 as t65 using (a);
|
select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) left join t1 as t32 using (a) left join t1 as t33 using (a) left join t1 as t34 using (a) left join t1 as t35 using (a) left join t1 as t36 using (a) left join t1 as t37 using (a) left join t1 as t38 using (a) left join t1 as t39 using (a) left join t1 as t40 using (a) left join t1 as t41 using (a) left join t1 as t42 using (a) left join t1 as t43 using (a) left join t1 as t44 using (a) left join t1 as t45 using (a) left join t1 as t46 using (a) left join t1 as t47 using (a) left join t1 as t48 using (a) left join t1 as t49 using (a) left join t1 as t50 using (a) left join t1 as t51 using (a) left join t1 as t52 using (a) left join t1 as t53 using (a) left join t1 as t54 using (a) left join t1 as t55 using (a) left join t1 as t56 using (a) left join t1 as t57 using (a) left join t1 as t58 using (a) left join t1 as t59 using (a) left join t1 as t60 using (a) left join t1 as t61 using (a) left join t1 as t62 using (a) left join t1 as t63 using (a) left join t1 as t64 using (a) left join t1 as t65 using (a);
|
||||||
ERROR HY000: Too many tables. MySQL can only use XX tables in a join
|
ERROR HY000: Too many tables; MySQL can only use XX tables in a join
|
||||||
drop table t1;
|
drop table t1;
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
a int(11) NOT NULL,
|
a int(11) NOT NULL,
|
||||||
|
@ -106,11 +106,11 @@ grp a c id a c d a
|
|||||||
3 6 D 3 6 C 6 6
|
3 6 D 3 6 C 6 6
|
||||||
NULL NULL NULL NULL NULL NULL NULL
|
NULL NULL NULL NULL NULL NULL NULL
|
||||||
explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a);
|
explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a);
|
||||||
ERROR 42000: Cross dependency found in OUTER JOIN. Examine your ON conditions
|
ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions
|
||||||
select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a);
|
select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a);
|
||||||
ERROR 42000: Cross dependency found in OUTER JOIN. Examine your ON conditions
|
ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions
|
||||||
select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a);
|
select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a);
|
||||||
ERROR 42000: Cross dependency found in OUTER JOIN. Examine your ON conditions
|
ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions
|
||||||
select t1.*,t2.* from t1 inner join t2 using (a);
|
select t1.*,t2.* from t1 inner join t2 using (a);
|
||||||
grp a c id a c d
|
grp a c id a c d
|
||||||
1 1 a 1 1 a 1
|
1 1 a 1 1 a 1
|
||||||
@ -406,7 +406,7 @@ insert into t3 values (1);
|
|||||||
insert into t4 values (1,1);
|
insert into t4 values (1,1);
|
||||||
insert into t5 values (1,1);
|
insert into t5 values (1,1);
|
||||||
explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23;
|
explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23;
|
||||||
ERROR 42000: Cross dependency found in OUTER JOIN. Examine your ON conditions
|
ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions
|
||||||
drop table t1,t2,t3,t4,t5;
|
drop table t1,t2,t3,t4,t5;
|
||||||
create table t1 (n int, m int, o int, key(n));
|
create table t1 (n int, m int, o int, key(n));
|
||||||
create table t2 (n int not null, m int, o int, primary key(n));
|
create table t2 (n int not null, m int, o int, primary key(n));
|
||||||
|
@ -156,8 +156,8 @@ CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
|
|||||||
UNIQUE (c,i));
|
UNIQUE (c,i));
|
||||||
INSERT INTO t1 (c) VALUES (NULL),(NULL);
|
INSERT INTO t1 (c) VALUES (NULL),(NULL);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 1
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 2
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 2
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
c i
|
c i
|
||||||
1
|
1
|
||||||
|
@ -39,9 +39,9 @@ SELECT @@medium.key_buffer_size;
|
|||||||
0
|
0
|
||||||
SET @@global.key_buffer_size=@save_key_buffer;
|
SET @@global.key_buffer_size=@save_key_buffer;
|
||||||
SELECT @@default.key_buffer_size;
|
SELECT @@default.key_buffer_size;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'default.key_buffer_size' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default.key_buffer_size' at line 1
|
||||||
SELECT @@skr.storage_engine="test";
|
SELECT @@skr.storage_engine="test";
|
||||||
ERROR HY000: Variable 'storage_engine' is not a variable component (Can't be used as XXXX.variable_name)
|
ERROR HY000: Variable 'storage_engine' is not a variable component (can't be used as XXXX.variable_name)
|
||||||
select @@keycache1.key_cache_block_size;
|
select @@keycache1.key_cache_block_size;
|
||||||
@@keycache1.key_cache_block_size
|
@@keycache1.key_cache_block_size
|
||||||
0
|
0
|
||||||
|
@ -44,9 +44,9 @@ create table t1 (a int, b char(10));
|
|||||||
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
|
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1265 Data truncated for column 'a' at row 3
|
Warning 1265 Data truncated for column 'a' at row 3
|
||||||
Warning 1262 Row 3 was truncated; It contained more data than there were input columns
|
Warning 1262 Row 3 was truncated; it contained more data than there were input columns
|
||||||
Warning 1265 Data truncated for column 'a' at row 5
|
Warning 1265 Data truncated for column 'a' at row 5
|
||||||
Warning 1262 Row 5 was truncated; It contained more data than there were input columns
|
Warning 1262 Row 5 was truncated; it contained more data than there were input columns
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a b
|
a b
|
||||||
1 row 1
|
1 row 1
|
||||||
|
@ -191,7 +191,7 @@ n d unix_timestamp(t)
|
|||||||
1 10 1038401397
|
1 10 1038401397
|
||||||
2 20 1038401397
|
2 20 1038401397
|
||||||
UPDATE t1,t2 SET 1=2 WHERE t1.n=t2.n;
|
UPDATE t1,t2 SET 1=2 WHERE t1.n=t2.n;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '1=2 WHERE t1.n=t2.n' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1=2 WHERE t1.n=t2.n' at line 1
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
set timestamp=0;
|
set timestamp=0;
|
||||||
set sql_safe_updates=0;
|
set sql_safe_updates=0;
|
||||||
|
@ -11,7 +11,7 @@ insert into t1 (gesuchnr, benutzer_id) value (3,2);
|
|||||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||||
insert into t1 (gesuchnr,benutzer_id) values (1,1);
|
insert into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||||
ERROR 23000: Can't write, duplicate key in table 't1'
|
ERROR 23000: Can't write; duplicate key in table 't1'
|
||||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||||
select * from t1 order by gesuchnr;
|
select * from t1 order by gesuchnr;
|
||||||
gesuchnr benutzer_id
|
gesuchnr benutzer_id
|
||||||
|
@ -97,39 +97,39 @@ Warnings:
|
|||||||
Warning 1265 Data truncated for column 'd' at row 1
|
Warning 1265 Data truncated for column 'd' at row 1
|
||||||
UPDATE t1 SET d=NULL;
|
UPDATE t1 SET d=NULL;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'd' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 1
|
||||||
INSERT INTO t1 (a) values (null);
|
INSERT INTO t1 (a) values (null);
|
||||||
ERROR 23000: Column 'a' cannot be null
|
ERROR 23000: Column 'a' cannot be null
|
||||||
INSERT INTO t1 (a) values (1/null);
|
INSERT INTO t1 (a) values (1/null);
|
||||||
ERROR 23000: Column 'a' cannot be null
|
ERROR 23000: Column 'a' cannot be null
|
||||||
INSERT INTO t1 (a) values (null),(null);
|
INSERT INTO t1 (a) values (null),(null);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 2
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 2
|
||||||
INSERT INTO t1 (b) values (null);
|
INSERT INTO t1 (b) values (null);
|
||||||
ERROR 23000: Column 'b' cannot be null
|
ERROR 23000: Column 'b' cannot be null
|
||||||
INSERT INTO t1 (b) values (1/null);
|
INSERT INTO t1 (b) values (1/null);
|
||||||
ERROR 23000: Column 'b' cannot be null
|
ERROR 23000: Column 'b' cannot be null
|
||||||
INSERT INTO t1 (b) values (null),(null);
|
INSERT INTO t1 (b) values (null),(null);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 1
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2
|
||||||
INSERT INTO t1 (c) values (null);
|
INSERT INTO t1 (c) values (null);
|
||||||
ERROR 23000: Column 'c' cannot be null
|
ERROR 23000: Column 'c' cannot be null
|
||||||
INSERT INTO t1 (c) values (1/null);
|
INSERT INTO t1 (c) values (1/null);
|
||||||
ERROR 23000: Column 'c' cannot be null
|
ERROR 23000: Column 'c' cannot be null
|
||||||
INSERT INTO t1 (c) values (null),(null);
|
INSERT INTO t1 (c) values (null),(null);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 1
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 2
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 2
|
||||||
INSERT INTO t1 (d) values (null);
|
INSERT INTO t1 (d) values (null);
|
||||||
ERROR 23000: Column 'd' cannot be null
|
ERROR 23000: Column 'd' cannot be null
|
||||||
INSERT INTO t1 (d) values (1/null);
|
INSERT INTO t1 (d) values (1/null);
|
||||||
ERROR 23000: Column 'd' cannot be null
|
ERROR 23000: Column 'd' cannot be null
|
||||||
INSERT INTO t1 (d) values (null),(null);
|
INSERT INTO t1 (d) values (null),(null);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'd' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 1
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'd' at row 2
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 2
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a b c d
|
a b c d
|
||||||
0 0000-00-00 00:00:00 0
|
0 0000-00-00 00:00:00 0
|
||||||
|
@ -337,7 +337,7 @@ index (id2)
|
|||||||
);
|
);
|
||||||
insert into t1 values(null,null),(1,1);
|
insert into t1 values(null,null),(1,1);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'id2' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'id2' at row 1
|
||||||
select * from t1;
|
select * from t1;
|
||||||
id id2
|
id id2
|
||||||
NULL 0
|
NULL 0
|
||||||
|
@ -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: Access denied for user 'ssl_user1'@'localhost' to database 'test'
|
||||||
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: Access denied for user 'ssl_user2'@'localhost' to database 'test'
|
||||||
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: Access denied for user 'ssl_user3'@'localhost' to database 'test'
|
||||||
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: Access denied for user 'ssl_user4'@'localhost' to database 'test'
|
||||||
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;
|
||||||
|
@ -12,7 +12,7 @@ select @@net_buffer_length, @@max_allowed_packet;
|
|||||||
@@net_buffer_length @@max_allowed_packet
|
@@net_buffer_length @@max_allowed_packet
|
||||||
1024 1024
|
1024 1024
|
||||||
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
|
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
|
||||||
ERROR 08S01: Got a packet bigger than 'max_allowed_packet'
|
ERROR 08S01: Got a packet bigger than 'max_allowed_packet' bytes
|
||||||
set global max_allowed_packet=default;
|
set global max_allowed_packet=default;
|
||||||
set max_allowed_packet=default;
|
set max_allowed_packet=default;
|
||||||
set global net_buffer_length=default;
|
set global net_buffer_length=default;
|
||||||
|
@ -23,13 +23,13 @@ a b
|
|||||||
deallocate prepare no_such_statement;
|
deallocate prepare no_such_statement;
|
||||||
ERROR HY000: Unknown prepared statement handler (no_such_statement) given to DEALLOCATE PREPARE
|
ERROR HY000: Unknown prepared statement handler (no_such_statement) given to DEALLOCATE PREPARE
|
||||||
execute stmt1;
|
execute stmt1;
|
||||||
ERROR HY000: Wrong arguments to EXECUTE
|
ERROR HY000: Incorrect arguments to EXECUTE
|
||||||
prepare stmt2 from 'prepare nested_stmt from "select 1"';
|
prepare stmt2 from 'prepare nested_stmt from "select 1"';
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"select 1"' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"select 1"' at line 1
|
||||||
prepare stmt2 from 'execute stmt1';
|
prepare stmt2 from 'execute stmt1';
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'stmt1' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'stmt1' at line 1
|
||||||
prepare stmt2 from 'deallocate prepare z';
|
prepare stmt2 from 'deallocate prepare z';
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'z' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'z' at line 1
|
||||||
prepare stmt3 from 'insert into t1 values (?,?)';
|
prepare stmt3 from 'insert into t1 values (?,?)';
|
||||||
set @arg1=5, @arg2='five';
|
set @arg1=5, @arg2='five';
|
||||||
execute stmt3 using @arg1, @arg2;
|
execute stmt3 using @arg1, @arg2;
|
||||||
@ -84,11 +84,11 @@ NULL
|
|||||||
NULL
|
NULL
|
||||||
NULL
|
NULL
|
||||||
prepare stmt6 from 'select 1; select2';
|
prepare stmt6 from 'select 1; select2';
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1
|
||||||
prepare stmt6 from 'insert into t1 values (5,"five"); select2';
|
prepare stmt6 from 'insert into t1 values (5,"five"); select2';
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1
|
||||||
explain prepare stmt6 from 'insert into t1 values (5,"five"); select2';
|
explain prepare stmt6 from 'insert into t1 values (5,"five"); select2';
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'from 'insert into t1 values (5,"five"); select2'' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from 'insert into t1 values (5,"five"); select2'' at line 1
|
||||||
create table t2
|
create table t2
|
||||||
(
|
(
|
||||||
a int
|
a int
|
||||||
@ -99,13 +99,13 @@ prepare stmt1 from 'select 1 FROM t2 where a=?' ;
|
|||||||
execute stmt1 using @arg00 ;
|
execute stmt1 using @arg00 ;
|
||||||
1
|
1
|
||||||
prepare stmt1 from @nosuchvar;
|
prepare stmt1 from @nosuchvar;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1
|
||||||
set @ivar= 1234;
|
set @ivar= 1234;
|
||||||
prepare stmt1 from @ivar;
|
prepare stmt1 from @ivar;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '1234' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1234' at line 1
|
||||||
set @fvar= 123.4567;
|
set @fvar= 123.4567;
|
||||||
prepare stmt1 from @fvar;
|
prepare stmt1 from @fvar;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '123.4567' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '123.4567' at line 1
|
||||||
set @str1 = 'select ?';
|
set @str1 = 'select ?';
|
||||||
set @str2 = convert(@str1 using ucs2);
|
set @str2 = convert(@str1 using ucs2);
|
||||||
prepare stmt1 from @str2;
|
prepare stmt1 from @str2;
|
||||||
|
@ -593,7 +593,7 @@ select * from t1;
|
|||||||
a
|
a
|
||||||
set GLOBAL query_cache_size=1024;
|
set GLOBAL query_cache_size=1024;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1282 Query cache failed to set size 1024, new query cache size is 0
|
Warning 1282 Query cache failed to set size 1024; new query cache size is 0
|
||||||
show global variables like "query_cache_size";
|
show global variables like "query_cache_size";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
query_cache_size 0
|
query_cache_size 0
|
||||||
@ -601,7 +601,7 @@ select * from t1;
|
|||||||
a
|
a
|
||||||
set GLOBAL query_cache_size=10240;
|
set GLOBAL query_cache_size=10240;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1282 Query cache failed to set size 10240, new query cache size is 0
|
Warning 1282 Query cache failed to set size 10240; new query cache size is 0
|
||||||
show global variables like "query_cache_size";
|
show global variables like "query_cache_size";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
query_cache_size 0
|
query_cache_size 0
|
||||||
@ -609,7 +609,7 @@ select * from t1;
|
|||||||
a
|
a
|
||||||
set GLOBAL query_cache_size=20480;
|
set GLOBAL query_cache_size=20480;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1282 Query cache failed to set size 20480, new query cache size is 0
|
Warning 1282 Query cache failed to set size 20480; new query cache size is 0
|
||||||
show global variables like "query_cache_size";
|
show global variables like "query_cache_size";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
query_cache_size 0
|
query_cache_size 0
|
||||||
@ -617,7 +617,7 @@ select * from t1;
|
|||||||
a
|
a
|
||||||
set GLOBAL query_cache_size=40960;
|
set GLOBAL query_cache_size=40960;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1282 Query cache failed to set size 40960, new query cache size is 0
|
Warning 1282 Query cache failed to set size 40960; new query cache size is 0
|
||||||
show global variables like "query_cache_size";
|
show global variables like "query_cache_size";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
query_cache_size 0
|
query_cache_size 0
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
drop table if exists t1, t2, t3, t4;
|
drop table if exists t1, t2, t3, t4;
|
||||||
drop table if exists t1, t2, t3, t4;
|
drop table if exists t1, t2, t3, t4;
|
||||||
start slave;
|
start slave;
|
||||||
ERROR HY000: Could not initialize master info structure, more error messages can be found in the MySQL error log
|
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
|
||||||
start slave;
|
start slave;
|
||||||
ERROR HY000: Could not initialize master info structure, more error messages can be found in the MySQL error log
|
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
|
||||||
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
|
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
|
||||||
ERROR HY000: Could not initialize master info structure, more error messages can be found in the MySQL error log
|
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
|
||||||
reset slave;
|
reset slave;
|
||||||
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
|
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
|
||||||
reset master;
|
reset master;
|
||||||
|
@ -7,12 +7,12 @@ start slave;
|
|||||||
reset master;
|
reset master;
|
||||||
SET @save_select_limit=@@session.sql_select_limit;
|
SET @save_select_limit=@@session.sql_select_limit;
|
||||||
SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
|
SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
|
||||||
ERROR HY000: Access denied. You need the SUPER privilege for this operation
|
ERROR HY000: Access denied; you need the SUPER privilege for this operation
|
||||||
SELECT @@session.sql_select_limit = @save_select_limit;
|
SELECT @@session.sql_select_limit = @save_select_limit;
|
||||||
@@session.sql_select_limit = @save_select_limit
|
@@session.sql_select_limit = @save_select_limit
|
||||||
1
|
1
|
||||||
SET @@session.sql_select_limit=10, @@session.sql_log_bin=0;
|
SET @@session.sql_select_limit=10, @@session.sql_log_bin=0;
|
||||||
ERROR HY000: Access denied. You need the SUPER privilege for this operation
|
ERROR HY000: Access denied; you need the SUPER privilege for this operation
|
||||||
SELECT @@session.sql_select_limit = @save_select_limit;
|
SELECT @@session.sql_select_limit = @save_select_limit;
|
||||||
@@session.sql_select_limit = @save_select_limit
|
@@session.sql_select_limit = @save_select_limit
|
||||||
1
|
1
|
||||||
|
@ -57,15 +57,15 @@ show slave status;
|
|||||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||||
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 # master-bin.000001 Yes No 0 0 561 # Master master-bin.000001 561 No #
|
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 # master-bin.000001 Yes No 0 0 561 # Master master-bin.000001 561 No #
|
||||||
start slave until master_log_file='master-bin', master_log_pos=561;
|
start slave until master_log_file='master-bin', master_log_pos=561;
|
||||||
ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
|
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
||||||
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
|
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
|
||||||
ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
|
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
||||||
start slave until master_log_file='master-bin.000001';
|
start slave until master_log_file='master-bin.000001';
|
||||||
ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
|
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
||||||
start slave until relay_log_file='slave-relay-bin.000002';
|
start slave until relay_log_file='slave-relay-bin.000002';
|
||||||
ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
|
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
||||||
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
|
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
|
||||||
ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL
|
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
|
||||||
start slave sql_thread;
|
start slave sql_thread;
|
||||||
start slave until master_log_file='master-bin.000001', master_log_pos=561;
|
start slave until master_log_file='master-bin.000001', master_log_pos=561;
|
||||||
Warnings:
|
Warnings:
|
||||||
|
@ -30,7 +30,7 @@ ERROR HY000: You are using safe update mode and you tried to update a table with
|
|||||||
delete from t1 where a+0=1;
|
delete from t1 where a+0=1;
|
||||||
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
|
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
|
||||||
select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5;
|
select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5;
|
||||||
ERROR 42000: The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok
|
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
|
||||||
update t1 set b="a" limit 1;
|
update t1 set b="a" limit 1;
|
||||||
update t1 set b="a" where b="b" limit 2;
|
update t1 set b="a" where b="b" limit 2;
|
||||||
delete from t1 where b="test" limit 1;
|
delete from t1 where b="test" limit 1;
|
||||||
@ -42,7 +42,7 @@ SELECT @@MAX_JOIN_SIZE, @@SQL_BIG_SELECTS;
|
|||||||
2 0
|
2 0
|
||||||
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
|
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
|
||||||
SELECT * from t1 order by a;
|
SELECT * from t1 order by a;
|
||||||
ERROR 42000: The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok
|
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
|
||||||
SET SQL_BIG_SELECTS=1;
|
SET SQL_BIG_SELECTS=1;
|
||||||
SELECT * from t1 order by a;
|
SELECT * from t1 order by a;
|
||||||
a b
|
a b
|
||||||
@ -52,7 +52,7 @@ a b
|
|||||||
5 a
|
5 a
|
||||||
SET MAX_JOIN_SIZE=2;
|
SET MAX_JOIN_SIZE=2;
|
||||||
SELECT * from t1;
|
SELECT * from t1;
|
||||||
ERROR 42000: The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok
|
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
|
||||||
SET MAX_JOIN_SIZE=DEFAULT;
|
SET MAX_JOIN_SIZE=DEFAULT;
|
||||||
SELECT * from t1;
|
SELECT * from t1;
|
||||||
a b
|
a b
|
||||||
|
@ -378,21 +378,21 @@ show create database test_$1;
|
|||||||
Database Create Database
|
Database Create Database
|
||||||
test_$1 CREATE DATABASE `test_$1` /*!40100 DEFAULT CHARACTER SET latin1 */
|
test_$1 CREATE DATABASE `test_$1` /*!40100 DEFAULT CHARACTER SET latin1 */
|
||||||
drop table t1;
|
drop table t1;
|
||||||
ERROR 42000: Access denied for user: 'mysqltest_1'@'localhost' to database 'test_$1'
|
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'test_$1'
|
||||||
drop database test_$1;
|
drop database test_$1;
|
||||||
ERROR 42000: Access denied for user: 'mysqltest_1'@'localhost' to database 'test_$1'
|
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'test_$1'
|
||||||
select * from test_$1.t1;
|
select * from test_$1.t1;
|
||||||
ERROR 42000: Access denied for user: 'mysqltest_2'@'localhost' to database 'test_$1'
|
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
|
||||||
show create database test_$1;
|
show create database test_$1;
|
||||||
ERROR 42000: Access denied for user: 'mysqltest_2'@'localhost' to database 'test_$1'
|
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
|
||||||
drop table test_$1.t1;
|
drop table test_$1.t1;
|
||||||
ERROR 42000: Access denied for user: 'mysqltest_2'@'localhost' to database 'test_$1'
|
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
|
||||||
drop database test_$1;
|
drop database test_$1;
|
||||||
ERROR 42000: Access denied for user: 'mysqltest_2'@'localhost' to database 'test_$1'
|
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
|
||||||
select * from test_$1.t1;
|
select * from test_$1.t1;
|
||||||
ERROR 42000: Access denied for user: 'mysqltest_3'@'localhost' to database 'test_$1'
|
ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1'
|
||||||
show create database test_$1;
|
show create database test_$1;
|
||||||
ERROR 42000: Access denied for user: 'mysqltest_3'@'localhost' to database 'test_$1'
|
ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1'
|
||||||
drop table test_$1.t1;
|
drop table test_$1.t1;
|
||||||
drop database test_$1;
|
drop database test_$1;
|
||||||
delete from mysql.user
|
delete from mysql.user
|
||||||
|
@ -6,7 +6,7 @@ explain extended select (select 2);
|
|||||||
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 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1249 Select 2 was reduced during optimisation
|
Note 1249 Select 2 was reduced during optimization
|
||||||
Note 1003 select 2 AS `(select 2)`
|
Note 1003 select 2 AS `(select 2)`
|
||||||
SELECT (SELECT 1) UNION SELECT (SELECT 2);
|
SELECT (SELECT 1) UNION SELECT (SELECT 2);
|
||||||
(SELECT 1)
|
(SELECT 1)
|
||||||
@ -18,8 +18,8 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
|
3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||||
NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL
|
NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1249 Select 2 was reduced during optimisation
|
Note 1249 Select 2 was reduced during optimization
|
||||||
Note 1249 Select 4 was reduced during optimisation
|
Note 1249 Select 4 was reduced during optimization
|
||||||
Note 1003 select 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)`
|
Note 1003 select 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)`
|
||||||
SELECT (SELECT (SELECT 0 UNION SELECT 0));
|
SELECT (SELECT (SELECT 0 UNION SELECT 0));
|
||||||
(SELECT (SELECT 0 UNION SELECT 0))
|
(SELECT (SELECT 0 UNION SELECT 0))
|
||||||
@ -31,7 +31,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
|
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||||
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
|
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1249 Select 2 was reduced during optimisation
|
Note 1249 Select 2 was reduced during optimization
|
||||||
Note 1003 select (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))`
|
Note 1003 select (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))`
|
||||||
SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a;
|
SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a;
|
||||||
ERROR 42S22: Reference 'a' not supported (forward reference in item list)
|
ERROR 42S22: Reference 'a' not supported (forward reference in item list)
|
||||||
@ -73,7 +73,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
|
|||||||
1
|
1
|
||||||
1
|
1
|
||||||
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
|
select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1));
|
||||||
ERROR HY000: Wrong usage of PROCEDURE and subquery
|
ERROR HY000: Incorrect usage of PROCEDURE and subquery
|
||||||
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
|
SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1));
|
||||||
ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
|
ERROR HY000: Incorrect parameters to procedure 'ANALYSE'
|
||||||
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
|
SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL;
|
||||||
@ -333,7 +333,7 @@ Warnings:
|
|||||||
Note 1276 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1
|
Note 1276 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1
|
||||||
Note 1003 select test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select 1 AS `Not_used` from test.t7 where (test.t7.uq = test.t6.clinic_uq))
|
Note 1003 select test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select 1 AS `Not_used` from test.t7 where (test.t7.uq = test.t6.clinic_uq))
|
||||||
select * from t1 where a= (select a from t2,t4 where t2.b=t4.b);
|
select * from t1 where a= (select a from t2,t4 where t2.b=t4.b);
|
||||||
ERROR 23000: Column: 'a' in field list is ambiguous
|
ERROR 23000: Column 'a' in field list is ambiguous
|
||||||
drop table t1,t2,t3;
|
drop table t1,t2,t3;
|
||||||
CREATE TABLE t3 (a varchar(20),b char(1) NOT NULL default '0');
|
CREATE TABLE t3 (a varchar(20),b char(1) NOT NULL default '0');
|
||||||
INSERT INTO t3 VALUES ('W','a'),('A','c'),('J','b');
|
INSERT INTO t3 VALUES ('W','a'),('A','c'),('J','b');
|
||||||
@ -712,7 +712,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1);
|
|||||||
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 PRIMARY t2 ref id id 5 const 1 Using where; Using index
|
1 PRIMARY t2 ref id id 5 const 1 Using where; Using index
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1249 Select 2 was reduced during optimisation
|
Note 1249 Select 2 was reduced during optimization
|
||||||
Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = 1)
|
Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = 1)
|
||||||
SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
|
SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
|
||||||
id
|
id
|
||||||
@ -724,8 +724,8 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1));
|
|||||||
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 PRIMARY t2 ref id id 5 const 1 Using where; Using index
|
1 PRIMARY t2 ref id id 5 const 1 Using where; Using index
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1249 Select 3 was reduced during optimisation
|
Note 1249 Select 3 was reduced during optimization
|
||||||
Note 1249 Select 2 was reduced during optimisation
|
Note 1249 Select 2 was reduced during optimization
|
||||||
Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = (1 + 1))
|
Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = (1 + 1))
|
||||||
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
|
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
|
||||||
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
|
||||||
@ -859,7 +859,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1276 Field or reference 'a' of SELECT #2 was resolved in SELECT #1
|
Note 1276 Field or reference 'a' of SELECT #2 was resolved in SELECT #1
|
||||||
Note 1249 Select 2 was reduced during optimisation
|
Note 1249 Select 2 was reduced during optimization
|
||||||
Note 1003 select (test.t1.a + 1) AS `(select a+1)` from test.t1
|
Note 1003 select (test.t1.a + 1) AS `(select a+1)` from test.t1
|
||||||
select (select a+1) from t1;
|
select (select a+1) from t1;
|
||||||
(select a+1)
|
(select a+1)
|
||||||
@ -976,7 +976,7 @@ ERROR 42S02: Table 'test.t1' doesn't exist
|
|||||||
CREATE TABLE t1 (a int, KEY(a));
|
CREATE TABLE t1 (a int, KEY(a));
|
||||||
HANDLER t1 OPEN;
|
HANDLER t1 OPEN;
|
||||||
HANDLER t1 READ a=((SELECT 1));
|
HANDLER t1 READ a=((SELECT 1));
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1))' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1))' at line 1
|
||||||
HANDLER t1 CLOSE;
|
HANDLER t1 CLOSE;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (a int);
|
create table t1 (a int);
|
||||||
@ -1714,7 +1714,7 @@ create table t1(id int);
|
|||||||
create table t2(id int);
|
create table t2(id int);
|
||||||
create table t3(flag int);
|
create table t3(flag int);
|
||||||
select (select * from t3 where id not null) from t1, t2;
|
select (select * from t3 where id not null) from t1, t2;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'null) from t1, t2' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null) from t1, t2' at line 1
|
||||||
drop table t1,t2,t3;
|
drop table t1,t2,t3;
|
||||||
CREATE TABLE t1 (id INT);
|
CREATE TABLE t1 (id INT);
|
||||||
CREATE TABLE t2 (id INT);
|
CREATE TABLE t2 (id INT);
|
||||||
|
@ -27,7 +27,7 @@ t3 CREATE TABLE `t3` (
|
|||||||
drop table t1,t2,t3
|
drop table t1,t2,t3
|
||||||
#;
|
#;
|
||||||
CREATE TABLE t1 (a char(257) default "hello");
|
CREATE TABLE t1 (a char(257) default "hello");
|
||||||
ERROR 42000: Too big column length for column 'a' (max = 255). Use BLOB instead
|
ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB instead
|
||||||
CREATE TABLE t2 (a blob default "hello");
|
CREATE TABLE t2 (a blob default "hello");
|
||||||
ERROR 42000: BLOB/TEXT column 'a' can't have a default value
|
ERROR 42000: BLOB/TEXT column 'a' can't have a default value
|
||||||
drop table if exists t1,t2;
|
drop table if exists t1,t2;
|
||||||
|
@ -36,11 +36,11 @@ test.t1 check status OK
|
|||||||
delete from t1;
|
delete from t1;
|
||||||
insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460");
|
insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 't' at row 14
|
Warning 1264 Data truncated; out of range for column 't' at row 14
|
||||||
Warning 1264 Data truncated, out of range for column 't' at row 15
|
Warning 1264 Data truncated; out of range for column 't' at row 15
|
||||||
Warning 1264 Data truncated, out of range for column 't' at row 16
|
Warning 1264 Data truncated; out of range for column 't' at row 16
|
||||||
Warning 1264 Data truncated, out of range for column 't' at row 17
|
Warning 1264 Data truncated; out of range for column 't' at row 17
|
||||||
Warning 1264 Data truncated, out of range for column 't' at row 18
|
Warning 1264 Data truncated; out of range for column 't' at row 18
|
||||||
select * from t1;
|
select * from t1;
|
||||||
t
|
t
|
||||||
2000-01-01 00:00:00
|
2000-01-01 00:00:00
|
||||||
|
@ -158,14 +158,14 @@ insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
|
|||||||
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
|
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
|
||||||
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
|
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 2
|
Warning 1264 Data truncated; out of range for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
|
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1265 Data truncated for column 'a' at row 2
|
Warning 1265 Data truncated for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
|
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1265 Data truncated for column 'a' at row 3
|
Warning 1265 Data truncated for column 'a' at row 3
|
||||||
@ -201,29 +201,29 @@ drop table t1;
|
|||||||
create table t1 (a decimal(10,2) unsigned);
|
create table t1 (a decimal(10,2) unsigned);
|
||||||
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
|
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 2
|
Warning 1264 Data truncated; out of range for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 6
|
Warning 1264 Data truncated; out of range for column 'a' at row 6
|
||||||
insert into t1 values ("-.1"),("+.1"),(".1");
|
insert into t1 values ("-.1"),("+.1"),(".1");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
|
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
|
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 2
|
Warning 1264 Data truncated; out of range for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
|
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 2
|
Warning 1264 Data truncated; out of range for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
|
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1265 Data truncated for column 'a' at row 2
|
Warning 1265 Data truncated for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
|
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1265 Data truncated for column 'a' at row 3
|
Warning 1265 Data truncated for column 'a' at row 3
|
||||||
@ -259,29 +259,29 @@ drop table t1;
|
|||||||
create table t1 (a decimal(10,2) zerofill);
|
create table t1 (a decimal(10,2) zerofill);
|
||||||
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
|
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 2
|
Warning 1264 Data truncated; out of range for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 6
|
Warning 1264 Data truncated; out of range for column 'a' at row 6
|
||||||
insert into t1 values ("-.1"),("+.1"),(".1");
|
insert into t1 values ("-.1"),("+.1"),(".1");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
|
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
|
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 2
|
Warning 1264 Data truncated; out of range for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
|
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 2
|
Warning 1264 Data truncated; out of range for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
|
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1265 Data truncated for column 'a' at row 2
|
Warning 1265 Data truncated for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
|
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1265 Data truncated for column 'a' at row 3
|
Warning 1265 Data truncated for column 'a' at row 3
|
||||||
@ -321,13 +321,13 @@ insert into t1 values (00000000000001),(+0000000000001),(-0000000000001);
|
|||||||
insert into t1 values (+111111111.11),(111111111.11),(-11111111.11);
|
insert into t1 values (+111111111.11),(111111111.11),(-11111111.11);
|
||||||
insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.11);
|
insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.11);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 2
|
Warning 1264 Data truncated; out of range for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
insert into t1 values (1e+100),(1e-100),(-1e+100);
|
insert into t1 values (1e+100),(1e-100),(-1e+100);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0);
|
insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0);
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
@ -361,8 +361,8 @@ drop table t1;
|
|||||||
create table t1 (a decimal);
|
create table t1 (a decimal);
|
||||||
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999);
|
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 7
|
Warning 1264 Data truncated; out of range for column 'a' at row 7
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
-9999999999
|
-9999999999
|
||||||
@ -376,9 +376,9 @@ drop table t1;
|
|||||||
create table t1 (a decimal unsigned);
|
create table t1 (a decimal unsigned);
|
||||||
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
|
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 2
|
Warning 1264 Data truncated; out of range for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 7
|
Warning 1264 Data truncated; out of range for column 'a' at row 7
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
0
|
0
|
||||||
@ -392,9 +392,9 @@ drop table t1;
|
|||||||
create table t1 (a decimal zerofill);
|
create table t1 (a decimal zerofill);
|
||||||
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
|
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 2
|
Warning 1264 Data truncated; out of range for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 7
|
Warning 1264 Data truncated; out of range for column 'a' at row 7
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
0000000000
|
0000000000
|
||||||
@ -408,9 +408,9 @@ drop table t1;
|
|||||||
create table t1 (a decimal unsigned zerofill);
|
create table t1 (a decimal unsigned zerofill);
|
||||||
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
|
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 2
|
Warning 1264 Data truncated; out of range for column 'a' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 7
|
Warning 1264 Data truncated; out of range for column 'a' at row 7
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
0000000000
|
0000000000
|
||||||
@ -425,7 +425,7 @@ create table t1(a decimal(10,0));
|
|||||||
insert into t1 values ("1e4294967295");
|
insert into t1 values ("1e4294967295");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1265 Data truncated for column 'a' at row 1
|
Warning 1265 Data truncated for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
99999999999
|
99999999999
|
||||||
@ -433,17 +433,17 @@ delete from t1;
|
|||||||
insert into t1 values("1e4294967297");
|
insert into t1 values("1e4294967297");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1265 Data truncated for column 'a' at row 1
|
Warning 1265 Data truncated for column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 1
|
Warning 1264 Data truncated; out of range for column 'a' at row 1
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
99999999999
|
99999999999
|
||||||
drop table t1;
|
drop table t1;
|
||||||
CREATE TABLE t1 (a_dec DECIMAL(-1,0));
|
CREATE TABLE t1 (a_dec DECIMAL(-1,0));
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,0))' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,0))' at line 1
|
||||||
CREATE TABLE t1 (a_dec DECIMAL(-2,1));
|
CREATE TABLE t1 (a_dec DECIMAL(-2,1));
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-2,1))' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-2,1))' at line 1
|
||||||
CREATE TABLE t1 (a_dec DECIMAL(-1,1));
|
CREATE TABLE t1 (a_dec DECIMAL(-1,1));
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,1))' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,1))' at line 1
|
||||||
create table t1(a decimal(7,3));
|
create table t1(a decimal(7,3));
|
||||||
insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000');
|
insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000');
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
@ -15,8 +15,8 @@ f1 float NULL YES NULL select,insert,update,references
|
|||||||
f2 double NULL YES NULL select,insert,update,references
|
f2 double NULL YES NULL select,insert,update,references
|
||||||
insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150);
|
insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'f1' at row 7
|
Warning 1264 Data truncated; out of range for column 'f1' at row 7
|
||||||
Warning 1264 Data truncated, out of range for column 'f1' at row 8
|
Warning 1264 Data truncated; out of range for column 'f1' at row 8
|
||||||
insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150);
|
insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150);
|
||||||
select * from t1;
|
select * from t1;
|
||||||
f1 f2
|
f1 f2
|
||||||
|
@ -89,33 +89,33 @@ insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,N
|
|||||||
insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3);
|
insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3);
|
||||||
insert into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1);
|
insert into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'utiny' at row 1
|
Warning 1264 Data truncated; out of range for column 'utiny' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'ushort' at row 1
|
Warning 1264 Data truncated; out of range for column 'ushort' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'umedium' at row 1
|
Warning 1264 Data truncated; out of range for column 'umedium' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'ulong' at row 1
|
Warning 1264 Data truncated; out of range for column 'ulong' at row 1
|
||||||
Warning 1265 Data truncated for column 'options' at row 1
|
Warning 1265 Data truncated for column 'options' at row 1
|
||||||
Warning 1265 Data truncated for column 'flags' at row 1
|
Warning 1265 Data truncated for column 'flags' at row 1
|
||||||
insert into t1 values (0,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,NULL,0,0,0,-4294967295,-4294967295,-4294967295,'-4294967295',0,"one,two,tree");
|
insert into t1 values (0,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,NULL,0,0,0,-4294967295,-4294967295,-4294967295,'-4294967295',0,"one,two,tree");
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1265 Data truncated for column 'string' at row 1
|
Warning 1265 Data truncated for column 'string' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'tiny' at row 1
|
Warning 1264 Data truncated; out of range for column 'tiny' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'short' at row 1
|
Warning 1264 Data truncated; out of range for column 'short' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'medium' at row 1
|
Warning 1264 Data truncated; out of range for column 'medium' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'long_int' at row 1
|
Warning 1264 Data truncated; out of range for column 'long_int' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'utiny' at row 1
|
Warning 1264 Data truncated; out of range for column 'utiny' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'ushort' at row 1
|
Warning 1264 Data truncated; out of range for column 'ushort' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'umedium' at row 1
|
Warning 1264 Data truncated; out of range for column 'umedium' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'ulong' at row 1
|
Warning 1264 Data truncated; out of range for column 'ulong' at row 1
|
||||||
Warning 1265 Data truncated for column 'options' at row 1
|
Warning 1265 Data truncated for column 'options' at row 1
|
||||||
insert into t1 values (0,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,NULL,0,0,0,4294967295,4294967295,4294967295,'4294967295',0,0);
|
insert into t1 values (0,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,NULL,0,0,0,4294967295,4294967295,4294967295,'4294967295',0,0);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'tiny' at row 1
|
Warning 1264 Data truncated; out of range for column 'tiny' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'short' at row 1
|
Warning 1264 Data truncated; out of range for column 'short' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'medium' at row 1
|
Warning 1264 Data truncated; out of range for column 'medium' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'long_int' at row 1
|
Warning 1264 Data truncated; out of range for column 'long_int' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'utiny' at row 1
|
Warning 1264 Data truncated; out of range for column 'utiny' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'ushort' at row 1
|
Warning 1264 Data truncated; out of range for column 'ushort' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'umedium' at row 1
|
Warning 1264 Data truncated; out of range for column 'umedium' at row 1
|
||||||
Warning 1265 Data truncated for column 'options' at row 1
|
Warning 1265 Data truncated for column 'options' at row 1
|
||||||
insert into t1 (tiny) values (1);
|
insert into t1 (tiny) values (1);
|
||||||
select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,utiny,ushort,umedium,ulong,ulonglong,mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000),date_field,time_field,date_time,blob_col,tinyblob_col,mediumblob_col,longblob_col from t1;
|
select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,utiny,ushort,umedium,ulong,ulonglong,mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000),date_field,time_field,date_time,blob_col,tinyblob_col,mediumblob_col,longblob_col from t1;
|
||||||
|
@ -25,11 +25,11 @@ t
|
|||||||
36:30:31
|
36:30:31
|
||||||
insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:22"),("12.45a");
|
insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:22"),("12.45a");
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1292 Truncated wrong time value: '10.22.22'
|
Note 1292 Truncated incorrect time value: '10.22.22'
|
||||||
Warning 1264 Data truncated, out of range for column 't' at row 2
|
Warning 1264 Data truncated; out of range for column 't' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 't' at row 3
|
Warning 1264 Data truncated; out of range for column 't' at row 3
|
||||||
Warning 1264 Data truncated, out of range for column 't' at row 4
|
Warning 1264 Data truncated; out of range for column 't' at row 4
|
||||||
Note 1292 Truncated wrong time value: '12.45a'
|
Note 1292 Truncated incorrect time value: '12.45a'
|
||||||
select * from t1;
|
select * from t1;
|
||||||
t
|
t
|
||||||
10:22:33
|
10:22:33
|
||||||
|
@ -129,15 +129,15 @@ t2 t4 t6 t8 t10 t12 t14
|
|||||||
1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59
|
1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (t1 timestamp, t2 timestamp default now());
|
create table t1 (t1 timestamp, t2 timestamp default now());
|
||||||
ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
|
ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
|
||||||
create table t1 (t1 timestamp, t2 timestamp on update now());
|
create table t1 (t1 timestamp, t2 timestamp on update now());
|
||||||
ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
|
ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
|
||||||
create table t1 (t1 timestamp, t2 timestamp default now() on update now());
|
create table t1 (t1 timestamp, t2 timestamp default now() on update now());
|
||||||
ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
|
ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
|
||||||
create table t1 (t1 timestamp default now(), t2 timestamp on update now());
|
create table t1 (t1 timestamp default now(), t2 timestamp on update now());
|
||||||
ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
|
ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
|
||||||
create table t1 (t1 timestamp on update now(), t2 timestamp default now() on update now());
|
create table t1 (t1 timestamp on update now(), t2 timestamp default now() on update now());
|
||||||
ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
|
ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
|
||||||
create table t1 (t1 timestamp default '2003-01-01 00:00:00', t2 datetime, t3 timestamp);
|
create table t1 (t1 timestamp default '2003-01-01 00:00:00', t2 datetime, t3 timestamp);
|
||||||
SET TIMESTAMP=1000000000;
|
SET TIMESTAMP=1000000000;
|
||||||
insert into t1 values ();
|
insert into t1 values ();
|
||||||
|
@ -4,7 +4,7 @@ create table t1 (this int unsigned);
|
|||||||
insert into t1 values (1);
|
insert into t1 values (1);
|
||||||
insert into t1 values (-1);
|
insert into t1 values (-1);
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1264 Data truncated, out of range for column 'this' at row 1
|
Warning 1264 Data truncated; out of range for column 'this' at row 1
|
||||||
select * from t1;
|
select * from t1;
|
||||||
this
|
this
|
||||||
1
|
1
|
||||||
|
@ -81,7 +81,7 @@ a b
|
|||||||
2 b
|
2 b
|
||||||
1 a
|
1 a
|
||||||
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b;
|
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b;
|
||||||
ERROR 42000: Table 't1' from one of SELECT's can not be used in global ORDER clause
|
ERROR 42000: Table 't1' from one of the SELECTs cannot be used in global ORDER clause
|
||||||
explain extended (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
|
explain extended (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
|
||||||
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 PRIMARY t1 ALL NULL NULL NULL NULL 4
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
|
||||||
@ -117,11 +117,11 @@ ERROR 21000: The used SELECT statements have a different number of columns
|
|||||||
explain select a,b from t1 union select 1 limit 0;
|
explain select a,b from t1 union select 1 limit 0;
|
||||||
ERROR 21000: The used SELECT statements have a different number of columns
|
ERROR 21000: The used SELECT statements have a different number of columns
|
||||||
select a,b from t1 into outfile 'skr' union select a,b from t2;
|
select a,b from t1 into outfile 'skr' union select a,b from t2;
|
||||||
ERROR HY000: Wrong usage of UNION and INTO
|
ERROR HY000: Incorrect usage of UNION and INTO
|
||||||
select a,b from t1 order by a union select a,b from t2;
|
select a,b from t1 order by a union select a,b from t2;
|
||||||
ERROR HY000: Wrong usage of UNION and ORDER BY
|
ERROR HY000: Incorrect usage of UNION and ORDER BY
|
||||||
insert into t3 select a from t1 order by a union select a from t2;
|
insert into t3 select a from t1 order by a union select a from t2;
|
||||||
ERROR HY000: Wrong usage of UNION and ORDER BY
|
ERROR HY000: Incorrect usage of UNION and ORDER BY
|
||||||
create table t3 select a,b from t1 union select a from t2;
|
create table t3 select a,b from t1 union select a from t2;
|
||||||
ERROR 21000: The used SELECT statements have a different number of columns
|
ERROR 21000: The used SELECT statements have a different number of columns
|
||||||
select a,b from t1 union select a from t2;
|
select a,b from t1 union select a from t2;
|
||||||
@ -131,7 +131,7 @@ ERROR 21000: The used SELECT statements have a different number of columns
|
|||||||
select a from t1 union select * from t2;
|
select a from t1 union select * from t2;
|
||||||
ERROR 21000: The used SELECT statements have a different number of columns
|
ERROR 21000: The used SELECT statements have a different number of columns
|
||||||
select * from t1 union select SQL_BUFFER_RESULT * from t2;
|
select * from t1 union select SQL_BUFFER_RESULT * from t2;
|
||||||
ERROR 42000: Wrong usage/placement of 'SQL_BUFFER_RESULT'
|
ERROR 42000: Incorrect usage/placement of 'SQL_BUFFER_RESULT'
|
||||||
create table t3 select a,b from t1 union all select a,b from t2;
|
create table t3 select a,b from t1 union all select a,b from t2;
|
||||||
insert into t3 select a,b from t1 union all select a,b from t2;
|
insert into t3 select a,b from t1 union all select a,b from t2;
|
||||||
replace into t3 select a,b as c from t1 union all select a,b from t2;
|
replace into t3 select a,b as c from t1 union all select a,b from t2;
|
||||||
@ -341,7 +341,7 @@ select found_rows();
|
|||||||
found_rows()
|
found_rows()
|
||||||
4
|
4
|
||||||
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1;
|
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
||||||
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2;
|
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2;
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
@ -424,7 +424,7 @@ a
|
|||||||
3
|
3
|
||||||
3
|
3
|
||||||
(SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1;
|
(SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1;
|
||||||
ERROR 42000: Wrong usage/placement of 'SQL_CALC_FOUND_ROWS'
|
ERROR 42000: Incorrect usage/placement of 'SQL_CALC_FOUND_ROWS'
|
||||||
create temporary table t1 select a from t1 union select a from t2;
|
create temporary table t1 select a from t1 union select a from t2;
|
||||||
drop temporary table t1;
|
drop temporary table t1;
|
||||||
create table t1 select a from t1 union select a from t2;
|
create table t1 select a from t1 union select a from t2;
|
||||||
|
@ -18,7 +18,7 @@ Warnings:
|
|||||||
Note 1003 select test.t1.ID AS `ID`,test.t1.UNIQ AS `UNIQ` from test.t1 where (test.t1.UNIQ = 4084688022709641610)
|
Note 1003 select test.t1.ID AS `ID`,test.t1.UNIQ AS `UNIQ` from test.t1 where (test.t1.UNIQ = 4084688022709641610)
|
||||||
drop table t1;
|
drop table t1;
|
||||||
select x'hello';
|
select x'hello';
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'x'hello'' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'x'hello'' at line 1
|
||||||
select 0xfg;
|
select 0xfg;
|
||||||
ERROR 42S22: Unknown column '0xfg' in 'field list'
|
ERROR 42S22: Unknown column '0xfg' in 'field list'
|
||||||
create table t1 select 1 as x, 2 as xx;
|
create table t1 select 1 as x, 2 as xx;
|
||||||
|
@ -217,7 +217,7 @@ ERROR 42000: Variable 'big_tables' can't be set to the value of 'OFFF'
|
|||||||
set unknown_variable=1;
|
set unknown_variable=1;
|
||||||
ERROR HY000: Unknown system variable 'unknown_variable'
|
ERROR HY000: Unknown system variable 'unknown_variable'
|
||||||
set max_join_size="hello";
|
set max_join_size="hello";
|
||||||
ERROR 42000: Wrong argument type to variable 'max_join_size'
|
ERROR 42000: Incorrect argument type to variable 'max_join_size'
|
||||||
set storage_engine=UNKNOWN_TABLE_TYPE;
|
set storage_engine=UNKNOWN_TABLE_TYPE;
|
||||||
ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE'
|
ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE'
|
||||||
set storage_engine=INNODB, big_tables=2;
|
set storage_engine=INNODB, big_tables=2;
|
||||||
@ -427,12 +427,12 @@ select @a, @b;
|
|||||||
@a @b
|
@a @b
|
||||||
2 1
|
2 1
|
||||||
set @@global.global.key_buffer_size= 1;
|
set @@global.global.key_buffer_size= 1;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size= 1' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size= 1' at line 1
|
||||||
set GLOBAL global.key_buffer_size= 1;
|
set GLOBAL global.key_buffer_size= 1;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size= 1' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size= 1' at line 1
|
||||||
SELECT @@global.global.key_buffer_size;
|
SELECT @@global.global.key_buffer_size;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1
|
||||||
SELECT @@global.session.key_buffer_size;
|
SELECT @@global.session.key_buffer_size;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1
|
||||||
SELECT @@global.local.key_buffer_size;
|
SELECT @@global.local.key_buffer_size;
|
||||||
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1
|
||||||
|
@ -43,13 +43,13 @@ drop table t1;
|
|||||||
create table t1(a tinyint, b int not null, c date, d char(5));
|
create table t1(a tinyint, b int not null, c date, d char(5));
|
||||||
load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ',';
|
load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ',';
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2
|
||||||
Warning 1265 Data truncated for column 'd' at row 3
|
Warning 1265 Data truncated for column 'd' at row 3
|
||||||
Warning 1265 Data truncated for column 'c' at row 4
|
Warning 1265 Data truncated for column 'c' at row 4
|
||||||
Warning 1261 Row 5 doesn't contain data for all columns
|
Warning 1261 Row 5 doesn't contain data for all columns
|
||||||
Warning 1265 Data truncated for column 'b' at row 6
|
Warning 1265 Data truncated for column 'b' at row 6
|
||||||
Warning 1262 Row 7 was truncated; It contained more data than there were input columns
|
Warning 1262 Row 7 was truncated; it contained more data than there were input columns
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 8
|
Warning 1264 Data truncated; out of range for column 'a' at row 8
|
||||||
select @@warning_count;
|
select @@warning_count;
|
||||||
@@warning_count
|
@@warning_count
|
||||||
7
|
7
|
||||||
@ -57,11 +57,11 @@ drop table t1;
|
|||||||
create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5));
|
create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5));
|
||||||
insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
|
insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 1
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1
|
||||||
Warning 1264 Data truncated, out of range for column 'b' at row 2
|
Warning 1264 Data truncated; out of range for column 'b' at row 2
|
||||||
Warning 1265 Data truncated for column 'c' at row 2
|
Warning 1265 Data truncated for column 'c' at row 2
|
||||||
Warning 1264 Data truncated, out of range for column 'a' at row 3
|
Warning 1264 Data truncated; out of range for column 'a' at row 3
|
||||||
Warning 1264 Data truncated, out of range for column 'b' at row 3
|
Warning 1264 Data truncated; out of range for column 'b' at row 3
|
||||||
Warning 1265 Data truncated for column 'c' at row 3
|
Warning 1265 Data truncated for column 'c' at row 3
|
||||||
alter table t1 modify c char(4);
|
alter table t1 modify c char(4);
|
||||||
Warnings:
|
Warnings:
|
||||||
@ -70,7 +70,7 @@ Warning 1265 Data truncated for column 'c' at row 2
|
|||||||
alter table t1 add d char(2);
|
alter table t1 add d char(2);
|
||||||
update t1 set a=NULL where a=10;
|
update t1 set a=NULL where a=10;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 2
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 2
|
||||||
update t1 set c='mysql ab' where c='test';
|
update t1 set c='mysql ab' where c='test';
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1265 Data truncated for column 'c' at row 4
|
Warning 1265 Data truncated for column 'c' at row 4
|
||||||
@ -86,7 +86,7 @@ Warnings:
|
|||||||
Warning 1265 Data truncated for column 'b' at row 1
|
Warning 1265 Data truncated for column 'b' at row 1
|
||||||
Warning 1265 Data truncated for column 'b' at row 2
|
Warning 1265 Data truncated for column 'b' at row 2
|
||||||
Warning 1265 Data truncated for column 'b' at row 3
|
Warning 1265 Data truncated for column 'b' at row 3
|
||||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 4
|
Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 4
|
||||||
Warning 1265 Data truncated for column 'b' at row 4
|
Warning 1265 Data truncated for column 'b' at row 4
|
||||||
insert into t2(b) values('mysqlab');
|
insert into t2(b) values('mysqlab');
|
||||||
Warnings:
|
Warnings:
|
||||||
@ -125,11 +125,11 @@ Warning 1266 Using storage engine MyISAM for table 't1'
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (id int) type=heap;
|
create table t1 (id int) type=heap;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1287 'TYPE=storage_engine' is deprecated, use 'ENGINE=storage_engine' instead
|
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
|
||||||
alter table t1 type=myisam;
|
alter table t1 type=myisam;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1287 'TYPE=storage_engine' is deprecated, use 'ENGINE=storage_engine' instead
|
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
|
||||||
drop table t1;
|
drop table t1;
|
||||||
set table_type=MYISAM;
|
set table_type=MYISAM;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1287 'table_type' is deprecated, use 'storage_engine' instead
|
Warning 1287 'table_type' is deprecated; use 'storage_engine' instead
|
||||||
|
181
mysql-test/t/ctype_uca.test
Normal file
181
mysql-test/t/ctype_uca.test
Normal file
@ -0,0 +1,181 @@
|
|||||||
|
-- source include/have_ucs2.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS t1;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test Unicode collations.
|
||||||
|
#
|
||||||
|
|
||||||
|
set names utf8;
|
||||||
|
create table t1 (c1 char(10) character set utf8 collate utf8_bin);
|
||||||
|
|
||||||
|
#
|
||||||
|
# Basic Latin
|
||||||
|
#
|
||||||
|
insert into t1 values ('A'),('a');
|
||||||
|
insert into t1 values ('B'),('b');
|
||||||
|
insert into t1 values ('C'),('c');
|
||||||
|
insert into t1 values ('D'),('d');
|
||||||
|
insert into t1 values ('E'),('e');
|
||||||
|
insert into t1 values ('F'),('f');
|
||||||
|
insert into t1 values ('G'),('g');
|
||||||
|
insert into t1 values ('H'),('h');
|
||||||
|
insert into t1 values ('I'),('i');
|
||||||
|
insert into t1 values ('J'),('j');
|
||||||
|
insert into t1 values ('K'),('k');
|
||||||
|
insert into t1 values ('L'),('l');
|
||||||
|
insert into t1 values ('M'),('m');
|
||||||
|
insert into t1 values ('N'),('n');
|
||||||
|
insert into t1 values ('O'),('o');
|
||||||
|
insert into t1 values ('P'),('p');
|
||||||
|
insert into t1 values ('Q'),('q');
|
||||||
|
insert into t1 values ('R'),('r');
|
||||||
|
insert into t1 values ('S'),('s');
|
||||||
|
insert into t1 values ('T'),('t');
|
||||||
|
insert into t1 values ('U'),('u');
|
||||||
|
insert into t1 values ('V'),('v');
|
||||||
|
insert into t1 values ('W'),('w');
|
||||||
|
insert into t1 values ('X'),('x');
|
||||||
|
insert into t1 values ('Y'),('y');
|
||||||
|
insert into t1 values ('Z'),('z');
|
||||||
|
|
||||||
|
#
|
||||||
|
# Latin1 suppliment
|
||||||
|
#
|
||||||
|
insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0);
|
||||||
|
insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1);
|
||||||
|
insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2);
|
||||||
|
insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3);
|
||||||
|
insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4);
|
||||||
|
insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5);
|
||||||
|
insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6);
|
||||||
|
insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7);
|
||||||
|
insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8);
|
||||||
|
insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9);
|
||||||
|
insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca);
|
||||||
|
insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb);
|
||||||
|
insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc);
|
||||||
|
insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd);
|
||||||
|
insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce);
|
||||||
|
insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf);
|
||||||
|
|
||||||
|
insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0);
|
||||||
|
insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1);
|
||||||
|
insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2);
|
||||||
|
insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3);
|
||||||
|
insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4);
|
||||||
|
insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5);
|
||||||
|
insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6);
|
||||||
|
insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7);
|
||||||
|
insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8);
|
||||||
|
insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9);
|
||||||
|
insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da);
|
||||||
|
insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db);
|
||||||
|
insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc);
|
||||||
|
insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd);
|
||||||
|
insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de);
|
||||||
|
insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df);
|
||||||
|
|
||||||
|
#
|
||||||
|
# Latin extended-A, 0100-017F
|
||||||
|
#
|
||||||
|
insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103);
|
||||||
|
insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107);
|
||||||
|
insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b);
|
||||||
|
insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f);
|
||||||
|
insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113);
|
||||||
|
insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117);
|
||||||
|
insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b);
|
||||||
|
insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f);
|
||||||
|
insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123);
|
||||||
|
insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127);
|
||||||
|
insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b);
|
||||||
|
insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f);
|
||||||
|
insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133);
|
||||||
|
insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137);
|
||||||
|
insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b);
|
||||||
|
insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f);
|
||||||
|
insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143);
|
||||||
|
insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147);
|
||||||
|
insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b);
|
||||||
|
insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f);
|
||||||
|
insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153);
|
||||||
|
insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157);
|
||||||
|
insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b);
|
||||||
|
insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f);
|
||||||
|
insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163);
|
||||||
|
insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167);
|
||||||
|
insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b);
|
||||||
|
insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f);
|
||||||
|
insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173);
|
||||||
|
insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177);
|
||||||
|
insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b);
|
||||||
|
insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f);
|
||||||
|
|
||||||
|
#
|
||||||
|
# Latin extended-B, 0180-024F
|
||||||
|
#
|
||||||
|
insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183);
|
||||||
|
insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187);
|
||||||
|
insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b);
|
||||||
|
insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f);
|
||||||
|
insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193);
|
||||||
|
insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197);
|
||||||
|
insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b);
|
||||||
|
insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f);
|
||||||
|
insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3);
|
||||||
|
insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7);
|
||||||
|
insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab);
|
||||||
|
insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af);
|
||||||
|
insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3);
|
||||||
|
insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7);
|
||||||
|
insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb);
|
||||||
|
insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf);
|
||||||
|
insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3);
|
||||||
|
insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7);
|
||||||
|
insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb);
|
||||||
|
insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf);
|
||||||
|
insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3);
|
||||||
|
insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7);
|
||||||
|
insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db);
|
||||||
|
insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df);
|
||||||
|
insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3);
|
||||||
|
insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7);
|
||||||
|
insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb);
|
||||||
|
insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef);
|
||||||
|
insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3);
|
||||||
|
insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7);
|
||||||
|
insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb);
|
||||||
|
insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff);
|
||||||
|
|
||||||
|
|
||||||
|
insert into t1 values ('AA'),('Aa'),('aa'),('aA');
|
||||||
|
insert into t1 values ('CH'),('Ch'),('ch'),('cH');
|
||||||
|
insert into t1 values ('DZ'),('Dz'),('dz'),('dZ');
|
||||||
|
insert into t1 values ('IJ'),('Ij'),('ij'),('iJ');
|
||||||
|
insert into t1 values ('LJ'),('Lj'),('lj'),('lJ');
|
||||||
|
insert into t1 values ('LL'),('Ll'),('ll'),('lL');
|
||||||
|
insert into t1 values ('NJ'),('Nj'),('nj'),('nJ');
|
||||||
|
insert into t1 values ('OE'),('Oe'),('oe'),('oE');
|
||||||
|
insert into t1 values ('SS'),('Ss'),('ss'),('sS');
|
||||||
|
insert into t1 values ('RR'),('Rr'),('rr'),('rR');
|
||||||
|
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci;
|
||||||
|
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci;
|
||||||
|
--select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci;
|
||||||
|
|
@ -279,3 +279,12 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr
|
|||||||
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
|
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# bug#3964
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t1 (s varchar(255), FULLTEXT (s)) DEFAULT CHARSET=utf8;
|
||||||
|
insert into t1 (s) values ('p<>ra para para'),('para para para');
|
||||||
|
select * from t1 where match(s) against('para' in boolean mode);
|
||||||
|
select * from t1 where match(s) against('par*' in boolean mode);
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -189,3 +189,15 @@ INSERT INTO t1 VALUES (1), (2);
|
|||||||
INSERT INTO t2 VALUES (1), (2);
|
INSERT INTO t2 VALUES (1), (2);
|
||||||
SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a;
|
SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a;
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #4035: group_concat() and HAVING
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a char(4));
|
||||||
|
INSERT INTO t1 VALUES ('John'), ('Anna'), ('Bill');
|
||||||
|
SELECT GROUP_CONCAT(a SEPARATOR '||') AS names FROM t1
|
||||||
|
HAVING names LIKE '%An%';
|
||||||
|
SELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1
|
||||||
|
HAVING LEFT(names, 1) ='J';
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -12,7 +12,7 @@ show slave status;
|
|||||||
|
|
||||||
change master to master_host='127.0.0.1';
|
change master to master_host='127.0.0.1';
|
||||||
# The following needs to be cleaned up when change master is fixed
|
# The following needs to be cleaned up when change master is fixed
|
||||||
--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT
|
--replace_result $MASTER_MYPORT MASTER_PORT $MYSQL_TCP_PORT MASTER_PORT
|
||||||
--replace_column 1 # 33 #
|
--replace_column 1 # 33 #
|
||||||
show slave status;
|
show slave status;
|
||||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||||
|
@ -33,6 +33,29 @@ extern CHARSET_INFO my_charset_ucs2_estonian_uca_ci;
|
|||||||
extern CHARSET_INFO my_charset_ucs2_spanish_uca_ci;
|
extern CHARSET_INFO my_charset_ucs2_spanish_uca_ci;
|
||||||
extern CHARSET_INFO my_charset_ucs2_swedish_uca_ci;
|
extern CHARSET_INFO my_charset_ucs2_swedish_uca_ci;
|
||||||
extern CHARSET_INFO my_charset_ucs2_turkish_uca_ci;
|
extern CHARSET_INFO my_charset_ucs2_turkish_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_ucs2_czech_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_ucs2_danish_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_ucs2_slovak_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_ucs2_spanish2_uca_ci;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_CHARSET_utf8
|
||||||
|
extern CHARSET_INFO my_charset_utf8_general_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_icelandic_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_latvian_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_romanian_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_slovenian_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_polish_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_estonian_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_spanish_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_swedish_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_turkish_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_czech_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_danish_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_lithuanian_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_slovak_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_spanish2_uca_ci;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
my_bool init_compiled_charsets(myf flags __attribute__((unused)))
|
my_bool init_compiled_charsets(myf flags __attribute__((unused)))
|
||||||
@ -87,7 +110,6 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
|
|||||||
add_compiled_collation(&my_charset_ucs2_general_ci);
|
add_compiled_collation(&my_charset_ucs2_general_ci);
|
||||||
add_compiled_collation(&my_charset_ucs2_bin);
|
add_compiled_collation(&my_charset_ucs2_bin);
|
||||||
add_compiled_collation(&my_charset_ucs2_general_uca);
|
add_compiled_collation(&my_charset_ucs2_general_uca);
|
||||||
add_compiled_collation(&my_charset_ucs2_general_uca);
|
|
||||||
add_compiled_collation(&my_charset_ucs2_icelandic_uca_ci);
|
add_compiled_collation(&my_charset_ucs2_icelandic_uca_ci);
|
||||||
add_compiled_collation(&my_charset_ucs2_latvian_uca_ci);
|
add_compiled_collation(&my_charset_ucs2_latvian_uca_ci);
|
||||||
add_compiled_collation(&my_charset_ucs2_romanian_uca_ci);
|
add_compiled_collation(&my_charset_ucs2_romanian_uca_ci);
|
||||||
@ -97,6 +119,11 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
|
|||||||
add_compiled_collation(&my_charset_ucs2_spanish_uca_ci);
|
add_compiled_collation(&my_charset_ucs2_spanish_uca_ci);
|
||||||
add_compiled_collation(&my_charset_ucs2_swedish_uca_ci);
|
add_compiled_collation(&my_charset_ucs2_swedish_uca_ci);
|
||||||
add_compiled_collation(&my_charset_ucs2_turkish_uca_ci);
|
add_compiled_collation(&my_charset_ucs2_turkish_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_ucs2_czech_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_ucs2_danish_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_ucs2_lithuanian_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_ucs2_slovak_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_ucs2_spanish2_uca_ci);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CHARSET_ujis
|
#ifdef HAVE_CHARSET_ujis
|
||||||
@ -107,6 +134,21 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
|
|||||||
#ifdef HAVE_CHARSET_utf8
|
#ifdef HAVE_CHARSET_utf8
|
||||||
add_compiled_collation(&my_charset_utf8_general_ci);
|
add_compiled_collation(&my_charset_utf8_general_ci);
|
||||||
add_compiled_collation(&my_charset_utf8_bin);
|
add_compiled_collation(&my_charset_utf8_bin);
|
||||||
|
add_compiled_collation(&my_charset_utf8_general_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_icelandic_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_latvian_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_romanian_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_slovenian_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_polish_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_estonian_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_spanish_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_swedish_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_turkish_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_czech_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_danish_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_lithuanian_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_slovak_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_spanish2_uca_ci);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Copy compiled charsets */
|
/* Copy compiled charsets */
|
||||||
|
@ -469,7 +469,6 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
|
|||||||
}
|
}
|
||||||
cs= (cs->state & MY_CS_AVAILABLE) ? cs : NULL;
|
cs= (cs->state & MY_CS_AVAILABLE) ? cs : NULL;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&THR_LOCK_charset);
|
|
||||||
if (cs && !(cs->state & MY_CS_READY))
|
if (cs && !(cs->state & MY_CS_READY))
|
||||||
{
|
{
|
||||||
if ((cs->cset->init && cs->cset->init(cs, cs_alloc)) ||
|
if ((cs->cset->init && cs->cset->init(cs, cs_alloc)) ||
|
||||||
@ -478,6 +477,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
|
|||||||
else
|
else
|
||||||
cs->state|= MY_CS_READY;
|
cs->state|= MY_CS_READY;
|
||||||
}
|
}
|
||||||
|
pthread_mutex_unlock(&THR_LOCK_charset);
|
||||||
return cs;
|
return cs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,13 +21,11 @@ int mi_compare_text(CHARSET_INFO *charset_info, uchar *a, uint a_length,
|
|||||||
uchar *b, uint b_length, my_bool part_key,
|
uchar *b, uint b_length, my_bool part_key,
|
||||||
my_bool skip_end_space)
|
my_bool skip_end_space)
|
||||||
{
|
{
|
||||||
if (part_key && b_length < a_length)
|
|
||||||
a_length=b_length;
|
|
||||||
if (skip_end_space)
|
if (skip_end_space)
|
||||||
return charset_info->coll->strnncollsp(charset_info, a, a_length,
|
return charset_info->coll->strnncollsp(charset_info, a, a_length,
|
||||||
b, b_length);
|
b, b_length);
|
||||||
return charset_info->coll->strnncoll(charset_info, a, a_length,
|
return charset_info->coll->strnncoll(charset_info, a, a_length,
|
||||||
b, b_length);
|
b, b_length, part_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
SUBDIRS = src tools . include $(ndb_opt_test_subdirs)
|
SUBDIRS = src tools . include @ndb_opt_subdirs@
|
||||||
|
DIST_SUBDIRS = src tools include test docs
|
||||||
EXTRA_DIST = config
|
EXTRA_DIST = config
|
||||||
|
|
||||||
include $(top_srcdir)/ndb/config/common.mk.am
|
include $(top_srcdir)/ndb/config/common.mk.am
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP" ]; then
|
|
||||||
echo "MYSQLCLUSTER_TOP not set or directory does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP/ndb" ]; then
|
|
||||||
echo "$MYSQLCLUSTER_TOP/ndb directory does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mysql --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $*
|
|
@ -1,119 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
NDB_HOME=
|
|
||||||
export NDB_CONNECTSTRING
|
|
||||||
if [ -z "$MYSQLCLUSTER_TOP" ]; then
|
|
||||||
echo "MYSQLCLUSTER_TOP not set"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [ -d "$MYSQLCLUSTER_TOP" ]; then :; else
|
|
||||||
echo "$MYSQLCLUSTER_TOP directory does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [ -d "$MYSQLCLUSTER_TOP/ndb" ]; then :; else
|
|
||||||
echo "$MYSQLCLUSTER_TOP/ndb directory does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
start_default_ndbcluster() {
|
|
||||||
|
|
||||||
# configurable parameters, make sure to change in mysqlcluterd as well
|
|
||||||
MYSQLCLUSTER_FILESYSTEM=$MYSQLCLUSTER_TOP/data/mysqlclusterfs
|
|
||||||
MYSQLCLUSTER_PORT_BASE="22" # using ports MYSQLCLUSTER_PORT_BASE{"00","01", etc}
|
|
||||||
# end configurable parameters
|
|
||||||
|
|
||||||
# do some checks
|
|
||||||
|
|
||||||
NDB_CONNECTSTRING=
|
|
||||||
|
|
||||||
[ -d "$MYSQLCLUSTER_FILESYSTEM" ] || mkdir "$MYSQLCLUSTER_FILESYSTEM"
|
|
||||||
if [ -d "$MYSQLCLUSTER_FILESYSTEM" ]; then :; else
|
|
||||||
echo "$MYSQLCLUSTER_FILESYSTEM filesystem directory does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# set som help variables
|
|
||||||
|
|
||||||
NDB_HOST="localhost"
|
|
||||||
NDB_PORT=$MYSQLCLUSTER_PORT_BASE"00"
|
|
||||||
NDB_CONNECTSTRING_BASE="host=$NDB_HOST:$NDB_PORT;nodeid="
|
|
||||||
|
|
||||||
|
|
||||||
# Edit file system path and ports in config file
|
|
||||||
|
|
||||||
cd $MYSQLCLUSTER_FILESYSTEM
|
|
||||||
sed \
|
|
||||||
-e s,"WRITE_PATH_TO_FILESYSTEM_2_HERE",$MYSQLCLUSTER_FILESYSTEM,g \
|
|
||||||
-e s,"CHOOSE_PORT_BASE",$MYSQLCLUSTER_PORT_BASE,g \
|
|
||||||
< $MYSQLCLUSTER_TOP/ndb/demos/config-templates/config_template-install.ini \
|
|
||||||
> config.ini
|
|
||||||
|
|
||||||
|
|
||||||
# Start management server as deamon
|
|
||||||
|
|
||||||
NDB_ID="1"
|
|
||||||
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
|
||||||
#xterm -e mgmtsrvr -c $MYSQLCLUSTER_FILESYSTEM/config.ini &
|
|
||||||
if mgmtsrvr -d -c $MYSQLCLUSTER_FILESYSTEM/config.ini ; then :; else
|
|
||||||
echo "Unable to start mgmtsrvr"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Start database node
|
|
||||||
|
|
||||||
cd $MYSQLCLUSTER_FILESYSTEM # the output from the database node gets where it starts
|
|
||||||
NDB_ID="2"
|
|
||||||
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
|
||||||
#xterm -T "NDB Cluster DB Node" -geometry 80x10 -xrm *.hold:true -e ndb -i &
|
|
||||||
ndb -d -i &
|
|
||||||
|
|
||||||
# Start xterm for application programs
|
|
||||||
|
|
||||||
NDB_ID="3"
|
|
||||||
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
|
||||||
#xterm -T "NDB Cluster API Node" -geometry 80x10 &
|
|
||||||
echo set before running ndbApi programs > export NDB_CONNECTSTRING=$NDB_CONNECTSTRING
|
|
||||||
|
|
||||||
# Start management client
|
|
||||||
|
|
||||||
#xterm -T "NDB Management Client" -geometry 80x10 -xrm *.hold:true -e mgmtclient $NDB_HOST $NDB_PORT &
|
|
||||||
echo "NDB Management Client starts with: mgmtclient $NDB_HOST $NDB_PORT"
|
|
||||||
|
|
||||||
# test if Ndb Cluster starts properly
|
|
||||||
|
|
||||||
NDB_ID="11"
|
|
||||||
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
|
|
||||||
if list_tables | grep "NDBT_ProgramExit: 0 - OK"; then :; else
|
|
||||||
echo "Ndbcluster startup failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
start_mysql_install_db() {
|
|
||||||
# run install of regular MySQL Server
|
|
||||||
|
|
||||||
cd $MYSQLCLUSTER_TOP
|
|
||||||
scripts/mysql_install_db --basedir=$MYSQLCLUSTER_TOP --datadir=$MYSQLCLUSTER_TOP/data --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $*
|
|
||||||
}
|
|
||||||
|
|
||||||
if test "$1" = "ndb_started"
|
|
||||||
then
|
|
||||||
shift
|
|
||||||
mgmt_host=$1
|
|
||||||
shift
|
|
||||||
mgmt_port=$1
|
|
||||||
shift
|
|
||||||
if [ -z "$mgmt_host" -o -z "$mgmt_port" ]; then
|
|
||||||
echo "syntax: ndb_started hostname port"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
NDB_CONNECTSTRING="host=$mgmt_host:$mgmt_port;nodeid=11"
|
|
||||||
echo using NDB_CONNECTSTRING=$NDB_CONNECTSTRING
|
|
||||||
start_mysql_install_db $*
|
|
||||||
else
|
|
||||||
start_default_ndbcluster
|
|
||||||
start_mysql_install_db
|
|
||||||
fi
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# configurable parameters
|
|
||||||
MYSQLCLUSTER_PORT_BASE="22"
|
|
||||||
# end configurable parameters
|
|
||||||
|
|
||||||
if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP" ]; then
|
|
||||||
echo "MYSQLCLUSTER_TOP not set or directory does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP/ndb" ]; then
|
|
||||||
echo "$MYSQLCLUSTER_TOP/ndb directory does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$1" = "ndb_started"
|
|
||||||
then
|
|
||||||
shift
|
|
||||||
mgmt_host=$1
|
|
||||||
shift
|
|
||||||
mgmt_port=$1
|
|
||||||
shift
|
|
||||||
if [ -z "$mgmt_host" -o -z "$mgmt_port" ]; then
|
|
||||||
echo "syntax: ndb_started hostname port"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
NDB_CONNECTSTRING="host=$mgmt_host:$mgmt_port;nodeid=11"
|
|
||||||
echo using NDB_CONNECTSTRING=$NDB_CONNECTSTRING
|
|
||||||
else
|
|
||||||
NDB_CONNECTSTRING="host=localhost:"$MYSQLCLUSTER_PORT_BASE"00;nodeid=11"
|
|
||||||
fi
|
|
||||||
export NDB_CONNECTSTRING
|
|
||||||
|
|
||||||
mysqld --default-table-type=ndbcluster --basedir=$MYSQLCLUSTER_TOP --datadir=$MYSQLCLUSTER_TOP/data --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $*
|
|
@ -9,5 +9,4 @@ mgmapiincludedir = "$(pkgincludedir)/ndb/mgmapi"
|
|||||||
INCLUDES = $(INCLUDES_LOC)
|
INCLUDES = $(INCLUDES_LOC)
|
||||||
LDADD = $(top_srcdir)/ndb/src/common/portlib/gcc.cpp $(LDADD_LOC)
|
LDADD = $(top_srcdir)/ndb/src/common/portlib/gcc.cpp $(LDADD_LOC)
|
||||||
DEFS = @DEFS@ @NDB_DEFS@ $(DEFS_LOC) $(NDB_EXTRA_FLAGS)
|
DEFS = @DEFS@ @NDB_DEFS@ $(DEFS_LOC) $(NDB_EXTRA_FLAGS)
|
||||||
# ndb cannot be compiled with -fno-implicit-templaces
|
NDB_CXXFLAGS=@ndb_cxxflags_fix@ $(NDB_CXXFLAGS_LOC)
|
||||||
NDB_CXXFLAGS=-fimplicit-templates
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
DOXYDIR = doxygen
|
||||||
|
noinst_HEADERS = $(DOXYDIR)/predoxy.pl $(DOXYDIR)/postdoxy.pl $(DOXYDIR)/Doxyfile.ndbapi $(DOXYDIR)/Doxyfile.mgmapi $(DOXYDIR)/header.ndbapi.tex $(DOXYDIR)/header.mgmapi.tex
|
||||||
|
|
||||||
all: do-check ndbapidoc mgmapidoc
|
all: do-check ndbapidoc mgmapidoc
|
||||||
|
|
||||||
DOXYDIR = doxygen
|
|
||||||
DOXYTMP = .doxytmp
|
DOXYTMP = .doxytmp
|
||||||
DOXYOUT = .doxyout
|
DOXYOUT = .doxyout
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ do-check:
|
|||||||
#
|
#
|
||||||
ndbapidoc: ndbapi.pdf
|
ndbapidoc: ndbapi.pdf
|
||||||
|
|
||||||
ndbapi.pdf: $(top_srcdir)/ndb/include/ndb_version.h
|
ndbapi.pdf: $(noinst_HEADERS)
|
||||||
@set -x; \
|
@set -x; \
|
||||||
export NDB_RELEASE=$(NDB_RELEASE) \
|
export NDB_RELEASE=$(NDB_RELEASE) \
|
||||||
@RM@ -f ndbapi.pdf ndbapi.html; \
|
@RM@ -f ndbapi.pdf ndbapi.html; \
|
||||||
@ -59,7 +60,7 @@ ndbapi.pdf: $(top_srcdir)/ndb/include/ndb_version.h
|
|||||||
#
|
#
|
||||||
mgmapidoc: mgmapi.pdf
|
mgmapidoc: mgmapi.pdf
|
||||||
|
|
||||||
mgmapi.pdf: $(top_srcdir)/ndb/include/ndb_version.h
|
mgmapi.pdf: $(noinst_HEADERS)
|
||||||
@set -x; \
|
@set -x; \
|
||||||
export NDB_RELEASE=$(NDB_RELEASE) \
|
export NDB_RELEASE=$(NDB_RELEASE) \
|
||||||
@RM@ -f mgmapi.pdf mgmapi.html; \
|
@RM@ -f mgmapi.pdf mgmapi.html; \
|
||||||
|
@ -16,6 +16,7 @@ ndbapi/NdbError.hpp \
|
|||||||
ndbapi/NdbEventOperation.hpp \
|
ndbapi/NdbEventOperation.hpp \
|
||||||
ndbapi/NdbIndexOperation.hpp \
|
ndbapi/NdbIndexOperation.hpp \
|
||||||
ndbapi/NdbOperation.hpp \
|
ndbapi/NdbOperation.hpp \
|
||||||
|
ndbapi/NdbBlob.hpp \
|
||||||
ndbapi/NdbPool.hpp \
|
ndbapi/NdbPool.hpp \
|
||||||
ndbapi/NdbRecAttr.hpp \
|
ndbapi/NdbRecAttr.hpp \
|
||||||
ndbapi/NdbReceiver.hpp \
|
ndbapi/NdbReceiver.hpp \
|
||||||
|
@ -91,4 +91,9 @@
|
|||||||
#define MAX_TTREE_PREF_SIZE 4 // words in min/max prefix each
|
#define MAX_TTREE_PREF_SIZE 4 // words in min/max prefix each
|
||||||
#define MAX_TTREE_NODE_SLACK 3 // diff between max and min occupancy
|
#define MAX_TTREE_NODE_SLACK 3 // diff between max and min occupancy
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Blobs.
|
||||||
|
*/
|
||||||
|
#define NDB_BLOB_HEAD_SIZE 2 // sizeof(NdbBlob::Head) >> 2
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -309,7 +309,9 @@ public:
|
|||||||
ExtBinary = NdbSqlUtil::Type::Binary,
|
ExtBinary = NdbSqlUtil::Type::Binary,
|
||||||
ExtVarbinary = NdbSqlUtil::Type::Varbinary,
|
ExtVarbinary = NdbSqlUtil::Type::Varbinary,
|
||||||
ExtDatetime = NdbSqlUtil::Type::Datetime,
|
ExtDatetime = NdbSqlUtil::Type::Datetime,
|
||||||
ExtTimespec = NdbSqlUtil::Type::Timespec
|
ExtTimespec = NdbSqlUtil::Type::Timespec,
|
||||||
|
ExtBlob = NdbSqlUtil::Type::Blob,
|
||||||
|
ExtClob = NdbSqlUtil::Type::Clob
|
||||||
};
|
};
|
||||||
|
|
||||||
// Attribute data interpretation
|
// Attribute data interpretation
|
||||||
@ -432,6 +434,13 @@ public:
|
|||||||
AttributeSize = DictTabInfo::an8Bit;
|
AttributeSize = DictTabInfo::an8Bit;
|
||||||
AttributeArraySize = 12 * AttributeExtLength;
|
AttributeArraySize = 12 * AttributeExtLength;
|
||||||
return true;
|
return true;
|
||||||
|
case DictTabInfo::ExtBlob:
|
||||||
|
case DictTabInfo::ExtClob:
|
||||||
|
AttributeType = DictTabInfo::StringType;
|
||||||
|
AttributeSize = DictTabInfo::an8Bit;
|
||||||
|
// head + inline part [ attr precision ]
|
||||||
|
AttributeArraySize = (NDB_BLOB_HEAD_SIZE << 2) + AttributeExtPrecision;
|
||||||
|
return true;
|
||||||
};
|
};
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -129,6 +129,8 @@ private:
|
|||||||
/*
|
/*
|
||||||
* Operate on entire tuple. Used by TUX where the table has a single
|
* Operate on entire tuple. Used by TUX where the table has a single
|
||||||
* Uint32 array attribute representing an index tree node.
|
* Uint32 array attribute representing an index tree node.
|
||||||
|
*
|
||||||
|
* XXX this signal is no longer used by TUX and can be removed
|
||||||
*/
|
*/
|
||||||
class TupStoreTh {
|
class TupStoreTh {
|
||||||
friend class Dbtup;
|
friend class Dbtup;
|
||||||
|
@ -69,7 +69,7 @@ class TuxFragReq {
|
|||||||
friend class Dblqh;
|
friend class Dblqh;
|
||||||
friend class Dbtux;
|
friend class Dbtux;
|
||||||
public:
|
public:
|
||||||
STATIC_CONST( SignalLength = 9 );
|
STATIC_CONST( SignalLength = 14 );
|
||||||
private:
|
private:
|
||||||
Uint32 userPtr;
|
Uint32 userPtr;
|
||||||
Uint32 userRef;
|
Uint32 userRef;
|
||||||
@ -80,6 +80,9 @@ private:
|
|||||||
Uint32 fragOff;
|
Uint32 fragOff;
|
||||||
Uint32 tableType;
|
Uint32 tableType;
|
||||||
Uint32 primaryTableId;
|
Uint32 primaryTableId;
|
||||||
|
Uint32 tupIndexFragPtrI;
|
||||||
|
Uint32 tupTableFragPtrI[2];
|
||||||
|
Uint32 accTableFragPtrI[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
class TuxFragConf {
|
class TuxFragConf {
|
||||||
|
@ -879,6 +879,7 @@ class NdbCall;
|
|||||||
class Table;
|
class Table;
|
||||||
class BaseString;
|
class BaseString;
|
||||||
class NdbEventOperation;
|
class NdbEventOperation;
|
||||||
|
class NdbBlob;
|
||||||
|
|
||||||
typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*);
|
typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*);
|
||||||
|
|
||||||
@ -965,6 +966,7 @@ class Ndb
|
|||||||
friend class NdbIndexScanOperation;
|
friend class NdbIndexScanOperation;
|
||||||
friend class NdbDictionaryImpl;
|
friend class NdbDictionaryImpl;
|
||||||
friend class NdbDictInterface;
|
friend class NdbDictInterface;
|
||||||
|
friend class NdbBlob;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@ -1453,6 +1455,7 @@ private:
|
|||||||
NdbIndexOperation* getIndexOperation();// Get an index operation from idle
|
NdbIndexOperation* getIndexOperation();// Get an index operation from idle
|
||||||
|
|
||||||
class NdbGlobalEventBufferHandle* getGlobalEventBufferHandle();
|
class NdbGlobalEventBufferHandle* getGlobalEventBufferHandle();
|
||||||
|
NdbBlob* getNdbBlob();// Get a blob handle etc
|
||||||
|
|
||||||
void releaseSignal(NdbApiSignal* anApiSignal);
|
void releaseSignal(NdbApiSignal* anApiSignal);
|
||||||
void releaseSignalsInList(NdbApiSignal** pList);
|
void releaseSignalsInList(NdbApiSignal** pList);
|
||||||
@ -1464,6 +1467,7 @@ private:
|
|||||||
void releaseRecAttr (NdbRecAttr* aRecAttr);
|
void releaseRecAttr (NdbRecAttr* aRecAttr);
|
||||||
void releaseOperation(NdbOperation* anOperation);
|
void releaseOperation(NdbOperation* anOperation);
|
||||||
void releaseScanOperation(NdbIndexScanOperation*);
|
void releaseScanOperation(NdbIndexScanOperation*);
|
||||||
|
void releaseNdbBlob(NdbBlob* aBlob);
|
||||||
|
|
||||||
void check_send_timeout();
|
void check_send_timeout();
|
||||||
void remove_sent_list(Uint32);
|
void remove_sent_list(Uint32);
|
||||||
@ -1506,6 +1510,7 @@ private:
|
|||||||
void freeNdbSubroutine();// Free the first idle NdbSubroutine obj
|
void freeNdbSubroutine();// Free the first idle NdbSubroutine obj
|
||||||
void freeNdbCall(); // Free the first idle NdbCall obj
|
void freeNdbCall(); // Free the first idle NdbCall obj
|
||||||
void freeNdbScanRec(); // Free the first idle NdbScanRec obj
|
void freeNdbScanRec(); // Free the first idle NdbScanRec obj
|
||||||
|
void freeNdbBlob(); // Free the first etc
|
||||||
|
|
||||||
NdbConnection* getNdbCon(); // Get a connection from idle list
|
NdbConnection* getNdbCon(); // Get a connection from idle list
|
||||||
|
|
||||||
@ -1613,6 +1618,7 @@ private:
|
|||||||
NdbSubroutine* theSubroutineList; // First subroutine descriptor in
|
NdbSubroutine* theSubroutineList; // First subroutine descriptor in
|
||||||
NdbCall* theCallList; // First call descriptor in list
|
NdbCall* theCallList; // First call descriptor in list
|
||||||
NdbReceiver* theScanList;
|
NdbReceiver* theScanList;
|
||||||
|
NdbBlob* theNdbBlobIdleList;
|
||||||
|
|
||||||
Uint32 theMyRef; // My block reference
|
Uint32 theMyRef; // My block reference
|
||||||
Uint32 theNode; // The node number of our node
|
Uint32 theNode; // The node number of our node
|
||||||
|
@ -30,4 +30,5 @@
|
|||||||
#include "NdbDictionary.hpp"
|
#include "NdbDictionary.hpp"
|
||||||
#include "NdbEventOperation.hpp"
|
#include "NdbEventOperation.hpp"
|
||||||
#include "NdbPool.hpp"
|
#include "NdbPool.hpp"
|
||||||
|
#include "NdbBlob.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
293
ndb/include/ndbapi/NdbBlob.hpp
Normal file
293
ndb/include/ndbapi/NdbBlob.hpp
Normal file
@ -0,0 +1,293 @@
|
|||||||
|
/* Copyright (C) 2003 MySQL AB
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
#ifndef NdbBlob_H
|
||||||
|
#define NdbBlob_H
|
||||||
|
|
||||||
|
#include <ndb_types.h>
|
||||||
|
#include <NdbDictionary.hpp>
|
||||||
|
#include <NdbConnection.hpp>
|
||||||
|
#include <NdbError.hpp>
|
||||||
|
|
||||||
|
class Ndb;
|
||||||
|
class NdbConnection;
|
||||||
|
class NdbOperation;
|
||||||
|
class NdbRecAttr;
|
||||||
|
class NdbTableImpl;
|
||||||
|
class NdbColumnImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @class NdbBlob
|
||||||
|
* @brief Blob handle
|
||||||
|
*
|
||||||
|
* Blob data is stored in 2 places:
|
||||||
|
*
|
||||||
|
* - "header" and "inline bytes" stored in the blob attribute
|
||||||
|
* - "blob parts" stored in a separate table NDB$BLOB_<t>_<v>_<c>
|
||||||
|
*
|
||||||
|
* Inline and part sizes can be set via NdbDictionary::Column methods
|
||||||
|
* when the table is created.
|
||||||
|
*
|
||||||
|
* NdbBlob is a blob handle. To access blob data, the handle must be
|
||||||
|
* created using NdbOperation::getBlobHandle in operation prepare phase.
|
||||||
|
* The handle has following states:
|
||||||
|
*
|
||||||
|
* - prepared: before the operation is executed
|
||||||
|
* - active: after execute or next result but before transaction commit
|
||||||
|
* - closed: after transaction commit
|
||||||
|
* - invalid: after rollback or transaction close
|
||||||
|
*
|
||||||
|
* NdbBlob supports 2 styles of data access:
|
||||||
|
*
|
||||||
|
* - in prepare phase, NdbBlob methods getValue and setValue are used to
|
||||||
|
* prepare a read or write of a single blob value of known size
|
||||||
|
*
|
||||||
|
* - in active phase, NdbBlob methods readData and writeData are used to
|
||||||
|
* read or write blob data of undetermined size
|
||||||
|
*
|
||||||
|
* NdbBlob methods return -1 on error and 0 on success, and use output
|
||||||
|
* parameters when necessary.
|
||||||
|
*
|
||||||
|
* Notes:
|
||||||
|
* - table and its blob part tables are not created atomically
|
||||||
|
* - blob data operations take effect at next transaction execute
|
||||||
|
* - NdbBlob may need to do implicit executes on the transaction
|
||||||
|
* - read and write of complete parts is much more efficient
|
||||||
|
* - scan must use the "new" interface NdbScanOperation
|
||||||
|
* - scan with blobs applies hold-read-lock (at minimum)
|
||||||
|
* - to update a blob in a read op requires exclusive tuple lock
|
||||||
|
* - update op in scan must do its own getBlobHandle
|
||||||
|
* - delete creates implicit, not-accessible blob handles
|
||||||
|
* - NdbOperation::writeTuple does not support blobs
|
||||||
|
* - there is no support for an asynchronous interface
|
||||||
|
*
|
||||||
|
* Bugs / limitations:
|
||||||
|
* - scan must use exclusive locking for now
|
||||||
|
*
|
||||||
|
* Todo:
|
||||||
|
* - add scan method hold-read-lock-until-next + return-keyinfo
|
||||||
|
* - better check of keyinfo length when setting keys
|
||||||
|
* - better check of allowed blob op vs locking mode
|
||||||
|
*/
|
||||||
|
class NdbBlob {
|
||||||
|
public:
|
||||||
|
enum State {
|
||||||
|
Idle = 0,
|
||||||
|
Prepared = 1,
|
||||||
|
Active = 2,
|
||||||
|
Closed = 3,
|
||||||
|
Invalid = 9
|
||||||
|
};
|
||||||
|
State getState();
|
||||||
|
/**
|
||||||
|
* Prepare to read blob value. The value is available after execute.
|
||||||
|
* Use isNull to check for NULL and getLength to get the real length
|
||||||
|
* and to check for truncation. Sets current read/write position to
|
||||||
|
* after the data read.
|
||||||
|
*/
|
||||||
|
int getValue(void* data, Uint32 bytes);
|
||||||
|
/**
|
||||||
|
* Prepare to insert or update blob value. An existing longer blob
|
||||||
|
* value will be truncated. The data buffer must remain valid until
|
||||||
|
* execute. Sets current read/write position to after the data. Set
|
||||||
|
* data to null pointer (0) to create a NULL value.
|
||||||
|
*/
|
||||||
|
int setValue(const void* data, Uint32 bytes);
|
||||||
|
/**
|
||||||
|
* Check if blob is null.
|
||||||
|
*/
|
||||||
|
int getNull(bool& isNull);
|
||||||
|
/**
|
||||||
|
* Set blob to NULL.
|
||||||
|
*/
|
||||||
|
int setNull();
|
||||||
|
/**
|
||||||
|
* Get current length in bytes. Use isNull to distinguish between
|
||||||
|
* length 0 blob and NULL blob.
|
||||||
|
*/
|
||||||
|
int getLength(Uint64& length);
|
||||||
|
/**
|
||||||
|
* Truncate blob to given length. Has no effect if the length is
|
||||||
|
* larger than current length.
|
||||||
|
*/
|
||||||
|
int truncate(Uint64 length = 0);
|
||||||
|
/**
|
||||||
|
* Get current read/write position.
|
||||||
|
*/
|
||||||
|
int getPos(Uint64& pos);
|
||||||
|
/**
|
||||||
|
* Set read/write position. Must be between 0 and current length.
|
||||||
|
* "Sparse blobs" are not supported.
|
||||||
|
*/
|
||||||
|
int setPos(Uint64 pos);
|
||||||
|
/**
|
||||||
|
* Read at current position and set new position to first byte after
|
||||||
|
* the data read. A read past blob end returns actual number of bytes
|
||||||
|
* read in the in/out bytes parameter.
|
||||||
|
*/
|
||||||
|
int readData(void* data, Uint32& bytes);
|
||||||
|
/**
|
||||||
|
* Read at given position. Does not use or update current position.
|
||||||
|
*/
|
||||||
|
int readData(Uint64 pos, void* data, Uint32& bytes);
|
||||||
|
/**
|
||||||
|
* Write at current position and set new position to first byte after
|
||||||
|
* the data written. A write past blob end extends the blob value.
|
||||||
|
*/
|
||||||
|
int writeData(const void* data, Uint32 bytes);
|
||||||
|
/**
|
||||||
|
* Write at given position. Does not use or update current position.
|
||||||
|
*/
|
||||||
|
int writeData(Uint64 pos, const void* data, Uint32 bytes);
|
||||||
|
/**
|
||||||
|
* Return the blob column.
|
||||||
|
*/
|
||||||
|
const NdbDictionary::Column* getColumn();
|
||||||
|
/**
|
||||||
|
* Get blob parts table name. Useful only to test programs.
|
||||||
|
*/
|
||||||
|
static const unsigned BlobTableNameSize = 40;
|
||||||
|
static int getBlobTableName(char* btname, Ndb* anNdb, const char* tableName, const char* columnName);
|
||||||
|
/**
|
||||||
|
* Return error object. The error may be blob specific (below) or may
|
||||||
|
* be copied from a failed implicit operation.
|
||||||
|
*/
|
||||||
|
const NdbError& getNdbError() const;
|
||||||
|
// "Invalid blob attributes or invalid blob parts table"
|
||||||
|
static const int ErrTable = 4263;
|
||||||
|
// "Invalid usage of blob attribute"
|
||||||
|
static const int ErrUsage = 4264;
|
||||||
|
// "Method is not valid in current blob state"
|
||||||
|
static const int ErrState = 4265;
|
||||||
|
// "Invalid blob seek position"
|
||||||
|
static const int ErrSeek = 4266;
|
||||||
|
// "Corrupted blob value"
|
||||||
|
static const int ErrCorrupt = 4267;
|
||||||
|
// "Error in blob head update forced rollback of transaction"
|
||||||
|
static const int ErrAbort = 4268;
|
||||||
|
// "Unknown blob error"
|
||||||
|
static const int ErrUnknown = 4269;
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class Ndb;
|
||||||
|
friend class NdbConnection;
|
||||||
|
friend class NdbOperation;
|
||||||
|
friend class NdbScanOperation;
|
||||||
|
friend class NdbDictionaryImpl;
|
||||||
|
// state
|
||||||
|
State theState;
|
||||||
|
void setState(State newState);
|
||||||
|
// define blob table
|
||||||
|
static void getBlobTableName(char* btname, const NdbTableImpl* t, const NdbColumnImpl* c);
|
||||||
|
static void getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnImpl* c);
|
||||||
|
// table name
|
||||||
|
char theBlobTableName[BlobTableNameSize];
|
||||||
|
// ndb api stuff
|
||||||
|
Ndb* theNdb;
|
||||||
|
NdbConnection* theNdbCon;
|
||||||
|
NdbOperation* theNdbOp;
|
||||||
|
NdbTableImpl* theTable;
|
||||||
|
NdbTableImpl* theAccessTable;
|
||||||
|
const NdbColumnImpl* theColumn;
|
||||||
|
char theFillChar;
|
||||||
|
// sizes
|
||||||
|
Uint32 theInlineSize;
|
||||||
|
Uint32 thePartSize;
|
||||||
|
Uint32 theStripeSize;
|
||||||
|
// getValue/setValue
|
||||||
|
bool theGetFlag;
|
||||||
|
char* theGetBuf;
|
||||||
|
bool theSetFlag;
|
||||||
|
const char* theSetBuf;
|
||||||
|
Uint32 theGetSetBytes;
|
||||||
|
// head
|
||||||
|
struct Head {
|
||||||
|
Uint64 length;
|
||||||
|
};
|
||||||
|
// buffers
|
||||||
|
struct Buf {
|
||||||
|
char* data;
|
||||||
|
unsigned size;
|
||||||
|
unsigned maxsize;
|
||||||
|
Buf();
|
||||||
|
~Buf();
|
||||||
|
void alloc(unsigned n);
|
||||||
|
};
|
||||||
|
Buf theKeyBuf;
|
||||||
|
Buf theAccessKeyBuf;
|
||||||
|
Buf theHeadInlineBuf;
|
||||||
|
Buf thePartBuf;
|
||||||
|
Head* theHead;
|
||||||
|
char* theInlineData;
|
||||||
|
NdbRecAttr* theHeadInlineRecAttr;
|
||||||
|
bool theHeadInlineUpdateFlag;
|
||||||
|
bool theNewPartFlag;
|
||||||
|
// length and read/write position
|
||||||
|
int theNullFlag;
|
||||||
|
Uint64 theLength;
|
||||||
|
Uint64 thePos;
|
||||||
|
// errors
|
||||||
|
NdbError theError;
|
||||||
|
// for keeping in lists
|
||||||
|
NdbBlob* theNext;
|
||||||
|
// initialization
|
||||||
|
NdbBlob();
|
||||||
|
void init();
|
||||||
|
void release();
|
||||||
|
// classify operations
|
||||||
|
bool isTableOp();
|
||||||
|
bool isIndexOp();
|
||||||
|
bool isKeyOp();
|
||||||
|
bool isReadOp();
|
||||||
|
bool isInsertOp();
|
||||||
|
bool isUpdateOp();
|
||||||
|
bool isDeleteOp();
|
||||||
|
bool isScanOp();
|
||||||
|
// computations
|
||||||
|
Uint32 getPartNumber(Uint64 pos);
|
||||||
|
Uint32 getPartCount();
|
||||||
|
Uint32 getDistKey(Uint32 part);
|
||||||
|
// getters and setters
|
||||||
|
int getTableKeyValue(NdbOperation* anOp);
|
||||||
|
int setTableKeyValue(NdbOperation* anOp);
|
||||||
|
int setAccessKeyValue(NdbOperation* anOp);
|
||||||
|
int setPartKeyValue(NdbOperation* anOp, Uint32 part);
|
||||||
|
int getHeadInlineValue(NdbOperation* anOp);
|
||||||
|
void getHeadFromRecAttr();
|
||||||
|
int setHeadInlineValue(NdbOperation* anOp);
|
||||||
|
// data operations
|
||||||
|
int readDataPrivate(Uint64 pos, char* buf, Uint32& bytes);
|
||||||
|
int writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes);
|
||||||
|
int readParts(char* buf, Uint32 part, Uint32 count);
|
||||||
|
int insertParts(const char* buf, Uint32 part, Uint32 count);
|
||||||
|
int updateParts(const char* buf, Uint32 part, Uint32 count);
|
||||||
|
int deleteParts(Uint32 part, Uint32 count);
|
||||||
|
// blob handle maintenance
|
||||||
|
int atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn);
|
||||||
|
int preExecute(ExecType anExecType, bool& batch);
|
||||||
|
int postExecute(ExecType anExecType);
|
||||||
|
int preCommit();
|
||||||
|
int atNextResult();
|
||||||
|
// errors
|
||||||
|
void setErrorCode(int anErrorCode, bool invalidFlag = true);
|
||||||
|
void setErrorCode(NdbOperation* anOp, bool invalidFlag = true);
|
||||||
|
void setErrorCode(NdbConnection* aCon, bool invalidFlag = true);
|
||||||
|
#ifdef VM_TRACE
|
||||||
|
friend class NdbOut& operator<<(NdbOut&, const NdbBlob&);
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -27,6 +27,7 @@ class NdbIndexScanOperation;
|
|||||||
class NdbIndexOperation;
|
class NdbIndexOperation;
|
||||||
class NdbApiSignal;
|
class NdbApiSignal;
|
||||||
class Ndb;
|
class Ndb;
|
||||||
|
class NdbBlob;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -159,6 +160,7 @@ class NdbConnection
|
|||||||
friend class NdbScanOperation;
|
friend class NdbScanOperation;
|
||||||
friend class NdbIndexOperation;
|
friend class NdbIndexOperation;
|
||||||
friend class NdbIndexScanOperation;
|
friend class NdbIndexScanOperation;
|
||||||
|
friend class NdbBlob;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -449,6 +451,10 @@ private:
|
|||||||
~NdbConnection();
|
~NdbConnection();
|
||||||
|
|
||||||
void init(); // Initialize connection object for new transaction
|
void init(); // Initialize connection object for new transaction
|
||||||
|
|
||||||
|
int executeNoBlobs(ExecType execType,
|
||||||
|
AbortOption abortOption = AbortOnError,
|
||||||
|
int force = 0 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Connected node id
|
* Set Connected node id
|
||||||
@ -532,10 +538,12 @@ private:
|
|||||||
void setOperationErrorCodeAbort(int anErrorCode);
|
void setOperationErrorCodeAbort(int anErrorCode);
|
||||||
|
|
||||||
int checkMagicNumber(); // Verify correct object
|
int checkMagicNumber(); // Verify correct object
|
||||||
NdbOperation* getNdbOperation(class NdbTableImpl* aTable);
|
NdbOperation* getNdbOperation(class NdbTableImpl* aTable,
|
||||||
|
NdbOperation* aNextOp = 0);
|
||||||
NdbIndexScanOperation* getNdbScanOperation(class NdbTableImpl* aTable);
|
NdbIndexScanOperation* getNdbScanOperation(class NdbTableImpl* aTable);
|
||||||
NdbIndexOperation* getNdbIndexOperation(class NdbIndexImpl* anIndex,
|
NdbIndexOperation* getNdbIndexOperation(class NdbIndexImpl* anIndex,
|
||||||
class NdbTableImpl* aTable);
|
class NdbTableImpl* aTable,
|
||||||
|
NdbOperation* aNextOp = 0);
|
||||||
|
|
||||||
void handleExecuteCompletion();
|
void handleExecuteCompletion();
|
||||||
|
|
||||||
@ -632,6 +640,8 @@ private:
|
|||||||
// The operation actually performing the scan
|
// The operation actually performing the scan
|
||||||
NdbScanOperation* theScanningOp;
|
NdbScanOperation* theScanningOp;
|
||||||
Uint32 theBuddyConPtr;
|
Uint32 theBuddyConPtr;
|
||||||
|
// optim: any blobs
|
||||||
|
bool theBlobFlag;
|
||||||
|
|
||||||
static void sendTC_COMMIT_ACK(NdbApiSignal *,
|
static void sendTC_COMMIT_ACK(NdbApiSignal *,
|
||||||
Uint32 transId1, Uint32 transId2,
|
Uint32 transId1, Uint32 transId2,
|
||||||
|
@ -182,7 +182,8 @@ public:
|
|||||||
Varbinary, ///< Max len
|
Varbinary, ///< Max len
|
||||||
Datetime, ///< Precision down to 1 sec (sizeof(Datetime) == 8 bytes )
|
Datetime, ///< Precision down to 1 sec (sizeof(Datetime) == 8 bytes )
|
||||||
Timespec, ///< Precision down to 1 nsec(sizeof(Datetime) == 12 bytes )
|
Timespec, ///< Precision down to 1 nsec(sizeof(Datetime) == 12 bytes )
|
||||||
Blob ///< Binary large object (see NdbBlob)
|
Blob, ///< Binary large object (see NdbBlob)
|
||||||
|
Clob ///< Text blob
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -297,7 +298,29 @@ public:
|
|||||||
* Array length for column or max length for variable length arrays.
|
* Array length for column or max length for variable length arrays.
|
||||||
*/
|
*/
|
||||||
int getLength() const;
|
int getLength() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For blob, set or get "inline size" i.e. number of initial bytes
|
||||||
|
* to store in table's blob attribute. This part is normally in
|
||||||
|
* main memory and can be indexed and interpreted.
|
||||||
|
*/
|
||||||
|
void setInlineSize(int size) { setPrecision(size); }
|
||||||
|
int getInlineSize() const { return getPrecision(); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For blob, set or get "part size" i.e. number of bytes to store in
|
||||||
|
* each tuple of the "blob table". Must be less than 64k.
|
||||||
|
*/
|
||||||
|
void setPartSize(int size) { setScale(size); }
|
||||||
|
int getPartSize() const { return getScale(); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For blob, set or get "stripe size" i.e. number of consecutive
|
||||||
|
* <em>parts</em> to store in each node group.
|
||||||
|
*/
|
||||||
|
void setStripeSize(int size) { setLength(size); }
|
||||||
|
int getStripeSize() const { return getLength(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get size of element
|
* Get size of element
|
||||||
*/
|
*/
|
||||||
@ -1029,6 +1052,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
friend class NdbDictionaryImpl;
|
friend class NdbDictionaryImpl;
|
||||||
friend class UtilTransactions;
|
friend class UtilTransactions;
|
||||||
|
friend class NdbBlob;
|
||||||
class NdbDictionaryImpl & m_impl;
|
class NdbDictionaryImpl & m_impl;
|
||||||
Dictionary(NdbDictionaryImpl&);
|
Dictionary(NdbDictionaryImpl&);
|
||||||
const Table * getIndexTable(const char * indexName,
|
const Table * getIndexTable(const char * indexName,
|
||||||
|
@ -28,6 +28,7 @@ class NdbRecAttr;
|
|||||||
class NdbOperation;
|
class NdbOperation;
|
||||||
class NdbConnection;
|
class NdbConnection;
|
||||||
class NdbColumnImpl;
|
class NdbColumnImpl;
|
||||||
|
class NdbBlob;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class NdbOperation
|
* @class NdbOperation
|
||||||
@ -42,7 +43,7 @@ class NdbOperation
|
|||||||
friend class NdbScanFilter;
|
friend class NdbScanFilter;
|
||||||
friend class NdbScanFilterImpl;
|
friend class NdbScanFilterImpl;
|
||||||
friend class NdbReceiver;
|
friend class NdbReceiver;
|
||||||
|
friend class NdbBlob;
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @name Define Standard Operation Type
|
* @name Define Standard Operation Type
|
||||||
@ -337,6 +338,17 @@ public:
|
|||||||
virtual int setValue(Uint32 anAttrId, Int64 aValue);
|
virtual int setValue(Uint32 anAttrId, Int64 aValue);
|
||||||
virtual int setValue(Uint32 anAttrId, float aValue);
|
virtual int setValue(Uint32 anAttrId, float aValue);
|
||||||
virtual int setValue(Uint32 anAttrId, double aValue);
|
virtual int setValue(Uint32 anAttrId, double aValue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method replaces getValue/setValue for blobs. It creates
|
||||||
|
* a blob handle NdbBlob. A second call with same argument returns
|
||||||
|
* the previously created handle. The handle is linked to the
|
||||||
|
* operation and is maintained automatically.
|
||||||
|
*
|
||||||
|
* See NdbBlob for details.
|
||||||
|
*/
|
||||||
|
virtual NdbBlob* getBlobHandle(const char* anAttrName);
|
||||||
|
virtual NdbBlob* getBlobHandle(Uint32 anAttrId);
|
||||||
|
|
||||||
/** @} *********************************************************************/
|
/** @} *********************************************************************/
|
||||||
/**
|
/**
|
||||||
@ -644,6 +656,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
int getNdbErrorLine();
|
int getNdbErrorLine();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get table name of this operation.
|
||||||
|
*/
|
||||||
|
const char* getTableName() const;
|
||||||
|
|
||||||
/** @} *********************************************************************/
|
/** @} *********************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -751,6 +768,7 @@ protected:
|
|||||||
Uint32 len);
|
Uint32 len);
|
||||||
NdbRecAttr* getValue_impl(const NdbColumnImpl* anAttrObject, char* aValue = 0);
|
NdbRecAttr* getValue_impl(const NdbColumnImpl* anAttrObject, char* aValue = 0);
|
||||||
int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len);
|
int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len);
|
||||||
|
NdbBlob* getBlobHandle(NdbConnection* aCon, const NdbColumnImpl* anAttrObject);
|
||||||
int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
|
int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
|
||||||
int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue);
|
int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue);
|
||||||
int subValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
|
int subValue(const NdbColumnImpl* anAttrObject, Uint32 aValue);
|
||||||
@ -789,6 +807,9 @@ protected:
|
|||||||
|
|
||||||
Uint32 ptr2int() { return theReceiver.getId(); };
|
Uint32 ptr2int() { return theReceiver.getId(); };
|
||||||
|
|
||||||
|
// get table or index key from prepared signals
|
||||||
|
int getKeyFromTCREQ(Uint32* data, unsigned size);
|
||||||
|
int getKeyFromKEYINFO20(Uint32* data, unsigned size);
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* These are the private variables that are defined in the operation objects.
|
* These are the private variables that are defined in the operation objects.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
@ -869,6 +890,8 @@ protected:
|
|||||||
// saveBoundATTRINFO() moves ATTRINFO here when setBound() is ready
|
// saveBoundATTRINFO() moves ATTRINFO here when setBound() is ready
|
||||||
NdbApiSignal* theBoundATTRINFO;
|
NdbApiSignal* theBoundATTRINFO;
|
||||||
Uint32 theTotalBoundAI_Len;
|
Uint32 theTotalBoundAI_Len;
|
||||||
|
// Blobs in this operation
|
||||||
|
NdbBlob* theBlobList;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
#include <NdbOperation.hpp>
|
#include <NdbOperation.hpp>
|
||||||
|
|
||||||
|
class NdbBlob;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class NdbScanOperation
|
* @class NdbScanOperation
|
||||||
* @brief Class of scan operations for use in transactions.
|
* @brief Class of scan operations for use in transactions.
|
||||||
@ -93,6 +95,10 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
CursorType m_cursor_type;
|
CursorType m_cursor_type;
|
||||||
|
|
||||||
|
NdbBlob* getBlobHandle(const char* anAttrName);
|
||||||
|
NdbBlob* getBlobHandle(Uint32 anAttrId);
|
||||||
|
|
||||||
|
private:
|
||||||
NdbScanOperation(Ndb* aNdb);
|
NdbScanOperation(Ndb* aNdb);
|
||||||
~NdbScanOperation();
|
~NdbScanOperation();
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ndb_types.h>
|
#include <ndb_types.h>
|
||||||
|
#include <kernel/ndb_limits.h>
|
||||||
|
|
||||||
class NdbSqlUtil {
|
class NdbSqlUtil {
|
||||||
public:
|
public:
|
||||||
@ -77,7 +78,9 @@ public:
|
|||||||
Binary, // Len
|
Binary, // Len
|
||||||
Varbinary, // Max len
|
Varbinary, // Max len
|
||||||
Datetime, // Precision down to 1 sec (size 8 bytes)
|
Datetime, // Precision down to 1 sec (size 8 bytes)
|
||||||
Timespec // Precision down to 1 nsec (size 12 bytes)
|
Timespec, // Precision down to 1 nsec (size 12 bytes)
|
||||||
|
Blob, // Blob
|
||||||
|
Clob // Text blob
|
||||||
};
|
};
|
||||||
Enum m_typeId;
|
Enum m_typeId;
|
||||||
Cmp* m_cmp; // set to NULL if cmp not implemented
|
Cmp* m_cmp; // set to NULL if cmp not implemented
|
||||||
@ -121,6 +124,8 @@ private:
|
|||||||
static Cmp cmpVarbinary;
|
static Cmp cmpVarbinary;
|
||||||
static Cmp cmpDatetime;
|
static Cmp cmpDatetime;
|
||||||
static Cmp cmpTimespec;
|
static Cmp cmpTimespec;
|
||||||
|
static Cmp cmpBlob;
|
||||||
|
static Cmp cmpClob;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline int
|
inline int
|
||||||
@ -350,6 +355,23 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
|
|||||||
break;
|
break;
|
||||||
case Type::Timespec: // XXX fix this
|
case Type::Timespec: // XXX fix this
|
||||||
break;
|
break;
|
||||||
|
case Type::Blob: // XXX fix
|
||||||
|
break;
|
||||||
|
case Type::Clob:
|
||||||
|
{
|
||||||
|
// skip blob head, the rest is varchar
|
||||||
|
const unsigned skip = NDB_BLOB_HEAD_SIZE;
|
||||||
|
if (size >= skip + 1) {
|
||||||
|
union { const Uint32* p; const char* v; } u1, u2;
|
||||||
|
u1.p = p1 + skip;
|
||||||
|
u2.p = p2 + skip;
|
||||||
|
// length in first 2 bytes
|
||||||
|
int k = strncmp(u1.v + 2, u2.v + 2, ((size - skip) << 2) - 2);
|
||||||
|
return k < 0 ? -1 : k > 0 ? +1 : full == size ? 0 : CmpUnknown;
|
||||||
|
}
|
||||||
|
return CmpUnknown;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return CmpError;
|
return CmpError;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ printDEFINE_BACKUP_REQ(FILE * out, const Uint32 * data, Uint32 len, Uint16 bno){
|
|||||||
sig->backupPtr, sig->backupId, sig->clientRef, sig->clientData);
|
sig->backupPtr, sig->backupId, sig->clientRef, sig->clientData);
|
||||||
fprintf(out, " backupKey: [ %08x%08x ] DataLength: %d\n",
|
fprintf(out, " backupKey: [ %08x%08x ] DataLength: %d\n",
|
||||||
sig->backupKey[0], sig->backupKey[1], sig->backupDataLen);
|
sig->backupKey[0], sig->backupKey[1], sig->backupDataLen);
|
||||||
char buf[sig->nodes.TextLength + 1];
|
char buf[_NDB_NODE_BITMASK_SIZE * 8 + 1];
|
||||||
fprintf(out, " Nodes: %s\n", sig->nodes.getText(buf));
|
fprintf(out, " Nodes: %s\n", sig->nodes.getText(buf));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ bool printCREATE_TRIG_REQ(FILE * output, const Uint32 * theData, Uint32 len, Uin
|
|||||||
fprintf(output, "Monitor all attributes: %s ", (sig->getMonitorAllAttributes())?"true":"false");
|
fprintf(output, "Monitor all attributes: %s ", (sig->getMonitorAllAttributes())?"true":"false");
|
||||||
const AttributeMask& attributeMask = sig->getAttributeMask();
|
const AttributeMask& attributeMask = sig->getAttributeMask();
|
||||||
|
|
||||||
char buf[attributeMask.TextLength + 1];
|
char buf[MAXNROFATTRIBUTESINWORDS * 8 + 1];
|
||||||
fprintf(output, "Attribute mask: %s", attributeMask.getText(buf));
|
fprintf(output, "Attribute mask: %s", attributeMask.getText(buf));
|
||||||
fprintf(output, "\n");
|
fprintf(output, "\n");
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user