mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
merge
BitKeeper/etc/logging_ok: auto-union configure.in: Auto merged ndb/include/Makefile.am: Auto merged ndb/include/kernel/LogLevel.hpp: Auto merged ndb/include/mgmapi/mgmapi.h: Auto merged ndb/include/ndbapi/NdbConnection.hpp: Auto merged ndb/include/ndbapi/NdbDictionary.hpp: Auto merged ndb/src/common/debugger/EventLogger.cpp: Auto merged ndb/src/common/logger/FileLogHandler.cpp: Auto merged ndb/src/common/logger/Logger.cpp: Auto merged ndb/src/common/mgmcommon/ConfigRetriever.cpp: Auto merged ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Auto merged ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Auto merged ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged ndb/src/kernel/main.cpp: Auto merged ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp: Auto merged ndb/src/kernel/vm/Configuration.cpp: Auto merged ndb/src/mgmapi/mgmapi.cpp: Auto merged ndb/src/mgmsrv/InitConfigFileParser.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.hpp: Auto merged ndb/src/mgmsrv/Services.cpp: Auto merged ndb/src/mgmsrv/Services.hpp: Auto merged ndb/src/mgmsrv/main.cpp: Auto merged ndb/src/ndbapi/NdbConnection.cpp: Auto merged ndb/src/ndbapi/TransporterFacade.cpp: Auto merged ndb/src/ndbapi/ndberror.c: Auto merged ndb/tools/Makefile.am: Auto merged
This commit is contained in:
commit
72c28731e9
433 changed files with 33894 additions and 5122 deletions
22
.bzrignore
22
.bzrignore
|
|
@ -924,3 +924,25 @@ Docs/Images/mydsn.txt
|
|||
Docs/Images/myflowchart.txt
|
||||
mysql-test/mysql_test_run_new
|
||||
ndb/tools/ndb_test_platform
|
||||
help
|
||||
ndbcluster-1186
|
||||
ndbcluster-1186/SCCS
|
||||
ndbcluster-1186/config.ini
|
||||
ndbcluster-1186/ndb_1.pid
|
||||
ndbcluster-1186/ndb_1_out.log
|
||||
ndbcluster-1186/ndb_1_signal.log
|
||||
ndbcluster-1186/ndb_2.pid
|
||||
ndbcluster-1186/ndb_2_out.log
|
||||
ndbcluster-1186/ndb_2_signal.log
|
||||
ndbcluster-1186/ndb_3.pid
|
||||
ndbcluster-1186/ndb_3_cluster.log
|
||||
ndbcluster-1186/ndb_3_out.log
|
||||
ndbcluster-1186/ndbcluster.pid
|
||||
ndb/tools/ndb_restore
|
||||
ac_available_languages_fragment
|
||||
libmysqld/ha_archive.cc
|
||||
libmysqld/ha_example.cc
|
||||
libmysqld/ha_tina.cc
|
||||
analyse.test
|
||||
client/mysqladmin.c
|
||||
mysql-4.1.8-win-src.zip
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wcto
|
|||
|
||||
alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet
|
||||
pentium_cflags="-mcpu=pentiumpro"
|
||||
ppc_cflags="-mpowerpc -mcpu=powerpc"
|
||||
sparc_cflags=""
|
||||
|
||||
# be as fast as we can be without losing our ability to backtrace
|
||||
|
|
|
|||
10
BUILD/compile-ppc
Executable file
10
BUILD/compile-ppc
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$ppc_cflags $fast_cflags"
|
||||
extra_configs="$static_link"
|
||||
strip=yes
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
13
BUILD/compile-ppc-debug
Executable file
13
BUILD/compile-ppc-debug
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$ppc_cflags $debug_cflags"
|
||||
c_warnings="$c_warnings $debug_extra_warnings"
|
||||
cxx_warnings="$cxx_warnings $debug_extra_warnings"
|
||||
extra_configs="$debug_configs "
|
||||
|
||||
extra_configs="$extra_configs"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
13
BUILD/compile-ppc-debug-max
Executable file
13
BUILD/compile-ppc-debug-max
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$ppc_cflags $debug_cflags"
|
||||
c_warnings="$c_warnings $debug_extra_warnings"
|
||||
cxx_warnings="$cxx_warnings $debug_extra_warnings"
|
||||
extra_configs="$debug_configs"
|
||||
|
||||
extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid --with-vio --with-ndbcluster"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
13
BUILD/compile-ppc-max
Executable file
13
BUILD/compile-ppc-max
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$ppc_cflags $fast_cflags -g"
|
||||
#strip=yes
|
||||
|
||||
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
|
||||
--with-embedded-server --enable-thread-safe-client \
|
||||
--with-openssl --with-vio --with-raid --with-ndbcluster"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
|
@ -88,6 +88,7 @@ jcole@mugatu.jcole.us
|
|||
jcole@mugatu.spaceapes.com
|
||||
jcole@sarvik.tfr.cafe.ee
|
||||
jcole@tetra.spaceapes.com
|
||||
jimw@mysql.com
|
||||
joerg@mysql.com
|
||||
joreland@mysql.com
|
||||
jorge@linux.jorge.mysql.com
|
||||
|
|
@ -102,6 +103,7 @@ lenz@mysql.com
|
|||
magnus@neptunus.(none)
|
||||
magnus@shellback.(none)
|
||||
marko@hundin.mysql.fi
|
||||
mats@mysql.com
|
||||
matt@mysql.com
|
||||
matthias@three.local.lan
|
||||
miguel@hegel.(none)
|
||||
|
|
@ -140,6 +142,7 @@ msvensson@build.mysql.com
|
|||
mwagner@cash.mwagner.org
|
||||
mwagner@evoq.mwagner.org
|
||||
mwagner@here.mwagner.org
|
||||
mwagner@mysql.com
|
||||
mwagner@work.mysql.com
|
||||
mydev@mysql.com
|
||||
mysql@home.(none)
|
||||
|
|
@ -164,6 +167,7 @@ pem@mysql.com
|
|||
peter@linux.local
|
||||
peter@mysql.com
|
||||
peterg@mysql.com
|
||||
petr@mysql.com
|
||||
pgulutzan@linux.local
|
||||
ram@deer.(none)
|
||||
ram@gw.mysql.r18.ru
|
||||
|
|
@ -189,6 +193,7 @@ serg@sergbook.mylan
|
|||
serg@sergbook.mysql.com
|
||||
sergefp@mysql.com
|
||||
sinisa@rhols221.adsl.netsonic.fi
|
||||
stewart@mysql.com
|
||||
tfr@beta.frontier86.ee
|
||||
tfr@indrek.tfr.cafe.ee
|
||||
tfr@sarvik.tfr.cafe.ee
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ use Sys::Hostname;
|
|||
$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_tmp=$opt_version_suffix="";
|
||||
$opt_bundled_zlib=$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=0;
|
||||
$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
|
||||
$opt_embedded_test=$opt_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0;
|
||||
|
||||
GetOptions(
|
||||
"bdb",
|
||||
|
|
@ -25,6 +25,7 @@ GetOptions(
|
|||
"delete",
|
||||
"distribution=s",
|
||||
"enable-shared",
|
||||
"embedded-test",
|
||||
"fast-benchmark",
|
||||
"help|Information",
|
||||
"innodb",
|
||||
|
|
@ -37,8 +38,10 @@ GetOptions(
|
|||
"no-test",
|
||||
"no-mysqltest",
|
||||
"no-benchmark",
|
||||
"one-error",
|
||||
"perl-files=s",
|
||||
"perl-options=s",
|
||||
"ps-test",
|
||||
"raid",
|
||||
"readline",
|
||||
"stage=i",
|
||||
|
|
@ -52,7 +55,10 @@ GetOptions(
|
|||
"use-old-distribution",
|
||||
"user=s",
|
||||
"version-suffix=s",
|
||||
"with-archive",
|
||||
"with-cluster",
|
||||
"with-csv",
|
||||
"with-example",
|
||||
"with-debug",
|
||||
"with-low-memory",
|
||||
"with-other-libc=s",
|
||||
|
|
@ -272,7 +278,11 @@ if ($opt_stage <= 1)
|
|||
$opt_config_options.= " --with-libedit";
|
||||
}
|
||||
$opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded);
|
||||
$opt_embedded_test= 0 if ($opt_without_embedded);
|
||||
$opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive);
|
||||
$opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster);
|
||||
$opt_config_options.= " --with-csv-storage-engine" if ($opt_with_csv);
|
||||
$opt_config_options.= " --with-example-storage-engine" if ($opt_with_example);
|
||||
|
||||
# Only enable InnoDB when requested (required to be able to
|
||||
# build the "Classic" packages that do not include InnoDB)
|
||||
|
|
@ -310,6 +320,7 @@ if ($opt_stage <= 2)
|
|||
$command=$make;
|
||||
$command.= " $opt_make_options" if (defined($opt_make_options) && $opt_make_options ne "");
|
||||
safe_system($command);
|
||||
print LOG "Do-compile: Build successful\n";
|
||||
}
|
||||
|
||||
#
|
||||
|
|
@ -373,10 +384,29 @@ if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
|
|||
{
|
||||
my $flags= "";
|
||||
$flags.= " --with-ndbcluster" if ($opt_with_cluster);
|
||||
$flags.= " --force" if (!$opt_one_error);
|
||||
log_timestamp();
|
||||
info("Running test suite");
|
||||
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
|
||||
safe_cd("${test_dir}/mysql-test");
|
||||
check_system("./mysql-test-run $flags --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
|
||||
|
||||
if ($opt_ps_test)
|
||||
{
|
||||
log_timestamp();
|
||||
info("Running test suite using prepared statements");
|
||||
check_system("./mysql-test-run $flags --ps-protocol --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
|
||||
}
|
||||
|
||||
if ($opt_embedded_test)
|
||||
{
|
||||
log_timestamp();
|
||||
info("Running embedded server test suite");
|
||||
# Embedded server and NDB don't jive
|
||||
$flags=~ s/ --with-ndbcluster//;
|
||||
check_system("./mysql-test-run $flags --embedded-server --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
|
||||
}
|
||||
# 'mysql-test-run' writes its own final message for log evaluation.
|
||||
}
|
||||
|
||||
#
|
||||
|
|
@ -521,6 +551,9 @@ Delete the distribution file.
|
|||
--distribution=<distribution_file>
|
||||
Name of the MySQL source distribution file.
|
||||
|
||||
--embedded-test
|
||||
Run the test suite against the embedded server
|
||||
|
||||
--enable-shared
|
||||
Compile with shared libraries
|
||||
|
||||
|
|
@ -555,7 +588,10 @@ Do not run any tests.
|
|||
Do not run the benchmark test (written in perl)
|
||||
|
||||
--no-mysqltest
|
||||
Do not run the the mysql-test-run test (Same as 'make test')
|
||||
Do not run the mysql-test-run test (Same as 'make test')
|
||||
|
||||
--one-error
|
||||
Terminate the mysql-test-run test after the first difference (default: use '--force')
|
||||
|
||||
--no-perl
|
||||
Do not compile or install Perl modules, use the system installed ones
|
||||
|
|
@ -566,6 +602,9 @@ Compile and install the given perl modules.
|
|||
--perl-options=<options>
|
||||
Build Perl modules with the additional options
|
||||
|
||||
--ps-test
|
||||
Run an additional test run, using prepared statements
|
||||
|
||||
--raid
|
||||
Compile with RAID support
|
||||
|
||||
|
|
@ -601,9 +640,18 @@ If user is empty then no mail is sent.
|
|||
--version-suffix=suffix
|
||||
Set name suffix (e.g. 'com' or '-max') for a distribution
|
||||
|
||||
--with archive
|
||||
Enable the Archive storage engine
|
||||
|
||||
--with cluster
|
||||
Compile and test with NDB Cluster enabled
|
||||
|
||||
--with-csv
|
||||
Enable the CSV storage engine
|
||||
|
||||
--with-example
|
||||
Enable the Example storage engine
|
||||
|
||||
--with-debug
|
||||
Build binaries with debug information (implies "--no-strip")
|
||||
|
||||
|
|
|
|||
|
|
@ -100,5 +100,4 @@ tags:
|
|||
# Test installation
|
||||
|
||||
test:
|
||||
cd mysql-test ; ./mysql-test-run
|
||||
|
||||
cd mysql-test; ./mysql-test-run && ./mysql-test-run --ps-protocol
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ LINK32=xilink6.exe
|
|||
# Name "mysqladmin - Win32 classic"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\mysqladmin.c
|
||||
SOURCE=.\mysqladmin.cpp
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
|
|
|
|||
125
VC++Files/client/mysqltest.dsp
Normal file
125
VC++Files/client/mysqltest.dsp
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
# Microsoft Developer Studio Project File - Name="mysqltest" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=mysqltest - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "mysqltest.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "mysqltest.mak" CFG="mysqltest - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "mysqltest - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "mysqltest - Win32 classic" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "mysqltest - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "mysqltest - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\debug"
|
||||
# PROP BASE Intermediate_Dir ".\debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\debug"
|
||||
# PROP Intermediate_Dir ".\debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
|
||||
# ADD CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
|
||||
# ADD BASE MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
|
||||
# ADD MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
|
||||
# ADD BASE RSC /l 1033 /d "_DEBUG"
|
||||
# ADD RSC /l 1033 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "mysqltest - Win32 classic"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\classic"
|
||||
# PROP BASE Intermediate_Dir ".\classic"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\classic"
|
||||
# PROP Intermediate_Dir ".\classic"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX
|
||||
# ADD CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX
|
||||
# ADD BASE MTL /nologo /tlb".\classic\mysqltest.tlb" /win32
|
||||
# ADD MTL /nologo /tlb".\classic\mysqltest.tlb" /win32
|
||||
# ADD BASE RSC /l 1033 /d "NDEBUG"
|
||||
# ADD RSC /l 1033 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "mysqltest - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\release"
|
||||
# PROP BASE Intermediate_Dir ".\release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\release"
|
||||
# PROP Intermediate_Dir ".\release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX
|
||||
# ADD CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX
|
||||
# ADD BASE MTL /nologo /tlb".\release\mysqltest.tlb" /win32
|
||||
# ADD MTL /nologo /tlb".\release\mysqltest.tlb" /win32
|
||||
# ADD BASE RSC /l 1033 /d "NDEBUG"
|
||||
# ADD RSC /l 1033 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "mysqltest - Win32 Debug"
|
||||
# Name "mysqltest - Win32 classic"
|
||||
# Name "mysqltest - Win32 Release"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\libmysql\manager.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\mysqltest.c
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
|
||||
106
VC++Files/mysql-test/mysql_test_run_new.dsp
Normal file
106
VC++Files/mysql-test/mysql_test_run_new.dsp
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
# Microsoft Developer Studio Project File - Name="mysql_test_run_new" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=mysql_test_run_new - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "mysql_test_run_new.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "mysql_test_run_new.mak" CFG="mysql_test_run_new - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "mysql_test_run_new - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\Debug"
|
||||
# PROP Intermediate_Dir ".\Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
|
||||
# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
|
||||
# ADD BASE MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32
|
||||
# ADD MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32
|
||||
# ADD BASE RSC /l 1033
|
||||
# ADD RSC /l 1033
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console
|
||||
|
||||
!ELSEIF "$(CFG)" == "mysql_test_run_new - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
|
||||
# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
|
||||
# ADD BASE MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32
|
||||
# ADD MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32
|
||||
# ADD BASE RSC /l 1033
|
||||
# ADD RSC /l 1033
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "mysql_test_run_new - Win32 Debug"
|
||||
# Name "mysql_test_run_new - Win32 Release"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\my_create_tables.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\my_manage.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\my_manage.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\mysql_test_run_new.c
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
|
||||
|
|
@ -816,6 +816,45 @@ Package=<4>
|
|||
|
||||
###############################################################################
|
||||
|
||||
Project: "mysqltest"=.\client\mysqltest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libmysql
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name mysys
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name regex
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name mysqltest
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name mysqladmin
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
|
|
|
|||
|
|
@ -924,76 +924,139 @@ SOURCE=.\message.mc
|
|||
|
||||
!IF "$(CFG)" == "mysqld - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=.\message.mc
|
||||
|
||||
BuildCmds= \
|
||||
mc message.mc
|
||||
|
||||
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "mysqld - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=.\message.mc
|
||||
|
||||
BuildCmds= \
|
||||
mc message.mc
|
||||
|
||||
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "mysqld - Win32 nt"
|
||||
|
||||
# Begin Custom Build - Compiling messages
|
||||
InputDir=.
|
||||
# Begin Custom Build
|
||||
InputPath=.\message.mc
|
||||
InputName=message
|
||||
|
||||
BuildCmds= \
|
||||
mc.exe "$(InputDir)\$(InputName).mc"
|
||||
mc message.mc
|
||||
|
||||
"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "mysqld - Win32 Max nt"
|
||||
# Begin Custom Build - Compiling messages
|
||||
InputDir=.
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=.\message.mc
|
||||
InputName=message
|
||||
|
||||
BuildCmds= \
|
||||
mc.exe "$(InputDir)\$(InputName).mc"
|
||||
mc message.mc
|
||||
|
||||
"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=.\message.mc
|
||||
|
||||
BuildCmds= \
|
||||
mc message.mc
|
||||
|
||||
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=.\message.mc
|
||||
|
||||
BuildCmds= \
|
||||
mc message.mc
|
||||
|
||||
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=.\message.mc
|
||||
|
||||
BuildCmds= \
|
||||
mc message.mc
|
||||
|
||||
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
|
||||
# Begin Custom Build - Compiling messages
|
||||
InputDir=.
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=.\message.mc
|
||||
InputName=message
|
||||
|
||||
BuildCmds= \
|
||||
mc.exe "$(InputDir)\$(InputName).mc"
|
||||
mc message.mc
|
||||
|
||||
"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
|
||||
# Begin Custom Build - Compiling messages
|
||||
InputDir=.
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=.\message.mc
|
||||
InputName=message
|
||||
|
||||
BuildCmds= \
|
||||
mc.exe "$(InputDir)\$(InputName).mc"
|
||||
mc message.mc
|
||||
|
||||
"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
|
|
|
|||
23
acinclude.m4
23
acinclude.m4
|
|
@ -1624,6 +1624,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
|
|||
--with-ndb-port-base Base port for NDB Cluster transporters],
|
||||
[ndb_port_base="$withval"],
|
||||
[ndb_port_base="default"])
|
||||
AC_ARG_WITH([ndb-debug],
|
||||
[
|
||||
--without-ndb-debug Disable special ndb debug features],
|
||||
[ndb_debug="$withval"],
|
||||
[ndb_debug="default"])
|
||||
|
||||
AC_MSG_CHECKING([for NDB Cluster options])
|
||||
AC_MSG_RESULT([])
|
||||
|
|
@ -1663,6 +1668,24 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
|
|||
;;
|
||||
esac
|
||||
|
||||
case "$ndb_debug" in
|
||||
yes )
|
||||
AC_MSG_RESULT([-- including ndb extra debug options])
|
||||
have_ndb_debug="yes"
|
||||
;;
|
||||
full )
|
||||
AC_MSG_RESULT([-- including ndb extra extra debug options])
|
||||
have_ndb_debug="full"
|
||||
;;
|
||||
no )
|
||||
AC_MSG_RESULT([-- not including ndb extra debug options])
|
||||
have_ndb_debug="no"
|
||||
;;
|
||||
* )
|
||||
have_ndb_debug="default"
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_MSG_RESULT([done.])
|
||||
])
|
||||
|
||||
|
|
|
|||
|
|
@ -20,15 +20,15 @@
|
|||
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \
|
||||
$(openssl_includes)
|
||||
LIBS = @CLIENT_LIBS@
|
||||
DEPLIB= @ndb_mgmclient_libs@ \
|
||||
../libmysql/libmysqlclient.la
|
||||
DEPLIB= ../libmysql/libmysqlclient.la
|
||||
REGEXLIB= ../regex/libregex.a
|
||||
LDADD = @CLIENT_EXTRA_LDFLAGS@ $(DEPLIB)
|
||||
bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \
|
||||
mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen
|
||||
noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
|
||||
client_priv.h
|
||||
mysqladmin_SOURCES = mysqladmin.cc
|
||||
mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc
|
||||
mysqladmin_SOURCES = mysqladmin.cc
|
||||
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS)
|
||||
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
|
||||
mysql_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
||||
|
|
@ -38,8 +38,8 @@ mysqlshow_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
|||
mysqldump_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
||||
mysqlimport_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
||||
mysqltest_SOURCES= mysqltest.c ../mysys/my_getsystime.c
|
||||
mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
||||
mysqltest_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a
|
||||
mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(REGEXLIB) $(DEPLIB)
|
||||
mysqltest_LDADD = $(REGEXLIB) $(LDADD)
|
||||
mysqlbinlog_SOURCES = mysqlbinlog.cc ../mysys/mf_tempdir.c
|
||||
mysqlbinlog_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
|
||||
mysqlmanagerc_SOURCES = mysqlmanagerc.c
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ enum options_client
|
|||
OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH,
|
||||
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS,
|
||||
OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
|
||||
OPT_SIGINT_IGNORE, OPT_HEXBLOB
|
||||
OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY
|
||||
#ifdef HAVE_NDBCLUSTER_DB
|
||||
,OPT_NDBCLUSTER,OPT_NDB_CONNECTSTRING
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1609,7 +1609,7 @@ static void print_help_item(MYSQL_ROW *cur, int num_name, int num_cat, char *las
|
|||
char ccat= (*cur)[num_cat][0];
|
||||
if (*last_char != ccat)
|
||||
{
|
||||
put_info(ccat == 'Y' ? "categories :" : "topics :", INFO_INFO);
|
||||
put_info(ccat == 'Y' ? "categories:" : "topics:", INFO_INFO);
|
||||
*last_char= ccat;
|
||||
}
|
||||
tee_fprintf(PAGER, " %s\n", (*cur)[num_name]);
|
||||
|
|
@ -1676,8 +1676,8 @@ static int com_server_help(String *buffer __attribute__((unused)),
|
|||
|
||||
if (num_fields == 2)
|
||||
{
|
||||
put_info("Many help items for your request exist", INFO_INFO);
|
||||
put_info("To make a more specific request, please type 'help <item>',\nwhere item is one of next", INFO_INFO);
|
||||
put_info("Many help items for your request exist.", INFO_INFO);
|
||||
put_info("To make a more specific request, please type 'help <item>',\nwhere item is one of the following", INFO_INFO);
|
||||
num_name= 0;
|
||||
num_cat= 1;
|
||||
last_char= '_';
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <mysql.h>
|
||||
|
||||
#ifdef HAVE_NDBCLUSTER_DB
|
||||
#ifdef LATER_HAVE_NDBCLUSTER_DB
|
||||
#include "../ndb/src/mgmclient/ndb_mgmclient.h"
|
||||
#endif
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations,
|
|||
opt_count_iterations= 0;
|
||||
static ulong opt_connect_timeout, opt_shutdown_timeout;
|
||||
static my_string unix_port=0;
|
||||
#ifdef HAVE_NDBCLUSTER_DB
|
||||
#ifdef LATER_HAVE_NDBCLUSTER_DB
|
||||
static my_bool opt_ndbcluster=0;
|
||||
static char *opt_ndb_connectstring=0;
|
||||
#endif
|
||||
|
|
@ -101,7 +101,7 @@ enum commands {
|
|||
ADMIN_PING, ADMIN_EXTENDED_STATUS, ADMIN_FLUSH_STATUS,
|
||||
ADMIN_FLUSH_PRIVILEGES, ADMIN_START_SLAVE, ADMIN_STOP_SLAVE,
|
||||
ADMIN_FLUSH_THREADS, ADMIN_OLD_PASSWORD
|
||||
#ifdef HAVE_NDBCLUSTER_DB
|
||||
#ifdef LATER_HAVE_NDBCLUSTER_DB
|
||||
,ADMIN_NDB_MGM
|
||||
#endif
|
||||
};
|
||||
|
|
@ -114,7 +114,7 @@ static const char *command_names[]= {
|
|||
"ping", "extended-status", "flush-status",
|
||||
"flush-privileges", "start-slave", "stop-slave",
|
||||
"flush-threads","old-password",
|
||||
#ifdef HAVE_NDBCLUSTER_DB
|
||||
#ifdef LATER_HAVE_NDBCLUSTER_DB
|
||||
"ndb-mgm",
|
||||
#endif
|
||||
NullS
|
||||
|
|
@ -125,6 +125,10 @@ static TYPELIB command_typelib=
|
|||
|
||||
static struct my_option my_long_options[] =
|
||||
{
|
||||
#ifdef __NETWARE__
|
||||
{"autoclose", 'a', " Auto close the screen on exit for NetWare",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"count", 'c',
|
||||
"Number of iterations to make. This works with -i (--sleep) only.",
|
||||
(gptr*) &nr_iterations, (gptr*) &nr_iterations, 0, GET_UINT,
|
||||
|
|
@ -197,7 +201,7 @@ static struct my_option my_long_options[] =
|
|||
{"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (gptr*) &opt_shutdown_timeout,
|
||||
(gptr*) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
|
||||
SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
|
||||
#ifdef HAVE_NDBCLUSTER_DB
|
||||
#ifdef LATER_HAVE_NDBCLUSTER_DB
|
||||
{"ndbcluster", OPT_NDBCLUSTER, ""
|
||||
"", (gptr*) &opt_ndbcluster,
|
||||
(gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
|
|
@ -218,6 +222,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
int error = 0;
|
||||
|
||||
switch(optid) {
|
||||
#ifdef __NETWARE__
|
||||
case 'a':
|
||||
setscreenmode(SCR_AUTOCLOSE_ON_EXIT); // auto close the screen /
|
||||
break;
|
||||
#endif
|
||||
case 'c':
|
||||
opt_count_iterations= 1;
|
||||
break;
|
||||
|
|
@ -608,7 +617,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
{
|
||||
char *pos,buff[40];
|
||||
ulong sec;
|
||||
pos=strchr(status,' ');
|
||||
pos= (char*) strchr(status,' ');
|
||||
*pos++=0;
|
||||
printf("%s\t\t\t",status); /* print label */
|
||||
if ((status=str2int(pos,10,0,LONG_MAX,(long*) &sec)))
|
||||
|
|
@ -816,10 +825,17 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
}
|
||||
if (argv[1][0])
|
||||
{
|
||||
char *pw= argv[1];
|
||||
#ifdef __WIN__
|
||||
uint pw_len= strlen(pw);
|
||||
if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'')
|
||||
printf("Warning: single quotes were not trimmed from the password by"
|
||||
" your command\nline client, as you might have expected.\n");
|
||||
#endif
|
||||
if (find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD)
|
||||
make_scrambled_password_323(crypted_pw, argv[1]);
|
||||
make_scrambled_password_323(crypted_pw, pw);
|
||||
else
|
||||
make_scrambled_password(crypted_pw, argv[1]);
|
||||
make_scrambled_password(crypted_pw, pw);
|
||||
}
|
||||
else
|
||||
crypted_pw[0]=0; /* No password */
|
||||
|
|
@ -903,7 +919,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
|||
}
|
||||
mysql->reconnect=1; /* Automatic reconnect is default */
|
||||
break;
|
||||
#ifdef HAVE_NDBCLUSTER_DB
|
||||
#ifdef LATER_HAVE_NDBCLUSTER_DB
|
||||
case ADMIN_NDB_MGM:
|
||||
{
|
||||
if (argc < 2)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ static const char *load_default_groups[]= { "mysqlbinlog","client",0 };
|
|||
|
||||
void sql_print_error(const char *format, ...);
|
||||
|
||||
static bool one_database=0, to_last_remote_log= 0;
|
||||
static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 0;
|
||||
static const char* database= 0;
|
||||
static my_bool force_opt= 0, short_form= 0, remote_opt= 0;
|
||||
static ulonglong offset = 0;
|
||||
|
|
@ -438,6 +438,13 @@ static struct my_option my_long_options[] =
|
|||
{"database", 'd', "List entries for just this database (local log only).",
|
||||
(gptr*) &database, (gptr*) &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"disable-log-bin", 'D', "Disable binary log. This is useful, if you "
|
||||
"enabled --to-last-log and are sending the output to the same MySQL server. "
|
||||
"This way you could avoid an endless loop. You would also like to use it "
|
||||
"when restoring after a crash to avoid duplication of the statements you "
|
||||
"already have. NOTE: you will need a SUPER privilege to use this option.",
|
||||
(gptr*) &disable_log_bin, (gptr*) &disable_log_bin, 0, GET_BOOL,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"force-read", 'f', "Force reading unknown binlog events.",
|
||||
(gptr*) &force_opt, (gptr*) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
|
|
@ -1068,6 +1075,11 @@ int main(int argc, char** argv)
|
|||
|
||||
fprintf(result_file,
|
||||
"/*!40019 SET @@session.max_insert_delayed_threads=0*/;\n");
|
||||
|
||||
if (disable_log_bin)
|
||||
fprintf(result_file,
|
||||
"/*!32316 SET @OLD_SQL_LOG_BIN=@@SQL_LOG_BIN, SQL_LOG_BIN=0*/;\n");
|
||||
|
||||
for (save_stop_position= stop_position, stop_position= ~(my_off_t)0 ;
|
||||
(--argc >= 0) && !stop_passed ; )
|
||||
{
|
||||
|
|
@ -1082,6 +1094,9 @@ int main(int argc, char** argv)
|
|||
start_position= BIN_LOG_HEADER_SIZE;
|
||||
}
|
||||
|
||||
if (disable_log_bin)
|
||||
fprintf(result_file, "/*!32316 SET SQL_LOG_BIN=@OLD_SQL_LOG_BIN*/;\n");
|
||||
|
||||
if (tmpdir.list)
|
||||
free_tmpdir(&tmpdir);
|
||||
if (result_file != stdout)
|
||||
|
|
|
|||
|
|
@ -75,20 +75,20 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length,
|
|||
|
||||
static char *field_escape(char *to,const char *from,uint length);
|
||||
static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1,
|
||||
lock_tables=1,ignore_errors=0,flush_logs=0,replace=0,
|
||||
ignore=0,opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0,
|
||||
lock_tables=1,ignore_errors=0,flush_logs=0,
|
||||
opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0,
|
||||
opt_delayed=0,create_options=1,opt_quoted=0,opt_databases=0,
|
||||
opt_alldbs=0,opt_create_db=0,opt_lock_all_tables=0,opt_set_charset,
|
||||
opt_autocommit=0,opt_disable_keys=1,opt_xml=0,
|
||||
opt_delete_master_logs=0, tty_password=0,
|
||||
opt_single_transaction=0, opt_comments= 0, opt_compact= 0,
|
||||
opt_hex_blob=0;
|
||||
opt_hex_blob=0, opt_order_by_primary=0;
|
||||
static ulong opt_max_allowed_packet, opt_net_buffer_length;
|
||||
static MYSQL mysql_connection,*sock=0;
|
||||
static char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
|
||||
*current_host=0,*path=0,*fields_terminated=0,
|
||||
*lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0,
|
||||
*where=0,
|
||||
*where=0, *order_by=0,
|
||||
*opt_compatible_mode_str= 0,
|
||||
*err_ptr= 0;
|
||||
static char compatible_mode_normal_str[255];
|
||||
|
|
@ -158,7 +158,7 @@ static struct my_option my_long_options[] =
|
|||
(gptr*) &opt_compatible_mode_str, (gptr*) &opt_compatible_mode_str, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"compact", OPT_COMPACT,
|
||||
"Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-lock-tables",
|
||||
"Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-add-locks",
|
||||
(gptr*) &opt_compact, (gptr*) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"complete-insert", 'c', "Use complete insert statements.", (gptr*) &cFlag,
|
||||
|
|
@ -332,6 +332,9 @@ static struct my_option my_long_options[] =
|
|||
{"socket", 'S', "Socket file to use for connection.",
|
||||
(gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"order-by-primary", OPT_ORDER_BY_PRIMARY,
|
||||
"Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.",
|
||||
(gptr*) &opt_order_by_primary, (gptr*) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#include <sslopt-longopts.h>
|
||||
{"tab",'T',
|
||||
"Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon.",
|
||||
|
|
@ -368,6 +371,7 @@ static int dump_databases(char **);
|
|||
static int dump_all_databases();
|
||||
static char *quote_name(const char *name, char *buff, my_bool force);
|
||||
static const char *check_if_ignore_table(const char *table_name);
|
||||
static char *primary_key_fields(const char *table_name);
|
||||
|
||||
#include <help_start.h>
|
||||
|
||||
|
|
@ -669,11 +673,6 @@ static int get_options(int *argc, char ***argv)
|
|||
fprintf(stderr, "%s: You can't use ..enclosed.. and ..optionally-enclosed.. at the same time.\n", my_progname);
|
||||
return(1);
|
||||
}
|
||||
if (replace && ignore)
|
||||
{
|
||||
fprintf(stderr, "%s: You can't use --ignore (-i) and --replace (-r) at the same time.\n",my_progname);
|
||||
return(1);
|
||||
}
|
||||
if ((opt_databases || opt_alldbs) && path)
|
||||
{
|
||||
fprintf(stderr,
|
||||
|
|
@ -754,7 +753,6 @@ static void safe_exit(int error)
|
|||
|
||||
/*
|
||||
** dbConnect -- connects to the host and selects DB.
|
||||
** Also checks whether the tablename is a valid table name.
|
||||
*/
|
||||
static int dbConnect(char *host, char *user,char *passwd)
|
||||
{
|
||||
|
|
@ -892,7 +890,7 @@ static char *quote_for_like(const char *name, char *buff)
|
|||
len - its length
|
||||
|
||||
DESCRIPTION
|
||||
Quote '<' '>' '&' '\"' singns and print a string to the xml_file.
|
||||
Quote '<' '>' '&' '\"' chars and print a string to the xml_file.
|
||||
*/
|
||||
|
||||
static void print_quoted_xml(FILE *xml_file, const char *str, ulong len)
|
||||
|
|
@ -1033,6 +1031,10 @@ static uint getTableStructure(char *table, char* db)
|
|||
|
||||
result_table= quote_name(table, table_buff, 1);
|
||||
opt_quoted_table= quote_name(table, table_buff2, 0);
|
||||
|
||||
if (opt_order_by_primary)
|
||||
order_by = primary_key_fields(opt_quoted_table);
|
||||
|
||||
if (!opt_xml && !mysql_query_with_error_report(sock, 0, insert_pat))
|
||||
{
|
||||
/* using SHOW CREATE statement */
|
||||
|
|
@ -1449,10 +1451,6 @@ static void dumpTable(uint numFields, char *table)
|
|||
sprintf(query, "SELECT /*!40001 SQL_NO_CACHE */ * INTO OUTFILE '%s'",
|
||||
filename);
|
||||
end= strend(query);
|
||||
if (replace)
|
||||
end= strmov(end, " REPLACE");
|
||||
if (ignore)
|
||||
end= strmov(end, " IGNORE");
|
||||
|
||||
if (fields_terminated || enclosed || opt_enclosed || escaped)
|
||||
end= strmov(end, " FIELDS");
|
||||
|
|
@ -1465,10 +1463,17 @@ static void dumpTable(uint numFields, char *table)
|
|||
|
||||
sprintf(buff," FROM %s", result_table);
|
||||
end= strmov(end,buff);
|
||||
if (where)
|
||||
if (where || order_by)
|
||||
{
|
||||
query= alloc_query_str((ulong) (strlen(where) + (end - query) + 10));
|
||||
end= strxmov(query, query_buf, " WHERE ", where, NullS);
|
||||
query = alloc_query_str((ulong) ((end - query) + 1 +
|
||||
(where ? strlen(where) + 7 : 0) +
|
||||
(order_by ? strlen(order_by) + 10 : 0)));
|
||||
end = strmov(query, query_buf);
|
||||
|
||||
if (where)
|
||||
end = strxmov(end, " WHERE ", where, NullS);
|
||||
if (order_by)
|
||||
end = strxmov(end, " ORDER BY ", order_by, NullS);
|
||||
}
|
||||
if (mysql_real_query(sock, query, (uint) (end - query)))
|
||||
{
|
||||
|
|
@ -1486,15 +1491,31 @@ static void dumpTable(uint numFields, char *table)
|
|||
}
|
||||
sprintf(query, "SELECT /*!40001 SQL_NO_CACHE */ * FROM %s",
|
||||
result_table);
|
||||
if (where)
|
||||
if (where || order_by)
|
||||
{
|
||||
if (!opt_xml && opt_comments)
|
||||
query = alloc_query_str((ulong) (strlen(query) + 1 +
|
||||
(where ? strlen(where) + 7 : 0) +
|
||||
(order_by ? strlen(order_by) + 10 : 0)));
|
||||
end = strmov(query, query_buf);
|
||||
|
||||
if (where)
|
||||
{
|
||||
fprintf(md_result_file,"-- WHERE: %s\n",where);
|
||||
check_io(md_result_file);
|
||||
if (!opt_xml && opt_comments)
|
||||
{
|
||||
fprintf(md_result_file, "-- WHERE: %s\n", where);
|
||||
check_io(md_result_file);
|
||||
}
|
||||
end = strxmov(end, " WHERE ", where, NullS);
|
||||
}
|
||||
if (order_by)
|
||||
{
|
||||
if (!opt_xml && opt_comments)
|
||||
{
|
||||
fprintf(md_result_file, "-- ORDER BY: %s\n", order_by);
|
||||
check_io(md_result_file);
|
||||
}
|
||||
end = strxmov(end, " ORDER BY ", order_by, NullS);
|
||||
}
|
||||
query= alloc_query_str((ulong) (strlen(where) + strlen(query) + 10));
|
||||
strxmov(query, query_buf, " WHERE ", where, NullS);
|
||||
}
|
||||
if (!opt_xml && !opt_compact)
|
||||
{
|
||||
|
|
@ -1890,7 +1911,7 @@ static int init_dumping(char *database)
|
|||
MYSQL_ROW row;
|
||||
MYSQL_RES *dbinfo;
|
||||
|
||||
sprintf(qbuf,"SHOW CREATE DATABASE WITH IF NOT EXISTS %s",
|
||||
sprintf(qbuf,"SHOW CREATE DATABASE IF NOT EXISTS %s",
|
||||
qdatabase);
|
||||
|
||||
if (mysql_query_with_error_report(sock, &dbinfo, qbuf))
|
||||
|
|
@ -1955,6 +1976,8 @@ static int dump_all_tables_in_db(char *database)
|
|||
numrows = getTableStructure(table, database);
|
||||
if (!dFlag && numrows > 0)
|
||||
dumpTable(numrows,table);
|
||||
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
|
||||
order_by= 0;
|
||||
}
|
||||
if (opt_xml)
|
||||
{
|
||||
|
|
@ -2004,6 +2027,8 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
|||
numrows = getTableStructure(*table_names, db);
|
||||
if (!dFlag && numrows > 0)
|
||||
dumpTable(numrows, *table_names);
|
||||
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
|
||||
order_by= 0;
|
||||
}
|
||||
if (opt_xml)
|
||||
{
|
||||
|
|
@ -2215,6 +2240,80 @@ static const char *check_if_ignore_table(const char *table_name)
|
|||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
Get string of comma-separated primary key field names
|
||||
|
||||
SYNOPSIS
|
||||
char *primary_key_fields(const char *table_name)
|
||||
RETURNS pointer to allocated buffer (must be freed by caller)
|
||||
table_name quoted table name
|
||||
|
||||
DESCRIPTION
|
||||
Use SHOW KEYS FROM table_name, allocate a buffer to hold the
|
||||
field names, and then build that string and return the pointer
|
||||
to that buffer.
|
||||
|
||||
Returns NULL if there is no PRIMARY or UNIQUE key on the table,
|
||||
or if there is some failure. It is better to continue to dump
|
||||
the table unsorted, rather than exit without dumping the data.
|
||||
*/
|
||||
static char *primary_key_fields(const char *table_name)
|
||||
{
|
||||
MYSQL_RES *res = NULL;
|
||||
MYSQL_ROW row;
|
||||
/* SHOW KEYS FROM + table name * 2 (escaped) + 2 quotes + \0 */
|
||||
char show_keys_buff[15 + 64 * 2 + 3];
|
||||
uint result_length = 0;
|
||||
char *result = 0;
|
||||
|
||||
sprintf(show_keys_buff, "SHOW KEYS FROM %s", table_name);
|
||||
if (mysql_query(sock, show_keys_buff) ||
|
||||
!(res = mysql_store_result(sock)))
|
||||
{
|
||||
fprintf(stderr, "Warning: Couldn't read keys from table %s;"
|
||||
" records are NOT sorted (%s)\n",
|
||||
table_name, mysql_error(sock));
|
||||
/* Don't exit, because it's better to print out unsorted records */
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
* Figure out the length of the ORDER BY clause result.
|
||||
* Note that SHOW KEYS is ordered: a PRIMARY key is always the first
|
||||
* row, and UNIQUE keys come before others. So we only need to check
|
||||
* the first key, not all keys.
|
||||
*/
|
||||
if ((row = mysql_fetch_row(res)) && atoi(row[1]) == 0)
|
||||
{
|
||||
/* Key is unique */
|
||||
do
|
||||
result_length += strlen(row[4]) + 1; /* + 1 for ',' or \0 */
|
||||
while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1);
|
||||
}
|
||||
|
||||
/* Build the ORDER BY clause result */
|
||||
if (result_length) {
|
||||
char *end;
|
||||
/* result (terminating \0 is already in result_length) */
|
||||
result = my_malloc(result_length + 10, MYF(MY_WME));
|
||||
if (!result) {
|
||||
fprintf(stderr, "Error: Not enough memory to store ORDER BY clause\n");
|
||||
goto cleanup;
|
||||
}
|
||||
mysql_data_seek(res, 0);
|
||||
row = mysql_fetch_row(res);
|
||||
end = strmov(result, row[4]);
|
||||
while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1)
|
||||
end = strxmov(end, ",", row[4], NullS);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (res)
|
||||
mysql_free_result(res);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ typedef struct
|
|||
int alloced;
|
||||
} VAR;
|
||||
|
||||
#ifdef __NETWARE__
|
||||
#if defined(__NETWARE__) || defined(__WIN__)
|
||||
/*
|
||||
Netware doesn't proved environment variable substitution that is done
|
||||
by the shell in unix environments. We do this in the following function:
|
||||
|
|
@ -4600,6 +4600,9 @@ static char *subst_env_var(const char *str)
|
|||
*/
|
||||
|
||||
#undef popen /* Remove wrapper */
|
||||
#ifdef __WIN__
|
||||
#define popen _popen /* redefine for windows */
|
||||
#endif
|
||||
|
||||
FILE *my_popen(const char *cmd, const char *mode __attribute__((unused)))
|
||||
{
|
||||
|
|
|
|||
29
configure.in
29
configure.in
|
|
@ -5,7 +5,7 @@ AC_INIT(sql/mysqld.cc)
|
|||
AC_CANONICAL_SYSTEM
|
||||
# The Docs Makefile.am parses this line!
|
||||
# remember to also change ndb version below and update version.c in ndb
|
||||
AM_INIT_AUTOMAKE(mysql, 4.1.8)
|
||||
AM_INIT_AUTOMAKE(mysql, 4.1.9)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
PROTOCOL_VERSION=10
|
||||
|
|
@ -16,7 +16,7 @@ SHARED_LIB_VERSION=14:0:0
|
|||
# ndb version
|
||||
NDB_VERSION_MAJOR=4
|
||||
NDB_VERSION_MINOR=1
|
||||
NDB_VERSION_BUILD=8
|
||||
NDB_VERSION_BUILD=9
|
||||
NDB_VERSION_STATUS=""
|
||||
|
||||
# Set all version vars based on $VERSION. How do we do this more elegant ?
|
||||
|
|
@ -1931,9 +1931,11 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
|
|||
#
|
||||
#
|
||||
case "$target" in
|
||||
*-*-aix4*)
|
||||
*-*-aix4* | *-*-sco*)
|
||||
# (grr) aix 4.3 has a stub for clock_gettime, (returning ENOSYS)
|
||||
# and using AC_TRY_RUN is hard when cross-compiling
|
||||
# We also disable for SCO for the time being, the headers for the
|
||||
# thread library we use conflicts with other headers.
|
||||
;;
|
||||
*) AC_CHECK_FUNCS(clock_gettime)
|
||||
;;
|
||||
|
|
@ -2712,7 +2714,7 @@ case $default_charset in
|
|||
;;
|
||||
latin1)
|
||||
default_charset_default_collation="latin1_swedish_ci"
|
||||
default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_swedish_ci"
|
||||
default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_spanish_ci latin1_swedish_ci"
|
||||
;;
|
||||
latin2)
|
||||
default_charset_default_collation="latin2_general_ci"
|
||||
|
|
@ -2828,7 +2830,7 @@ thread_dirs=
|
|||
|
||||
dnl This probably should be cleaned up more - for now the threaded
|
||||
dnl client is just using plain-old libs.
|
||||
sql_client_dirs="libmysql strings regex client"
|
||||
sql_client_dirs="libmysql client"
|
||||
linked_client_targets="linked_libmysql_sources"
|
||||
CLIENT_LIBS=$NON_THREADED_CLIENT_LIBS
|
||||
if test "$THREAD_SAFE_CLIENT" != "no"
|
||||
|
|
@ -3037,15 +3039,26 @@ then
|
|||
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
|
||||
|
||||
CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)"
|
||||
if test "$with_debug" = "yes"
|
||||
if test "$have_ndb_debug" = "default"
|
||||
then
|
||||
have_ndb_debug=$with_debug
|
||||
fi
|
||||
|
||||
if test "$have_ndb_debug" = "yes"
|
||||
then
|
||||
# Medium debug.
|
||||
NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
|
||||
elif test "$with_debug" = "full"
|
||||
elif test "$have_ndb_debug" = "full"
|
||||
then
|
||||
NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
|
||||
else
|
||||
NDB_DEFS="-DNDEBUG"
|
||||
# no extra ndb debug but still do asserts if debug version
|
||||
if test "$with_debug" = "yes" -o "$with_debug" = "full"
|
||||
then
|
||||
NDB_DEFS=""
|
||||
else
|
||||
NDB_DEFS="-DNDEBUG"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST([NDB_DEFS])
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ static HA_ERRORS ha_errlist[]=
|
|||
{
|
||||
{ 120,"Didn't find key on read or update" },
|
||||
{ 121,"Duplicate key on write or update" },
|
||||
{ 123,"Someone has changed the row since it was read; Update with is recoverable" },
|
||||
{ 123,"Someone has changed the row since it was read (while the table was locked to prevent it)" },
|
||||
{ 124,"Wrong index given to function" },
|
||||
{ 126,"Index file is crashed" },
|
||||
{ 127,"Record-file is crashed" },
|
||||
|
|
|
|||
|
|
@ -41,6 +41,13 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
|
|||
{
|
||||
HP_KEYDEF *keyinfo;
|
||||
DBUG_PRINT("info",("Initializing new table"));
|
||||
|
||||
/*
|
||||
We have to store sometimes byte* del_link in records,
|
||||
so the record length should be at least sizeof(byte*)
|
||||
*/
|
||||
set_if_bigger(reclength, sizeof (byte*));
|
||||
|
||||
for (i= key_segs= max_length= 0, keyinfo= keydef; i < keys; i++, keyinfo++)
|
||||
{
|
||||
bzero((char*) &keyinfo->block,sizeof(keyinfo->block));
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ int heap_rfirst(HP_INFO *info, byte *record, int inx)
|
|||
my_errno=HA_ERR_END_OF_FILE;
|
||||
DBUG_RETURN(my_errno);
|
||||
}
|
||||
DBUG_ASSERT(0); /* TODO fix it */
|
||||
info->current_record=0;
|
||||
info->current_hash_ptr=0;
|
||||
info->update=HA_STATE_PREV_FOUND;
|
||||
|
|
|
|||
|
|
@ -90,3 +90,4 @@ extern const char *client_errors[]; /* Error messages */
|
|||
#define CR_SECURE_AUTH 2049
|
||||
#define CR_FETCH_CANCELED 2050
|
||||
#define CR_NO_DATA 2051
|
||||
#define CR_NO_STMT_METADATA 2052
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ typedef struct unicase_info_st
|
|||
#define MY_CS_UNICODE 128 /* is a charset is full unicode */
|
||||
#define MY_CS_READY 256 /* if a charset is initialized */
|
||||
#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/
|
||||
|
||||
#define MY_CS_CSSORT 1024 /* if case sensitive sort order */
|
||||
#define MY_CHARSET_UNDEFINED 0
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -291,6 +291,7 @@ enum ha_base_keytype {
|
|||
#define HA_ERR_NO_SUCH_TABLE 155 /* The table does not exist in engine */
|
||||
#define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */
|
||||
#define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */
|
||||
#define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */
|
||||
|
||||
/* Other constants */
|
||||
|
||||
|
|
|
|||
|
|
@ -58,14 +58,15 @@ void init_time(void);
|
|||
my_time_t
|
||||
my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap);
|
||||
|
||||
void set_zero_time(MYSQL_TIME *tm);
|
||||
void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type);
|
||||
|
||||
/*
|
||||
Required buffer length for my_time_to_str, my_date_to_str,
|
||||
my_datetime_to_str and TIME_to_string functions. Note, that the
|
||||
caller is still responsible to check that given TIME structure
|
||||
has values in valid ranges, otherwise size of the buffer could
|
||||
be not enough.
|
||||
be not enough. We also rely on the fact that even wrong values
|
||||
sent using binary protocol fit in this buffer.
|
||||
*/
|
||||
#define MAX_DATE_STRING_REP_LENGTH 30
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,18 @@ enum enum_mysql_timestamp_type
|
|||
};
|
||||
|
||||
|
||||
/*
|
||||
Structure which is used to represent datetime values inside MySQL.
|
||||
|
||||
We assume that values in this structure are normalized, i.e. year <= 9999,
|
||||
month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions
|
||||
in server such as my_system_gmt_sec() or make_time() family of functions
|
||||
rely on this (actually now usage of make_*() family relies on a bit weaker
|
||||
restriction). Also functions that produce MYSQL_TIME as result ensure this.
|
||||
There is one exception to this rule though if this structure holds time
|
||||
value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold
|
||||
bigger values.
|
||||
*/
|
||||
typedef struct st_mysql_time
|
||||
{
|
||||
unsigned int year, month, day, hour, minute, second;
|
||||
|
|
|
|||
|
|
@ -32,9 +32,6 @@ C_MODE_END
|
|||
#endif
|
||||
#if defined(USE_RAID)
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma interface /* gcc class implementation */
|
||||
#endif
|
||||
#include "my_dir.h"
|
||||
|
||||
/* Trap all occurences of my_...() in source and use our wrapper around this function */
|
||||
|
|
@ -92,6 +89,10 @@ extern "C" {
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma interface /* gcc class implementation */
|
||||
#endif
|
||||
|
||||
class RaidName {
|
||||
public:
|
||||
RaidName(const char *FileName);
|
||||
|
|
|
|||
|
|
@ -547,8 +547,9 @@ buf_pool_init(
|
|||
}
|
||||
/*----------------------------------------*/
|
||||
} else {
|
||||
buf_pool->frame_mem = ut_malloc(
|
||||
UNIV_PAGE_SIZE * (n_frames + 1));
|
||||
buf_pool->frame_mem = ut_malloc_low(
|
||||
UNIV_PAGE_SIZE * (n_frames + 1),
|
||||
TRUE, FALSE);
|
||||
}
|
||||
|
||||
if (buf_pool->frame_mem == NULL) {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@ initial segment in buf_LRU_get_recent_limit */
|
|||
|
||||
#define BUF_LRU_INITIAL_RATIO 8
|
||||
|
||||
/* If we switch on the InnoDB monitor because there are too few available
|
||||
frames in the buffer pool, we set this to TRUE */
|
||||
ibool buf_lru_switched_on_innodb_mon = FALSE;
|
||||
|
||||
/**********************************************************************
|
||||
Takes a block out of the LRU list and page hash table and sets the block
|
||||
state to BUF_BLOCK_REMOVE_HASH. */
|
||||
|
|
@ -287,6 +291,32 @@ buf_LRU_try_free_flushed_blocks(void)
|
|||
mutex_exit(&(buf_pool->mutex));
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
Returns TRUE if less than 15 % of the buffer pool is available. This can be
|
||||
used in heuristics to prevent huge transactions eating up the whole buffer
|
||||
pool for their locks. */
|
||||
|
||||
ibool
|
||||
buf_LRU_buf_pool_running_out(void)
|
||||
/*==============================*/
|
||||
/* out: TRUE if less than 15 % of buffer pool
|
||||
left */
|
||||
{
|
||||
ibool ret = FALSE;
|
||||
|
||||
mutex_enter(&(buf_pool->mutex));
|
||||
|
||||
if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
|
||||
+ UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 7) {
|
||||
|
||||
ret = TRUE;
|
||||
}
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
Returns a free block from buf_pool. The block is taken off the free list.
|
||||
If it is empty, blocks are moved from the end of the LRU list to the free
|
||||
|
|
@ -325,7 +355,8 @@ loop:
|
|||
|
||||
} else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
|
||||
+ UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 5) {
|
||||
if (!srv_print_innodb_monitor) {
|
||||
|
||||
if (!buf_lru_switched_on_innodb_mon) {
|
||||
|
||||
/* Over 80 % of the buffer pool is occupied by lock
|
||||
heaps or the adaptive hash index. This may be a memory
|
||||
|
|
@ -342,16 +373,18 @@ loop:
|
|||
"InnoDB: lock heap and hash index sizes.\n",
|
||||
(ulong) (buf_pool->curr_size / (1024 * 1024 / UNIV_PAGE_SIZE)));
|
||||
|
||||
buf_lru_switched_on_innodb_mon = TRUE;
|
||||
srv_print_innodb_monitor = TRUE;
|
||||
os_event_set(srv_lock_timeout_thread_event);
|
||||
}
|
||||
} else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
|
||||
+ UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 4) {
|
||||
} else if (buf_lru_switched_on_innodb_mon) {
|
||||
|
||||
/* Switch off the InnoDB Monitor; this is a simple way
|
||||
to stop the monitor if the situation becomes less urgent,
|
||||
but may also surprise users! */
|
||||
but may also surprise users if the user also switched on the
|
||||
monitor! */
|
||||
|
||||
buf_lru_switched_on_innodb_mon = FALSE;
|
||||
srv_print_innodb_monitor = FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@ AC_CHECK_SIZEOF(long, 4)
|
|||
AC_CHECK_SIZEOF(void*, 4)
|
||||
AC_CHECK_FUNCS(sched_yield)
|
||||
AC_CHECK_FUNCS(fdatasync)
|
||||
#AC_CHECK_FUNCS(localtime_r) # Already checked by MySQL
|
||||
AC_CHECK_FUNCS(localtime_r)
|
||||
#AC_CHECK_FUNCS(readdir_r) MySQL checks that it has also the right args.
|
||||
# Some versions of Unix only take 2 arguments.
|
||||
#AC_C_INLINE Already checked in MySQL
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
|
|
@ -110,6 +112,9 @@ esac
|
|||
case "$target" in
|
||||
i[[4567]]86-*-*)
|
||||
CFLAGS="$CFLAGS -DUNIV_INTEL_X86";;
|
||||
# The compiler on Linux/S390 does not seem to have inlining
|
||||
s390-*-*)
|
||||
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
|
||||
esac
|
||||
|
||||
AC_OUTPUT(Makefile os/Makefile ut/Makefile btr/Makefile dnl
|
||||
|
|
|
|||
|
|
@ -2364,6 +2364,8 @@ dict_scan_id(
|
|||
ulint len = 0;
|
||||
const char* s;
|
||||
char* d;
|
||||
ulint id_len;
|
||||
byte* b;
|
||||
|
||||
*id = NULL;
|
||||
|
||||
|
|
@ -2425,6 +2427,28 @@ dict_scan_id(
|
|||
*id = s;
|
||||
}
|
||||
|
||||
if (heap && !quote) {
|
||||
/* EMS MySQL Manager sometimes adds characters 0xA0 (in
|
||||
latin1, a 'non-breakable space') to the end of a table name.
|
||||
But isspace(0xA0) is not true, which confuses our foreign key
|
||||
parser. After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2
|
||||
and 0xA0 are at the end of the string.
|
||||
|
||||
TODO: we should lex the string using thd->charset_info, and
|
||||
my_isspace(). Only after that, convert id names to UTF-8. */
|
||||
|
||||
b = (byte*)(*id);
|
||||
id_len = strlen(b);
|
||||
|
||||
if (id_len >= 3 && b[id_len - 1] == 0xA0
|
||||
&& b[id_len - 2] == 0xC2) {
|
||||
|
||||
/* Strip the 2 last bytes */
|
||||
|
||||
b[id_len - 2] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
|
|
@ -2479,7 +2503,7 @@ dict_scan_col(
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
Scans the referenced table name from an SQL string. */
|
||||
Scans a table name from an SQL string. */
|
||||
static
|
||||
const char*
|
||||
dict_scan_table_name(
|
||||
|
|
@ -2490,7 +2514,7 @@ dict_scan_table_name(
|
|||
const char* name, /* in: foreign key table name */
|
||||
ibool* success,/* out: TRUE if ok name found */
|
||||
mem_heap_t* heap, /* in: heap where to allocate the id */
|
||||
const char** ref_name)/* out,own: the referenced table name;
|
||||
const char** ref_name)/* out,own: the table name;
|
||||
NULL if no name was scannable */
|
||||
{
|
||||
const char* database_name = NULL;
|
||||
|
|
|
|||
|
|
@ -765,6 +765,22 @@ dict_load_table(
|
|||
return(NULL);
|
||||
}
|
||||
|
||||
#if MYSQL_VERSION_ID < 50300
|
||||
/* Starting from MySQL 5.0.3, the high-order bit of MIX_LEN is the
|
||||
"compact format" flag. */
|
||||
field = rec_get_nth_field(rec, 7, &len);
|
||||
if (mach_read_from_1(field) & 0x80) {
|
||||
btr_pcur_close(&pcur);
|
||||
mtr_commit(&mtr);
|
||||
mem_heap_free(heap);
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: table %s is in the new compact format\n"
|
||||
"InnoDB: of MySQL 5.0.3 or later\n", name);
|
||||
return(NULL);
|
||||
}
|
||||
#endif /* MYSQL_VERSION_ID < 50300 */
|
||||
|
||||
ut_a(0 == ut_strcmp("SPACE",
|
||||
dict_field_get_col(
|
||||
dict_index_get_nth_field(
|
||||
|
|
|
|||
|
|
@ -25,6 +25,16 @@ wasted. */
|
|||
void
|
||||
buf_LRU_try_free_flushed_blocks(void);
|
||||
/*==================================*/
|
||||
/**********************************************************************
|
||||
Returns TRUE if less than 15 % of the buffer pool is available. This can be
|
||||
used in heuristics to prevent huge transactions eating up the whole buffer
|
||||
pool for their locks. */
|
||||
|
||||
ibool
|
||||
buf_LRU_buf_pool_running_out(void);
|
||||
/*==============================*/
|
||||
/* out: TRUE if less than 15 % of buffer pool
|
||||
left */
|
||||
|
||||
/*#######################################################################
|
||||
These are low-level functions
|
||||
|
|
|
|||
|
|
@ -53,7 +53,11 @@ Created 5/24/1996 Heikki Tuuri
|
|||
name already exists */
|
||||
#define DB_TABLESPACE_DELETED 44 /* tablespace does not exist or is
|
||||
being dropped right now */
|
||||
|
||||
#define DB_LOCK_TABLE_FULL 45 /* lock structs have exhausted the
|
||||
buffer pool (for big transactions,
|
||||
InnoDB stores the lock structs in the
|
||||
buffer pool) */
|
||||
|
||||
/* The following are partial failure codes */
|
||||
#define DB_FAIL 1000
|
||||
#define DB_OVERFLOW 1001
|
||||
|
|
|
|||
|
|
@ -463,13 +463,32 @@ lock_rec_hash(
|
|||
ulint space, /* in: space */
|
||||
ulint page_no);/* in: page number */
|
||||
/*************************************************************************
|
||||
Gets the table covered by an IX table lock. */
|
||||
Gets the source table of an ALTER TABLE transaction. The table must be
|
||||
covered by an IX or IS table lock. */
|
||||
|
||||
dict_table_t*
|
||||
lock_get_ix_table(
|
||||
/*==============*/
|
||||
/* out: the table covered by the lock */
|
||||
lock_t* lock); /* in: table lock */
|
||||
lock_get_src_table(
|
||||
/*===============*/
|
||||
/* out: the source table of transaction,
|
||||
if it is covered by an IX or IS table lock;
|
||||
dest if there is no source table, and
|
||||
NULL if the transaction is locking more than
|
||||
two tables or an inconsistency is found */
|
||||
trx_t* trx, /* in: transaction */
|
||||
dict_table_t* dest, /* in: destination of ALTER TABLE */
|
||||
ulint* mode); /* out: lock mode of the source table */
|
||||
/*************************************************************************
|
||||
Determine if the given table is exclusively "owned" by the given
|
||||
transaction, i.e., transaction holds LOCK_IX and possibly LOCK_AUTO_INC
|
||||
on the table. */
|
||||
|
||||
ibool
|
||||
lock_is_table_exclusive(
|
||||
/*====================*/
|
||||
/* out: TRUE if table is only locked by trx,
|
||||
with LOCK_IX, and possibly LOCK_AUTO_INC */
|
||||
dict_table_t* table, /* in: table */
|
||||
trx_t* trx); /* in: transaction */
|
||||
/*************************************************************************
|
||||
Checks that a transaction id is sensible, i.e., not in the future. */
|
||||
|
||||
|
|
|
|||
|
|
@ -177,10 +177,12 @@ row_lock_table_for_mysql(
|
|||
/* out: error code or DB_SUCCESS */
|
||||
row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL
|
||||
table handle */
|
||||
dict_table_t* table); /* in: table to LOCK_IX, or NULL
|
||||
dict_table_t* table, /* in: table to lock, or NULL
|
||||
if prebuilt->table should be
|
||||
locked as LOCK_TABLE_EXP |
|
||||
prebuilt->select_lock_type */
|
||||
ulint mode); /* in: lock mode of table */
|
||||
|
||||
/*************************************************************************
|
||||
Does an insert for MySQL. */
|
||||
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ row_search_for_mysql(
|
|||
/* out: DB_SUCCESS,
|
||||
DB_RECORD_NOT_FOUND,
|
||||
DB_END_OF_INDEX, DB_DEADLOCK,
|
||||
DB_LOCK_TABLE_FULL,
|
||||
or DB_TOO_BIG_RECORD */
|
||||
byte* buf, /* in/out: buffer for the fetched
|
||||
row in the MySQL format */
|
||||
|
|
|
|||
|
|
@ -38,8 +38,10 @@ ut_malloc_low(
|
|||
/*==========*/
|
||||
/* out, own: allocated memory */
|
||||
ulint n, /* in: number of bytes to allocate */
|
||||
ibool set_to_zero); /* in: TRUE if allocated memory should be set
|
||||
ibool set_to_zero, /* in: TRUE if allocated memory should be set
|
||||
to zero if UNIV_SET_MEM_TO_ZERO is defined */
|
||||
ibool assert_on_error); /* in: if TRUE, we crash mysqld if the memory
|
||||
cannot be allocated */
|
||||
/**************************************************************************
|
||||
Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is
|
||||
defined. */
|
||||
|
|
|
|||
|
|
@ -365,6 +365,21 @@ lock_deadlock_recursive(
|
|||
ulint* cost); /* in/out: number of calculation steps thus
|
||||
far: if this exceeds LOCK_MAX_N_STEPS_...
|
||||
we return TRUE */
|
||||
|
||||
/*************************************************************************
|
||||
Gets the type of a lock. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
lock_get_type(
|
||||
/*==========*/
|
||||
/* out: LOCK_TABLE or LOCK_REC */
|
||||
lock_t* lock) /* in: lock */
|
||||
{
|
||||
ut_ad(lock);
|
||||
|
||||
return(lock->type_mode & LOCK_TYPE_MASK);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the nth bit of a record lock. */
|
||||
UNIV_INLINE
|
||||
|
|
@ -395,19 +410,6 @@ lock_rec_get_nth_bit(
|
|||
return(ut_bit_get_nth(b, bit_index));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the table covered by an IX table lock. */
|
||||
|
||||
dict_table_t*
|
||||
lock_get_ix_table(
|
||||
/*==============*/
|
||||
/* out: the table covered by the lock */
|
||||
lock_t* lock) /* in: table lock */
|
||||
{
|
||||
ut_a(lock->type_mode == (LOCK_TABLE | LOCK_IX));
|
||||
return(lock->un_member.tab_lock.table);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#define lock_mutex_enter_kernel() mutex_enter(&kernel_mutex)
|
||||
|
|
@ -581,20 +583,6 @@ lock_get_mode(
|
|||
return(lock->type_mode & LOCK_MODE_MASK);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the type of a lock. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
lock_get_type(
|
||||
/*==========*/
|
||||
/* out: LOCK_TABLE or LOCK_REC */
|
||||
lock_t* lock) /* in: lock */
|
||||
{
|
||||
ut_ad(lock);
|
||||
|
||||
return(lock->type_mode & LOCK_TYPE_MASK);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the wait flag of a lock. */
|
||||
UNIV_INLINE
|
||||
|
|
@ -614,6 +602,128 @@ lock_get_wait(
|
|||
return(FALSE);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the source table of an ALTER TABLE transaction. The table must be
|
||||
covered by an IX or IS table lock. */
|
||||
|
||||
dict_table_t*
|
||||
lock_get_src_table(
|
||||
/*===============*/
|
||||
/* out: the source table of transaction,
|
||||
if it is covered by an IX or IS table lock;
|
||||
dest if there is no source table, and
|
||||
NULL if the transaction is locking more than
|
||||
two tables or an inconsistency is found */
|
||||
trx_t* trx, /* in: transaction */
|
||||
dict_table_t* dest, /* in: destination of ALTER TABLE */
|
||||
ulint* mode) /* out: lock mode of the source table */
|
||||
{
|
||||
dict_table_t* src;
|
||||
lock_t* lock;
|
||||
|
||||
src = NULL;
|
||||
*mode = LOCK_NONE;
|
||||
|
||||
for (lock = UT_LIST_GET_FIRST(trx->trx_locks);
|
||||
lock;
|
||||
lock = UT_LIST_GET_NEXT(trx_locks, lock)) {
|
||||
lock_table_t* tab_lock;
|
||||
ulint lock_mode;
|
||||
if (!(lock_get_type(lock) & LOCK_TABLE)) {
|
||||
/* We are only interested in table locks. */
|
||||
continue;
|
||||
}
|
||||
tab_lock = &lock->un_member.tab_lock;
|
||||
if (dest == tab_lock->table) {
|
||||
/* We are not interested in the destination table. */
|
||||
continue;
|
||||
} else if (!src) {
|
||||
/* This presumably is the source table. */
|
||||
src = tab_lock->table;
|
||||
if (UT_LIST_GET_LEN(src->locks) != 1 ||
|
||||
UT_LIST_GET_FIRST(src->locks) != lock) {
|
||||
/* We only support the case when
|
||||
there is only one lock on this table. */
|
||||
return(NULL);
|
||||
}
|
||||
} else if (src != tab_lock->table) {
|
||||
/* The transaction is locking more than
|
||||
two tables (src and dest): abort */
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* Check that the source table is locked by
|
||||
LOCK_IX or LOCK_IS. */
|
||||
lock_mode = lock_get_mode(lock);
|
||||
switch (lock_mode) {
|
||||
case LOCK_IX:
|
||||
case LOCK_IS:
|
||||
if (*mode != LOCK_NONE && *mode != lock_mode) {
|
||||
/* There are multiple locks on src. */
|
||||
return(NULL);
|
||||
}
|
||||
*mode = lock_mode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!src) {
|
||||
/* No source table lock found: flag the situation to caller */
|
||||
src = dest;
|
||||
}
|
||||
|
||||
return(src);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Determine if the given table is exclusively "owned" by the given
|
||||
transaction, i.e., transaction holds LOCK_IX and possibly LOCK_AUTO_INC
|
||||
on the table. */
|
||||
|
||||
ibool
|
||||
lock_is_table_exclusive(
|
||||
/*====================*/
|
||||
/* out: TRUE if table is only locked by trx,
|
||||
with LOCK_IX, and possibly LOCK_AUTO_INC */
|
||||
dict_table_t* table, /* in: table */
|
||||
trx_t* trx) /* in: transaction */
|
||||
{
|
||||
lock_t* lock;
|
||||
bool ok = FALSE;
|
||||
|
||||
ut_ad(table && trx);
|
||||
|
||||
for (lock = UT_LIST_GET_FIRST(table->locks);
|
||||
lock;
|
||||
lock = UT_LIST_GET_NEXT(locks, &lock->un_member.tab_lock)) {
|
||||
if (lock->trx != trx) {
|
||||
/* A lock on the table is held
|
||||
by some other transaction. */
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
if (!(lock_get_type(lock) & LOCK_TABLE)) {
|
||||
/* We are interested in table locks only. */
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (lock_get_mode(lock)) {
|
||||
case LOCK_IX:
|
||||
ok = TRUE;
|
||||
break;
|
||||
case LOCK_AUTO_INC:
|
||||
/* It is allowed for trx to hold an
|
||||
auto_increment lock. */
|
||||
break;
|
||||
default:
|
||||
/* Other table locks than LOCK_IX are not allowed. */
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
return(ok);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Sets the wait flag of a lock and the back pointer in trx to lock. */
|
||||
UNIV_INLINE
|
||||
|
|
@ -4063,6 +4173,9 @@ lock_print_info(
|
|||
(ulong) ut_dulint_get_high(purge_sys->purge_undo_no),
|
||||
(ulong) ut_dulint_get_low(purge_sys->purge_undo_no));
|
||||
|
||||
fprintf(file,
|
||||
"History list length %lu\n", (ulong) trx_sys->rseg_history_len);
|
||||
|
||||
fprintf(file,
|
||||
"Total number of lock structs in row lock hash table %lu\n",
|
||||
(ulong) lock_get_n_rec_locks());
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ mem_pool_create(
|
|||
but only when allocated at a higher level in mem0mem.c.
|
||||
This is to avoid masking useful Purify warnings. */
|
||||
|
||||
pool->buf = ut_malloc_low(size, FALSE);
|
||||
pool->buf = ut_malloc_low(size, FALSE, TRUE);
|
||||
pool->size = size;
|
||||
|
||||
mutex_create(&(pool->mutex));
|
||||
|
|
|
|||
|
|
@ -394,10 +394,19 @@ os_file_lock(
|
|||
lk.l_start = lk.l_len = 0;
|
||||
if (fcntl(fd, F_SETLK, &lk) == -1) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Unable to lock %s, error: %d", name, errno);
|
||||
"InnoDB: Unable to lock %s, error: %d\n", name, errno);
|
||||
|
||||
if (errno == EAGAIN || errno == EACCES) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Check that you do not already have another mysqld process\n"
|
||||
"InnoDB: using the same InnoDB data or log files.\n");
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
return(-1);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
#endif /* USE_FILE_LOCK */
|
||||
|
|
@ -711,13 +720,41 @@ http://www.mysql.com/doc/en/Windows_symbolic_links.html */
|
|||
char* full_path;
|
||||
int ret;
|
||||
struct stat statinfo;
|
||||
#ifdef HAVE_READDIR_R
|
||||
char dirent_buf[sizeof(struct dirent) + _POSIX_PATH_MAX +
|
||||
100];
|
||||
/* In /mysys/my_lib.c, _POSIX_PATH_MAX + 1 is used as
|
||||
the max file name len; but in most standards, the
|
||||
length is NAME_MAX; we add 100 to be even safer */
|
||||
#endif
|
||||
|
||||
next_file:
|
||||
ent = readdir(dir);
|
||||
|
||||
#ifdef HAVE_READDIR_R
|
||||
ret = readdir_r(dir, (struct dirent*)dirent_buf, &ent);
|
||||
|
||||
if (ret != 0) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: cannot read directory %s, error %lu\n", dirname, (ulong)ret);
|
||||
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (ent == NULL) {
|
||||
/* End of directory */
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
ut_a(strlen(ent->d_name) < _POSIX_PATH_MAX + 100 - 1);
|
||||
#else
|
||||
ent = readdir(dir);
|
||||
|
||||
if (ent == NULL) {
|
||||
|
||||
return(1);
|
||||
}
|
||||
#endif
|
||||
ut_a(strlen(ent->d_name) < OS_FILE_MAX_PATH);
|
||||
|
||||
if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) {
|
||||
|
|
|
|||
|
|
@ -308,7 +308,8 @@ handle_new_error:
|
|||
|
||||
return(TRUE);
|
||||
|
||||
} else if (err == DB_DEADLOCK || err == DB_LOCK_WAIT_TIMEOUT) {
|
||||
} else if (err == DB_DEADLOCK || err == DB_LOCK_WAIT_TIMEOUT
|
||||
|| err == DB_LOCK_TABLE_FULL) {
|
||||
/* Roll back the whole transaction; this resolution was added
|
||||
to version 3.23.43 */
|
||||
|
||||
|
|
@ -781,10 +782,11 @@ row_lock_table_for_mysql(
|
|||
/* out: error code or DB_SUCCESS */
|
||||
row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL
|
||||
table handle */
|
||||
dict_table_t* table) /* in: table to LOCK_IX, or NULL
|
||||
dict_table_t* table, /* in: table to lock, or NULL
|
||||
if prebuilt->table should be
|
||||
locked as LOCK_TABLE_EXP |
|
||||
prebuilt->select_lock_type */
|
||||
ulint mode) /* in: lock mode of table */
|
||||
{
|
||||
trx_t* trx = prebuilt->trx;
|
||||
que_thr_t* thr;
|
||||
|
|
@ -818,7 +820,7 @@ run_again:
|
|||
trx_start_if_not_started(trx);
|
||||
|
||||
if (table) {
|
||||
err = lock_table(0, table, LOCK_IX, thr);
|
||||
err = lock_table(0, table, mode, thr);
|
||||
} else {
|
||||
err = lock_table(LOCK_TABLE_EXP, prebuilt->table,
|
||||
prebuilt->select_lock_type, thr);
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ Created 12/19/1997 Heikki Tuuri
|
|||
#include "pars0pars.h"
|
||||
#include "row0mysql.h"
|
||||
#include "read0read.h"
|
||||
#include "buf0lru.h"
|
||||
|
||||
/* Maximum number of rows to prefetch; MySQL interface has another parameter */
|
||||
#define SEL_MAX_N_PREFETCH 16
|
||||
|
|
@ -638,23 +639,24 @@ row_sel_get_clust_rec(
|
|||
if (!node->read_view) {
|
||||
/* Try to place a lock on the index record */
|
||||
|
||||
/* If innodb_locks_unsafe_for_binlog option is used,
|
||||
we lock only the record, i.e. next-key locking is
|
||||
not used.
|
||||
*/
|
||||
if ( srv_locks_unsafe_for_binlog )
|
||||
{
|
||||
err = lock_clust_rec_read_check_and_lock(0, clust_rec,
|
||||
index,node->row_lock_mode, LOCK_REC_NOT_GAP, thr);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = lock_clust_rec_read_check_and_lock(0, clust_rec, index,
|
||||
node->row_lock_mode, LOCK_ORDINARY, thr);
|
||||
/* If innodb_locks_unsafe_for_binlog option is used,
|
||||
we lock only the record, i.e. next-key locking is
|
||||
not used.
|
||||
*/
|
||||
|
||||
}
|
||||
if (srv_locks_unsafe_for_binlog) {
|
||||
err = lock_clust_rec_read_check_and_lock(0,
|
||||
clust_rec,
|
||||
index, node->row_lock_mode,
|
||||
LOCK_REC_NOT_GAP, thr);
|
||||
} else {
|
||||
err = lock_clust_rec_read_check_and_lock(0,
|
||||
clust_rec,
|
||||
index, node->row_lock_mode,
|
||||
LOCK_ORDINARY, thr);
|
||||
}
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
if (err != DB_SUCCESS) {
|
||||
|
||||
return(err);
|
||||
}
|
||||
|
|
@ -729,8 +731,18 @@ sel_set_rec_lock(
|
|||
ulint type, /* in: LOCK_ORDINARY, LOCK_GAP, or LOC_REC_NOT_GAP */
|
||||
que_thr_t* thr) /* in: query thread */
|
||||
{
|
||||
trx_t* trx;
|
||||
ulint err;
|
||||
|
||||
trx = thr_get_trx(thr);
|
||||
|
||||
if (UT_LIST_GET_LEN(trx->trx_locks) > 10000) {
|
||||
if (buf_LRU_buf_pool_running_out()) {
|
||||
|
||||
return(DB_LOCK_TABLE_FULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (index->type & DICT_CLUSTERED) {
|
||||
err = lock_clust_rec_read_check_and_lock(0, rec, index, mode,
|
||||
type, thr);
|
||||
|
|
@ -1205,22 +1217,24 @@ rec_loop:
|
|||
|
||||
if (!consistent_read) {
|
||||
|
||||
/* If innodb_locks_unsafe_for_binlog option is used,
|
||||
we lock only the record, i.e. next-key locking is
|
||||
not used.
|
||||
*/
|
||||
/* If innodb_locks_unsafe_for_binlog option is used,
|
||||
we lock only the record, i.e. next-key locking is
|
||||
not used.
|
||||
*/
|
||||
|
||||
if ( srv_locks_unsafe_for_binlog )
|
||||
{
|
||||
err = sel_set_rec_lock(page_rec_get_next(rec), index,
|
||||
node->row_lock_mode, LOCK_REC_NOT_GAP, thr);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = sel_set_rec_lock(page_rec_get_next(rec), index,
|
||||
node->row_lock_mode, LOCK_ORDINARY, thr);
|
||||
}
|
||||
if (err != DB_SUCCESS) {
|
||||
if (srv_locks_unsafe_for_binlog) {
|
||||
err = sel_set_rec_lock(page_rec_get_next(rec),
|
||||
index,
|
||||
node->row_lock_mode,
|
||||
LOCK_REC_NOT_GAP, thr);
|
||||
} else {
|
||||
err = sel_set_rec_lock(page_rec_get_next(rec),
|
||||
index,
|
||||
node->row_lock_mode,
|
||||
LOCK_ORDINARY, thr);
|
||||
}
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
/* Note that in this case we will store in pcur
|
||||
the PREDECESSOR of the record we are waiting
|
||||
the lock for */
|
||||
|
|
@ -1245,21 +1259,18 @@ rec_loop:
|
|||
if (!consistent_read) {
|
||||
/* Try to place a lock on the index record */
|
||||
|
||||
/* If innodb_locks_unsafe_for_binlog option is used,
|
||||
we lock only the record, i.e. next-key locking is
|
||||
not used.
|
||||
*/
|
||||
/* If innodb_locks_unsafe_for_binlog option is used,
|
||||
we lock only the record, i.e. next-key locking is
|
||||
not used.
|
||||
*/
|
||||
|
||||
if ( srv_locks_unsafe_for_binlog )
|
||||
{
|
||||
err = sel_set_rec_lock(rec, index, node->row_lock_mode,
|
||||
if (srv_locks_unsafe_for_binlog) {
|
||||
err = sel_set_rec_lock(rec, index, node->row_lock_mode,
|
||||
LOCK_REC_NOT_GAP, thr);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = sel_set_rec_lock(rec, index, node->row_lock_mode,
|
||||
} else {
|
||||
err = sel_set_rec_lock(rec, index, node->row_lock_mode,
|
||||
LOCK_ORDINARY, thr);
|
||||
}
|
||||
}
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
|
||||
|
|
@ -2765,6 +2776,7 @@ row_search_for_mysql(
|
|||
/* out: DB_SUCCESS,
|
||||
DB_RECORD_NOT_FOUND,
|
||||
DB_END_OF_INDEX, DB_DEADLOCK,
|
||||
DB_LOCK_TABLE_FULL,
|
||||
or DB_TOO_BIG_RECORD */
|
||||
byte* buf, /* in/out: buffer for the fetched
|
||||
row in the MySQL format */
|
||||
|
|
@ -3209,8 +3221,7 @@ rec_loop:
|
|||
we do not lock gaps. Supremum record is really
|
||||
a gap and therefore we do not set locks there. */
|
||||
|
||||
if ( srv_locks_unsafe_for_binlog == FALSE )
|
||||
{
|
||||
if (srv_locks_unsafe_for_binlog == FALSE) {
|
||||
err = sel_set_rec_lock(rec, index,
|
||||
prebuilt->select_lock_type,
|
||||
LOCK_ORDINARY, thr);
|
||||
|
|
@ -3312,11 +3323,18 @@ rec_loop:
|
|||
|
||||
if (prebuilt->select_lock_type != LOCK_NONE
|
||||
&& set_also_gap_locks) {
|
||||
/* Try to place a lock on the index record */
|
||||
|
||||
err = sel_set_rec_lock(rec, index,
|
||||
/* Try to place a gap lock on the index
|
||||
record only if innodb_locks_unsafe_for_binlog
|
||||
option is not set */
|
||||
|
||||
if (srv_locks_unsafe_for_binlog == FALSE) {
|
||||
|
||||
err = sel_set_rec_lock(rec, index,
|
||||
prebuilt->select_lock_type,
|
||||
LOCK_GAP, thr);
|
||||
}
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
|
||||
goto lock_wait_or_error;
|
||||
|
|
@ -3338,11 +3356,18 @@ rec_loop:
|
|||
|
||||
if (prebuilt->select_lock_type != LOCK_NONE
|
||||
&& set_also_gap_locks) {
|
||||
/* Try to place a lock on the index record */
|
||||
|
||||
err = sel_set_rec_lock(rec, index,
|
||||
/* Try to place a gap lock on the index
|
||||
record only if innodb_locks_unsafe_for_binlog
|
||||
option is not set */
|
||||
|
||||
if (srv_locks_unsafe_for_binlog == FALSE) {
|
||||
|
||||
err = sel_set_rec_lock(rec, index,
|
||||
prebuilt->select_lock_type,
|
||||
LOCK_GAP, thr);
|
||||
}
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
|
||||
goto lock_wait_or_error;
|
||||
|
|
@ -3376,19 +3401,16 @@ rec_loop:
|
|||
prebuilt->select_lock_type,
|
||||
LOCK_REC_NOT_GAP, thr);
|
||||
} else {
|
||||
/* If innodb_locks_unsafe_for_binlog option is used,
|
||||
we lock only the record, i.e. next-key locking is
|
||||
not used.
|
||||
*/
|
||||
if ( srv_locks_unsafe_for_binlog )
|
||||
{
|
||||
err = sel_set_rec_lock(rec, index,
|
||||
/* If innodb_locks_unsafe_for_binlog option is used,
|
||||
we lock only the record, i.e. next-key locking is
|
||||
not used. */
|
||||
|
||||
if (srv_locks_unsafe_for_binlog) {
|
||||
err = sel_set_rec_lock(rec, index,
|
||||
prebuilt->select_lock_type,
|
||||
LOCK_REC_NOT_GAP, thr);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = sel_set_rec_lock(rec, index,
|
||||
} else {
|
||||
err = sel_set_rec_lock(rec, index,
|
||||
prebuilt->select_lock_type,
|
||||
LOCK_ORDINARY, thr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1490,7 +1490,6 @@ srv_printf_innodb_monitor(
|
|||
|
||||
srv_last_monitor_time = time(NULL);
|
||||
|
||||
rewind(file);
|
||||
fputs("\n=====================================\n", file);
|
||||
|
||||
ut_print_timestamp(file);
|
||||
|
|
@ -1677,11 +1676,13 @@ loop:
|
|||
srv_printf_innodb_monitor(stderr);
|
||||
}
|
||||
|
||||
mutex_enter(&srv_monitor_file_mutex);
|
||||
rewind(srv_monitor_file);
|
||||
srv_printf_innodb_monitor(srv_monitor_file);
|
||||
os_file_set_eof(srv_monitor_file);
|
||||
mutex_exit(&srv_monitor_file_mutex);
|
||||
if (srv_innodb_status) {
|
||||
mutex_enter(&srv_monitor_file_mutex);
|
||||
rewind(srv_monitor_file);
|
||||
srv_printf_innodb_monitor(srv_monitor_file);
|
||||
os_file_set_eof(srv_monitor_file);
|
||||
mutex_exit(&srv_monitor_file_mutex);
|
||||
}
|
||||
|
||||
if (srv_print_innodb_tablespace_monitor
|
||||
&& difftime(current_time, last_table_monitor_time) > 60) {
|
||||
|
|
|
|||
|
|
@ -1172,6 +1172,9 @@ NetWare. */
|
|||
}
|
||||
|
||||
if (ret == NULL) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Fatal error: cannot allocate the memory for the buffer pool\n");
|
||||
|
||||
return(DB_ERROR);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ trx_purge_add_update_undo_to_history(
|
|||
flst_get_len(seg_header + TRX_UNDO_PAGE_LIST, mtr));
|
||||
|
||||
mlog_write_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE,
|
||||
hist_size + undo->size, MLOG_4BYTES, mtr);
|
||||
hist_size + undo->size, MLOG_4BYTES, mtr);
|
||||
}
|
||||
|
||||
/* Add the log as the first in the history list */
|
||||
|
|
@ -646,6 +646,27 @@ trx_purge_rseg_get_next_history_log(
|
|||
mutex_exit(&(rseg->mutex));
|
||||
mtr_commit(&mtr);
|
||||
|
||||
mutex_enter(&kernel_mutex);
|
||||
|
||||
/* Add debug code to track history list corruption reported
|
||||
on the MySQL mailing list on Nov 9, 2004. The fut0lst.c
|
||||
file-based list was corrupt. The prev node pointer was
|
||||
FIL_NULL, even though the list length was over 8 million nodes!
|
||||
We assume that purge truncates the history list in moderate
|
||||
size pieces, and if we here reach the head of the list, the
|
||||
list cannot be longer than 20 000 undo logs now. */
|
||||
|
||||
if (trx_sys->rseg_history_len > 20000) {
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: Warning: purge reached the head of the history list,\n"
|
||||
"InnoDB: but its length is still reported as %lu! Make a detailed bug\n"
|
||||
"InnoDB: report, and post it to bugs.mysql.com\n",
|
||||
(ulong)trx_sys->rseg_history_len);
|
||||
}
|
||||
|
||||
mutex_exit(&kernel_mutex);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1241,7 +1241,7 @@ trx_undo_lists_init(
|
|||
|
||||
if (page_no != FIL_NULL
|
||||
&& srv_force_recovery < SRV_FORCE_NO_UNDO_LOG_SCAN) {
|
||||
|
||||
|
||||
undo = trx_undo_mem_create_at_db_start(rseg, i,
|
||||
page_no, &mtr);
|
||||
size += undo->size;
|
||||
|
|
|
|||
|
|
@ -61,8 +61,10 @@ ut_malloc_low(
|
|||
/*==========*/
|
||||
/* out, own: allocated memory */
|
||||
ulint n, /* in: number of bytes to allocate */
|
||||
ibool set_to_zero) /* in: TRUE if allocated memory should be set
|
||||
ibool set_to_zero, /* in: TRUE if allocated memory should be set
|
||||
to zero if UNIV_SET_MEM_TO_ZERO is defined */
|
||||
ibool assert_on_error) /* in: if TRUE, we crash mysqld if the memory
|
||||
cannot be allocated */
|
||||
{
|
||||
void* ret;
|
||||
|
||||
|
|
@ -86,9 +88,7 @@ ut_malloc_low(
|
|||
"InnoDB: Check if you should increase the swap file or\n"
|
||||
"InnoDB: ulimits of your operating system.\n"
|
||||
"InnoDB: On FreeBSD check you have compiled the OS with\n"
|
||||
"InnoDB: a big enough maximum process size.\n"
|
||||
"InnoDB: We now intentionally generate a seg fault so that\n"
|
||||
"InnoDB: on Linux we get a stack trace.\n",
|
||||
"InnoDB: a big enough maximum process size.\n",
|
||||
(ulong) n, (ulong) ut_total_allocated_memory,
|
||||
#ifdef __WIN__
|
||||
(ulong) GetLastError()
|
||||
|
|
@ -110,7 +110,15 @@ ut_malloc_low(
|
|||
/* Intentional segfault on NetWare causes an abend. Avoid this
|
||||
by graceful exit handling in ut_a(). */
|
||||
#if (!defined __NETWARE__)
|
||||
if (*ut_mem_null_ptr) ut_mem_null_ptr = 0;
|
||||
if (assert_on_error) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: We now intentionally generate a seg fault so that\n"
|
||||
"InnoDB: on Linux we get a stack trace.\n");
|
||||
|
||||
if (*ut_mem_null_ptr) ut_mem_null_ptr = 0;
|
||||
} else {
|
||||
return(NULL);
|
||||
}
|
||||
#else
|
||||
ut_a(0);
|
||||
#endif
|
||||
|
|
@ -144,7 +152,7 @@ ut_malloc(
|
|||
/* out, own: allocated memory */
|
||||
ulint n) /* in: number of bytes to allocate */
|
||||
{
|
||||
return(ut_malloc_low(n, TRUE));
|
||||
return(ut_malloc_low(n, TRUE, TRUE));
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
|
|
|||
|
|
@ -235,13 +235,18 @@ ut_get_year_month_day(
|
|||
*month = (ulint)cal_tm.wMonth;
|
||||
*day = (ulint)cal_tm.wDay;
|
||||
#else
|
||||
struct tm cal_tm;
|
||||
struct tm* cal_tm_ptr;
|
||||
time_t tm;
|
||||
|
||||
time(&tm);
|
||||
|
||||
#ifdef HAVE_LOCALTIME_R
|
||||
localtime_r(&tm, &cal_tm);
|
||||
cal_tm_ptr = &cal_tm;
|
||||
#else
|
||||
cal_tm_ptr = localtime(&tm);
|
||||
|
||||
#endif
|
||||
*year = (ulint)cal_tm_ptr->tm_year + 1900;
|
||||
*month = (ulint)cal_tm_ptr->tm_mon + 1;
|
||||
*day = (ulint)cal_tm_ptr->tm_mday;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,9 @@ const char *client_errors[]=
|
|||
"Invalid connection handle",
|
||||
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
|
||||
"Row retrieval was canceled by mysql_stmt_close() call",
|
||||
"Attempt to read column without prior row fetch"
|
||||
"Attempt to read column without prior row fetch",
|
||||
"Prepared statement contains no metadata",
|
||||
""
|
||||
};
|
||||
|
||||
/* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */
|
||||
|
|
@ -137,7 +139,9 @@ const char *client_errors[]=
|
|||
"Invalid connection handle",
|
||||
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
|
||||
"Row retrieval was canceled by mysql_stmt_close() call",
|
||||
"Attempt to read column without prior row fetch"
|
||||
"Attempt to read column without prior row fetch",
|
||||
"Prepared statement contains no metadata",
|
||||
""
|
||||
};
|
||||
|
||||
#else /* ENGLISH */
|
||||
|
|
@ -194,7 +198,9 @@ const char *client_errors[]=
|
|||
"Invalid connection handle",
|
||||
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
|
||||
"Row retrieval was canceled by mysql_stmt_close() call",
|
||||
"Attempt to read column without prior row fetch"
|
||||
"Attempt to read column without prior row fetch",
|
||||
"Prepared statement contains no metadata",
|
||||
""
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -2139,12 +2139,12 @@ static void update_stmt_fields(MYSQL_STMT *stmt)
|
|||
DESCRIPTION
|
||||
This function should be used after mysql_stmt_execute().
|
||||
You can safely check that prepared statement has a result set by calling
|
||||
mysql_stmt_num_fields(): if number of fields is not zero, you can call
|
||||
mysql_stmt_field_count(): if number of fields is not zero, you can call
|
||||
this function to get fields metadata.
|
||||
Next steps you may want to make:
|
||||
- find out number of columns in result set by calling
|
||||
mysql_num_fields(res) (the same value is returned by
|
||||
mysql_stmt_num_fields)
|
||||
mysql_stmt_field_count())
|
||||
- fetch metadata for any column with mysql_fetch_field,
|
||||
mysql_fetch_field_direct, mysql_fetch_fields, mysql_field_seek.
|
||||
- free returned MYSQL_RES structure with mysql_free_result.
|
||||
|
|
@ -3257,11 +3257,12 @@ static void read_binary_time(MYSQL_TIME *tm, uchar **pos)
|
|||
tm->hour+= tm->day*24;
|
||||
tm->day= 0;
|
||||
}
|
||||
tm->time_type= MYSQL_TIMESTAMP_TIME;
|
||||
|
||||
*pos+= length;
|
||||
}
|
||||
else
|
||||
set_zero_time(tm);
|
||||
tm->time_type= MYSQL_TIMESTAMP_TIME;
|
||||
set_zero_time(tm, MYSQL_TIMESTAMP_TIME);
|
||||
}
|
||||
|
||||
static void read_binary_datetime(MYSQL_TIME *tm, uchar **pos)
|
||||
|
|
@ -3286,12 +3287,12 @@ static void read_binary_datetime(MYSQL_TIME *tm, uchar **pos)
|
|||
else
|
||||
tm->hour= tm->minute= tm->second= 0;
|
||||
tm->second_part= (length > 7) ? (ulong) sint4korr(to+7) : 0;
|
||||
tm->time_type= MYSQL_TIMESTAMP_DATETIME;
|
||||
|
||||
*pos+= length;
|
||||
}
|
||||
else
|
||||
set_zero_time(tm);
|
||||
tm->time_type= MYSQL_TIMESTAMP_DATETIME;
|
||||
set_zero_time(tm, MYSQL_TIMESTAMP_DATETIME);
|
||||
}
|
||||
|
||||
static void read_binary_date(MYSQL_TIME *tm, uchar **pos)
|
||||
|
|
@ -3308,12 +3309,12 @@ static void read_binary_date(MYSQL_TIME *tm, uchar **pos)
|
|||
tm->hour= tm->minute= tm->second= 0;
|
||||
tm->second_part= 0;
|
||||
tm->neg= 0;
|
||||
tm->time_type= MYSQL_TIMESTAMP_DATE;
|
||||
|
||||
*pos+= length;
|
||||
}
|
||||
else
|
||||
set_zero_time(tm);
|
||||
tm->time_type= MYSQL_TIMESTAMP_DATE;
|
||||
set_zero_time(tm, MYSQL_TIMESTAMP_DATE);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -3662,8 +3663,8 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
|
|||
case MYSQL_TYPE_INT24: /* mediumint is sent as 4 bytes int */
|
||||
case MYSQL_TYPE_LONG:
|
||||
{
|
||||
long value= sint4korr(*row);
|
||||
longlong data= field_is_unsigned ? (longlong) (unsigned long) value :
|
||||
int32 value= sint4korr(*row);
|
||||
longlong data= field_is_unsigned ? (longlong) (uint32) value :
|
||||
(longlong) value;
|
||||
fetch_long_with_conversion(param, field, data);
|
||||
*row+= 4;
|
||||
|
|
@ -3881,11 +3882,10 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
|
|||
|
||||
if (!bind_count)
|
||||
{
|
||||
if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE)
|
||||
{
|
||||
set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
int errorcode= (int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE ?
|
||||
CR_NO_PREPARE_STMT : CR_NO_STMT_METADATA;
|
||||
set_stmt_error(stmt, errorcode, unknown_sqlstate);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -4277,7 +4277,7 @@ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data)
|
|||
row+= (stmt->field_count+9)/8; /* skip null bits */
|
||||
bit= 4; /* first 2 bits are reserved */
|
||||
|
||||
/* Go throw all fields and calculate metadata */
|
||||
/* Go through all fields and calculate metadata */
|
||||
for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ;
|
||||
bind < end ;
|
||||
bind++, field++)
|
||||
|
|
@ -4412,6 +4412,12 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
|
|||
for (; tmp && row; --row, tmp= tmp->next)
|
||||
;
|
||||
stmt->data_cursor= tmp;
|
||||
if (!row && tmp)
|
||||
{
|
||||
/* Rewind the counter */
|
||||
stmt->read_row_func= stmt_read_row_buffered;
|
||||
stmt->state= MYSQL_STMT_EXECUTE_DONE;
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
|
|||
-DDATADIR="\"$(MYSQLDATAdir)\"" \
|
||||
-DSHAREDIR="\"$(MYSQLSHAREdir)\""
|
||||
INCLUDES= @MT_INCLUDES@ @bdb_includes@ -I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/sql -I$(top_srcdir)/regex \
|
||||
-I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples -I$(top_srcdir)/regex \
|
||||
$(openssl_includes) @ZLIB_INCLUDES@
|
||||
|
||||
noinst_LIBRARIES = libmysqld_int.a
|
||||
|
|
@ -35,6 +35,7 @@ SUBDIRS = . examples
|
|||
libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc
|
||||
libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
|
||||
my_time.c
|
||||
sqlexamplessources = ha_example.cc ha_archive.cc ha_tina.cc
|
||||
|
||||
noinst_HEADERS = embedded_priv.h emb_qcache.h
|
||||
|
||||
|
|
@ -59,7 +60,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
|
|||
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
|
||||
spatial.cc gstream.cc sql_help.cc tztime.cc
|
||||
|
||||
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
|
||||
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
|
||||
libmysqld_a_SOURCES=
|
||||
|
||||
# automake misses these
|
||||
|
|
@ -123,12 +124,16 @@ link_sources:
|
|||
rm -f $(srcdir)/$$f; \
|
||||
@LN_CP_F@ $(srcdir)/../libmysql/$$f $(srcdir)/$$f; \
|
||||
done; \
|
||||
for f in $(sqlexamplessources); do \
|
||||
rm -f $(srcdir)/$$f; \
|
||||
@LN_CP_F@ $(srcdir)/../sql/examples/$$f $(srcdir)/$$f; \
|
||||
done; \
|
||||
rm -f $(srcdir)/client_settings.h; \
|
||||
@LN_CP_F@ $(srcdir)/../libmysql/client_settings.h $(srcdir)/client_settings.h;
|
||||
|
||||
|
||||
clean-local:
|
||||
rm -f `echo $(sqlsources) $(libmysqlsources) | sed "s;\.lo;.c;g"` \
|
||||
rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) | sed "s;\.lo;.c;g"` \
|
||||
$(top_srcdir)/linked_libmysqld_sources; \
|
||||
rm -f client_settings.h
|
||||
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
|
|||
ftbw=(FTB_WORD *)alloc_root(&ftb->mem_root,
|
||||
sizeof(FTB_WORD) +
|
||||
(param.trunc ? MI_MAX_KEY_BUFF :
|
||||
w.len+extra));
|
||||
w.len*ftb->charset->mbmaxlen+extra));
|
||||
ftbw->len=w.len+1;
|
||||
ftbw->flags=0;
|
||||
ftbw->off=0;
|
||||
|
|
@ -348,7 +348,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
|
|||
FTB_EXPR *top_ftbe=ftbe->up->up;
|
||||
ftbw->docid[0]=HA_OFFSET_ERROR;
|
||||
for (ftbe=ftbw->up; ftbe != top_ftbe; ftbe=ftbe->up)
|
||||
if (ftbe->flags & FTB_FLAG_YES)
|
||||
if (!(ftbe->flags & FTB_FLAG_NO))
|
||||
ftbe->yweaks++;
|
||||
ftbe=0;
|
||||
break;
|
||||
|
|
@ -356,7 +356,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
|
|||
}
|
||||
if (!ftbe)
|
||||
continue;
|
||||
/* 3 */
|
||||
/* 4 */
|
||||
if (!is_tree_inited(& ftb->no_dupes))
|
||||
init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t),
|
||||
_ftb_no_dupes_cmp,0,0,0);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
#include "rt_index.h"
|
||||
|
||||
#ifndef USE_RAID
|
||||
#define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G)
|
||||
|
|
@ -1465,6 +1466,12 @@ static int writekeys(MI_CHECK *param, register MI_INFO *info, byte *buff,
|
|||
if (_mi_ft_add(info,i,(char*) key,buff,filepos))
|
||||
goto err;
|
||||
}
|
||||
else if (info->s->keyinfo[i].flag & HA_SPATIAL)
|
||||
{
|
||||
uint key_length=_mi_make_key(info,i,key,buff,filepos);
|
||||
if (rtree_insert(info, i, key, key_length))
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint key_length=_mi_make_key(info,i,key,buff,filepos);
|
||||
|
|
@ -3987,7 +3994,8 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows)
|
|||
key->seg->charset->mbmaxlen;
|
||||
key_maxlength+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN;
|
||||
}
|
||||
return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) &&
|
||||
return (key->flag & HA_SPATIAL) ||
|
||||
(key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) &&
|
||||
((ulonglong) rows * key_maxlength >
|
||||
(ulonglong) myisam_max_temp_length));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
/* Create a MyISAM table */
|
||||
|
||||
#include "fulltext.h"
|
||||
#include "ftdefs.h"
|
||||
#include "sp_defs.h"
|
||||
|
||||
#if defined(MSDOS) || defined(__WIN__)
|
||||
|
|
@ -41,7 +41,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
|||
File dfile,file;
|
||||
int errpos,save_errno;
|
||||
myf create_flag;
|
||||
uint fields,length,max_key_length,packed,pointer,
|
||||
uint fields,length,max_key_length,packed,pointer,real_length_diff,
|
||||
key_length,info_length,key_segs,options,min_key_length_skip,
|
||||
base_pos,varchar_count,long_varchar_count,varchar_length,
|
||||
max_key_block_length,unique_key_parts,fulltext_keys,offset;
|
||||
|
|
@ -238,7 +238,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
|||
{
|
||||
|
||||
share.state.key_root[i]= HA_OFFSET_ERROR;
|
||||
min_key_length_skip=length=0;
|
||||
min_key_length_skip=length=real_length_diff=0;
|
||||
key_length=pointer;
|
||||
if (keydef->flag & HA_SPATIAL)
|
||||
{
|
||||
|
|
@ -297,6 +297,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
|||
key_length+= HA_FT_MAXBYTELEN+HA_FT_WLEN;
|
||||
length++; /* At least one length byte */
|
||||
min_key_length_skip+=HA_FT_MAXBYTELEN;
|
||||
real_length_diff=HA_FT_MAXBYTELEN-FT_MAX_WORD_LEN_FOR_SORT;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -397,7 +398,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
|||
key_segs)
|
||||
share.state.rec_per_key_part[key_segs-1]=1L;
|
||||
length+=key_length;
|
||||
keydef->block_length= MI_BLOCK_SIZE(length,pointer,MI_MAX_KEYPTR_SIZE);
|
||||
keydef->block_length= MI_BLOCK_SIZE(length-real_length_diff,
|
||||
pointer,MI_MAX_KEYPTR_SIZE);
|
||||
if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH ||
|
||||
length >= MI_MAX_KEY_BUFF)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,8 +42,9 @@
|
|||
{ bits-=(bit+1); break; } \
|
||||
pos+= *pos
|
||||
|
||||
#define OFFSET_TABLE_SIZE 512
|
||||
|
||||
static void read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree,
|
||||
static uint read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree,
|
||||
uint16 **decode_table,byte **intervall_buff,
|
||||
uint16 *tmp_buff);
|
||||
static void make_quick_table(uint16 *to_table,uint16 *decode_table,
|
||||
|
|
@ -53,7 +54,7 @@ static void fill_quick_table(uint16 *table,uint bits, uint max_bits,
|
|||
uint value);
|
||||
static uint copy_decode_table(uint16 *to_pos,uint offset,
|
||||
uint16 *decode_table);
|
||||
static uint find_longest_bitstream(uint16 *table);
|
||||
static uint find_longest_bitstream(uint16 *table, uint16 *end);
|
||||
static void (*get_unpack_function(MI_COLUMNDEF *rec))(MI_COLUMNDEF *field,
|
||||
MI_BIT_BUFF *buff,
|
||||
uchar *to,
|
||||
|
|
@ -146,12 +147,12 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
|
|||
{
|
||||
if (!my_errno)
|
||||
my_errno=HA_ERR_END_OF_FILE;
|
||||
DBUG_RETURN(1);
|
||||
goto err0;
|
||||
}
|
||||
if (memcmp((byte*) header,(byte*) myisam_pack_file_magic,4))
|
||||
{
|
||||
my_errno=HA_ERR_WRONG_IN_RECORD;
|
||||
DBUG_RETURN(1);
|
||||
goto err0;
|
||||
}
|
||||
share->pack.header_length= uint4korr(header+4);
|
||||
share->min_pack_length=(uint) uint4korr(header+8);
|
||||
|
|
@ -173,20 +174,20 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
|
|||
my_malloc((uint) (trees*sizeof(MI_DECODE_TREE)+
|
||||
intervall_length*sizeof(byte)),
|
||||
MYF(MY_WME))))
|
||||
DBUG_RETURN(1);
|
||||
goto err0;
|
||||
intervall_buff=(byte*) (share->decode_trees+trees);
|
||||
|
||||
length=(uint) (elements*2+trees*(1 << myisam_quick_table_bits));
|
||||
if (!(share->decode_tables=(uint16*)
|
||||
my_malloc((length+512)*sizeof(uint16)+
|
||||
my_malloc((length+OFFSET_TABLE_SIZE)*sizeof(uint16)+
|
||||
(uint) (share->pack.header_length+7),
|
||||
MYF(MY_WME | MY_ZEROFILL))))
|
||||
{
|
||||
my_free((gptr) share->decode_trees,MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
goto err1;
|
||||
}
|
||||
tmp_buff=share->decode_tables+length;
|
||||
disk_cache=(byte*) (tmp_buff+512);
|
||||
disk_cache=(byte*) (tmp_buff+OFFSET_TABLE_SIZE);
|
||||
|
||||
if (my_read(file,disk_cache,
|
||||
(uint) (share->pack.header_length-sizeof(header)),
|
||||
|
|
@ -194,7 +195,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
|
|||
{
|
||||
my_free((gptr) share->decode_trees,MYF(0));
|
||||
my_free((gptr) share->decode_tables,MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
goto err2;
|
||||
}
|
||||
|
||||
huff_tree_bits=max_bit(trees ? trees-1 : 0);
|
||||
|
|
@ -213,8 +214,9 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
|
|||
skip_to_next_byte(&bit_buff);
|
||||
decode_table=share->decode_tables;
|
||||
for (i=0 ; i < trees ; i++)
|
||||
read_huff_table(&bit_buff,share->decode_trees+i,&decode_table,
|
||||
&intervall_buff,tmp_buff);
|
||||
if (read_huff_table(&bit_buff,share->decode_trees+i,&decode_table,
|
||||
&intervall_buff,tmp_buff))
|
||||
goto err3;
|
||||
decode_table=(uint16*)
|
||||
my_realloc((gptr) share->decode_tables,
|
||||
(uint) ((byte*) decode_table - (byte*) share->decode_tables),
|
||||
|
|
@ -224,8 +226,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
|
|||
share->decode_tables=decode_table;
|
||||
for (i=0 ; i < trees ; i++)
|
||||
share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table,
|
||||
diff,
|
||||
uint16*);
|
||||
diff, uint16*);
|
||||
}
|
||||
|
||||
/* Fix record-ref-length for keys */
|
||||
|
|
@ -242,19 +243,24 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
|
|||
}
|
||||
|
||||
if (bit_buff.error || bit_buff.pos < bit_buff.end)
|
||||
{ /* info_length was wrong */
|
||||
my_errno=HA_ERR_WRONG_IN_RECORD;
|
||||
my_free((gptr) share->decode_trees,MYF(0));
|
||||
my_free((gptr) share->decode_tables,MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
goto err3;
|
||||
|
||||
DBUG_RETURN(0);
|
||||
|
||||
err3:
|
||||
my_errno=HA_ERR_WRONG_IN_RECORD;
|
||||
err2:
|
||||
my_free((gptr) share->decode_tables,MYF(0));
|
||||
err1:
|
||||
my_free((gptr) share->decode_trees,MYF(0));
|
||||
err0:
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
|
||||
/* Read on huff-code-table from datafile */
|
||||
|
||||
static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree,
|
||||
static uint read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree,
|
||||
uint16 **decode_table, byte **intervall_buff,
|
||||
uint16 *tmp_buff)
|
||||
{
|
||||
|
|
@ -297,7 +303,9 @@ static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree,
|
|||
decode_tree->intervalls= *intervall_buff;
|
||||
if (! intervall_length)
|
||||
{
|
||||
table_bits=find_longest_bitstream(tmp_buff);
|
||||
table_bits=find_longest_bitstream(tmp_buff, tmp_buff+OFFSET_TABLE_SIZE);
|
||||
if (table_bits == (uint) ~0)
|
||||
return 1;
|
||||
if (table_bits > myisam_quick_table_bits)
|
||||
table_bits=myisam_quick_table_bits;
|
||||
next_free_offset= (1 << table_bits);
|
||||
|
|
@ -315,7 +323,7 @@ static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree,
|
|||
bit_buff->pos+=intervall_length;
|
||||
bit_buff->bits=0;
|
||||
}
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -390,15 +398,23 @@ static uint copy_decode_table(uint16 *to_pos, uint offset,
|
|||
}
|
||||
|
||||
|
||||
static uint find_longest_bitstream(uint16 *table)
|
||||
static uint find_longest_bitstream(uint16 *table, uint16 *end)
|
||||
{
|
||||
uint length=1,length2;
|
||||
if (!(*table & IS_CHAR))
|
||||
length=find_longest_bitstream(table+ *table)+1;
|
||||
{
|
||||
uint16 *next= table + *table;
|
||||
if (next > end || next == table)
|
||||
return ~0;
|
||||
length=find_longest_bitstream(next, end)+1;
|
||||
}
|
||||
table++;
|
||||
if (!(*table & IS_CHAR))
|
||||
{
|
||||
length2=find_longest_bitstream(table+ *table)+1;
|
||||
uint16 *next= table + *table;
|
||||
if (next > end || next == table)
|
||||
return ~0;
|
||||
length2=find_longest_bitstream(table+ *table, end)+1;
|
||||
length=max(length,length2);
|
||||
}
|
||||
return length;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
#endif
|
||||
|
||||
|
||||
const char *filename= "test3.MSI";
|
||||
const char *filename= "test3";
|
||||
uint tests=10,forks=10,key_cacheing=0,use_log=0;
|
||||
|
||||
static void get_options(int argc, char *argv[]);
|
||||
|
|
@ -363,7 +363,7 @@ int test_write(MI_INFO *file,int id,int lock_type)
|
|||
}
|
||||
|
||||
sprintf(record.id,"%7d",getpid());
|
||||
strmov(record.text,"Testing...");
|
||||
strnmov(record.text,"Testing...", sizeof(record.text));
|
||||
|
||||
tries=(uint) rnd(100)+10;
|
||||
for (i=count=0 ; i < tries ; i++)
|
||||
|
|
|
|||
|
|
@ -124,8 +124,8 @@ int mi_write(MI_INFO *info, byte *record)
|
|||
{
|
||||
if (local_lock_tree)
|
||||
rw_unlock(&share->key_root_lock[i]);
|
||||
DBUG_PRINT("error",("Got error: %d on write",my_errno));
|
||||
goto err;
|
||||
DBUG_PRINT("error",("Got error: %d on write",my_errno));
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
if (local_lock_tree)
|
||||
|
|
@ -159,18 +159,14 @@ int mi_write(MI_INFO *info, byte *record)
|
|||
|
||||
err:
|
||||
save_errno=my_errno;
|
||||
if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL)
|
||||
if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL ||
|
||||
my_errno == HA_ERR_NULL_IN_SPATIAL)
|
||||
{
|
||||
if (info->bulk_insert)
|
||||
{
|
||||
uint j;
|
||||
for (j=0 ; j < share->base.keys ; j++)
|
||||
{
|
||||
if (is_tree_inited(&info->bulk_insert[j]))
|
||||
{
|
||||
reset_tree(&info->bulk_insert[j]);
|
||||
}
|
||||
}
|
||||
mi_flush_bulk_insert(info, j);
|
||||
}
|
||||
info->errkey= (int) i;
|
||||
while ( i-- > 0)
|
||||
|
|
@ -329,7 +325,7 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
|
|||
uchar *temp_buff,*keypos;
|
||||
uchar keybuff[MI_MAX_KEY_BUFF];
|
||||
my_bool was_last_key;
|
||||
my_off_t next_page;
|
||||
my_off_t next_page, dupp_key_pos;
|
||||
DBUG_ENTER("w_search");
|
||||
DBUG_PRINT("enter",("page: %ld",page));
|
||||
|
||||
|
|
@ -349,9 +345,9 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
|
|||
/* get position to record with duplicated key */
|
||||
tmp_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,keybuff);
|
||||
if (tmp_key_length)
|
||||
info->dupp_key_pos=_mi_dpos(info,0,keybuff+tmp_key_length);
|
||||
dupp_key_pos=_mi_dpos(info,0,keybuff+tmp_key_length);
|
||||
else
|
||||
info->dupp_key_pos= HA_OFFSET_ERROR;
|
||||
dupp_key_pos= HA_OFFSET_ERROR;
|
||||
if (keyinfo->flag & HA_FULLTEXT)
|
||||
{
|
||||
uint off;
|
||||
|
|
@ -370,7 +366,7 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
|
|||
else
|
||||
{
|
||||
/* popular word. two-level tree. going down */
|
||||
my_off_t root=info->dupp_key_pos;
|
||||
my_off_t root=dupp_key_pos;
|
||||
keyinfo=&info->s->ft2_keyinfo;
|
||||
get_key_full_length_rdonly(off, key);
|
||||
key+=off;
|
||||
|
|
@ -389,6 +385,7 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
|
|||
}
|
||||
else /* not HA_FULLTEXT, normal HA_NOSAME key */
|
||||
{
|
||||
info->dupp_key_pos= dupp_key_pos;
|
||||
my_afree((byte*) temp_buff);
|
||||
my_errno=HA_ERR_FOUND_DUPP_KEY;
|
||||
DBUG_RETURN(-1);
|
||||
|
|
|
|||
|
|
@ -710,7 +710,8 @@ err1:
|
|||
|
||||
int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length)
|
||||
{
|
||||
return (rtree_insert_level(info, keynr, key, key_length, -1) == -1) ? -1 : 0;
|
||||
return (!key_length ||
|
||||
(rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ? -1 : 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,9 @@ static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info,
|
|||
IO_CACHE *to_file,
|
||||
char* key, uint sort_length,
|
||||
uint count);
|
||||
inline int my_var_write(MI_SORT_PARAM *info,IO_CACHE *to_file, byte *bufs);
|
||||
static inline int
|
||||
my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs);
|
||||
|
||||
/*
|
||||
Creates a index of sorted keys
|
||||
|
||||
|
|
@ -625,7 +627,8 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys,
|
|||
} /* write_keys */
|
||||
|
||||
|
||||
inline int my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs)
|
||||
static inline int
|
||||
my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs)
|
||||
{
|
||||
int err;
|
||||
uint16 len = _mi_keylength(info->keyinfo, (uchar*) bufs);
|
||||
|
|
|
|||
|
|
@ -50,6 +50,11 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
|
|||
|
||||
dlen = _mi_calc_blob_length(keyseg->bit_start, pos);
|
||||
memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*));
|
||||
if (!dptr)
|
||||
{
|
||||
my_errno= HA_ERR_NULL_IN_SPATIAL;
|
||||
return 0;
|
||||
}
|
||||
sp_mbr_from_wkb(dptr + 4, dlen - 4, SPDIMS, mbr); /* SRID */
|
||||
|
||||
for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ CLEANFILES = $(test_SCRIPTS) $(test_DATA)
|
|||
INCLUDES = -I$(srcdir)/../include -I../include -I..
|
||||
EXTRA_PROGRAMS = mysql_test_run_new
|
||||
noinst_HEADERS = my_manage.h
|
||||
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c
|
||||
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c
|
||||
|
||||
|
||||
dist-hook:
|
||||
|
|
|
|||
58
mysql-test/include/ctype_common.inc
Normal file
58
mysql-test/include/ctype_common.inc
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#
|
||||
# Common tests for all character sets and collations.
|
||||
# Include this file from a test with @test_characrer_set
|
||||
# and @test_collation set to desired values.
|
||||
#
|
||||
# Please don't use SHOW CREATE TABLE in this file,
|
||||
# we want it to be HANDLER independent. You can
|
||||
# use SHOW FULL COLUMNS instead.
|
||||
#
|
||||
# Please surround all CREATE TABLE with --disable_warnings
|
||||
# and --enable_warnings to be able to set storage_engine
|
||||
# without having to check if the hanlder exists.
|
||||
|
||||
SET @safe_character_set_server= @@character_set_server;
|
||||
SET @safe_collation_server= @@collation_server;
|
||||
SET character_set_server= @test_character_set;
|
||||
SET collation_server= @test_collation;
|
||||
CREATE DATABASE d1;
|
||||
USE d1;
|
||||
|
||||
#
|
||||
# Bug 1883: LIKE did not work in some cases with a key.
|
||||
#
|
||||
--disable_warnings
|
||||
CREATE TABLE t1 (c CHAR(10), KEY(c));
|
||||
--enable_warnings
|
||||
# check the column was created with the expected charset/collation
|
||||
--replace_result select,insert,update,references ""
|
||||
SHOW FULL COLUMNS FROM t1;
|
||||
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
|
||||
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug 6643 incorrect response with partial utf8 index
|
||||
#
|
||||
--disable_warnings
|
||||
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
|
||||
--enable_warnings
|
||||
# check the column was created with the expected charset/collation
|
||||
--replace_result select,insert,update,references ""
|
||||
SHOW FULL COLUMNS FROM t1;
|
||||
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
|
||||
SELECT c1 as want3results from t1 where c1 like 'l%';
|
||||
SELECT c1 as want3results from t1 where c1 like 'lo%';
|
||||
SELECT c1 as want1result from t1 where c1 like 'loc%';
|
||||
SELECT c1 as want1result from t1 where c1 like 'loca%';
|
||||
SELECT c1 as want1result from t1 where c1 like 'locat%';
|
||||
SELECT c1 as want1result from t1 where c1 like 'locati%';
|
||||
SELECT c1 as want1result from t1 where c1 like 'locatio%';
|
||||
SELECT c1 as want1result from t1 where c1 like 'location%';
|
||||
DROP TABLE t1;
|
||||
|
||||
DROP DATABASE d1;
|
||||
# Restore settings
|
||||
USE test;
|
||||
SET character_set_server= @safe_character_set_server;
|
||||
SET collation_server= @safe_collation_server;
|
||||
7
mysql-test/include/endspace.inc
Normal file
7
mysql-test/include/endspace.inc
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
|
||||
select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a';
|
||||
select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
|
||||
select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
|
||||
select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
|
||||
select 'a a' > 'a', 'a \0' < 'a';
|
||||
select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a';
|
||||
646
mysql-test/my_create_tables.c
Normal file
646
mysql-test/my_create_tables.c
Normal file
|
|
@ -0,0 +1,646 @@
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#ifndef __WIN__
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#ifdef __NETWARE__
|
||||
#include <screen.h>
|
||||
#include <proc.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#ifndef __WIN__
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <direct.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include "my_manage.h"
|
||||
|
||||
/*
|
||||
Synopsis:
|
||||
This function testes a exist file
|
||||
|
||||
Arguments:
|
||||
mdata: path to data
|
||||
file_name: name of file
|
||||
Output:
|
||||
A zero value indicates that file is exist.
|
||||
*/
|
||||
bool test_sys_file(const char *mdata,const char *file_name)
|
||||
{
|
||||
struct stat file;
|
||||
char path_file_name[PATH_MAX];
|
||||
snprintf(path_file_name, PATH_MAX, "%s/%s", mdata, file_name);
|
||||
return(stat(path_file_name,&file));
|
||||
}
|
||||
|
||||
/*
|
||||
Synopsis:
|
||||
This function creates a file with sql requstes for creating
|
||||
system data files.
|
||||
|
||||
Arguments:
|
||||
mdata: path to data
|
||||
output_file: file name for output file
|
||||
test: to create system files with test data
|
||||
Output:
|
||||
A zero value indicates a success.
|
||||
*/
|
||||
bool create_system_files(const char *mdata,const char *output_file, bool test)
|
||||
{
|
||||
FILE *out;
|
||||
|
||||
out = fopen(output_file, "w+");
|
||||
|
||||
if (!out)
|
||||
return 1;
|
||||
|
||||
if (test_sys_file(mdata,"mysql"))
|
||||
{
|
||||
fprintf(out,"CREATE DATABASE mysql;\n");
|
||||
}
|
||||
|
||||
if (test && test_sys_file(mdata,"test"))
|
||||
{
|
||||
fprintf(out,"CREATE DATABASE test;\n");
|
||||
}
|
||||
|
||||
fprintf(out,"USE mysql;\n");
|
||||
|
||||
if (test_sys_file(mdata,"mysql/db.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE db ("
|
||||
"Host char(60) binary DEFAULT '' NOT NULL,"
|
||||
"Db char(64) binary DEFAULT '' NOT NULL,"
|
||||
"User char(16) binary DEFAULT '' NOT NULL,"
|
||||
"Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"PRIMARY KEY Host (Host,Db,User),"
|
||||
"KEY User (User))"
|
||||
"comment='Database privileges';\n");
|
||||
|
||||
if (test)
|
||||
{
|
||||
fprintf(out,"INSERT INTO db VALUES ('%%','test','','Y','Y','Y','Y'"
|
||||
",'Y','Y','N','Y','Y','Y','Y','Y');\n");
|
||||
fprintf(out,"INSERT INTO db VALUES ('%%','test\\_%%','','Y','Y','Y'"
|
||||
",'Y','Y','Y','N','Y','Y','Y','Y','Y');\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (test_sys_file(mdata,"mysql/host.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE host ("
|
||||
"Host char(60) binary DEFAULT '' NOT NULL,"
|
||||
"Db char(64) binary DEFAULT '' NOT NULL,"
|
||||
"Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"PRIMARY KEY Host (Host,Db))"
|
||||
"comment='Host privileges;"
|
||||
" Merged with database privileges';\n");
|
||||
}
|
||||
|
||||
if (test_sys_file(mdata,"mysql/user.frm"))
|
||||
{
|
||||
#ifdef __WIN__
|
||||
WSADATA wsa_data;
|
||||
#endif
|
||||
char hostname[FN_REFLEN];
|
||||
|
||||
#ifdef __WIN__
|
||||
if (WSAStartup(MAKEWORD( 2, 2 ),&wsa_data))
|
||||
return 1;
|
||||
#endif
|
||||
if (gethostname(hostname, FN_REFLEN))
|
||||
return 1;
|
||||
#ifdef __WIN__
|
||||
WSACleanup( );
|
||||
#endif
|
||||
|
||||
if (strchr(hostname, '.') == NULL)
|
||||
strcat(hostname, "%");
|
||||
|
||||
fprintf(out,
|
||||
"CREATE TABLE user ("
|
||||
"Host char(60) binary DEFAULT '' NOT NULL,"
|
||||
"User char(16) binary DEFAULT '' NOT NULL,"
|
||||
"Password char(41) binary DEFAULT '' NOT NULL,"
|
||||
"Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"File_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"References_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
"ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,"
|
||||
"ssl_cipher BLOB NOT NULL,"
|
||||
"x509_issuer BLOB NOT NULL,"
|
||||
"x509_subject BLOB NOT NULL,"
|
||||
"max_questions int(11) unsigned DEFAULT 0 NOT NULL,"
|
||||
"max_updates int(11) unsigned DEFAULT 0 NOT NULL,"
|
||||
"max_connections int(11) unsigned DEFAULT 0 NOT NULL,"
|
||||
"PRIMARY KEY Host (Host,User)"
|
||||
") comment='Users and global privileges';\n");
|
||||
|
||||
if (test)
|
||||
{
|
||||
fprintf(out,
|
||||
"INSERT INTO user VALUES ('localhost','root',''"
|
||||
",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'"
|
||||
",'Y','Y','Y','Y','Y','','','','',0,0,0);\n");
|
||||
fprintf(out,
|
||||
"INSERT INTO user VALUES ('%s','root','','Y','Y',"
|
||||
"'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"
|
||||
"'Y','Y','Y','Y','','','','',0,0,0);\n",hostname);
|
||||
fprintf(out,
|
||||
"REPLACE INTO user VALUES ('127.0.0.1','root','',"
|
||||
"'Y','Y','Y','Y','Y','Y',"
|
||||
"'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'"
|
||||
",'Y','','','','',0,0,0);\n");
|
||||
fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n");
|
||||
fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(out,
|
||||
"INSERT INTO user VALUES ('localhost','root','',"
|
||||
"'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y',"
|
||||
"'Y','Y','Y','Y','','','','',0,0,0);\n");
|
||||
#ifndef __WIN__
|
||||
fprintf(out,
|
||||
"INSERT INTO user VALUES ('%s','root','','Y','Y',"
|
||||
"'Y','Y','Y','Y','Y','Y'"
|
||||
"'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','',''"
|
||||
",'','',0,0,0);\n",hostname);
|
||||
fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname);
|
||||
fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n");
|
||||
#else
|
||||
fprintf(out,
|
||||
"INSERT INTO user VALUES ('localhost','','','Y','Y','Y'"
|
||||
",'Y','Y','Y','Y','Y','Y'"
|
||||
",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','',"
|
||||
"'','',0,0,0);\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (test_sys_file(mdata,"mysql/func.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE func ("
|
||||
"name char(64) binary DEFAULT '' NOT NULL,"
|
||||
"ret tinyint(1) DEFAULT '0' NOT NULL,"
|
||||
"dl char(128) DEFAULT '' NOT NULL,"
|
||||
"type enum ('function','aggregate') NOT NULL,"
|
||||
"PRIMARY KEY (name)"
|
||||
") comment='User defined functions';\n");
|
||||
}
|
||||
|
||||
if (test_sys_file(mdata,"mysql/tables_priv.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE tables_priv ("
|
||||
"Host char(60) binary DEFAULT '' NOT NULL,"
|
||||
"Db char(64) binary DEFAULT '' NOT NULL,"
|
||||
"User char(16) binary DEFAULT '' NOT NULL,"
|
||||
"Table_name char(64) binary DEFAULT '' NOT NULL,"
|
||||
"Grantor char(77) DEFAULT '' NOT NULL,"
|
||||
"Timestamp timestamp(14),"
|
||||
"Table_priv set('Select','Insert','Update','Delete',"
|
||||
"'Create','Drop','Grant','References','Index','Alter')"
|
||||
" DEFAULT '' NOT NULL,"
|
||||
"Column_priv set('Select','Insert','Update','References')"
|
||||
" DEFAULT '' NOT NULL,"
|
||||
"PRIMARY KEY (Host,Db,User,Table_name),"
|
||||
"KEY Grantor (Grantor)"
|
||||
") comment='Table privileges';\n");
|
||||
}
|
||||
|
||||
if (test_sys_file(mdata,"mysql/columns_priv.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE columns_priv ("
|
||||
"Host char(60) binary DEFAULT '' NOT NULL,"
|
||||
"Db char(64) binary DEFAULT '' NOT NULL,"
|
||||
"User char(16) binary DEFAULT '' NOT NULL,"
|
||||
"Table_name char(64) binary DEFAULT '' NOT NULL,"
|
||||
"Column_name char(64) binary DEFAULT '' NOT NULL,"
|
||||
"Timestamp timestamp(14),"
|
||||
"Column_priv set('Select','Insert','Update','References')"
|
||||
" DEFAULT '' NOT NULL,"
|
||||
"PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
|
||||
") comment='Column privileges';\n");
|
||||
}
|
||||
|
||||
if (test_sys_file(mdata,"mysql/help_topic.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE help_topic ("
|
||||
"help_topic_id int unsigned not null,"
|
||||
"name varchar(64) not null,"
|
||||
"help_category_id smallint unsigned not null,"
|
||||
"description text not null,"
|
||||
"example text not null,"
|
||||
"url varchar(128) not null,"
|
||||
"primary key (help_topic_id),"
|
||||
"unique index (name)"
|
||||
") comment='help topics';\n");
|
||||
}
|
||||
|
||||
if (test_sys_file(mdata,"mysql/help_category.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE help_category ("
|
||||
"help_category_id smallint unsigned not null,"
|
||||
"name varchar(64) not null,"
|
||||
"parent_category_id smallint unsigned null,"
|
||||
"url varchar(128) not null,"
|
||||
"primary key (help_category_id),"
|
||||
"unique index (name)"
|
||||
") comment='help categories';\n");
|
||||
}
|
||||
|
||||
if (test_sys_file(mdata,"mysql/help_keyword.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE help_keyword ("
|
||||
"help_keyword_id int unsigned not null,"
|
||||
"name varchar(64) not null,"
|
||||
"primary key (help_keyword_id),"
|
||||
"unique index (name)"
|
||||
") comment='help keywords';\n");
|
||||
}
|
||||
|
||||
if (test_sys_file(mdata,"mysql/help_relation.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE help_relation ("
|
||||
"help_topic_id int unsigned not null references help_topic,"
|
||||
"help_keyword_id int unsigned not null references help_keyword,"
|
||||
"primary key (help_keyword_id, help_topic_id)"
|
||||
") comment='keyword-topic relation';\n");
|
||||
}
|
||||
|
||||
if (test_sys_file(mdata,"mysql/time_zone_name.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE time_zone_name ("
|
||||
"Name char(64) NOT NULL,"
|
||||
"Time_zone_id int unsigned NOT NULL,"
|
||||
"PRIMARY KEY Name (Name)"
|
||||
") DEFAULT CHARACTER SET latin1 "
|
||||
"comment='Time zone names';\n");
|
||||
|
||||
if (test)
|
||||
{
|
||||
fprintf(out,
|
||||
"INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES"
|
||||
"('MET', 1), ('UTC', 2), ('Universal', 2), "
|
||||
"('Europe/Moscow',3), ('leap/Europe/Moscow',4);\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (test_sys_file(mdata,"mysql/time_zone.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE time_zone ("
|
||||
"Time_zone_id int unsigned NOT NULL auto_increment,"
|
||||
"Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,"
|
||||
"PRIMARY KEY TzId (Time_zone_id)"
|
||||
") DEFAULT CHARACTER SET latin1 "
|
||||
"comment='Time zones';\n");
|
||||
|
||||
if (test)
|
||||
{
|
||||
fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)"
|
||||
"VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (test_sys_file(mdata,"mysql/time_zone_transition.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE time_zone_transition ("
|
||||
"Time_zone_id int unsigned NOT NULL,"
|
||||
"Transition_time bigint signed NOT NULL,"
|
||||
"Transition_type_id int unsigned NOT NULL,"
|
||||
"PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)"
|
||||
") DEFAULT CHARACTER SET latin1 "
|
||||
"comment='Time zone transitions';\n");
|
||||
|
||||
if (test)
|
||||
{
|
||||
fprintf(out,
|
||||
"INSERT INTO time_zone_transition"
|
||||
"(Time_zone_id, Transition_time, Transition_type_id)"
|
||||
"VALUES"
|
||||
" (1, -1693706400, 0) ,(1, -1680483600, 1)"
|
||||
",(1, -1663455600, 2) ,(1, -1650150000, 3)"
|
||||
",(1, -1632006000, 2) ,(1, -1618700400, 3)"
|
||||
",(1, -938905200, 2) ,(1, -857257200, 3)"
|
||||
",(1, -844556400, 2) ,(1, -828226800, 3)"
|
||||
",(1, -812502000, 2) ,(1, -796777200, 3)"
|
||||
",(1, 228877200, 2) ,(1, 243997200, 3)"
|
||||
",(1, 260326800, 2) ,(1, 276051600, 3)"
|
||||
",(1, 291776400, 2) ,(1, 307501200, 3)"
|
||||
",(1, 323830800, 2) ,(1, 338950800, 3)"
|
||||
",(1, 354675600, 2) ,(1, 370400400, 3)"
|
||||
",(1, 386125200, 2) ,(1, 401850000, 3)"
|
||||
",(1, 417574800, 2) ,(1, 433299600, 3)"
|
||||
",(1, 449024400, 2) ,(1, 465354000, 3)"
|
||||
",(1, 481078800, 2) ,(1, 496803600, 3)"
|
||||
",(1, 512528400, 2) ,(1, 528253200, 3)"
|
||||
",(1, 543978000, 2) ,(1, 559702800, 3)"
|
||||
",(1, 575427600, 2) ,(1, 591152400, 3)"
|
||||
",(1, 606877200, 2) ,(1, 622602000, 3)"
|
||||
",(1, 638326800, 2) ,(1, 654656400, 3)"
|
||||
",(1, 670381200, 2) ,(1, 686106000, 3)"
|
||||
",(1, 701830800, 2) ,(1, 717555600, 3)"
|
||||
",(1, 733280400, 2) ,(1, 749005200, 3)"
|
||||
",(1, 764730000, 2) ,(1, 780454800, 3)"
|
||||
",(1, 796179600, 2) ,(1, 811904400, 3)"
|
||||
",(1, 828234000, 2) ,(1, 846378000, 3)"
|
||||
",(1, 859683600, 2) ,(1, 877827600, 3)"
|
||||
",(1, 891133200, 2) ,(1, 909277200, 3)"
|
||||
",(1, 922582800, 2) ,(1, 941331600, 3)"
|
||||
",(1, 954032400, 2) ,(1, 972781200, 3)"
|
||||
",(1, 985482000, 2) ,(1, 1004230800, 3)"
|
||||
",(1, 1017536400, 2) ,(1, 1035680400, 3)"
|
||||
",(1, 1048986000, 2) ,(1, 1067130000, 3)"
|
||||
",(1, 1080435600, 2) ,(1, 1099184400, 3)"
|
||||
",(1, 1111885200, 2) ,(1, 1130634000, 3)"
|
||||
",(1, 1143334800, 2) ,(1, 1162083600, 3)"
|
||||
",(1, 1174784400, 2) ,(1, 1193533200, 3)"
|
||||
",(1, 1206838800, 2) ,(1, 1224982800, 3)"
|
||||
",(1, 1238288400, 2) ,(1, 1256432400, 3)"
|
||||
",(1, 1269738000, 2) ,(1, 1288486800, 3)"
|
||||
",(1, 1301187600, 2) ,(1, 1319936400, 3)"
|
||||
",(1, 1332637200, 2) ,(1, 1351386000, 3)"
|
||||
",(1, 1364691600, 2) ,(1, 1382835600, 3)"
|
||||
",(1, 1396141200, 2) ,(1, 1414285200, 3)"
|
||||
",(1, 1427590800, 2) ,(1, 1445734800, 3)"
|
||||
",(1, 1459040400, 2) ,(1, 1477789200, 3)"
|
||||
",(1, 1490490000, 2) ,(1, 1509238800, 3)"
|
||||
",(1, 1521939600, 2) ,(1, 1540688400, 3)"
|
||||
",(1, 1553994000, 2) ,(1, 1572138000, 3)"
|
||||
",(1, 1585443600, 2) ,(1, 1603587600, 3)"
|
||||
",(1, 1616893200, 2) ,(1, 1635642000, 3)"
|
||||
",(1, 1648342800, 2) ,(1, 1667091600, 3)"
|
||||
",(1, 1679792400, 2) ,(1, 1698541200, 3)"
|
||||
",(1, 1711846800, 2) ,(1, 1729990800, 3)"
|
||||
",(1, 1743296400, 2) ,(1, 1761440400, 3)"
|
||||
",(1, 1774746000, 2) ,(1, 1792890000, 3)"
|
||||
",(1, 1806195600, 2) ,(1, 1824944400, 3)"
|
||||
",(1, 1837645200, 2) ,(1, 1856394000, 3)"
|
||||
",(1, 1869094800, 2) ,(1, 1887843600, 3)"
|
||||
",(1, 1901149200, 2) ,(1, 1919293200, 3)"
|
||||
",(1, 1932598800, 2) ,(1, 1950742800, 3)"
|
||||
",(1, 1964048400, 2) ,(1, 1982797200, 3)"
|
||||
",(1, 1995498000, 2) ,(1, 2014246800, 3)"
|
||||
",(1, 2026947600, 2) ,(1, 2045696400, 3)"
|
||||
",(1, 2058397200, 2) ,(1, 2077146000, 3)"
|
||||
",(1, 2090451600, 2) ,(1, 2108595600, 3)"
|
||||
",(1, 2121901200, 2) ,(1, 2140045200, 3)"
|
||||
",(3, -1688265000, 2) ,(3, -1656819048, 1)"
|
||||
",(3, -1641353448, 2) ,(3, -1627965048, 3)"
|
||||
",(3, -1618716648, 1) ,(3, -1596429048, 3)"
|
||||
",(3, -1593829848, 5) ,(3, -1589860800, 4)"
|
||||
",(3, -1542427200, 5) ,(3, -1539493200, 6)"
|
||||
",(3, -1525323600, 5) ,(3, -1522728000, 4)"
|
||||
",(3, -1491188400, 7) ,(3, -1247536800, 4)"
|
||||
",(3, 354920400, 5) ,(3, 370728000, 4)"
|
||||
",(3, 386456400, 5) ,(3, 402264000, 4)"
|
||||
",(3, 417992400, 5) ,(3, 433800000, 4)"
|
||||
",(3, 449614800, 5) ,(3, 465346800, 8)"
|
||||
",(3, 481071600, 9) ,(3, 496796400, 8)"
|
||||
",(3, 512521200, 9) ,(3, 528246000, 8)"
|
||||
",(3, 543970800, 9) ,(3, 559695600, 8)"
|
||||
",(3, 575420400, 9) ,(3, 591145200, 8)"
|
||||
",(3, 606870000, 9) ,(3, 622594800, 8)"
|
||||
",(3, 638319600, 9) ,(3, 654649200, 8)"
|
||||
",(3, 670374000, 10) ,(3, 686102400, 11)"
|
||||
",(3, 695779200, 8) ,(3, 701812800, 5)"
|
||||
",(3, 717534000, 4) ,(3, 733273200, 9)"
|
||||
",(3, 748998000, 8) ,(3, 764722800, 9)"
|
||||
",(3, 780447600, 8) ,(3, 796172400, 9)"
|
||||
",(3, 811897200, 8) ,(3, 828226800, 9)"
|
||||
",(3, 846370800, 8) ,(3, 859676400, 9)"
|
||||
",(3, 877820400, 8) ,(3, 891126000, 9)"
|
||||
",(3, 909270000, 8) ,(3, 922575600, 9)"
|
||||
",(3, 941324400, 8) ,(3, 954025200, 9)"
|
||||
",(3, 972774000, 8) ,(3, 985474800, 9)"
|
||||
",(3, 1004223600, 8) ,(3, 1017529200, 9)"
|
||||
",(3, 1035673200, 8) ,(3, 1048978800, 9)"
|
||||
",(3, 1067122800, 8) ,(3, 1080428400, 9)"
|
||||
",(3, 1099177200, 8) ,(3, 1111878000, 9)"
|
||||
",(3, 1130626800, 8) ,(3, 1143327600, 9)"
|
||||
",(3, 1162076400, 8) ,(3, 1174777200, 9)"
|
||||
",(3, 1193526000, 8) ,(3, 1206831600, 9)"
|
||||
",(3, 1224975600, 8) ,(3, 1238281200, 9)"
|
||||
",(3, 1256425200, 8) ,(3, 1269730800, 9)"
|
||||
",(3, 1288479600, 8) ,(3, 1301180400, 9)"
|
||||
",(3, 1319929200, 8) ,(3, 1332630000, 9)"
|
||||
",(3, 1351378800, 8) ,(3, 1364684400, 9)"
|
||||
",(3, 1382828400, 8) ,(3, 1396134000, 9)"
|
||||
",(3, 1414278000, 8) ,(3, 1427583600, 9)"
|
||||
",(3, 1445727600, 8) ,(3, 1459033200, 9)"
|
||||
",(3, 1477782000, 8) ,(3, 1490482800, 9)"
|
||||
",(3, 1509231600, 8) ,(3, 1521932400, 9)"
|
||||
",(3, 1540681200, 8) ,(3, 1553986800, 9)"
|
||||
",(3, 1572130800, 8) ,(3, 1585436400, 9)"
|
||||
",(3, 1603580400, 8) ,(3, 1616886000, 9)"
|
||||
",(3, 1635634800, 8) ,(3, 1648335600, 9)"
|
||||
",(3, 1667084400, 8) ,(3, 1679785200, 9)"
|
||||
",(3, 1698534000, 8) ,(3, 1711839600, 9)"
|
||||
",(3, 1729983600, 8) ,(3, 1743289200, 9)"
|
||||
",(3, 1761433200, 8) ,(3, 1774738800, 9)"
|
||||
",(3, 1792882800, 8) ,(3, 1806188400, 9)"
|
||||
",(3, 1824937200, 8) ,(3, 1837638000, 9)"
|
||||
",(3, 1856386800, 8) ,(3, 1869087600, 9)"
|
||||
",(3, 1887836400, 8) ,(3, 1901142000, 9)"
|
||||
",(3, 1919286000, 8) ,(3, 1932591600, 9)"
|
||||
",(3, 1950735600, 8) ,(3, 1964041200, 9)"
|
||||
",(3, 1982790000, 8) ,(3, 1995490800, 9)"
|
||||
",(3, 2014239600, 8) ,(3, 2026940400, 9)"
|
||||
",(3, 2045689200, 8) ,(3, 2058390000, 9)"
|
||||
",(3, 2077138800, 8) ,(3, 2090444400, 9)"
|
||||
",(3, 2108588400, 8) ,(3, 2121894000, 9)"
|
||||
",(3, 2140038000, 8)"
|
||||
",(4, -1688265000, 2) ,(4, -1656819048, 1)"
|
||||
",(4, -1641353448, 2) ,(4, -1627965048, 3)"
|
||||
",(4, -1618716648, 1) ,(4, -1596429048, 3)"
|
||||
",(4, -1593829848, 5) ,(4, -1589860800, 4)"
|
||||
",(4, -1542427200, 5) ,(4, -1539493200, 6)"
|
||||
",(4, -1525323600, 5) ,(4, -1522728000, 4)"
|
||||
",(4, -1491188400, 7) ,(4, -1247536800, 4)"
|
||||
",(4, 354920409, 5) ,(4, 370728010, 4)"
|
||||
",(4, 386456410, 5) ,(4, 402264011, 4)"
|
||||
",(4, 417992411, 5) ,(4, 433800012, 4)"
|
||||
",(4, 449614812, 5) ,(4, 465346812, 8)"
|
||||
",(4, 481071612, 9) ,(4, 496796413, 8)"
|
||||
",(4, 512521213, 9) ,(4, 528246013, 8)"
|
||||
",(4, 543970813, 9) ,(4, 559695613, 8)"
|
||||
",(4, 575420414, 9) ,(4, 591145214, 8)"
|
||||
",(4, 606870014, 9) ,(4, 622594814, 8)"
|
||||
",(4, 638319615, 9) ,(4, 654649215, 8)"
|
||||
",(4, 670374016, 10) ,(4, 686102416, 11)"
|
||||
",(4, 695779216, 8) ,(4, 701812816, 5)"
|
||||
",(4, 717534017, 4) ,(4, 733273217, 9)"
|
||||
",(4, 748998018, 8) ,(4, 764722818, 9)"
|
||||
",(4, 780447619, 8) ,(4, 796172419, 9)"
|
||||
",(4, 811897219, 8) ,(4, 828226820, 9)"
|
||||
",(4, 846370820, 8) ,(4, 859676420, 9)"
|
||||
",(4, 877820421, 8) ,(4, 891126021, 9)"
|
||||
",(4, 909270021, 8) ,(4, 922575622, 9)"
|
||||
",(4, 941324422, 8) ,(4, 954025222, 9)"
|
||||
",(4, 972774022, 8) ,(4, 985474822, 9)"
|
||||
",(4, 1004223622, 8) ,(4, 1017529222, 9)"
|
||||
",(4, 1035673222, 8) ,(4, 1048978822, 9)"
|
||||
",(4, 1067122822, 8) ,(4, 1080428422, 9)"
|
||||
",(4, 1099177222, 8) ,(4, 1111878022, 9)"
|
||||
",(4, 1130626822, 8) ,(4, 1143327622, 9)"
|
||||
",(4, 1162076422, 8) ,(4, 1174777222, 9)"
|
||||
",(4, 1193526022, 8) ,(4, 1206831622, 9)"
|
||||
",(4, 1224975622, 8) ,(4, 1238281222, 9)"
|
||||
",(4, 1256425222, 8) ,(4, 1269730822, 9)"
|
||||
",(4, 1288479622, 8) ,(4, 1301180422, 9)"
|
||||
",(4, 1319929222, 8) ,(4, 1332630022, 9)"
|
||||
",(4, 1351378822, 8) ,(4, 1364684422, 9)"
|
||||
",(4, 1382828422, 8) ,(4, 1396134022, 9)"
|
||||
",(4, 1414278022, 8) ,(4, 1427583622, 9)"
|
||||
",(4, 1445727622, 8) ,(4, 1459033222, 9)"
|
||||
",(4, 1477782022, 8) ,(4, 1490482822, 9)"
|
||||
",(4, 1509231622, 8) ,(4, 1521932422, 9)"
|
||||
",(4, 1540681222, 8) ,(4, 1553986822, 9)"
|
||||
",(4, 1572130822, 8) ,(4, 1585436422, 9)"
|
||||
",(4, 1603580422, 8) ,(4, 1616886022, 9)"
|
||||
",(4, 1635634822, 8) ,(4, 1648335622, 9)"
|
||||
",(4, 1667084422, 8) ,(4, 1679785222, 9)"
|
||||
",(4, 1698534022, 8) ,(4, 1711839622, 9)"
|
||||
",(4, 1729983622, 8) ,(4, 1743289222, 9)"
|
||||
",(4, 1761433222, 8) ,(4, 1774738822, 9)"
|
||||
",(4, 1792882822, 8) ,(4, 1806188422, 9)"
|
||||
",(4, 1824937222, 8) ,(4, 1837638022, 9)"
|
||||
",(4, 1856386822, 8) ,(4, 1869087622, 9)"
|
||||
",(4, 1887836422, 8) ,(4, 1901142022, 9)"
|
||||
",(4, 1919286022, 8) ,(4, 1932591622, 9)"
|
||||
",(4, 1950735622, 8) ,(4, 1964041222, 9)"
|
||||
",(4, 1982790022, 8) ,(4, 1995490822, 9)"
|
||||
",(4, 2014239622, 8) ,(4, 2026940422, 9)"
|
||||
",(4, 2045689222, 8) ,(4, 2058390022, 9)"
|
||||
",(4, 2077138822, 8) ,(4, 2090444422, 9)"
|
||||
",(4, 2108588422, 8) ,(4, 2121894022, 9)"
|
||||
",(4, 2140038022, 8);\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (test_sys_file(mdata,"mysql/time_zone_transition_type.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE time_zone_transition_type ("
|
||||
"Time_zone_id int unsigned NOT NULL,"
|
||||
"Transition_type_id int unsigned NOT NULL,"
|
||||
"Offset int signed DEFAULT 0 NOT NULL,"
|
||||
"Is_DST tinyint unsigned DEFAULT 0 NOT NULL,"
|
||||
"Abbreviation char(8) DEFAULT '' NOT NULL,"
|
||||
"PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)"
|
||||
") DEFAULT CHARACTER SET latin1 "
|
||||
"comment='Time zone transition types';\n");
|
||||
|
||||
if (test)
|
||||
{
|
||||
fprintf(out,
|
||||
"INSERT INTO time_zone_transition_type (Time_zone_id,"
|
||||
"Transition_type_id, Offset, Is_DST, Abbreviation) VALUES"
|
||||
"(1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')"
|
||||
",(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')"
|
||||
",(2, 0, 0, 0, 'UTC')"
|
||||
",(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')"
|
||||
",(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')"
|
||||
",(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')"
|
||||
",(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')"
|
||||
",(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')"
|
||||
",(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')"
|
||||
",(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')"
|
||||
",(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')"
|
||||
",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')"
|
||||
",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')"
|
||||
",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')"
|
||||
",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (test_sys_file(mdata,"mysql/time_zone_leap_second.frm"))
|
||||
{
|
||||
fprintf(out,
|
||||
"CREATE TABLE time_zone_leap_second ("
|
||||
"Transition_time bigint signed NOT NULL,"
|
||||
"Correction int signed NOT NULL,"
|
||||
"PRIMARY KEY TranTime (Transition_time)"
|
||||
") DEFAULT CHARACTER SET latin1 "
|
||||
"comment='Leap seconds information for time zones';\n");
|
||||
|
||||
if (test)
|
||||
{
|
||||
fprintf(out,
|
||||
"INSERT INTO time_zone_leap_second "
|
||||
"(Transition_time, Correction) VALUES "
|
||||
"(78796800, 1) ,(94694401, 2) ,(126230402, 3)"
|
||||
",(157766403, 4) ,(189302404, 5) ,(220924805, 6)"
|
||||
",(252460806, 7) ,(283996807, 8) ,(315532808, 9)"
|
||||
",(362793609, 10) ,(394329610, 11) ,(425865611, 12)"
|
||||
",(489024012, 13) ,(567993613, 14) ,(631152014, 15)"
|
||||
",(662688015, 16) ,(709948816, 17) ,(741484817, 18)"
|
||||
",(773020818, 19) ,(820454419, 20) ,(867715220, 21)"
|
||||
",(915148821, 22);\n");
|
||||
}
|
||||
}
|
||||
|
||||
return fclose(out);
|
||||
}
|
||||
|
|
@ -333,7 +333,6 @@ int spawn(char *path, arg_list_t *al, int join, char *input,
|
|||
PROCESS_INFORMATION process_information;
|
||||
DWORD exit_code;
|
||||
char win_args[1024]= "";
|
||||
char command_line[1024]= "";
|
||||
|
||||
/* Skip the first parameter */
|
||||
for (i= 1; i < al->argc; i++)
|
||||
|
|
@ -724,7 +723,7 @@ int removef(const char *format, ...)
|
|||
va_end(ap);
|
||||
return remove(path);
|
||||
|
||||
#eldef __WIN__
|
||||
#elif __WIN__
|
||||
{
|
||||
va_list ap;
|
||||
char path[FN_REFLEN];
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ int my_vsnprintf_(char *to, size_t n, const char* value, ...);
|
|||
#define TRY_MAX 5
|
||||
|
||||
#ifdef __WIN__
|
||||
#define PATH_MAX _MAX_PATH
|
||||
#define NAME_MAX _MAX_FNAME
|
||||
#define kill(A,B) TerminateProcess((HANDLE)A,0)
|
||||
#define NOT_NEED_PID 0
|
||||
#define MASTER_PID 1
|
||||
|
|
@ -130,4 +132,6 @@ int removef(const char *, ...);
|
|||
void get_basedir(char *, char *);
|
||||
void remove_empty_file(const char *file_name);
|
||||
|
||||
bool create_system_files(const char *mdata,const char *output_file, bool test);
|
||||
|
||||
#endif /* _MY_MANAGE */
|
||||
|
|
|
|||
|
|
@ -490,6 +490,7 @@ if [ x$SOURCE_DIST = x1 ] ; then
|
|||
echo "Fatal error: Cannot find embedded server 'mysqltest'" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
TESTS_BINDIR="$BASEDIR/libmysqld/examples"
|
||||
else
|
||||
MYSQLD="$VALGRIND $BASEDIR/sql/mysqld"
|
||||
if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then
|
||||
|
|
@ -499,6 +500,7 @@ if [ x$SOURCE_DIST = x1 ] ; then
|
|||
else
|
||||
MYSQL_TEST="$BASEDIR/client/mysqltest"
|
||||
fi
|
||||
TESTS_BINDIR="$BASEDIR/tests"
|
||||
fi
|
||||
if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then
|
||||
MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump"
|
||||
|
|
@ -515,7 +517,6 @@ if [ x$SOURCE_DIST = x1 ] ; then
|
|||
fi
|
||||
|
||||
CLIENT_BINDIR="$BASEDIR/client"
|
||||
TESTS_BINDIR="$BASEDIR/tests"
|
||||
MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
|
||||
WAIT_PID="$BASEDIR/extra/mysql_waitpid"
|
||||
MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqlmanagerc"
|
||||
|
|
@ -946,7 +947,7 @@ start_ndbcluster()
|
|||
else
|
||||
NDBCLUSTER_EXTRA_OPTS="--small"
|
||||
fi
|
||||
./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --diskless --initial || exit 1
|
||||
./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --initial || exit 1
|
||||
NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT"
|
||||
else
|
||||
NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
|
||||
|
|
@ -1387,13 +1388,18 @@ run_testcase ()
|
|||
# script soon anyway so it is not worth it spending the time
|
||||
if [ "x$USE_EMBEDDED_SERVER" = "x1" -a -z "$DO_TEST" ] ; then
|
||||
for t in \
|
||||
"alter_table" \
|
||||
"bdb-deadlock" \
|
||||
"connect" \
|
||||
"ctype_latin1_de" \
|
||||
"ctype_ucs" \
|
||||
"flush_block_commit" \
|
||||
"grant2" \
|
||||
"grant_cache" \
|
||||
"grant" \
|
||||
"init_connect" \
|
||||
"init_file" \
|
||||
"innodb" \
|
||||
"innodb-deadlock" \
|
||||
"innodb-lock" \
|
||||
"mix_innodb_myisam_binlog" \
|
||||
|
|
@ -1401,10 +1407,12 @@ run_testcase ()
|
|||
"mysqlbinlog" \
|
||||
"mysqldump" \
|
||||
"mysql_protocols" \
|
||||
"packet" \
|
||||
"ps_1general" \
|
||||
"rename" \
|
||||
"show_check" \
|
||||
"system_mysql_db_fix" \
|
||||
"timezone2" \
|
||||
"user_var" \
|
||||
"variables"
|
||||
do
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -267,6 +267,8 @@ void install_db(char *datadir)
|
|||
snprintf(output, FN_REFLEN, "%s/install.out", datadir);
|
||||
snprintf(error, FN_REFLEN, "%s/install.err", datadir);
|
||||
|
||||
if (create_system_files(datadir,input, TRUE))
|
||||
die("Unable to create init_db.sql.");
|
||||
/* args */
|
||||
init_args(&al);
|
||||
add_arg(&al, mysqld_file);
|
||||
|
|
@ -307,9 +309,6 @@ void mysql_install_db()
|
|||
/* var directory */
|
||||
snprintf(temp, FN_REFLEN, "%s/var", mysql_test_dir);
|
||||
|
||||
/* clean up old direcotry */
|
||||
del_tree(temp);
|
||||
|
||||
/* create var directory */
|
||||
#ifndef __WIN__
|
||||
mkdir(temp, S_IRWXU);
|
||||
|
|
@ -1435,6 +1434,17 @@ void setup(char *file __attribute__((unused)))
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
Compare names of testes for right order
|
||||
*/
|
||||
#ifdef __WIN__
|
||||
int compare( const void *arg1, const void *arg2 )
|
||||
{
|
||||
return _stricmp( * ( char** ) arg1, * ( char** ) arg2 );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
main()
|
||||
|
|
|
|||
69
mysql-test/ndb/basic.result
Normal file
69
mysql-test/ndb/basic.result
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
-- NDB Cluster -- Management Client --
|
||||
---------------------------------------------------------------------------
|
||||
NDB Cluster -- Management Client -- Help
|
||||
---------------------------------------------------------------------------
|
||||
HELP Print help text
|
||||
HELP SHOW Help for SHOW command
|
||||
HELP DEBUG Help for debug compiled version
|
||||
SHOW Print information about cluster
|
||||
START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]
|
||||
Start backup (default WAIT COMPLETED)
|
||||
ABORT BACKUP <backup id> Abort backup
|
||||
SHUTDOWN Shutdown all processes in cluster
|
||||
CLUSTERLOG ON [<severity>] ... Enable Cluster logging
|
||||
CLUSTERLOG OFF [<severity>] ... Disable Cluster logging
|
||||
CLUSTERLOG TOGGLE [<severity>] ... Toggle severity filter on/off
|
||||
CLUSTERLOG INFO Print cluster log information
|
||||
<id> START Start DB node (started with -n)
|
||||
<id> RESTART [-n] [-i] Restart DB node
|
||||
<id> STOP Stop DB node
|
||||
ENTER SINGLE USER MODE <api-node> Enter single user mode
|
||||
EXIT SINGLE USER MODE Exit single user mode
|
||||
<id> STATUS Print status
|
||||
<id> CLUSTERLOG {<category>=<level>}+ Set log level for cluster log
|
||||
PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server
|
||||
CONNECT [<connectstring>] Connect to management server (reconnect if already connected)
|
||||
QUIT Quit management client
|
||||
|
||||
<severity> = ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG
|
||||
<category> = STARTUP | SHUTDOWN | STATISTICS | CHECKPOINT | NODERESTART | CONNECTION | INFO | ERROR | GREP | DEBUG | BACKUP
|
||||
<level> = 0 - 15
|
||||
<id> = ALL | Any database node id
|
||||
|
||||
Connected to Management Server at: localhost:1186
|
||||
Node 1: started (Version 4.1.8)
|
||||
Node 2: started (Version 4.1.8)
|
||||
|
||||
Node 1: started (Version 4.1.8)
|
||||
|
||||
Node 2: started (Version 4.1.8)
|
||||
|
||||
Executing CLUSTERLOG on node 1 OK!
|
||||
Executing CLUSTERLOG on node 2 OK!
|
||||
|
||||
Executing CLUSTERLOG on node 1 OK!
|
||||
Executing CLUSTERLOG on node 2 OK!
|
||||
|
||||
Executing CLUSTERLOG on node 1 OK!
|
||||
Executing CLUSTERLOG on node 2 OK!
|
||||
|
||||
Executing CLUSTERLOG on node 1 OK!
|
||||
Executing CLUSTERLOG on node 2 OK!
|
||||
|
||||
Executing CLUSTERLOG on node 1 OK!
|
||||
Executing CLUSTERLOG on node 2 OK!
|
||||
|
||||
Executing CLUSTERLOG on node 1 OK!
|
||||
Executing CLUSTERLOG on node 2 OK!
|
||||
|
||||
Executing CLUSTERLOG on node 1 OK!
|
||||
Executing CLUSTERLOG on node 2 OK!
|
||||
|
||||
Executing CLUSTERLOG on node 1 OK!
|
||||
Executing CLUSTERLOG on node 2 OK!
|
||||
|
||||
Cluster logging is disabled
|
||||
Cluster logging is enabled.
|
||||
Cluster logging is disabled
|
||||
ALL disabled
|
||||
ALL enabled
|
||||
17
mysql-test/ndb/basic.test
Normal file
17
mysql-test/ndb/basic.test
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
help
|
||||
all status
|
||||
1 status
|
||||
2 status
|
||||
all clusterlog connection=8
|
||||
all clusterlog startup=7
|
||||
all clusterlog checkpoint=7
|
||||
all clusterlog noderestart=15
|
||||
all clusterlog statistics=7
|
||||
all clusterlog error=7
|
||||
all clusterlog info=7
|
||||
all clusterlog backup=15
|
||||
clusterlog off
|
||||
clusterlog toggle
|
||||
clusterlog off
|
||||
clusterlog off all
|
||||
clusterlog on all
|
||||
0
mysql-test/ndb/basic_log.result
Normal file
0
mysql-test/ndb/basic_log.result
Normal file
|
|
@ -47,6 +47,7 @@ fi
|
|||
|
||||
pidfile=ndbcluster.pid
|
||||
cfgfile=Ndb.cfg
|
||||
test_ndb=
|
||||
stop_ndb=
|
||||
initial_ndb=
|
||||
status_ndb=
|
||||
|
|
@ -59,6 +60,9 @@ ndb_imem=24M
|
|||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--test)
|
||||
test_ndb=1
|
||||
;;
|
||||
--stop)
|
||||
stop_ndb=1
|
||||
;;
|
||||
|
|
@ -67,8 +71,7 @@ while test $# -gt 0; do
|
|||
initial_ndb=1
|
||||
;;
|
||||
--debug*)
|
||||
f=`echo "$1" | sed -e "s;--debug=;;"`
|
||||
flags_ndb="$flags_ndb $f"
|
||||
flags_ndb="$flags_ndb $1"
|
||||
;;
|
||||
--status)
|
||||
status_ndb=1
|
||||
|
|
@ -232,7 +235,7 @@ status_ndbcluster
|
|||
|
||||
status_ndbcluster() {
|
||||
# Start management client
|
||||
echo "show" | $exec_mgmtclient
|
||||
$exec_mgmtclient -e show
|
||||
}
|
||||
|
||||
stop_default_ndbcluster() {
|
||||
|
|
@ -241,7 +244,7 @@ stop_default_ndbcluster() {
|
|||
|
||||
exec_mgmtclient="$exec_mgmtclient --try-reconnect=1"
|
||||
|
||||
echo "shutdown" | $exec_mgmtclient 2>&1 | cat > /dev/null
|
||||
$exec_mgmtclient -e shutdown 2>&1 | cat > /dev/null
|
||||
|
||||
if [ -f "$fs_ndb/$pidfile" ] ; then
|
||||
kill_pids=`cat "$fs_ndb/$pidfile"`
|
||||
|
|
@ -276,6 +279,44 @@ if [ -f "$fs_ndb/$pidfile" ] ; then
|
|||
fi
|
||||
}
|
||||
|
||||
initialize_ndb_test ()
|
||||
{
|
||||
fs_result=$fs_ndb/r
|
||||
rm -rf $fs_result
|
||||
mkdir $fs_result
|
||||
echo ------------------
|
||||
echo starting ndb tests
|
||||
echo ------------------
|
||||
}
|
||||
|
||||
do_ndb_test ()
|
||||
{
|
||||
test_name=$1
|
||||
|
||||
clusterlog=$fs_ndb/ndb_3_cluster.log
|
||||
|
||||
test_log_result=$fs_result/${test_name}_log.result
|
||||
test_log_reject=$fs_result/${test_name}_log.reject
|
||||
test_result=$fs_result/${test_name}.result
|
||||
test_reject=$fs_result/${test_name}.reject
|
||||
|
||||
clean_log='s/.*\[MgmSrvr\]//'
|
||||
|
||||
cat $clusterlog ndb/${test_name}_log.result | sed -e $clean_log > $test_log_result
|
||||
|
||||
cp ndb/${test_name}.result $test_result
|
||||
|
||||
cat ndb/${test_name}.test | $exec_mgmtclient > $test_reject
|
||||
cat $clusterlog | sed -e $clean_log > $test_log_reject
|
||||
|
||||
t="pass"
|
||||
diff -C 5 $test_result $test_reject || t="fail"
|
||||
printf "ndb_mgm output %20s [%s]\n" $test_name $t
|
||||
t="pass"
|
||||
diff -C 5 $test_log_result $test_log_reject || t="fail"
|
||||
printf "clusterlog output %20s [%s]\n" $test_name $t
|
||||
}
|
||||
|
||||
if [ $status_ndb ] ; then
|
||||
status_ndbcluster
|
||||
exit 0
|
||||
|
|
@ -287,4 +328,15 @@ else
|
|||
start_default_ndbcluster
|
||||
fi
|
||||
|
||||
if [ $test_ndb ] ; then
|
||||
initialize_ndb_test
|
||||
all_tests=`ls ndb/*.test | sed "s#ndb/##" | sed "s#.test##"`
|
||||
for a in $all_tests ; do
|
||||
do_ndb_test $a
|
||||
done
|
||||
echo ------------------
|
||||
echo shutting down cluster
|
||||
stop_default_ndbcluster
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
|
|||
16
mysql-test/ndb/restart.result
Normal file
16
mysql-test/ndb/restart.result
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
-- NDB Cluster -- Management Client --
|
||||
Connected to Management Server at: localhost:1186
|
||||
ALL disabled
|
||||
Cluster logging is enabled.
|
||||
ALERT enabled
|
||||
Executing CLUSTERLOG on node 1 OK!
|
||||
Executing CLUSTERLOG on node 2 OK!
|
||||
|
||||
Node 1 is being restarted.
|
||||
|
||||
Executing CLUSTERLOG on node 1 OK!
|
||||
Executing CLUSTERLOG on node 2 OK!
|
||||
|
||||
Node 1 is being restarted.
|
||||
|
||||
ALL enabled
|
||||
12
mysql-test/ndb/restart.test
Normal file
12
mysql-test/ndb/restart.test
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
clusterlog off all
|
||||
clusterlog on
|
||||
clusterlog on alert
|
||||
all clusterlog connection=0
|
||||
sleep 1
|
||||
1 restart
|
||||
sleep 5
|
||||
all clusterlog connection=8
|
||||
sleep 1
|
||||
1 restart
|
||||
sleep 5
|
||||
clusterlog on all
|
||||
20
mysql-test/ndb/restart_log.result
Normal file
20
mysql-test/ndb/restart_log.result
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
ALERT -- Node 2: Network partitioning - arbitration required
|
||||
ALERT -- Node 2: Arbitration won - positive reply from node 3
|
||||
ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0
|
||||
ALERT -- Node 2: Node failure of 1 DBLQH completed
|
||||
ALERT -- Node 2: Node failure of 1 DBDICT completed
|
||||
ALERT -- Node 2: Node failure of 1 DBDIH completed
|
||||
ALERT -- Node 2: Node failure of 1 DBTC completed
|
||||
ALERT -- Node 2: Node 2 completed failure of Node 1
|
||||
ALERT -- Node 2: All nodes completed failure of Node 1
|
||||
ALERT -- Node 3: Node 1 Disconnected
|
||||
ALERT -- Node 2: Node 1 Disconnected
|
||||
ALERT -- Node 2: Network partitioning - arbitration required
|
||||
ALERT -- Node 2: Arbitration won - positive reply from node 3
|
||||
ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0
|
||||
ALERT -- Node 2: Node failure of 1 DBLQH completed
|
||||
ALERT -- Node 2: Node failure of 1 DBDICT completed
|
||||
ALERT -- Node 2: Node failure of 1 DBDIH completed
|
||||
ALERT -- Node 2: Node failure of 1 DBTC completed
|
||||
ALERT -- Node 2: Node 2 completed failure of Node 1
|
||||
ALERT -- Node 2: All nodes completed failure of Node 1
|
||||
|
|
@ -1,10 +1,58 @@
|
|||
drop table if exists t1;
|
||||
SET NAMES big5;
|
||||
CREATE TABLE t1 (c CHAR(10) CHARACTER SET big5, KEY(c));
|
||||
SET @test_character_set= 'big5';
|
||||
SET @test_collation= 'big5_chinese_ci';
|
||||
SET @safe_character_set_server= @@character_set_server;
|
||||
SET @safe_collation_server= @@collation_server;
|
||||
SET character_set_server= @test_character_set;
|
||||
SET collation_server= @test_collation;
|
||||
CREATE DATABASE d1;
|
||||
USE d1;
|
||||
CREATE TABLE t1 (c CHAR(10), KEY(c));
|
||||
SHOW FULL COLUMNS FROM t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
c char(10) big5_chinese_ci YES MUL NULL
|
||||
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
|
||||
SELECT * FROM t1 WHERE c LIKE 'aaa%';
|
||||
c
|
||||
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
|
||||
want3results
|
||||
aaa
|
||||
aaaa
|
||||
aaaaa
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
|
||||
SHOW FULL COLUMNS FROM t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
c1 varchar(15) big5_chinese_ci YES MUL NULL
|
||||
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
|
||||
SELECT c1 as want3results from t1 where c1 like 'l%';
|
||||
want3results
|
||||
location
|
||||
loberge
|
||||
lotre
|
||||
SELECT c1 as want3results from t1 where c1 like 'lo%';
|
||||
want3results
|
||||
location
|
||||
loberge
|
||||
lotre
|
||||
SELECT c1 as want1result from t1 where c1 like 'loc%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'loca%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'locat%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'locati%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'locatio%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'location%';
|
||||
want1result
|
||||
location
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE d1;
|
||||
USE test;
|
||||
SET character_set_server= @safe_character_set_server;
|
||||
SET collation_server= @safe_collation_server;
|
||||
|
|
|
|||
|
|
@ -63,3 +63,12 @@ ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET
|
|||
create database d1 default character set latin1 collate latin2_bin;
|
||||
ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1'
|
||||
DROP DATABASE mysqltest1;
|
||||
CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET latin7;
|
||||
use mysqltest2;
|
||||
ALTER DATABASE DEFAULT CHARACTER SET latin2;
|
||||
show create database mysqltest2;
|
||||
Database Create Database
|
||||
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
|
||||
drop database mysqltest2;
|
||||
ALTER DATABASE DEFAULT CHARACTER SET latin2;
|
||||
ERROR 3D000: No database selected
|
||||
|
|
|
|||
|
|
@ -296,3 +296,12 @@ FD C3BD FD 1
|
|||
FE C3BE FE 1
|
||||
FF C3BF FF 1
|
||||
DROP TABLE t1;
|
||||
select 'a' regexp 'A' collate latin1_general_ci;
|
||||
'a' regexp 'A' collate latin1_general_ci
|
||||
1
|
||||
select 'a' regexp 'A' collate latin1_general_cs;
|
||||
'a' regexp 'A' collate latin1_general_cs
|
||||
0
|
||||
select 'a' regexp 'A' collate latin1_bin;
|
||||
'a' regexp 'A' collate latin1_bin
|
||||
0
|
||||
|
|
|
|||
242
mysql-test/r/ctype_recoding.result.es
Normal file
242
mysql-test/r/ctype_recoding.result.es
Normal file
|
|
@ -0,0 +1,242 @@
|
|||
SET CHARACTER SET koi8r;
|
||||
DROP TABLE IF EXISTS ÔÁÂÌÉÃÁ, t1, t2;
|
||||
SET CHARACTER SET koi8r;
|
||||
CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp1251) SELECT _koi8r'ÐÒÏÂÁ' AS a;
|
||||
CREATE TABLE t2 (a CHAR(10) CHARACTER SET utf8);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(10) character set cp1251 default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT a FROM t1;
|
||||
a
|
||||
ÐÒÏÂÁ
|
||||
SELECT HEX(a) FROM t1;
|
||||
HEX(a)
|
||||
EFF0EEE1E0
|
||||
INSERT t2 SELECT * FROM t1;
|
||||
SELECT HEX(a) FROM t2;
|
||||
HEX(a)
|
||||
D0BFD180D0BED0B1D0B0
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (description text character set cp1250 NOT NULL);
|
||||
INSERT INTO t1 (description) VALUES (_latin2'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde');
|
||||
SELECT description FROM t1;
|
||||
description
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a TEXT CHARACTER SET cp1251) SELECT _koi8r'ÐÒÏÂÁ' AS a;
|
||||
CREATE TABLE t2 (a TEXT CHARACTER SET utf8);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` text character set cp1251
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT HEX(a) FROM t1;
|
||||
HEX(a)
|
||||
EFF0EEE1E0
|
||||
INSERT t2 SELECT * FROM t1;
|
||||
SELECT HEX(a) FROM t2;
|
||||
HEX(a)
|
||||
D0BFD180D0BED0B1D0B0
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE `ÔÁÂÌÉÃÁ`
|
||||
(
|
||||
ÐÏÌÅ CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ"
|
||||
) COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ";
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
ÔÁÂÌÉÃÁ
|
||||
SHOW CREATE TABLE ÔÁÂÌÉÃÁ;
|
||||
Table Create Table
|
||||
ÔÁÂÌÉÃÁ CREATE TABLE `ÔÁÂÌÉÃÁ` (
|
||||
`ÐÏÌÅ` char(32) character set koi8r NOT NULL default '' COMMENT 'ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ'
|
||||
SHOW FIELDS FROM ÔÁÂÌÉÃÁ;
|
||||
Field Type Null Key Default Extra
|
||||
ÐÏÌÅ char(32)
|
||||
SET CHARACTER SET cp1251;
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
òàáëèöà
|
||||
SHOW CREATE TABLE òàáëèöà;
|
||||
Table Create Table
|
||||
òàáëèöà CREATE TABLE `òàáëèöà` (
|
||||
`ïîëå` char(32) character set koi8r NOT NULL default '' COMMENT 'êîììåíòàðèé ïîëÿ'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='êîììåíòàðèé òàáëèöû'
|
||||
SHOW FIELDS FROM òàáëèöà;
|
||||
Field Type Null Key Default Extra
|
||||
ïîëå char(32)
|
||||
SET CHARACTER SET utf8;
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
таблица
|
||||
SHOW CREATE TABLE таблица;
|
||||
Table Create Table
|
||||
таблица CREATE TABLE `таблица` (
|
||||
`поле` char(32) character set koi8r NOT NULL default '' COMMENT 'комментарий полÑ<EFBFBD>'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='комментарий таблицы'
|
||||
SHOW FIELDS FROM таблица;
|
||||
Field Type Null Key Default Extra
|
||||
поле char(32)
|
||||
SET CHARACTER SET koi8r;
|
||||
DROP TABLE ÔÁÂÌÉÃÁ;
|
||||
SET CHARACTER SET default;
|
||||
SET NAMES UTF8;
|
||||
CREATE TABLE t1 (t text) DEFAULT CHARSET UTF8;
|
||||
INSERT INTO t1 (t) VALUES ('x');
|
||||
SELECT 1 FROM t1 WHERE CONCAT(_latin1'x') = t;
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
SET CHARACTER SET koi8r;
|
||||
CREATE DATABASE ÔÅÓÔ;
|
||||
USE ÔÅÓÔ;
|
||||
SHOW TABLES;
|
||||
Tables_in_теÑ<EFBFBD>Ñ‚
|
||||
SHOW TABLES IN ÔÅÓÔ;
|
||||
Tables_in_теÑ<EFBFBD>Ñ‚
|
||||
SET CHARACTER SET cp1251;
|
||||
SHOW TABLES;
|
||||
Tables_in_теÑ<EFBFBD>Ñ‚
|
||||
SHOW TABLES IN òåñò;
|
||||
Tables_in_теÑ<EFBFBD>Ñ‚
|
||||
SET CHARACTER SET koi8r;
|
||||
DROP DATABASE ÔÅÓÔ;
|
||||
SET NAMES koi8r;
|
||||
SELECT hex('ÔÅÓÔ');
|
||||
hex('теÑ<C2B5>Ñ‚')
|
||||
D4C5D3D4
|
||||
SET character_set_connection=cp1251;
|
||||
SELECT hex('ÔÅÓÔ');
|
||||
hex('теÑ<C2B5>Ñ‚')
|
||||
F2E5F1F2
|
||||
USE test;
|
||||
SET NAMES binary;
|
||||
CREATE TABLE `теÑ<EFBFBD>Ñ‚` (`теÑ<EFBFBD>Ñ‚` int);
|
||||
SHOW CREATE TABLE `теÑ<EFBFBD>Ñ‚`;
|
||||
Table Create Table
|
||||
теÑ<EFBFBD>Ñ‚ CREATE TABLE `теÑ<EFBFBD>Ñ‚` (
|
||||
`теÑ<EFBFBD>Ñ‚` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SET NAMES utf8;
|
||||
SHOW CREATE TABLE `теÑ<EFBFBD>Ñ‚`;
|
||||
Table Create Table
|
||||
теÑ<EFBFBD>Ñ‚ CREATE TABLE `теÑ<EFBFBD>Ñ‚` (
|
||||
`теÑ<EFBFBD>Ñ‚` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE `теÑ<EFBFBD>Ñ‚`;
|
||||
SET NAMES binary;
|
||||
SET character_set_connection=utf8;
|
||||
SELECT 'теÑ<C2B5>Ñ‚' as s;
|
||||
s
|
||||
теÑ<EFBFBD>Ñ‚
|
||||
SET NAMES utf8;
|
||||
SET character_set_connection=binary;
|
||||
SELECT 'теÑ<C2B5>Ñ‚' as s;
|
||||
s
|
||||
теÑ<EFBFBD>Ñ‚
|
||||
SET NAMES latin1;
|
||||
CREATE TABLE t1 (`ä` CHAR(128) DEFAULT 'ä', `ä1` ENUM('ä1','ä2') DEFAULT 'ä2');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`ä` char(128) default 'ä',
|
||||
`ä1` enum('ä1','ä2') default 'ä2'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SHOW COLUMNS FROM t1;
|
||||
Field Type Null Key Default Extra
|
||||
ä char(128) YES ä
|
||||
ä1 enum('ä1','ä2') YES ä2
|
||||
SET NAMES binary;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`ä` char(128) default 'ä',
|
||||
`ä1` enum('ä1','ä2') default 'ä2'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SHOW COLUMNS FROM t1;
|
||||
Field Type Null Key Default Extra
|
||||
ä char(128) YES ä
|
||||
ä1 enum('ä1','ä2') YES ä2
|
||||
DROP TABLE t1;
|
||||
SET NAMES binary;
|
||||
CREATE TABLE `goodÐÌÏÈÏ` (a int);
|
||||
ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ'
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE `goodÐÌÏÈÏ` (a int);
|
||||
ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ` (a int)'
|
||||
set names latin1;
|
||||
create table t1 (a char(10) character set koi8r, b text character set koi8r);
|
||||
insert into t1 values ('test','test');
|
||||
insert into t1 values ('ÊÃÕË','ÊÃÕË');
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'a' at row 1
|
||||
Warning 1265 Data truncated for column 'b' at row 1
|
||||
drop table t1;
|
||||
set names koi8r;
|
||||
create table t1 (a char(10) character set cp1251);
|
||||
insert into t1 values (_koi8r'×ÁÓÑ');
|
||||
select * from t1 where a=_koi8r'×ÁÓÑ';
|
||||
a
|
||||
×ÁÓÑ
|
||||
select * from t1 where a=concat(_koi8r'×ÁÓÑ');
|
||||
ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation '='
|
||||
select * from t1 where a=_latin1'×ÁÓÑ';
|
||||
ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='
|
||||
drop table t1;
|
||||
set names latin1;
|
||||
set names koi8r;
|
||||
create table t1 (c1 char(10) character set cp1251);
|
||||
insert into t1 values ('ß');
|
||||
select c1 from t1 where c1 between 'ß' and 'ß';
|
||||
c1
|
||||
ß
|
||||
select ifnull(c1,'ß'), ifnull(null,c1) from t1;
|
||||
ifnull(c1,'ÑŠ') ifnull(null,c1)
|
||||
ß ß
|
||||
select if(1,c1,'ö'), if(0,c1,'ö') from t1;
|
||||
if(1,c1,'Ж') if(0,c1,'Ж')
|
||||
ß ö
|
||||
select coalesce('ö',c1), coalesce(null,c1) from t1;
|
||||
coalesce('Ж',c1) coalesce(null,c1)
|
||||
ö ß
|
||||
select least(c1,'ö'), greatest(c1,'ö') from t1;
|
||||
least(c1,'Ж') greatest(c1,'Ж')
|
||||
ö ß
|
||||
select locate(c1,'ß'), locate('ß',c1) from t1;
|
||||
locate(c1,'ÑŠ') locate('ÑŠ',c1)
|
||||
1 1
|
||||
select field(c1,'ß'),field('ß',c1) from t1;
|
||||
field(c1,'ÑŠ') field('ÑŠ',c1)
|
||||
1 1
|
||||
select concat(c1,'ö'), concat('ö',c1) from t1;
|
||||
concat(c1,'Ж') concat('Ж',c1)
|
||||
ßö öß
|
||||
select concat_ws(c1,'ö','ß'), concat_ws('ö',c1,'ß') from t1;
|
||||
concat_ws(c1,'Ж','ъ') concat_ws('Ж',c1,'ъ')
|
||||
ößß ßöß
|
||||
select replace(c1,'ß','ö'), replace('ß',c1,'ö') from t1;
|
||||
replace(c1,'ъ','Ж') replace('ъ',c1,'Ж')
|
||||
ö ö
|
||||
select substring_index(c1,'öößß',2) from t1;
|
||||
substring_index(c1,'ЖЖъъ',2)
|
||||
ß
|
||||
select elt(1,c1,'ö'),elt(1,'ö',c1) from t1;
|
||||
elt(1,c1,'Ж') elt(1,'Ж',c1)
|
||||
ß ö
|
||||
select make_set(3,c1,'ö'), make_set(3,'ö',c1) from t1;
|
||||
make_set(3,c1,'Ж') make_set(3,'Ж',c1)
|
||||
ß,ö ö,ß
|
||||
select insert(c1,1,2,'ö'),insert('ö',1,2,c1) from t1;
|
||||
insert(c1,1,2,'Ж') insert('Ж',1,2,c1)
|
||||
ö ß
|
||||
select trim(c1 from 'ß'),trim('ß' from c1) from t1;
|
||||
trim(c1 from 'ÑŠ') trim('ÑŠ' from c1)
|
||||
|
||||
select lpad(c1,3,'ö'), lpad('ö',3,c1) from t1;
|
||||
lpad(c1,3,'Ж') lpad('Ж',3,c1)
|
||||
ööß ßßö
|
||||
select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1;
|
||||
rpad(c1,3,'Ж') rpad('Ж',3,c1)
|
||||
ßöö ößß
|
||||
|
|
@ -19,6 +19,9 @@ select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t';
|
|||
select 'a a' > 'a', 'a \t' < 'a';
|
||||
'a a' > 'a' 'a \t' < 'a'
|
||||
1 1
|
||||
select 'c' like '\_' as want0;
|
||||
want0
|
||||
0
|
||||
CREATE TABLE t (
|
||||
c char(20) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
|
@ -2315,3 +2318,71 @@ HEX(CONVERT(col1 USING ucs2))
|
|||
064A06A9062F064A06AF0631
|
||||
064A06A9064A
|
||||
DROP TABLE t1;
|
||||
SET @test_character_set= 'utf8';
|
||||
SET @test_collation= 'utf8_swedish_ci';
|
||||
SET @safe_character_set_server= @@character_set_server;
|
||||
SET @safe_collation_server= @@collation_server;
|
||||
SET character_set_server= @test_character_set;
|
||||
SET collation_server= @test_collation;
|
||||
CREATE DATABASE d1;
|
||||
USE d1;
|
||||
CREATE TABLE t1 (c CHAR(10), KEY(c));
|
||||
SHOW FULL COLUMNS FROM t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
c char(10) utf8_swedish_ci YES MUL NULL
|
||||
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
|
||||
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
|
||||
want3results
|
||||
aaa
|
||||
aaaa
|
||||
aaaaa
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
|
||||
SHOW FULL COLUMNS FROM t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
c1 varchar(15) utf8_swedish_ci YES MUL NULL
|
||||
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
|
||||
SELECT c1 as want3results from t1 where c1 like 'l%';
|
||||
want3results
|
||||
location
|
||||
loberge
|
||||
lotre
|
||||
SELECT c1 as want3results from t1 where c1 like 'lo%';
|
||||
want3results
|
||||
location
|
||||
loberge
|
||||
lotre
|
||||
SELECT c1 as want1result from t1 where c1 like 'loc%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'loca%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'locat%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'locati%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'locatio%';
|
||||
want1result
|
||||
location
|
||||
SELECT c1 as want1result from t1 where c1 like 'location%';
|
||||
want1result
|
||||
location
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE d1;
|
||||
USE test;
|
||||
SET character_set_server= @safe_character_set_server;
|
||||
SET collation_server= @safe_collation_server;
|
||||
create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci;
|
||||
insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c');
|
||||
select a, a regexp '[a]' from t1 order by binary a;
|
||||
a a regexp '[a]'
|
||||
A 1
|
||||
B 0
|
||||
C 0
|
||||
a 1
|
||||
b 0
|
||||
c 0
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,27 @@
|
|||
DROP TABLE IF EXISTS t1;
|
||||
SET NAMES latin1;
|
||||
SET character_set_connection=ucs2;
|
||||
select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
|
||||
'a' = 'a' 'a' = 'a ' 'a ' = 'a'
|
||||
1 1 1
|
||||
select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a';
|
||||
'a\0' = 'a' 'a\0' < 'a' 'a\0' > 'a'
|
||||
0 1 0
|
||||
select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
|
||||
'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0'
|
||||
0 0 1
|
||||
select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
|
||||
'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a '
|
||||
0 1 0
|
||||
select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
|
||||
'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0'
|
||||
0 0 1
|
||||
select 'a a' > 'a', 'a \0' < 'a';
|
||||
'a a' > 'a' 'a \0' < 'a'
|
||||
1 1
|
||||
select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a';
|
||||
binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a'
|
||||
1 1 1
|
||||
SET CHARACTER SET koi8r;
|
||||
CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2);
|
||||
INSERT INTO t1 VALUES (_koi8r'ò'), (X'2004');
|
||||
|
|
@ -502,3 +525,59 @@ use test;
|
|||
SET TIMESTAMP=10000;
|
||||
insert into t2 values (@v);
|
||||
drop table t2;
|
||||
set names latin1;
|
||||
create table t1 (a enum('x','y','z') character set ucs2);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` enum('x','y','z') character set ucs2 default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
insert into t1 values ('x');
|
||||
insert into t1 values ('y');
|
||||
insert into t1 values ('z');
|
||||
select a, hex(a) from t1 order by a;
|
||||
a hex(a)
|
||||
x 0078
|
||||
y 0079
|
||||
z 007A
|
||||
alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set ucs2;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` enum('x','y','z','d','e','ä','ö','ü') character set ucs2 default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
insert into t1 values ('D');
|
||||
insert into t1 values ('E ');
|
||||
insert into t1 values ('Ä');
|
||||
insert into t1 values ('Ö');
|
||||
insert into t1 values ('Ü');
|
||||
select a, hex(a) from t1 order by a;
|
||||
a hex(a)
|
||||
x 0078
|
||||
y 0079
|
||||
z 007A
|
||||
d 0064
|
||||
e 0065
|
||||
ä 00E4
|
||||
ö 00F6
|
||||
ü 00FC
|
||||
drop table t1;
|
||||
create table t1 (a set ('x','y','z','ä','ö','ü') character set ucs2);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` set('x','y','z','ä','ö','ü') character set ucs2 default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
insert into t1 values ('x');
|
||||
insert into t1 values ('y');
|
||||
insert into t1 values ('z');
|
||||
insert into t1 values ('x,y');
|
||||
insert into t1 values ('x,y,z,Ä,Ö,Ü');
|
||||
select a, hex(a) from t1 order by a;
|
||||
a hex(a)
|
||||
x 0078
|
||||
y 0079
|
||||
x,y 0078002C0079
|
||||
z 007A
|
||||
x,y,z,ä,ö,ü 0078002C0079002C007A002C00E4002C00F6002C00FC
|
||||
drop table t1;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -814,3 +814,6 @@ t2 CREATE TABLE `t2` (
|
|||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
select 'c' like '\_' as want0;
|
||||
want0
|
||||
0
|
||||
|
|
|
|||
|
|
@ -16,12 +16,34 @@ SET AUTOCOMMIT=0;
|
|||
DELETE from t1;
|
||||
SET AUTOCOMMIT=1;
|
||||
drop table t1;
|
||||
create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
|
||||
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23);
|
||||
create table t1 (
|
||||
a bigint not null,
|
||||
b bigint not null default 0,
|
||||
c bigint not null default 0,
|
||||
d bigint not null default 0,
|
||||
e bigint not null default 0,
|
||||
f bigint not null default 0,
|
||||
g bigint not null default 0,
|
||||
h bigint not null default 0,
|
||||
i bigint not null default 0,
|
||||
j bigint not null default 0,
|
||||
primary key (a,b,c,d,e,f,g,h,i,j));
|
||||
insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23);
|
||||
delete from t1 where a=26;
|
||||
drop table t1;
|
||||
create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
|
||||
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
|
||||
create table t1 (
|
||||
a bigint not null,
|
||||
b bigint not null default 0,
|
||||
c bigint not null default 0,
|
||||
d bigint not null default 0,
|
||||
e bigint not null default 0,
|
||||
f bigint not null default 0,
|
||||
g bigint not null default 0,
|
||||
h bigint not null default 0,
|
||||
i bigint not null default 0,
|
||||
j bigint not null default 0,
|
||||
primary key (a,b,c,d,e,f,g,h,i,j));
|
||||
insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
|
||||
delete from t1 where a=27;
|
||||
drop table t1;
|
||||
CREATE TABLE `t1` (
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ get_lock("a",10)
|
|||
show binlog events;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3
|
||||
master-bin.000001 79 Query 1 79 use `test`; create database `drop-temp+table-test`
|
||||
master-bin.000001 152 Query 1 152 use `drop-temp+table-test`; create temporary table `table:name` (a int)
|
||||
master-bin.000001 246 Query 1 246 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name`
|
||||
master-bin.000001 375 Query 1 375 use `drop-temp+table-test`; DO RELEASE_LOCK("a")
|
||||
master-bin.000001 79 Query 1 79 create database `drop-temp+table-test`
|
||||
master-bin.000001 168 Query 1 168 use `drop-temp+table-test`; create temporary table `table:name` (a int)
|
||||
master-bin.000001 262 Query 1 262 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name`
|
||||
master-bin.000001 391 Query 1 391 use `drop-temp+table-test`; DO RELEASE_LOCK("a")
|
||||
drop database `drop-temp+table-test`;
|
||||
|
|
|
|||
|
|
@ -20,4 +20,12 @@ commit;
|
|||
a
|
||||
1
|
||||
unlock tables;
|
||||
commit;
|
||||
begin;
|
||||
insert into t1 values(10);
|
||||
flush tables with read lock;
|
||||
commit;
|
||||
unlock tables;
|
||||
flush tables with read lock;
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -190,6 +190,14 @@ a
|
|||
select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode);
|
||||
a
|
||||
aaa10 bbb20
|
||||
select * from t1 where match a against ("+(+aaa* +bbb1*)" in boolean mode);
|
||||
a
|
||||
aaa20 bbb15
|
||||
aaa30 bbb10
|
||||
select * from t1 where match a against ("(+aaa* +bbb1*)" in boolean mode);
|
||||
a
|
||||
aaa20 bbb15
|
||||
aaa30 bbb10
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
id int(11),
|
||||
|
|
@ -391,3 +399,9 @@ select count(*) from t1;
|
|||
count(*)
|
||||
1
|
||||
drop table t1;
|
||||
create table t1 (a int primary key, b text, fulltext(b));
|
||||
create table t2 (a int, b text);
|
||||
insert t1 values (1, "aaaa"), (2, "bbbb");
|
||||
insert t2 values (10, "aaaa"), (2, "cccc");
|
||||
replace t1 select * from t2;
|
||||
drop table t1, t2;
|
||||
|
|
|
|||
|
|
@ -69,6 +69,6 @@ Error 1259 ZLIB: Input data corrupted
|
|||
Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
|
||||
drop table t1;
|
||||
set @@max_allowed_packet=1048576*100;
|
||||
select compress(repeat('aaaaaaaaaa', 10000000)) is null;
|
||||
compress(repeat('aaaaaaaaaa', 10000000)) is null
|
||||
select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
|
||||
compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null
|
||||
0
|
||||
|
|
|
|||
|
|
@ -637,8 +637,22 @@ create table t1 (a char(10));
|
|||
insert into t1 values ('a'),('b'),('c');
|
||||
select coercibility(max(a)) from t1;
|
||||
coercibility(max(a))
|
||||
3
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (a char character set latin2);
|
||||
insert into t1 values ('a'),('b');
|
||||
select charset(max(a)), coercibility(max(a)),
|
||||
charset(min(a)), coercibility(min(a)) from t1;
|
||||
charset(max(a)) coercibility(max(a)) charset(min(a)) coercibility(min(a))
|
||||
latin2 2 latin2 2
|
||||
create table t2 select max(a),min(a) from t1;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`max(a)` char(1) character set latin2 default NULL,
|
||||
`min(a)` char(1) character set latin2 default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t2,t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1);
|
||||
select max(a) as b from t1 having b=1;
|
||||
|
|
|
|||
|
|
@ -685,3 +685,9 @@ drop table t1;
|
|||
select left(1234, 3) + 0;
|
||||
left(1234, 3) + 0
|
||||
123
|
||||
create table t1 (a int not null primary key, b varchar(40), c datetime);
|
||||
insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14');
|
||||
select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12;
|
||||
total reg
|
||||
10 2004-12-10
|
||||
drop table t1;
|
||||
|
|
|
|||
185
mysql-test/r/func_test.result.es
Normal file
185
mysql-test/r/func_test.result.es
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
drop table if exists t1,t2;
|
||||
select 0=0,1>0,1>=1,1<0,1<=0,1!=0,strcmp("abc","abcd"),strcmp("b","a"),strcmp("a","a") ;
|
||||
0=0 1>0 1>=1 1<0 1<=0 1!=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a")
|
||||
1 1 1 0 0 1 -1 1 0
|
||||
select "a"<"b","a"<="b","b">="a","b">"a","a"="A","a"<>"b";
|
||||
"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b"
|
||||
1 1 1 1 1 1
|
||||
select "a "="A", "A "="a", "a " <= "A b";
|
||||
"a "="A" "A "="a" "a " <= "A b"
|
||||
1 1 1
|
||||
select "abc" like "a%", "abc" not like "%d%", "a%" like "a\%","abc%" like "a%\%","abcd" like "a%b_%d", "a" like "%%a","abcde" like "a%_e","abc" like "abc%";
|
||||
"abc" like "a%" "abc" not like "%d%" "a%" like "a\%" "abc%" like "a%\%" "abcd" like "a%b_%d" "a" like "%%a" "abcde" like "a%_e" "abc" like "abc%"
|
||||
1 1 1 1 1 1 1 1
|
||||
select "a" like "%%b","a" like "%%ab","ab" like "a\%", "ab" like "_", "ab" like "ab_", "abc" like "%_d", "abc" like "abc%d";
|
||||
"a" like "%%b" "a" like "%%ab" "ab" like "a\%" "ab" like "_" "ab" like "ab_" "abc" like "%_d" "abc" like "abc%d"
|
||||
0 0 0 0 0 0 0
|
||||
select '?' like '|%', '?' like '|%' ESCAPE '|', '%' like '|%', '%' like '|%' ESCAPE '|', '%' like '%';
|
||||
'?' like '|%' '?' like '|%' ESCAPE '|' '%' like '|%' '%' like '|%' ESCAPE '|' '%' like '%'
|
||||
0 0 0 1 1
|
||||
select 'abc' like '%c','abcabc' like '%c', "ab" like "", "ab" like "a", "ab" like "ab";
|
||||
'abc' like '%c' 'abcabc' like '%c' "ab" like "" "ab" like "a" "ab" like "ab"
|
||||
1 1 0 0 1
|
||||
select "Det här är svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$";
|
||||
"Det här är svenska" regexp "h[[:alpha:]]+r" "aba" regexp "^(a|b)*$"
|
||||
1 1
|
||||
select "aba" regexp concat("^","a");
|
||||
"aba" regexp concat("^","a")
|
||||
1
|
||||
select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0;
|
||||
!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 or 1=1 and 1=0
|
||||
1 1 0 1 0 1 1 1
|
||||
select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3;
|
||||
2 between 1 and 3 "monty" between "max" and "my" 2=2 and "monty" between "max" and "my" and 3=3
|
||||
1 1 1
|
||||
select 'b' between 'a' and 'c', 'B' between 'a' and 'c';
|
||||
'b' between 'a' and 'c' 'B' between 'a' and 'c'
|
||||
1 1
|
||||
select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0);
|
||||
2 in (3,2,5,9,5,1) "monty" in ("david","monty","allan") 1.2 in (1.4,1.2,1.0)
|
||||
1 1 1
|
||||
select -1.49 or -1.49,0.6 or 0.6;
|
||||
-1.49 or -1.49 0.6 or 0.6
|
||||
1 1
|
||||
select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
|
||||
3 ^ 11 1 ^ 1 1 ^ 0 1 ^ NULL NULL ^ 1
|
||||
8 0 1 NULL NULL
|
||||
explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) AS `1 ^ 0`,(1 ^ NULL) AS `1 ^ NULL`,(NULL ^ 1) AS `NULL ^ 1`
|
||||
select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
|
||||
1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL
|
||||
0 1 1 0 NULL NULL NULL
|
||||
select 1 like 2 xor 2 like 1;
|
||||
1 like 2 xor 2 like 1
|
||||
0
|
||||
select 10 % 7, 10 mod 7, 10 div 3;
|
||||
10 % 7 10 mod 7 10 div 3
|
||||
3 3 3
|
||||
explain extended select 10 % 7, 10 mod 7, 10 div 3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3`
|
||||
select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
|
||||
(1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2
|
||||
18446744073709551615 18446744073709551615 9223372036854775807
|
||||
explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select ((1 << 64) - 1) AS `(1 << 64)-1`,(((1 << 64) - 1) DIV 1) AS `((1 << 64)-1) DIV 1`,(((1 << 64) - 1) DIV 2) AS `((1 << 64)-1) DIV 2`
|
||||
create table t1 (a int);
|
||||
insert t1 values (1);
|
||||
select * from t1 where 1 xor 1;
|
||||
a
|
||||
explain extended select * from t1 where 1 xor 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
Warnings:
|
||||
Note 1003 select test.t1.a AS `a` from test.t1 where (1 xor 1)
|
||||
select - a from t1;
|
||||
- a
|
||||
-1
|
||||
explain extended select - a from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1
|
||||
Warnings:
|
||||
Note 1003 select -(test.t1.a) AS `- a` from test.t1
|
||||
drop table t1;
|
||||
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
|
||||
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
|
||||
0 1
|
||||
select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1;
|
||||
1 and 2 between 2 and 10 2 between 2 and 10 and 1
|
||||
1 1
|
||||
select 1 and 0 or 2, 2 or 1 and 0;
|
||||
1 and 0 or 2 2 or 1 and 0
|
||||
1 1
|
||||
select _koi8r'a' = _koi8r'A';
|
||||
_koi8r'a' = _koi8r'A'
|
||||
1
|
||||
select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci;
|
||||
_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci
|
||||
1
|
||||
explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select (_koi8r'a' = (_koi8r'A' collate _latin1'koi8r_general_ci')) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci`
|
||||
select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin;
|
||||
_koi8r'a' = _koi8r'A' COLLATE koi8r_bin
|
||||
0
|
||||
select _koi8r'a' COLLATE koi8r_general_ci = _koi8r'A';
|
||||
_koi8r'a' COLLATE koi8r_general_ci = _koi8r'A'
|
||||
1
|
||||
select _koi8r'a' COLLATE koi8r_bin = _koi8r'A';
|
||||
_koi8r'a' COLLATE koi8r_bin = _koi8r'A'
|
||||
0
|
||||
select _koi8r'a' COLLATE koi8r_bin = _koi8r'A' COLLATE koi8r_general_ci;
|
||||
ERROR HY000: Illegal mix of collations (koi8r_bin,EXPLICIT) and (koi8r_general_ci,EXPLICIT) for operation '='
|
||||
select _koi8r'a' = _latin1'A';
|
||||
ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '='
|
||||
select strcmp(_koi8r'a', _koi8r'A');
|
||||
strcmp(_koi8r'a', _koi8r'A')
|
||||
0
|
||||
select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci);
|
||||
strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci)
|
||||
0
|
||||
select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin);
|
||||
strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin)
|
||||
1
|
||||
select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A');
|
||||
strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A')
|
||||
0
|
||||
select strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A');
|
||||
strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A')
|
||||
1
|
||||
select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A' COLLATE koi8r_bin);
|
||||
ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'strcmp'
|
||||
select strcmp(_koi8r'a', _latin1'A');
|
||||
ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'strcmp'
|
||||
select _koi8r'a' LIKE _koi8r'A';
|
||||
_koi8r'a' LIKE _koi8r'A'
|
||||
1
|
||||
select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci;
|
||||
_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci
|
||||
1
|
||||
select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin;
|
||||
_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin
|
||||
0
|
||||
select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A';
|
||||
_koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A'
|
||||
1
|
||||
select _koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A';
|
||||
_koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A'
|
||||
0
|
||||
select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin;
|
||||
ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'like'
|
||||
select _koi8r'a' LIKE _latin1'A';
|
||||
ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'like'
|
||||
CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (82,82,'How to use the DynaVox Usage Counts Feature','usages count, number, corner, white, box, button','<as-html>\r\n<table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"> </td>\r\n <td width=\"97%\">\r\n <h3><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000000\">How \r\n To</font><!-- #BeginEditable \"CS_troubleshoot_question\" --><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\"#000099\"><font color=\"#000000\">: \r\n Display or Hide the Usage Counts to find out how many times each button is being selected. </font></font><!-- #EndEditable --></h3>\r\n </td>\r\n </tr>\r\n</table>','<as-html>\r\n <table width=\"100%\" border=\"0\">\r\n <tr>\r\n <td width=\"3%\"> </td>\r\n \r\n<td width=\"97%\"><!-- #BeginEditable \"CS_troubleshoot_answer\" --> \r\n \r\n<p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">1. Select \r\n the <i>On/Setup</i> button to access the DynaVox Setup Menu.<br>\r\n 2. Select <b>Button Features.</b><br>\r\n 3. Below the <b>OK</b> button is the <b>Usage Counts</b> button.<br>\r\n a. If it says \"Hidden\" then the Usage Counts will not be displayed.<br>\r\n b. If it says \"Displayed\" then the Usage Counts will be shown.<br>\r\n c. Select the <b>Usage Counts</b> Option Ring once and it will toggle \r\n to the alternative option.<br>\r\n 4. Once the correct setting has been chosen, select <b>OK</b> to leave the <i>Button \r\n Features</i> menu.<br>\r\n 5. Select <b>OK</b> out of the <i>Setup</i> menu and return to the communication \r\n page.</font></p>\r\n <p><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\">For \r\n further information on <i>Usage Counts,</i> see the <i>Button Features \r\n Menu Entry</i> in the DynaVox/DynaMyte Reference Manual.</font></p>\r\n<!-- #EndEditable --></td>\r\n </tr>\r\n</table>',4,1,1,'2001-11-16 16:43:34','2002-11-25 12:09:43','2003-07-24 01:04:48',NULL,11,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,11,NULL,NULL,NULL);
|
||||
CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES (1,'Everyone',2),(2,'Help',3),(3,'Customer Support',1);
|
||||
SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1 AND f1.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a1 ON (a1.access_id = f1.access_id) LEFT JOIN t1 f2 ON (f2.access_id=3 AND f2.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a2 ON (a2.access_id = f2.access_id), t2 f_acc WHERE LEAST(a1.rank,a2.rank) = f_acc.rank;
|
||||
rank rank rank
|
||||
2 2 NULL
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (d varchar(6), k int);
|
||||
INSERT INTO t1 VALUES (NULL, 2);
|
||||
SELECT GREATEST(d,d) FROM t1 WHERE k=2;
|
||||
GREATEST(d,d)
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
select 1197.90 mod 50;
|
||||
1197.90 mod 50
|
||||
47.90
|
||||
select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3;
|
||||
5.1 mod 3 5.1 mod -3 -5.1 mod 3 -5.1 mod -3
|
||||
2.1 2.1 -2.1 -2.1
|
||||
select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3;
|
||||
5 mod 3 5 mod -3 -5 mod 3 -5 mod -3
|
||||
2 2 -2 -2
|
||||
|
|
@ -474,6 +474,12 @@ unix_timestamp(@a)
|
|||
select unix_timestamp('1969-12-01 19:00:01');
|
||||
unix_timestamp('1969-12-01 19:00:01')
|
||||
0
|
||||
select from_unixtime(0);
|
||||
from_unixtime(0)
|
||||
NULL
|
||||
select from_unixtime(2145916800);
|
||||
from_unixtime(2145916800)
|
||||
NULL
|
||||
CREATE TABLE t1 (datetime datetime, timestamp timestamp, date date, time time);
|
||||
INSERT INTO t1 values ("2001-01-02 03:04:05", "2002-01-02 03:04:05", "2003-01-02", "06:07:08");
|
||||
SELECT * from t1;
|
||||
|
|
|
|||
|
|
@ -757,3 +757,50 @@ SPATIAL KEY(g)
|
|||
) ENGINE=MyISAM;
|
||||
INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)'));
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
geoobjid INT NOT NULL,
|
||||
line LINESTRING NOT NULL,
|
||||
kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
|
||||
name VARCHAR(32),
|
||||
SPATIAL KEY (line)
|
||||
) engine=myisam;
|
||||
ALTER TABLE t1 DISABLE KEYS;
|
||||
INSERT INTO t1 (name, kind, line) VALUES
|
||||
("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
|
||||
("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")),
|
||||
("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")),
|
||||
("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")),
|
||||
("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")),
|
||||
("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")),
|
||||
("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")),
|
||||
("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")),
|
||||
("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")),
|
||||
("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")),
|
||||
("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")),
|
||||
("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")),
|
||||
("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")),
|
||||
("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")),
|
||||
("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")),
|
||||
("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")),
|
||||
("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")),
|
||||
("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")),
|
||||
("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")),
|
||||
("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")),
|
||||
("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")),
|
||||
("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")),
|
||||
("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")),
|
||||
("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
|
||||
("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")),
|
||||
("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")),
|
||||
("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")),
|
||||
("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")),
|
||||
("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)"));
|
||||
ALTER TABLE t1 ENABLE KEYS;
|
||||
INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)'));
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (st varchar(100));
|
||||
INSERT INTO t1 VALUES ("Fake string");
|
||||
CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
|
||||
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
|
||||
ERROR HY000: Unknown error
|
||||
drop table t1, t2;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue