mirror of
https://github.com/MariaDB/server.git
synced 2025-06-20 21:01:21 +03:00
Merge
BitKeeper/etc/logging_ok: auto-union BUILD/autorun.sh: Auto merged BitKeeper/etc/config: Auto merged Makefile.am: Auto merged include/my_bitmap.h: Auto merged libmysqld/Makefile.am: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/r/ps_6bdb.result: Auto merged mysql-test/r/ps_7ndb.result: Auto merged mysys/Makefile.am: Auto merged mysys/default.c: Auto merged scripts/mysql_create_system_tables.sh: Auto merged scripts/mysql_fix_privilege_tables.sql: Auto merged sql/Makefile.am: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_ndbcluster.h: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_acl.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_udf.cc: Auto merged sql/sql_yacc.yy: Auto merged storage/heap/Makefile.am: Auto merged storage/heap/hp_hash.c: Auto merged storage/innobase/btr/btr0btr.c: Auto merged storage/innobase/btr/btr0cur.c: Auto merged storage/innobase/configure.in: Auto merged storage/innobase/fil/fil0fil.c: Auto merged storage/innobase/ibuf/ibuf0ibuf.c: Auto merged storage/innobase/include/os0file.h: Auto merged storage/innobase/include/page0cur.h: Auto merged storage/innobase/include/row0mysql.h: Auto merged storage/innobase/include/srv0srv.h: Auto merged storage/innobase/include/trx0trx.h: Auto merged storage/innobase/include/trx0trx.ic: Auto merged storage/innobase/lock/lock0lock.c: Auto merged storage/innobase/log/log0recv.c: Auto merged storage/innobase/os/os0file.c: Auto merged storage/innobase/page/page0cur.c: Auto merged storage/innobase/page/page0page.c: Auto merged storage/innobase/rem/rem0rec.c: Auto merged storage/innobase/row/row0mysql.c: Auto merged storage/innobase/row/row0sel.c: Auto merged storage/innobase/row/row0upd.c: Auto merged storage/innobase/srv/srv0srv.c: Auto merged storage/innobase/trx/trx0trx.c: Auto merged storage/innobase/trx/trx0undo.c: Auto merged storage/myisam/Makefile.am: Auto merged storage/myisam/mi_create.c: Auto merged storage/myisam/mi_open.c: Auto merged storage/myisam/mi_packrec.c: Auto merged storage/myisam/mi_unique.c: Auto merged storage/myisam/myisampack.c: Auto merged storage/myisammrg/Makefile.am: Auto merged storage/ndb/include/mgmcommon/ConfigRetriever.hpp: Auto merged storage/ndb/include/transporter/TransporterDefinitions.hpp: Auto merged storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged storage/ndb/src/mgmsrv/main.cpp: Auto merged storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged storage/ndb/test/ndbapi/create_tab.cpp: Auto merged storage/ndb/test/ndbapi/testBlobs.cpp: Auto merged strings/ctype-big5.c: Auto merged strings/ctype-ucs2.c: Auto merged support-files/mysql.spec.sh: Auto merged configure.in: merge mysql-test/t/disabled.def: merge mysys/my_bitmap.c: SCCS merged sql/ha_federated.cc: merge sql/ha_innodb.cc: merge sql/ha_ndbcluster.cc: merge sql/mysqld.cc: e merge sql/sql_insert.cc: merge sql/sql_lex.h: merge sql/sql_load.cc: merge sql/sql_select.cc: merge e C sql/sql_update.cc: merge sql/table.cc: merge
This commit is contained in:
@ -4,8 +4,14 @@
|
|||||||
aclocal || (echo "Can't execute aclocal" && exit 1)
|
aclocal || (echo "Can't execute aclocal" && exit 1)
|
||||||
autoheader || (echo "Can't execute autoheader" && exit 1)
|
autoheader || (echo "Can't execute autoheader" && exit 1)
|
||||||
# --force means overwrite ltmain.sh script if it already exists
|
# --force means overwrite ltmain.sh script if it already exists
|
||||||
libtoolize --automake --force \
|
# Added glibtoolize reference to make native OSX autotools work
|
||||||
|| (echo "Can't execute libtoolize" && exit 1)
|
if [ -f /usr/bin/glibtoolize ] ; then
|
||||||
|
glibtoolize --automake --force \
|
||||||
|
|| (echo "Can't execute glibtoolize" && exit 1)
|
||||||
|
else
|
||||||
|
libtoolize --automake --force \
|
||||||
|
|| (echo "Can't execute libtoolize" && exit 1)
|
||||||
|
fi
|
||||||
# --add-missing instructs automake to install missing auxiliary files
|
# --add-missing instructs automake to install missing auxiliary files
|
||||||
# and --force to overwrite them if they already exist
|
# and --force to overwrite them if they already exist
|
||||||
automake --add-missing --force \
|
automake --add-missing --force \
|
||||||
|
@ -36,22 +36,22 @@ CLEAN_FILES: $(txt_files)
|
|||||||
GT = $(srcdir)/Support/generate-text-files.pl
|
GT = $(srcdir)/Support/generate-text-files.pl
|
||||||
|
|
||||||
../INSTALL-SOURCE: mysql.info $(GT)
|
../INSTALL-SOURCE: mysql.info $(GT)
|
||||||
perl -w $(GT) mysql.info "Installing" "Tutorial" > $@
|
perl -w $(GT) mysql.info "installing-source" "windows-source-build" > $@
|
||||||
|
|
||||||
../INSTALL-WIN-SOURCE: mysql.info $(GT)
|
../INSTALL-WIN-SOURCE: mysql.info $(GT)
|
||||||
perl -w $(GT) mysql.info "Windows source build" "Post-installation" > $@
|
perl -w $(GT) mysql.info "windows-source-build" "post-installation" > $@
|
||||||
|
|
||||||
# We put the description for the binary installation here so that
|
# We put the description for the binary installation here so that
|
||||||
# people who download source wont have to see it. It is moved up to
|
# people who download source wont have to see it. It is moved up to
|
||||||
# the toplevel by the script that makes the binary tar files.
|
# the toplevel by the script that makes the binary tar files.
|
||||||
INSTALL-BINARY: mysql.info $(GT)
|
INSTALL-BINARY: mysql.info $(GT)
|
||||||
perl -w $(GT) mysql.info "Installing binary" "Installing source" > $@
|
perl -w $(GT) mysql.info "installing-binary" "installing-source" > $@
|
||||||
|
|
||||||
../EXCEPTIONS-CLIENT: mysql.info $(GT)
|
../EXCEPTIONS-CLIENT: mysql.info $(GT)
|
||||||
perl -w $(GT) mysql.info "MySQL FLOSS License Exception" "Function Index" > $@
|
perl -w $(GT) mysql.info "mysql-floss-license-exception" "function-index" > $@
|
||||||
|
|
||||||
../support-files/MacOSX/ReadMe.txt: mysql.info $(GT)
|
../support-files/MacOSX/ReadMe.txt: mysql.info $(GT)
|
||||||
perl -w $(GT) mysql.info "Mac OS X installation" "NetWare installation" > $@
|
perl -w $(GT) mysql.info "mac-os-x-installation" "netware-installation" > $@
|
||||||
|
|
||||||
# Don't update the files from bitkeeper
|
# Don't update the files from bitkeeper
|
||||||
%::SCCS/s.%
|
%::SCCS/s.%
|
||||||
|
@ -1,76 +0,0 @@
|
|||||||
This ALPHA build of MySQL 4.1 for the Windows platform does not come
|
|
||||||
with an installer. A full-featured installer is being developed for the
|
|
||||||
4.1 series, and it is scheduled to be released with MySQL 4.1 BETA.
|
|
||||||
|
|
||||||
** FRESH INSTALL **
|
|
||||||
|
|
||||||
To install MySQL 4.1 as a 'fresh' install, unzip this archive to a directory
|
|
||||||
of your choice (we suggest 'c:\', which will cause MySQL to be installed in
|
|
||||||
a directory named 'mysql' in 'c:\'). You should then follow the directions
|
|
||||||
in the user manual for starting/stopping MySQL:
|
|
||||||
|
|
||||||
(Windows 9x/ME) http://www.mysql.com/doc/en/Win95_start.html
|
|
||||||
(Windows NT/2000/XP) http://www.mysql.com/doc/en/NT_start.html
|
|
||||||
|
|
||||||
** UPGRADE INSTALL **
|
|
||||||
|
|
||||||
To install MySQL 4.1 as an upgrade to your current version of MySQL, you need
|
|
||||||
to perform the following steps:
|
|
||||||
|
|
||||||
* Back up your original installation (always a good idea!)
|
|
||||||
|
|
||||||
* Unzip the 4.1 archive to a directory that is different than where your
|
|
||||||
current MySQL installation is located. (Or, if you do unzip this
|
|
||||||
archive into the same location as your existing installation, do NOT
|
|
||||||
unpack the 'data' subdirectory. If you unpack the 'data' directory,
|
|
||||||
your existing databases will be overwritten.)
|
|
||||||
|
|
||||||
* Shut down all MySQL server processes/services.
|
|
||||||
|
|
||||||
* Remove the Win32 MySQL service (if appropriate for your OS):
|
|
||||||
|
|
||||||
c:\mysql\bin\mysqld-nt --remove
|
|
||||||
|
|
||||||
* Exit 'WinMySQLAdmin' (if it is running).
|
|
||||||
|
|
||||||
* If you unzipped this archive into a directory different than that
|
|
||||||
of your existing MySQL installation, copy from the archive all its
|
|
||||||
directories and their contents EXCEPT the 'data' directory into the
|
|
||||||
existing installation.
|
|
||||||
|
|
||||||
* Start the MySQL server with the '--skip-grant-tables' option. Assuming
|
|
||||||
your MySQL installation is located at 'c:\mysql', the command looks like
|
|
||||||
this:
|
|
||||||
|
|
||||||
c:\mysql\bin\mysqld-opt --skip-grant-tables
|
|
||||||
|
|
||||||
If your installation is located in some other directory, adjust the
|
|
||||||
pathname in that command (and in the following commands).
|
|
||||||
|
|
||||||
* Execute the 'mysql_fix_privilege_tables.sql' script that is located in
|
|
||||||
the 'scripts' directory:
|
|
||||||
|
|
||||||
c:\mysql\bin\mysql -f mysql < c:\mysql\scripts\mysql_fix_privilege_tables.sql
|
|
||||||
|
|
||||||
This script performs any actions necessary to convert your grant tables
|
|
||||||
to the current format. You may see some "duplicate column" warnings as
|
|
||||||
it runs; these can be ignored.
|
|
||||||
|
|
||||||
* Stop the server:
|
|
||||||
|
|
||||||
c:\mysql\bin\mysqladmin -u root shutdown
|
|
||||||
|
|
||||||
* Re-install the Win32 MySQL service (if required):
|
|
||||||
|
|
||||||
c:\mysql\bin\mysqld-nt --install
|
|
||||||
|
|
||||||
* Re-start the server or service using your normal startup procedure.
|
|
||||||
|
|
||||||
** Further Questions **
|
|
||||||
|
|
||||||
You can find further information about running MySQL on Windows in the
|
|
||||||
manual that ships in the 'Doc' subdirectory, or online at the MySQL AB
|
|
||||||
web site:
|
|
||||||
|
|
||||||
http://www.mysql.com/doc/en/Windows.html
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
flags=`grep @image mirrors.texi | cut -d" " -f1 | cut -d/ -f2 | tr -d "}" | sort | uniq`
|
|
||||||
|
|
||||||
set -x
|
|
||||||
cd Flags
|
|
||||||
|
|
||||||
for c in $flags
|
|
||||||
do
|
|
||||||
# For PNM, to be used later
|
|
||||||
giftopnm ../Raw-Flags/$c.gif | pnmscale -xsize 30 > $c-tmp.pnm
|
|
||||||
pnmpaste $c-tmp.pnm 1 1 ../Images/flag-background.pnm > $c.pnm
|
|
||||||
rm -f $c-tmp.pnm
|
|
||||||
|
|
||||||
# For GIF version
|
|
||||||
ppmtogif $c.pnm > $c.gif
|
|
||||||
# or cjpeg -optimize -quality 70 -outfile $c.jpg
|
|
||||||
|
|
||||||
# For EPS version
|
|
||||||
pnmtops -noturn $c.pnm > $c.eps
|
|
||||||
|
|
||||||
# For PDF version
|
|
||||||
ps2pdf $c.eps $c.pdf
|
|
||||||
|
|
||||||
# For text version
|
|
||||||
echo -n "" > $c.txt
|
|
||||||
|
|
||||||
# PNM isn't really needed
|
|
||||||
rm -f $c.pnm
|
|
||||||
|
|
||||||
done
|
|
@ -13,7 +13,7 @@ while (<IN>)
|
|||||||
{
|
{
|
||||||
if ($in)
|
if ($in)
|
||||||
{
|
{
|
||||||
if (/Node: $tnode,/)
|
if (/Node: $tnode,/ || /\[index/)
|
||||||
{
|
{
|
||||||
$in = 0;
|
$in = 0;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ EXTRA_DIST = INSTALL-SOURCE README COPYING EXCEPTIONS-CLIENT
|
|||||||
SUBDIRS = . include @docs_dirs@ @zlib_dir@ @yassl_dir@ \
|
SUBDIRS = . include @docs_dirs@ @zlib_dir@ @yassl_dir@ \
|
||||||
@readline_topdir@ sql-common \
|
@readline_topdir@ sql-common \
|
||||||
@thread_dirs@ pstack \
|
@thread_dirs@ pstack \
|
||||||
@sql_union_dirs@ scripts man tests \
|
@sql_union_dirs@ scripts @man_dirs@ tests \
|
||||||
netware @libmysqld_dirs@ \
|
netware @libmysqld_dirs@ \
|
||||||
@bench_dirs@ support-files @tools_dirs@
|
@bench_dirs@ support-files @tools_dirs@
|
||||||
|
|
||||||
@ -103,12 +103,12 @@ tags:
|
|||||||
|
|
||||||
test:
|
test:
|
||||||
cd mysql-test; \
|
cd mysql-test; \
|
||||||
perl mysql-test-run.pl && perl mysql-test-run.pl --ps-protocol
|
./mysql-test-run && ./mysql-test-run --ps-protocol
|
||||||
|
|
||||||
test-force:
|
test-force:
|
||||||
cd mysql-test; \
|
cd mysql-test; \
|
||||||
perl mysql-test-run.pl --force ;\
|
./mysql-test-run --force ;\
|
||||||
perl mysql-test-run.pl --ps-protocol --force
|
./mysql-test-run --ps-protocol --force
|
||||||
|
|
||||||
# Don't update the files from bitkeeper
|
# Don't update the files from bitkeeper
|
||||||
%::SCCS/s.%
|
%::SCCS/s.%
|
||||||
|
@ -84,7 +84,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=xilink6.exe
|
LINK32=xilink6.exe
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib ..\extra\yassl\Release\yassl.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld-debug.exe" /pdbtype:sept
|
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib ..\extra\yassl\Debug\yassl.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld-debug.exe" /pdbtype:sept
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "mysqld - Win32 nt"
|
!ELSEIF "$(CFG)" == "mysqld - Win32 nt"
|
||||||
|
|
||||||
|
@ -51,8 +51,8 @@ BSC32=bscmake.exe
|
|||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
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 ..\extra\yassl\Release\yassl.lib /nologo /out:"..\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.map" /subsystem:console
|
# 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 ..\extra\yassl\Debug\yassl.lib /nologo /out:"..\client_debug\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.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 mysqlclient.lib wsock32.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.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 mysqlclient.lib wsock32.lib mysys.lib regex.lib ..\extra\yassl\Debug\yassl.lib /nologo /out:"..\client_debug\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.map" /subsystem:console
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "mysql_client_test - Win32 Release"
|
!ELSEIF "$(CFG)" == "mysql_client_test - Win32 Release"
|
||||||
|
|
||||||
@ -76,8 +76,8 @@ BSC32=bscmake.exe
|
|||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
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 mysqlclient.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
|
# 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 mysqlclient.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\client_release\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /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 mysqlclient.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /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 mysqlclient.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\client_release\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@ else
|
|||||||
yassl_dummy_link_fix=
|
yassl_dummy_link_fix=
|
||||||
endif
|
endif
|
||||||
#AUTOMAKE_OPTIONS = nostdinc
|
#AUTOMAKE_OPTIONS = nostdinc
|
||||||
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \
|
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
|
||||||
$(openssl_includes) -I$(top_builddir)/include
|
-I$(top_srcdir)/regex $(openssl_includes)
|
||||||
LIBS = @CLIENT_LIBS@
|
LIBS = @CLIENT_LIBS@
|
||||||
LDADD= @CLIENT_EXTRA_LDFLAGS@ \
|
LDADD= @CLIENT_EXTRA_LDFLAGS@ \
|
||||||
$(top_builddir)/libmysql/libmysqlclient.la
|
$(top_builddir)/libmysql/libmysqlclient.la
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
#define EX_CONSCHECK 3
|
#define EX_CONSCHECK 3
|
||||||
#define EX_EOM 4
|
#define EX_EOM 4
|
||||||
#define EX_EOF 5 /* ferror for output file was got */
|
#define EX_EOF 5 /* ferror for output file was got */
|
||||||
|
#define EX_ILLEGAL_TABLE 6
|
||||||
|
|
||||||
/* index into 'show fields from table' */
|
/* index into 'show fields from table' */
|
||||||
|
|
||||||
@ -142,14 +143,6 @@ const char *compatible_mode_names[]=
|
|||||||
TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1,
|
TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1,
|
||||||
"", compatible_mode_names, NULL};
|
"", compatible_mode_names, NULL};
|
||||||
|
|
||||||
#define TABLE_RULE_HASH_SIZE 16
|
|
||||||
|
|
||||||
typedef struct st_table_rule_ent
|
|
||||||
{
|
|
||||||
char* key; /* dbname.tablename */
|
|
||||||
uint key_len;
|
|
||||||
} TABLE_RULE_ENT;
|
|
||||||
|
|
||||||
HASH ignore_table;
|
HASH ignore_table;
|
||||||
|
|
||||||
static struct my_option my_long_options[] =
|
static struct my_option my_long_options[] =
|
||||||
@ -476,7 +469,10 @@ static void write_header(FILE *sql_file, char *db_name)
|
|||||||
if (opt_xml)
|
if (opt_xml)
|
||||||
{
|
{
|
||||||
fputs("<?xml version=\"1.0\"?>\n", sql_file);
|
fputs("<?xml version=\"1.0\"?>\n", sql_file);
|
||||||
fputs("<mysqldump>\n", sql_file);
|
fputs("<mysqldump ", sql_file);
|
||||||
|
fputs("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"",
|
||||||
|
sql_file);
|
||||||
|
fputs(">\n", sql_file);
|
||||||
check_io(sql_file);
|
check_io(sql_file);
|
||||||
}
|
}
|
||||||
else if (!opt_compact)
|
else if (!opt_compact)
|
||||||
@ -543,30 +539,29 @@ static void write_footer(FILE *sql_file)
|
|||||||
}
|
}
|
||||||
} /* write_footer */
|
} /* write_footer */
|
||||||
|
|
||||||
|
static void free_table_ent(char *key)
|
||||||
|
|
||||||
static void free_table_ent(TABLE_RULE_ENT* e)
|
|
||||||
{
|
{
|
||||||
my_free((gptr) e, MYF(0));
|
my_free((gptr) key, MYF(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static byte* get_table_key(TABLE_RULE_ENT* e, uint* len,
|
byte* get_table_key(const char *entry, uint *length,
|
||||||
my_bool not_used __attribute__((unused)))
|
my_bool not_used __attribute__((unused)))
|
||||||
{
|
{
|
||||||
*len= e->key_len;
|
*length= strlen(entry);
|
||||||
return (byte*)e->key;
|
return (byte*) entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void init_table_rule_hash(HASH* h)
|
void init_table_rule_hash(HASH* h)
|
||||||
{
|
{
|
||||||
if(hash_init(h, charset_info, TABLE_RULE_HASH_SIZE, 0, 0,
|
if (hash_init(h, charset_info, 16, 0, 0,
|
||||||
(hash_get_key) get_table_key,
|
(hash_get_key) get_table_key,
|
||||||
(hash_free_key) free_table_ent, 0))
|
(hash_free_key) free_table_ent, 0))
|
||||||
exit(EX_EOM);
|
exit(EX_EOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static my_bool
|
static my_bool
|
||||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||||
char *argument)
|
char *argument)
|
||||||
@ -639,25 +634,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
break;
|
break;
|
||||||
case (int) OPT_IGNORE_TABLE:
|
case (int) OPT_IGNORE_TABLE:
|
||||||
{
|
{
|
||||||
uint len= (uint)strlen(argument);
|
|
||||||
TABLE_RULE_ENT* e;
|
|
||||||
if (!strchr(argument, '.'))
|
if (!strchr(argument, '.'))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n");
|
fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
/* len is always > 0 because we know the there exists a '.' */
|
|
||||||
e= (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT) + len, MYF(MY_WME));
|
|
||||||
if (!e)
|
|
||||||
exit(EX_EOM);
|
|
||||||
e->key= (char*)e + sizeof(TABLE_RULE_ENT);
|
|
||||||
e->key_len= len;
|
|
||||||
memcpy(e->key, argument, len);
|
|
||||||
|
|
||||||
if (!hash_inited(&ignore_table))
|
if (!hash_inited(&ignore_table))
|
||||||
init_table_rule_hash(&ignore_table);
|
init_table_rule_hash(&ignore_table);
|
||||||
|
|
||||||
if(my_hash_insert(&ignore_table, (byte*)e))
|
if (my_hash_insert(&ignore_table, (byte*)my_strdup(argument, MYF(0))))
|
||||||
exit(EX_EOM);
|
exit(EX_EOM);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -828,7 +813,8 @@ static void DB_error(MYSQL *mysql, const char *when)
|
|||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
mysql_query_with_error_report()
|
mysql_query_with_error_report()
|
||||||
mysql_con connection to use
|
mysql_con connection to use
|
||||||
res if non zero, result will be put there with mysql_store_result
|
res if non zero, result will be put there with
|
||||||
|
mysql_store_result()
|
||||||
query query to send to server
|
query query to send to server
|
||||||
|
|
||||||
RETURN VALUES
|
RETURN VALUES
|
||||||
@ -981,14 +967,41 @@ static char *quote_name(const char *name, char *buff, my_bool force)
|
|||||||
} /* quote_name */
|
} /* quote_name */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Quote a table name so it can be used in "SHOW TABLES LIKE <tabname>"
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
quote_for_like()
|
||||||
|
name name of the table
|
||||||
|
buff quoted name of the table
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
Quote \, _, ' and % characters
|
||||||
|
|
||||||
|
Note: Because MySQL uses the C escape syntax in strings
|
||||||
|
(for example, '\n' to represent newline), you must double
|
||||||
|
any '\' that you use in your LIKE strings. For example, to
|
||||||
|
search for '\n', specify it as '\\n'. To search for '\', specify
|
||||||
|
it as '\\\\' (the backslashes are stripped once by the parser
|
||||||
|
and another time when the pattern match is done, leaving a
|
||||||
|
single backslash to be matched).
|
||||||
|
|
||||||
|
Example: "t\1" => "t\\\\1"
|
||||||
|
|
||||||
|
*/
|
||||||
static char *quote_for_like(const char *name, char *buff)
|
static char *quote_for_like(const char *name, char *buff)
|
||||||
{
|
{
|
||||||
char *to= buff;
|
char *to= buff;
|
||||||
*to++= '\'';
|
*to++= '\'';
|
||||||
while (*name)
|
while (*name)
|
||||||
{
|
{
|
||||||
if (*name == '\'' || *name == '_' || *name == '\\' || *name == '%')
|
if (*name == '\\')
|
||||||
|
{
|
||||||
|
*to++='\\';
|
||||||
|
*to++='\\';
|
||||||
|
*to++='\\';
|
||||||
|
}
|
||||||
|
else if (*name == '\'' || *name == '_' || *name == '%')
|
||||||
*to++= '\\';
|
*to++= '\\';
|
||||||
*to++= *name++;
|
*to++= *name++;
|
||||||
}
|
}
|
||||||
@ -1073,6 +1086,40 @@ static void print_xml_tag1(FILE * xml_file, const char* sbeg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Print xml tag with for a field that is null
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
print_xml_null_tag()
|
||||||
|
xml_file - output file
|
||||||
|
sbeg - line beginning
|
||||||
|
stag_atr - tag and attribute
|
||||||
|
sval - value of attribute
|
||||||
|
send - line ending
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
Print tag with one attribute to the xml_file. Format is:
|
||||||
|
<stag_atr="sval" xsi:nil="true"/>
|
||||||
|
NOTE
|
||||||
|
sval MUST be a NULL terminated string.
|
||||||
|
sval string will be qouted before output.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void print_xml_null_tag(FILE * xml_file, const char* sbeg,
|
||||||
|
const char* stag_atr, const char* sval,
|
||||||
|
const char* send)
|
||||||
|
{
|
||||||
|
fputs(sbeg, xml_file);
|
||||||
|
fputs("<", xml_file);
|
||||||
|
fputs(stag_atr, xml_file);
|
||||||
|
fputs("\"", xml_file);
|
||||||
|
print_quoted_xml(xml_file, sval, strlen(sval));
|
||||||
|
fputs("\" xsi:nil=\"true\" />", xml_file);
|
||||||
|
fputs(send, xml_file);
|
||||||
|
check_io(xml_file);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Print xml tag with many attributes.
|
Print xml tag with many attributes.
|
||||||
|
|
||||||
@ -1139,6 +1186,7 @@ static uint get_table_structure(char *table, char *db)
|
|||||||
FILE *sql_file = md_result_file;
|
FILE *sql_file = md_result_file;
|
||||||
int len;
|
int len;
|
||||||
DBUG_ENTER("get_table_structure");
|
DBUG_ENTER("get_table_structure");
|
||||||
|
DBUG_PRINT("enter", ("db: %s, table: %s", db, table));
|
||||||
|
|
||||||
if (!insert_pat_inited)
|
if (!insert_pat_inited)
|
||||||
{
|
{
|
||||||
@ -1212,7 +1260,54 @@ static uint get_table_structure(char *table, char *db)
|
|||||||
if (strcmp(field->name, "View") == 0)
|
if (strcmp(field->name, "View") == 0)
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf(stderr, "-- It's a view, skipped\n");
|
fprintf(stderr, "-- It's a view, create dummy table for view\n");
|
||||||
|
|
||||||
|
mysql_free_result(tableRes);
|
||||||
|
|
||||||
|
/* Create a dummy table for the view. ie. a table which has the
|
||||||
|
same columns as the view should have. This table is dropped
|
||||||
|
just before the view is created. The table is used to handle the
|
||||||
|
case where a view references another view, which hasn't yet been
|
||||||
|
created(during the load of the dump). BUG#10927 */
|
||||||
|
|
||||||
|
/* Create temp table by selecting from the view */
|
||||||
|
my_snprintf(query_buff, sizeof(query_buff),
|
||||||
|
"CREATE TEMPORARY TABLE %s SELECT * FROM %s WHERE 0",
|
||||||
|
result_table, result_table);
|
||||||
|
if (mysql_query_with_error_report(sock, 0, query_buff))
|
||||||
|
{
|
||||||
|
safe_exit(EX_MYSQLERR);
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get CREATE statement for the temp table */
|
||||||
|
my_snprintf(query_buff, sizeof(query_buff), "SHOW CREATE TABLE %s",
|
||||||
|
result_table);
|
||||||
|
if (mysql_query_with_error_report(sock, 0, query_buff))
|
||||||
|
{
|
||||||
|
safe_exit(EX_MYSQLERR);
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
}
|
||||||
|
tableRes= mysql_store_result(sock);
|
||||||
|
row= mysql_fetch_row(tableRes);
|
||||||
|
|
||||||
|
if (opt_drop)
|
||||||
|
fprintf(sql_file, "DROP VIEW IF EXISTS %s;\n",opt_quoted_table);
|
||||||
|
|
||||||
|
/* Print CREATE statement but remove TEMPORARY */
|
||||||
|
fprintf(sql_file, "CREATE %s;\n", row[1]+17);
|
||||||
|
check_io(sql_file);
|
||||||
|
|
||||||
|
mysql_free_result(tableRes);
|
||||||
|
|
||||||
|
/* Drop the temp table */
|
||||||
|
my_snprintf(buff, sizeof(buff),
|
||||||
|
"DROP TEMPORARY TABLE %s", result_table);
|
||||||
|
if (mysql_query_with_error_report(sock, 0, buff))
|
||||||
|
{
|
||||||
|
safe_exit(EX_MYSQLERR);
|
||||||
|
DBUG_RETURN(0);
|
||||||
|
}
|
||||||
was_views= 1;
|
was_views= 1;
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
@ -1592,6 +1687,26 @@ static void dump_table(uint numFields, char *table)
|
|||||||
const char *table_type;
|
const char *table_type;
|
||||||
int error= 0;
|
int error= 0;
|
||||||
|
|
||||||
|
/* Check --no-data flag */
|
||||||
|
if (dFlag)
|
||||||
|
{
|
||||||
|
if (verbose)
|
||||||
|
fprintf(stderr,
|
||||||
|
"-- Skipping dump data for table '%s', --no-data was used\n",
|
||||||
|
table);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check that there are any fields in the table */
|
||||||
|
if (numFields == 0)
|
||||||
|
{
|
||||||
|
if (verbose)
|
||||||
|
fprintf(stderr,
|
||||||
|
"-- Skipping dump data for table '%s', it has no fields\n",
|
||||||
|
table);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
result_table= quote_name(table,table_buff, 1);
|
result_table= quote_name(table,table_buff, 1);
|
||||||
opt_quoted_table= quote_name(table, table_buff2, 0);
|
opt_quoted_table= quote_name(table, table_buff2, 0);
|
||||||
|
|
||||||
@ -1912,7 +2027,14 @@ static void dump_table(uint numFields, char *table)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fputs("NULL", md_result_file);
|
{
|
||||||
|
/* The field value is NULL */
|
||||||
|
if (!opt_xml)
|
||||||
|
fputs("NULL", md_result_file);
|
||||||
|
else
|
||||||
|
print_xml_null_tag(md_result_file, "\t\t", "field name=",
|
||||||
|
field->name, "\n");
|
||||||
|
}
|
||||||
check_io(md_result_file);
|
check_io(md_result_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2201,8 +2323,7 @@ static int dump_all_tables_in_db(char *database)
|
|||||||
if (include_table(hash_key, end - hash_key))
|
if (include_table(hash_key, end - hash_key))
|
||||||
{
|
{
|
||||||
numrows = get_table_structure(table, database);
|
numrows = get_table_structure(table, database);
|
||||||
if (!dFlag && numrows > 0)
|
dump_table(numrows,table);
|
||||||
dump_table(numrows,table);
|
|
||||||
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
|
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
|
||||||
order_by= 0;
|
order_by= 0;
|
||||||
}
|
}
|
||||||
@ -2327,27 +2448,61 @@ static int get_actual_table_name(const char *old_table_name,
|
|||||||
|
|
||||||
static int dump_selected_tables(char *db, char **table_names, int tables)
|
static int dump_selected_tables(char *db, char **table_names, int tables)
|
||||||
{
|
{
|
||||||
uint numrows;
|
uint numrows, i;
|
||||||
int i;
|
|
||||||
char table_buff[NAME_LEN*+3];
|
char table_buff[NAME_LEN*+3];
|
||||||
|
char new_table_name[NAME_LEN];
|
||||||
|
DYNAMIC_STRING lock_tables_query;
|
||||||
|
HASH dump_tables;
|
||||||
|
char *table_name;
|
||||||
|
DBUG_ENTER("dump_selected_tables");
|
||||||
|
|
||||||
if (init_dumping(db))
|
if (init_dumping(db))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
/* Init hash table for storing the actual name of tables to dump */
|
||||||
|
if (hash_init(&dump_tables, charset_info, 16, 0, 0,
|
||||||
|
(hash_get_key) get_table_key, (hash_free_key) free_table_ent,
|
||||||
|
0))
|
||||||
|
exit(EX_EOM);
|
||||||
|
|
||||||
|
init_dynamic_string(&lock_tables_query, "LOCK TABLES ", 256, 1024);
|
||||||
|
for (; tables > 0 ; tables-- , table_names++)
|
||||||
|
{
|
||||||
|
/* the table name passed on commandline may be wrong case */
|
||||||
|
if (!get_actual_table_name(*table_names,
|
||||||
|
new_table_name, sizeof(new_table_name)))
|
||||||
|
{
|
||||||
|
/* Add found table name to lock_tables_query */
|
||||||
|
if (lock_tables)
|
||||||
|
{
|
||||||
|
dynstr_append(&lock_tables_query,
|
||||||
|
quote_name(new_table_name, table_buff, 1));
|
||||||
|
dynstr_append(&lock_tables_query, " READ /*!32311 LOCAL */,");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add found table name to dump_tables list */
|
||||||
|
if (my_hash_insert(&dump_tables,
|
||||||
|
(byte*)my_strdup(new_table_name, MYF(0))))
|
||||||
|
exit(EX_EOM);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
my_printf_error(0,"Couldn't find table: \"%s\"\n", MYF(0),
|
||||||
|
*table_names);
|
||||||
|
safe_exit(EX_ILLEGAL_TABLE);
|
||||||
|
/* We shall countinue here, if --force was given */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (lock_tables)
|
if (lock_tables)
|
||||||
{
|
{
|
||||||
DYNAMIC_STRING query;
|
if (mysql_real_query(sock, lock_tables_query.str,
|
||||||
|
lock_tables_query.length-1))
|
||||||
init_dynamic_string(&query, "LOCK TABLES ", 256, 1024);
|
|
||||||
for (i=0 ; i < tables ; i++)
|
|
||||||
{
|
|
||||||
dynstr_append(&query, quote_name(table_names[i], table_buff, 1));
|
|
||||||
dynstr_append(&query, " READ /*!32311 LOCAL */,");
|
|
||||||
}
|
|
||||||
if (mysql_real_query(sock, query.str, query.length-1))
|
|
||||||
DB_error(sock, "when doing LOCK TABLES");
|
DB_error(sock, "when doing LOCK TABLES");
|
||||||
/* We shall countinue here, if --force was given */
|
/* We shall countinue here, if --force was given */
|
||||||
dynstr_free(&query);
|
|
||||||
}
|
}
|
||||||
|
dynstr_free(&lock_tables_query);
|
||||||
if (flush_logs)
|
if (flush_logs)
|
||||||
{
|
{
|
||||||
if (mysql_refresh(sock, REFRESH_LOG))
|
if (mysql_refresh(sock, REFRESH_LOG))
|
||||||
@ -2356,25 +2511,28 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
|||||||
}
|
}
|
||||||
if (opt_xml)
|
if (opt_xml)
|
||||||
print_xml_tag1(md_result_file, "", "database name=", db, "\n");
|
print_xml_tag1(md_result_file, "", "database name=", db, "\n");
|
||||||
for (i=0 ; i < tables ; i++)
|
|
||||||
{
|
|
||||||
char new_table_name[NAME_LEN];
|
|
||||||
|
|
||||||
/* the table name passed on commandline may be wrong case */
|
/* Dump each selected table */
|
||||||
if (!get_actual_table_name( table_names[i], new_table_name,
|
for (i= 0; i < dump_tables.records; i++)
|
||||||
sizeof(new_table_name)))
|
{
|
||||||
{
|
table_name= hash_element(&dump_tables, i);
|
||||||
numrows= get_table_structure(new_table_name, db);
|
DBUG_PRINT("info",("Dumping table %s", table_name));
|
||||||
dump_table(numrows, new_table_name);
|
numrows= get_table_structure(table_name, db);
|
||||||
}
|
dump_table(numrows, table_name);
|
||||||
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
|
|
||||||
order_by= 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Dump each selected view */
|
||||||
if (was_views)
|
if (was_views)
|
||||||
{
|
{
|
||||||
for (i=0 ; i < tables ; i++)
|
for(i=0; i < dump_tables.records; i++)
|
||||||
get_view_structure(table_names[i], db);
|
{
|
||||||
|
table_name= hash_element(&dump_tables, i);
|
||||||
|
get_view_structure(table_name, db);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
hash_free(&dump_tables);
|
||||||
|
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
|
||||||
|
order_by= 0;
|
||||||
if (opt_xml)
|
if (opt_xml)
|
||||||
{
|
{
|
||||||
fputs("</database>\n", md_result_file);
|
fputs("</database>\n", md_result_file);
|
||||||
@ -2382,7 +2540,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
|||||||
}
|
}
|
||||||
if (lock_tables)
|
if (lock_tables)
|
||||||
mysql_query_with_error_report(sock, 0, "UNLOCK TABLES");
|
mysql_query_with_error_report(sock, 0, "UNLOCK TABLES");
|
||||||
return 0;
|
DBUG_RETURN(0);
|
||||||
} /* dump_selected_tables */
|
} /* dump_selected_tables */
|
||||||
|
|
||||||
|
|
||||||
@ -2403,6 +2561,7 @@ static int do_show_master_status(MYSQL *mysql_con)
|
|||||||
row = mysql_fetch_row(master);
|
row = mysql_fetch_row(master);
|
||||||
if (row && row[0] && row[1])
|
if (row && row[0] && row[1])
|
||||||
{
|
{
|
||||||
|
/* SHOW MASTER STATUS reports file and position */
|
||||||
if (opt_comments)
|
if (opt_comments)
|
||||||
fprintf(md_result_file,
|
fprintf(md_result_file,
|
||||||
"\n--\n-- Position to start replication or point-in-time "
|
"\n--\n-- Position to start replication or point-in-time "
|
||||||
@ -2412,6 +2571,14 @@ static int do_show_master_status(MYSQL *mysql_con)
|
|||||||
comment_prefix, row[0], row[1]);
|
comment_prefix, row[0], row[1]);
|
||||||
check_io(md_result_file);
|
check_io(md_result_file);
|
||||||
}
|
}
|
||||||
|
else if (!ignore_errors)
|
||||||
|
{
|
||||||
|
/* SHOW MASTER STATUS reports nothing and --force is not enabled */
|
||||||
|
my_printf_error(0, "Error: Binlogging on server not active",
|
||||||
|
MYF(0), mysql_error(mysql_con));
|
||||||
|
mysql_free_result(master);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
mysql_free_result(master);
|
mysql_free_result(master);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -2752,6 +2919,7 @@ static my_bool get_view_structure(char *table, char* db)
|
|||||||
}
|
}
|
||||||
if (opt_drop)
|
if (opt_drop)
|
||||||
{
|
{
|
||||||
|
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", opt_quoted_table);
|
||||||
fprintf(sql_file, "DROP VIEW IF EXISTS %s;\n", opt_quoted_table);
|
fprintf(sql_file, "DROP VIEW IF EXISTS %s;\n", opt_quoted_table);
|
||||||
check_io(sql_file);
|
check_io(sql_file);
|
||||||
}
|
}
|
||||||
@ -2775,8 +2943,9 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
compatible_mode_normal_str[0]= 0;
|
compatible_mode_normal_str[0]= 0;
|
||||||
default_charset= (char *)mysql_universal_client_charset;
|
default_charset= (char *)mysql_universal_client_charset;
|
||||||
|
bzero((char*) &ignore_table, sizeof(ignore_table));
|
||||||
|
|
||||||
MY_INIT(argv[0]);
|
MY_INIT("mysqldump");
|
||||||
if (get_options(&argc, &argv))
|
if (get_options(&argc, &argv))
|
||||||
{
|
{
|
||||||
my_end(0);
|
my_end(0);
|
||||||
@ -2833,6 +3002,8 @@ err:
|
|||||||
if (md_result_file != stdout)
|
if (md_result_file != stdout)
|
||||||
my_fclose(md_result_file, MYF(0));
|
my_fclose(md_result_file, MYF(0));
|
||||||
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
|
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
|
||||||
|
if (hash_inited(&ignore_table))
|
||||||
|
hash_free(&ignore_table);
|
||||||
if (extended_insert)
|
if (extended_insert)
|
||||||
dynstr_free(&extended_row);
|
dynstr_free(&extended_row);
|
||||||
if (insert_pat_inited)
|
if (insert_pat_inited)
|
||||||
|
@ -60,6 +60,12 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <violite.h>
|
#include <violite.h>
|
||||||
#include <regex.h> /* Our own version of lib */
|
#include <regex.h> /* Our own version of lib */
|
||||||
|
#ifdef HAVE_SYS_WAIT_H
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#endif
|
||||||
|
#ifndef WEXITSTATUS
|
||||||
|
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
|
||||||
|
#endif
|
||||||
#define MAX_QUERY 131072
|
#define MAX_QUERY 131072
|
||||||
#define MAX_VAR_NAME 256
|
#define MAX_VAR_NAME 256
|
||||||
#define MAX_COLUMNS 256
|
#define MAX_COLUMNS 256
|
||||||
@ -986,9 +992,39 @@ static void do_exec(struct st_query* q)
|
|||||||
replace_dynstr_append(ds, buf);
|
replace_dynstr_append(ds, buf);
|
||||||
}
|
}
|
||||||
error= pclose(res_file);
|
error= pclose(res_file);
|
||||||
|
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
die("command \"%s\" failed", cmd);
|
{
|
||||||
|
uint status= WEXITSTATUS(error), i;
|
||||||
|
my_bool ok= 0;
|
||||||
|
|
||||||
|
if (q->abort_on_error)
|
||||||
|
die("At line %u: command \"%s\" failed", start_lineno, cmd);
|
||||||
|
|
||||||
|
DBUG_PRINT("info",
|
||||||
|
("error: %d, status: %d", error, status));
|
||||||
|
for (i=0 ; (uint) i < q->expected_errors ; i++)
|
||||||
|
{
|
||||||
|
DBUG_PRINT("info",
|
||||||
|
("error: %d, status: %d", error, status));
|
||||||
|
DBUG_PRINT("info", ("expected error: %d",
|
||||||
|
q->expected_errno[i].code.errnum));
|
||||||
|
if ((q->expected_errno[i].type == ERR_ERRNO) &&
|
||||||
|
(q->expected_errno[i].code.errnum == status))
|
||||||
|
ok= 1;
|
||||||
|
verbose_msg("At line %u: command \"%s\" failed with expected error: %d",
|
||||||
|
start_lineno, cmd, status);
|
||||||
|
}
|
||||||
|
if (!ok)
|
||||||
|
die("At line: %u: command \"%s\" failed with wrong error: %d",
|
||||||
|
start_lineno, cmd, status);
|
||||||
|
}
|
||||||
|
else if (q->expected_errno[0].type == ERR_ERRNO &&
|
||||||
|
q->expected_errno[0].code.errnum != 0)
|
||||||
|
{
|
||||||
|
/* Error code we wanted was != 0, i.e. not an expected success */
|
||||||
|
die("At line: %u: command \"%s\" succeeded - should have failed with errno %d...",
|
||||||
|
start_lineno, cmd, q->expected_errno[0].code.errnum);
|
||||||
|
}
|
||||||
|
|
||||||
if (!disable_result_log)
|
if (!disable_result_log)
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
ASRC=vi.c emacs.c common.c
|
ASRC=vi.c emacs.c common.c
|
||||||
AHDR=vi.h emacs.h common.h
|
AHDR=vi.h emacs.h common.h
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/include -I$(srcdir)/../.. -I..
|
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
|
||||||
|
-I$(srcdir)/../.. -I..
|
||||||
|
|
||||||
noinst_LIBRARIES = libedit.a
|
noinst_LIBRARIES = libedit.a
|
||||||
|
|
||||||
|
@ -51,13 +51,13 @@ cv_undo(EditLine *el)
|
|||||||
{
|
{
|
||||||
c_undo_t *vu = &el->el_chared.c_undo;
|
c_undo_t *vu = &el->el_chared.c_undo;
|
||||||
c_redo_t *r = &el->el_chared.c_redo;
|
c_redo_t *r = &el->el_chared.c_redo;
|
||||||
uint size;
|
int size;
|
||||||
|
|
||||||
/* Save entire line for undo */
|
/* Save entire line for undo */
|
||||||
size = el->el_line.lastchar - el->el_line.buffer;
|
size = el->el_line.lastchar - el->el_line.buffer;
|
||||||
vu->len = size;
|
vu->len = size;
|
||||||
vu->cursor = el->el_line.cursor - el->el_line.buffer;
|
vu->cursor = el->el_line.cursor - el->el_line.buffer;
|
||||||
memcpy(vu->buf, el->el_line.buffer, size);
|
memcpy(vu->buf, el->el_line.buffer, (size_t)size);
|
||||||
|
|
||||||
/* save command info for redo */
|
/* save command info for redo */
|
||||||
r->count = el->el_state.doingarg ? el->el_state.argument : 0;
|
r->count = el->el_state.doingarg ? el->el_state.argument : 0;
|
||||||
|
@ -3,7 +3,8 @@
|
|||||||
# Copyright (C) 1994,1996,1997 Free Software Foundation, Inc.
|
# Copyright (C) 1994,1996,1997 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# Last -I$(top_srcdir) needed for RedHat!
|
# Last -I$(top_srcdir) needed for RedHat!
|
||||||
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
|
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
|
||||||
|
-I$(top_srcdir)
|
||||||
|
|
||||||
noinst_LIBRARIES = libreadline.a
|
noinst_LIBRARIES = libreadline.a
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
dnl -*- ksh -*-
|
dnl -*- ksh -*-
|
||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_PREREQ(2.50)dnl Minimum Autoconf version required.
|
AC_PREREQ(2.58)dnl Minimum Autoconf version required.
|
||||||
|
|
||||||
AC_INIT(sql/mysqld.cc)
|
AC_INIT(sql/mysqld.cc)
|
||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_SYSTEM
|
||||||
@ -343,7 +343,7 @@ AC_SUBST(CXXFLAGS)
|
|||||||
AC_SUBST(LD)
|
AC_SUBST(LD)
|
||||||
AC_SUBST(INSTALL_SCRIPT)
|
AC_SUBST(INSTALL_SCRIPT)
|
||||||
|
|
||||||
export CC CXX CFLAGS LD LDFLAGS AR
|
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
|
||||||
|
|
||||||
if test "$GCC" = "yes"
|
if test "$GCC" = "yes"
|
||||||
then
|
then
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||||
# MA 02111-1307, USA
|
# MA 02111-1307, USA
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/include
|
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
|
||||||
LDADD = libdbug.a ../mysys/libmysys.a ../strings/libmystrings.a
|
LDADD = libdbug.a ../mysys/libmysys.a ../strings/libmystrings.a
|
||||||
pkglib_LIBRARIES = libdbug.a
|
pkglib_LIBRARIES = libdbug.a
|
||||||
noinst_HEADERS = dbug_long.h
|
noinst_HEADERS = dbug_long.h
|
||||||
|
@ -14,9 +14,8 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/include \
|
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
|
||||||
@ndbcluster_includes@ -I$(top_srcdir)/sql \
|
@ndbcluster_includes@ -I$(top_srcdir)/sql
|
||||||
-I$(top_builddir)/include
|
|
||||||
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \
|
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \
|
||||||
../dbug/libdbug.a ../strings/libmystrings.a
|
../dbug/libdbug.a ../strings/libmystrings.a
|
||||||
BUILT_SOURCES= $(top_builddir)/include/mysqld_error.h \
|
BUILT_SOURCES= $(top_builddir)/include/mysqld_error.h \
|
||||||
|
@ -445,7 +445,7 @@ const opaque master_label[MASTER_LABEL_SZ + 1] = "master secret";
|
|||||||
const opaque key_label [KEY_LABEL_SZ + 1] = "key expansion";
|
const opaque key_label [KEY_LABEL_SZ + 1] = "key expansion";
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
} // naemspace
|
||||||
|
|
||||||
#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
|
#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
|
||||||
/*
|
/*
|
||||||
@ -456,4 +456,5 @@ const opaque key_label [KEY_LABEL_SZ + 1] = "key expansion";
|
|||||||
using yaSSL::byte;
|
using yaSSL::byte;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif // yaSSL_TYPES_HPP
|
#endif // yaSSL_TYPES_HPP
|
||||||
|
@ -5,3 +5,4 @@ libyassl_a_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \
|
|||||||
handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \
|
handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \
|
||||||
template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp
|
template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp
|
||||||
EXTRA_DIST = ../include/*.hpp ../include/openssl/*.h
|
EXTRA_DIST = ../include/*.hpp ../include/openssl/*.h
|
||||||
|
AM_CXXFLAGS = -DYASSL_PURE_C
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h> // memcpy
|
#include <string.h> // memcpy
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "buffer.hpp"
|
#include "buffer.hpp"
|
||||||
#include "yassl_types.hpp"
|
#include "yassl_types.hpp"
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "cert_wrapper.hpp"
|
#include "cert_wrapper.hpp"
|
||||||
#include "yassl_int.hpp"
|
#include "yassl_int.hpp"
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
/* Locking functions
|
/* Locking functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "lock.hpp"
|
#include "lock.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
/* Debug logging functions
|
/* Debug logging functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "log.hpp"
|
#include "log.hpp"
|
||||||
|
|
||||||
#ifdef YASSL_LOG
|
#ifdef YASSL_LOG
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "socket_wrapper.hpp"
|
#include "socket_wrapper.hpp"
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
@ -1,3 +1,29 @@
|
|||||||
|
/* template_instnt.cpp
|
||||||
|
*
|
||||||
|
* Copyright (C) 2003 Sawtooth Consulting Ltd.
|
||||||
|
*
|
||||||
|
* This file is part of yaSSL.
|
||||||
|
*
|
||||||
|
* yaSSL is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* yaSSL is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Explicit template instantiation requests
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "runtime.hpp"
|
#include "runtime.hpp"
|
||||||
#include "handshake.hpp"
|
#include "handshake.hpp"
|
||||||
#include "yassl_int.hpp"
|
#include "yassl_int.hpp"
|
||||||
@ -15,7 +41,7 @@ template class HMAC<MD5>;
|
|||||||
template class HMAC<SHA>;
|
template class HMAC<SHA>;
|
||||||
template class HMAC<RIPEMD160>;
|
template class HMAC<RIPEMD160>;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // USE_CRYPTOPP_LIB
|
||||||
|
|
||||||
namespace mySTL {
|
namespace mySTL {
|
||||||
template class list<unsigned char*>;
|
template class list<unsigned char*>;
|
||||||
@ -64,4 +90,6 @@ template void ysDelete<Message>(Message*);
|
|||||||
template void ysArrayDelete<unsigned char>(unsigned char*);
|
template void ysArrayDelete<unsigned char>(unsigned char*);
|
||||||
template void ysArrayDelete<char>(char*);
|
template void ysArrayDelete<char>(char*);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
#endif // HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "timer.hpp"
|
#include "timer.hpp"
|
||||||
|
|
||||||
namespace yaSSL {
|
namespace yaSSL {
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
/* yaSSL error implements and an exception class
|
/* yaSSL error implements and an exception class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "yassl_error.hpp"
|
#include "yassl_error.hpp"
|
||||||
|
|
||||||
namespace yaSSL {
|
namespace yaSSL {
|
||||||
|
@ -33,28 +33,36 @@
|
|||||||
|
|
||||||
void* operator new(size_t sz, yaSSL::new_t)
|
void* operator new(size_t sz, yaSSL::new_t)
|
||||||
{
|
{
|
||||||
|
#ifdef YASSL_PURE_C
|
||||||
void* ptr = malloc(sz ? sz : 1);
|
void* ptr = malloc(sz ? sz : 1);
|
||||||
if (!ptr) abort();
|
if (!ptr) abort();
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
|
#else
|
||||||
|
return ::operator new(sz);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void* operator new[](size_t sz, yaSSL::new_t)
|
|
||||||
{
|
|
||||||
void* ptr = malloc(sz ? sz : 1);
|
|
||||||
if (!ptr) abort();
|
|
||||||
|
|
||||||
return ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator delete(void* ptr, yaSSL::new_t)
|
void operator delete(void* ptr, yaSSL::new_t)
|
||||||
{
|
{
|
||||||
|
#ifdef YASSL_PURE_C
|
||||||
if (ptr) free(ptr);
|
if (ptr) free(ptr);
|
||||||
|
#else
|
||||||
|
::operator delete(ptr);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete[](void* ptr, yaSSL::new_t)
|
|
||||||
|
void* operator new[](size_t sz, yaSSL::new_t nt)
|
||||||
{
|
{
|
||||||
if (ptr) free(ptr);
|
return ::operator new(sz, nt);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void operator delete[](void* ptr, yaSSL::new_t nt)
|
||||||
|
{
|
||||||
|
::operator delete(ptr, nt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -923,7 +931,7 @@ void SSL::setKeys()
|
|||||||
|
|
||||||
|
|
||||||
// local functors
|
// local functors
|
||||||
namespace yassl_int_cpp_local1 {
|
namespace yassl_int_cpp_local1 { // for explicit templates
|
||||||
|
|
||||||
struct SumData {
|
struct SumData {
|
||||||
uint total_;
|
uint total_;
|
||||||
@ -1385,7 +1393,8 @@ Sessions::~Sessions()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace yassl_int_cpp_local2 { // locals
|
// locals
|
||||||
|
namespace yassl_int_cpp_local2 { // for explicit templates
|
||||||
|
|
||||||
typedef mySTL::list<SSL_SESSION*>::iterator iterator;
|
typedef mySTL::list<SSL_SESSION*>::iterator iterator;
|
||||||
|
|
||||||
@ -1974,6 +1983,8 @@ X509_NAME* X509::GetSubject()
|
|||||||
return &subject_;
|
return &subject_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
|
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
|
||||||
@ -1983,3 +1994,4 @@ template yaSSL::yassl_int_cpp_local1::SumBuffer for_each<mySTL::list<yaSSL::outp
|
|||||||
template mySTL::list<yaSSL::SSL_SESSION*>::iterator find_if<mySTL::list<yaSSL::SSL_SESSION*>::iterator, yaSSL::yassl_int_cpp_local2::sess_match>(mySTL::list<yaSSL::SSL_SESSION*>::iterator, mySTL::list<yaSSL::SSL_SESSION*>::iterator, yaSSL::yassl_int_cpp_local2::sess_match);
|
template mySTL::list<yaSSL::SSL_SESSION*>::iterator find_if<mySTL::list<yaSSL::SSL_SESSION*>::iterator, yaSSL::yassl_int_cpp_local2::sess_match>(mySTL::list<yaSSL::SSL_SESSION*>::iterator, mySTL::list<yaSSL::SSL_SESSION*>::iterator, yaSSL::yassl_int_cpp_local2::sess_match);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined(yaSSL_NEW_HPP) && defined(__GNUC__)
|
#if !defined(yaSSL_NEW_HPP) && defined(__GNUC__) && !defined(__ICC)
|
||||||
|
|
||||||
#define yaSSL_NEW_HPP
|
#define yaSSL_NEW_HPP
|
||||||
|
|
||||||
|
@ -31,10 +31,8 @@
|
|||||||
|
|
||||||
namespace TaoCrypt {
|
namespace TaoCrypt {
|
||||||
|
|
||||||
// define this if running on a big-endian CPU
|
|
||||||
#if !defined(LITTLE_ENDIAN_ORDER) && (defined(__BIG_ENDIAN__) || \
|
#if defined(WORDS_BIGENDIAN) || (defined(__MWERKS__) && !defined(__INTEL__))
|
||||||
defined(__sparc) || defined(__sparc__) || defined(__hppa__) || \
|
|
||||||
defined(__mips__) || (defined(__MWERKS__) && !defined(__INTEL__)))
|
|
||||||
#define BIG_ENDIAN_ORDER
|
#define BIG_ENDIAN_ORDER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -47,34 +45,28 @@ typedef unsigned char byte;
|
|||||||
typedef unsigned short word16;
|
typedef unsigned short word16;
|
||||||
typedef unsigned int word32;
|
typedef unsigned int word32;
|
||||||
|
|
||||||
#if defined(__GNUC__) || defined(__MWERKS__) || defined(_LONGLONG_TYPE)
|
#if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
|
||||||
#define WORD64_AVAILABLE
|
|
||||||
#define WORD64_IS_DISTINCT_TYPE
|
|
||||||
typedef unsigned long long word64;
|
|
||||||
#define W64LIT(x) x##LL
|
|
||||||
#elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
|
|
||||||
#define WORD64_AVAILABLE
|
#define WORD64_AVAILABLE
|
||||||
#define WORD64_IS_DISTINCT_TYPE
|
#define WORD64_IS_DISTINCT_TYPE
|
||||||
typedef unsigned __int64 word64;
|
typedef unsigned __int64 word64;
|
||||||
#define W64LIT(x) x##ui64
|
#elif SIZEOF_LONG == 8
|
||||||
#elif defined(__DECCXX)
|
|
||||||
#define WORD64_AVAILABLE
|
#define WORD64_AVAILABLE
|
||||||
typedef unsigned long word64;
|
typedef unsigned long word64;
|
||||||
#endif
|
#elif SIZEOF_LONG_LONG == 8
|
||||||
|
#define WORD64_AVAILABLE
|
||||||
// define largest word type
|
#define WORD64_IS_DISTINCT_TYPE
|
||||||
#ifdef WORD64_AVAILABLE
|
typedef unsigned long long word64;
|
||||||
typedef word64 lword;
|
|
||||||
#else
|
|
||||||
typedef word32 lword;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// TODO: FIXME, add asm multiply for x86_64 on Solaris and remove !__sun
|
// compilers we've found 64-bit multiply insructions for
|
||||||
|
#if defined(__GNUC__) || defined(_MSC_VER) || defined(__DECCXX)
|
||||||
|
#define HAVE_64_MULTIPLY
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(__alpha__) || (defined(__ia64__) && !defined(__INTEL_COMPILER)) || \
|
#if defined(HAVE_64_MULTIPLY) && (defined(__alpha__) || defined(__ia64__) \
|
||||||
defined(_ARCH_PPC64) || defined(__mips64) || \
|
|| defined(_ARCH_PPC64) || defined(__mips64) || defined(__x86_64__))
|
||||||
(defined(__x86_64__) && !defined(__sun))
|
|
||||||
// These platforms have 64-bit CPU registers. Unfortunately most C++ compilers
|
// These platforms have 64-bit CPU registers. Unfortunately most C++ compilers
|
||||||
// don't allow any way to access the 64-bit by 64-bit multiply instruction
|
// don't allow any way to access the 64-bit by 64-bit multiply instruction
|
||||||
// without using assembly, so in order to use word64 as word, the assembly
|
// without using assembly, so in order to use word64 as word, the assembly
|
||||||
@ -84,7 +76,7 @@ typedef unsigned int word32;
|
|||||||
#else
|
#else
|
||||||
#define TAOCRYPT_NATIVE_DWORD_AVAILABLE
|
#define TAOCRYPT_NATIVE_DWORD_AVAILABLE
|
||||||
#ifdef WORD64_AVAILABLE
|
#ifdef WORD64_AVAILABLE
|
||||||
#define TAOCRYPT_SLOW_WORD64
|
#define TAOCRYPT_SLOW_WORD64
|
||||||
typedef word16 hword;
|
typedef word16 hword;
|
||||||
typedef word32 word;
|
typedef word32 word;
|
||||||
typedef word64 dword;
|
typedef word64 dword;
|
||||||
|
@ -6,3 +6,4 @@ libtaocrypt_a_SOURCES = aes.cpp aestables.cpp algebra.cpp arc4.cpp asn.cpp \
|
|||||||
md2.cpp md5.cpp misc.cpp random.cpp ripemd.cpp rsa.cpp sha.cpp \
|
md2.cpp md5.cpp misc.cpp random.cpp ripemd.cpp rsa.cpp sha.cpp \
|
||||||
template_instnt.cpp
|
template_instnt.cpp
|
||||||
EXTRA_DIST = ../include/*.hpp
|
EXTRA_DIST = ../include/*.hpp
|
||||||
|
AM_CXXFLAGS = -DYASSL_PURE_C
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
/* based on Wei Dai's aestables.cpp from CryptoPP */
|
/* based on Wei Dai's aestables.cpp from CryptoPP */
|
||||||
|
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "aes.hpp"
|
#include "aes.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
@ -319,9 +319,11 @@ void AbstractRing::SimultaneousExponentiate(Integer *results,
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
|
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
|
||||||
namespace mySTL {
|
namespace mySTL {
|
||||||
template TaoCrypt::WindowSlider* uninit_copy<TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*>(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*);
|
template TaoCrypt::WindowSlider* uninit_copy<TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*>(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*);
|
||||||
template void destroy<TaoCrypt::WindowSlider*>(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*);
|
template void destroy<TaoCrypt::WindowSlider*>(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
/* based on Wei Dai's arc4.cpp from CryptoPP */
|
/* based on Wei Dai's arc4.cpp from CryptoPP */
|
||||||
|
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "arc4.hpp"
|
#include "arc4.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
/* coding.cpp implements hex and base64 encoding/decoing
|
/* coding.cpp implements hex and base64 encoding/decoing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "coding.hpp"
|
#include "coding.hpp"
|
||||||
#include "file.hpp"
|
#include "file.hpp"
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
/* file.cpp implements File Sources and Sinks
|
/* file.cpp implements File Sources and Sinks
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "file.hpp"
|
#include "file.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +35,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && defined(_WIN64) // 64 bit X overflow intrinsic
|
// 64bit multiply overflow intrinsic
|
||||||
|
#if defined(_MSC_VER) && defined(_WIN64) && !defined(__INTEL_COMPILER) && \
|
||||||
|
!defined(TAOCRYPT_NATIVE_DWORD_AVAILABLE)
|
||||||
#ifdef __ia64__
|
#ifdef __ia64__
|
||||||
#define myUMULH __UMULH
|
#define myUMULH __UMULH
|
||||||
#elif __x86_64__
|
#elif __x86_64__
|
||||||
@ -3956,6 +3958,7 @@ Integer CRT(const Integer &xp, const Integer &p, const Integer &xq,
|
|||||||
return p * (u * (xq-xp) % q) + xp;
|
return p * (u * (xq-xp) % q) + xp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
|
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
|
||||||
#ifndef TAOCRYPT_NATIVE_DWORD_AVAILABLE
|
#ifndef TAOCRYPT_NATIVE_DWORD_AVAILABLE
|
||||||
template hword DivideThreeWordsByTwo<hword, Word>(hword*, hword, hword, Word*);
|
template hword DivideThreeWordsByTwo<hword, Word>(hword*, hword, hword, Word*);
|
||||||
|
@ -22,34 +22,43 @@
|
|||||||
/* based on Wei Dai's misc.cpp from CryptoPP */
|
/* based on Wei Dai's misc.cpp from CryptoPP */
|
||||||
|
|
||||||
|
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "misc.hpp"
|
#include "misc.hpp"
|
||||||
#include <new> // for NewHandler
|
#include <new> // for NewHandler
|
||||||
|
|
||||||
|
|
||||||
void* operator new(size_t sz, TaoCrypt::new_t)
|
void* operator new(size_t sz, TaoCrypt::new_t)
|
||||||
{
|
{
|
||||||
|
#ifdef YASSL_PURE_C
|
||||||
void* ptr = malloc(sz ? sz : 1);
|
void* ptr = malloc(sz ? sz : 1);
|
||||||
if (!ptr) abort();
|
if (!ptr) abort();
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
|
#else
|
||||||
|
return ::operator new(sz);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void* operator new[](size_t sz, TaoCrypt::new_t)
|
|
||||||
{
|
|
||||||
void* ptr = malloc(sz ? sz : 1);
|
|
||||||
if (!ptr) abort();
|
|
||||||
|
|
||||||
return ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator delete(void* ptr, TaoCrypt::new_t)
|
void operator delete(void* ptr, TaoCrypt::new_t)
|
||||||
{
|
{
|
||||||
|
#ifdef YASSL_PURE_C
|
||||||
if (ptr) free(ptr);
|
if (ptr) free(ptr);
|
||||||
|
#else
|
||||||
|
::operator delete(ptr);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete[](void* ptr, TaoCrypt::new_t)
|
|
||||||
|
void* operator new[](size_t sz, TaoCrypt::new_t nt)
|
||||||
{
|
{
|
||||||
if (ptr) free(ptr);
|
return ::operator new(sz, nt);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void operator delete[](void* ptr, TaoCrypt::new_t nt)
|
||||||
|
{
|
||||||
|
::operator delete(ptr, nt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
specific seed, switch to /dev/random for more security but may block
|
specific seed, switch to /dev/random for more security but may block
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "runtime.hpp"
|
||||||
#include "random.hpp"
|
#include "random.hpp"
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
@ -1,3 +1,29 @@
|
|||||||
|
/* template_instnt.cpp
|
||||||
|
*
|
||||||
|
* Copyright (C) 2003 Sawtooth Consulting Ltd.
|
||||||
|
*
|
||||||
|
* This file is part of yaSSL.
|
||||||
|
*
|
||||||
|
* yaSSL is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* yaSSL is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Explicit template instantiation requests
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "integer.hpp"
|
#include "integer.hpp"
|
||||||
#include "rsa.hpp"
|
#include "rsa.hpp"
|
||||||
#include "algebra.hpp"
|
#include "algebra.hpp"
|
||||||
@ -6,9 +32,11 @@
|
|||||||
|
|
||||||
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
|
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
|
||||||
namespace TaoCrypt {
|
namespace TaoCrypt {
|
||||||
|
|
||||||
#if defined(SSE2_INTRINSICS_AVAILABLE)
|
#if defined(SSE2_INTRINSICS_AVAILABLE)
|
||||||
template AlignedAllocator<unsigned int>::pointer StdReallocate<unsigned int, AlignedAllocator<unsigned int> >(AlignedAllocator<unsigned int>&, unsigned int*, AlignedAllocator<unsigned int>::size_type, AlignedAllocator<unsigned int>::size_type, bool);
|
template AlignedAllocator<unsigned int>::pointer StdReallocate<unsigned int, AlignedAllocator<unsigned int> >(AlignedAllocator<unsigned int>&, unsigned int*, AlignedAllocator<unsigned int>::size_type, AlignedAllocator<unsigned int>::size_type, bool);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template class RSA_Decryptor<RSA_BlockType2>;
|
template class RSA_Decryptor<RSA_BlockType2>;
|
||||||
template class RSA_Encryptor<RSA_BlockType1>;
|
template class RSA_Encryptor<RSA_BlockType1>;
|
||||||
template class RSA_Encryptor<RSA_BlockType2>;
|
template class RSA_Encryptor<RSA_BlockType2>;
|
||||||
@ -17,10 +45,12 @@ template void tcArrayDelete<byte>(byte*);
|
|||||||
template AllocatorWithCleanup<byte>::pointer StdReallocate<byte, AllocatorWithCleanup<byte> >(AllocatorWithCleanup<byte>&, byte*, AllocatorWithCleanup<byte>::size_type, AllocatorWithCleanup<byte>::size_type, bool);
|
template AllocatorWithCleanup<byte>::pointer StdReallocate<byte, AllocatorWithCleanup<byte> >(AllocatorWithCleanup<byte>&, byte*, AllocatorWithCleanup<byte>::size_type, AllocatorWithCleanup<byte>::size_type, bool);
|
||||||
template void tcArrayDelete<word>(word*);
|
template void tcArrayDelete<word>(word*);
|
||||||
template AllocatorWithCleanup<word>::pointer StdReallocate<word, AllocatorWithCleanup<word> >(AllocatorWithCleanup<word>&, word*, AllocatorWithCleanup<word>::size_type, AllocatorWithCleanup<word>::size_type, bool);
|
template AllocatorWithCleanup<word>::pointer StdReallocate<word, AllocatorWithCleanup<word> >(AllocatorWithCleanup<word>&, word*, AllocatorWithCleanup<word>::size_type, AllocatorWithCleanup<word>::size_type, bool);
|
||||||
|
|
||||||
#ifndef TAOCRYPT_SLOW_WORD64 // defined when word != word32
|
#ifndef TAOCRYPT_SLOW_WORD64 // defined when word != word32
|
||||||
template void tcArrayDelete<word32>(word32*);
|
template void tcArrayDelete<word32>(word32*);
|
||||||
template AllocatorWithCleanup<word32>::pointer StdReallocate<word32, AllocatorWithCleanup<word32> >(AllocatorWithCleanup<word32>&, word32*, AllocatorWithCleanup<word32>::size_type, AllocatorWithCleanup<word32>::size_type, bool);
|
template AllocatorWithCleanup<word32>::pointer StdReallocate<word32, AllocatorWithCleanup<word32> >(AllocatorWithCleanup<word32>&, word32*, AllocatorWithCleanup<word32>::size_type, AllocatorWithCleanup<word32>::size_type, bool);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template void tcArrayDelete<char>(char*);
|
template void tcArrayDelete<char>(char*);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,11 +46,21 @@ extern "C" {
|
|||||||
#undef HAVE_SYS_MMAN_H
|
#undef HAVE_SYS_MMAN_H
|
||||||
#undef HAVE_SYNCH_H
|
#undef HAVE_SYNCH_H
|
||||||
#undef HAVE_MMAP
|
#undef HAVE_MMAP
|
||||||
|
|
||||||
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
|
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
|
||||||
#define HAVE_PTHREAD_SIGMASK 1
|
#define HAVE_PTHREAD_SIGMASK 1
|
||||||
#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
|
#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
|
||||||
#define HAVE_BROKEN_REALPATH 1
|
#define HAVE_BROKEN_REALPATH 1
|
||||||
|
|
||||||
|
#undef HAVE_POSIX_SIGNALS
|
||||||
|
#undef HAVE_PTHREAD_ATTR_SETSCOPE
|
||||||
|
#undef HAVE_ALLOC_A
|
||||||
|
#undef HAVE_FINITE
|
||||||
|
#undef HAVE_GETPWNAM
|
||||||
|
#undef HAVE_GETPWUID
|
||||||
|
#undef HAVE_PTHREAD_SETSCHEDPARAM
|
||||||
|
#undef HAVE_READLINK
|
||||||
|
#undef HAVE_STPCPY
|
||||||
/* no libc crypt() function */
|
/* no libc crypt() function */
|
||||||
#ifdef HAVE_OPENSSL
|
#ifdef HAVE_OPENSSL
|
||||||
#define HAVE_CRYPT 1
|
#define HAVE_CRYPT 1
|
||||||
|
@ -367,6 +367,7 @@ enum ha_base_keytype {
|
|||||||
#define HA_STATE_EXTEND_BLOCK 2048
|
#define HA_STATE_EXTEND_BLOCK 2048
|
||||||
#define HA_STATE_RNEXT_SAME 4096 /* rnext_same was called */
|
#define HA_STATE_RNEXT_SAME 4096 /* rnext_same was called */
|
||||||
|
|
||||||
|
/* myisampack expects no more than 32 field types. */
|
||||||
enum en_fieldtype {
|
enum en_fieldtype {
|
||||||
FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE,
|
FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE,
|
||||||
FIELD_SKIP_ZERO,FIELD_BLOB,FIELD_CONSTANT,FIELD_INTERVALL,FIELD_ZERO,
|
FIELD_SKIP_ZERO,FIELD_BLOB,FIELD_CONSTANT,FIELD_INTERVALL,FIELD_ZERO,
|
||||||
|
@ -46,6 +46,8 @@ extern my_bool bitmap_is_clear_all(const MY_BITMAP *map);
|
|||||||
extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size);
|
extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size);
|
||||||
extern my_bool bitmap_is_set_all(const MY_BITMAP *map);
|
extern my_bool bitmap_is_set_all(const MY_BITMAP *map);
|
||||||
extern my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2);
|
extern my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2);
|
||||||
|
extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit);
|
||||||
|
extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit);
|
||||||
extern uint bitmap_set_next(MY_BITMAP *map);
|
extern uint bitmap_set_next(MY_BITMAP *map);
|
||||||
extern uint bitmap_get_first(const MY_BITMAP *map);
|
extern uint bitmap_get_first(const MY_BITMAP *map);
|
||||||
extern uint bitmap_get_first_set(const MY_BITMAP *map);
|
extern uint bitmap_get_first_set(const MY_BITMAP *map);
|
||||||
|
@ -295,10 +295,8 @@ C_MODE_END
|
|||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ATOMIC_ADD
|
#ifdef HAVE_ATOMIC_ADD
|
||||||
#if defined(__ia64__)
|
|
||||||
#define new my_arg_new
|
#define new my_arg_new
|
||||||
#define need_to_restore_new 1
|
#define need_to_restore_new 1
|
||||||
#endif
|
|
||||||
C_MODE_START
|
C_MODE_START
|
||||||
#include <asm/atomic.h>
|
#include <asm/atomic.h>
|
||||||
C_MODE_END
|
C_MODE_END
|
||||||
@ -341,6 +339,11 @@ C_MODE_END
|
|||||||
#undef HAVE_FINITE
|
#undef HAVE_FINITE
|
||||||
#undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */
|
#undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */
|
||||||
#undef LONGLONG_MAX /* standard system library 'limits.h' */
|
#undef LONGLONG_MAX /* standard system library 'limits.h' */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define HAVE_RINT /* rint() and isnan() functions are not */
|
||||||
|
#define rint(a) std::rint(a) /* visible in C++ scope due to an error */
|
||||||
|
#define isnan(a) std::isnan(a) /* in the usr/include/math.h on QNX */
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* We can not live without the following defines */
|
/* We can not live without the following defines */
|
||||||
@ -393,10 +396,7 @@ int __void__;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define some useful general macros */
|
/* Define some useful general macros */
|
||||||
#if defined(__cplusplus) && defined(__GNUC__)
|
#if !defined(max)
|
||||||
#define max(a, b) ((a) >? (b))
|
|
||||||
#define min(a, b) ((a) <? (b))
|
|
||||||
#elif !defined(max)
|
|
||||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
@ -866,6 +866,9 @@ extern void add_compiled_collation(CHARSET_INFO *cs);
|
|||||||
extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info,
|
extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info,
|
||||||
char *to, ulong to_length,
|
char *to, ulong to_length,
|
||||||
const char *from, ulong length);
|
const char *from, ulong length);
|
||||||
|
extern ulong escape_quotes_for_mysql(CHARSET_INFO *charset_info,
|
||||||
|
char *to, ulong to_length,
|
||||||
|
const char *from, ulong length);
|
||||||
|
|
||||||
extern void thd_increment_bytes_sent(ulong length);
|
extern void thd_increment_bytes_sent(ulong length);
|
||||||
extern void thd_increment_bytes_received(ulong length);
|
extern void thd_increment_bytes_received(ulong length);
|
||||||
|
@ -218,6 +218,18 @@ enum mysql_rpl_type
|
|||||||
MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
|
MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef struct character_set
|
||||||
|
{
|
||||||
|
unsigned int number; /* character set number */
|
||||||
|
unsigned int state; /* character set state */
|
||||||
|
const char *csname; /* collation name */
|
||||||
|
const char *name; /* character set name */
|
||||||
|
const char *comment; /* comment */
|
||||||
|
const char *dir; /* character set directory */
|
||||||
|
unsigned int mbminlen; /* min. length for multibyte strings */
|
||||||
|
unsigned int mbmaxlen; /* max. length for multibyte strings */
|
||||||
|
} MY_CHARSET_INFO;
|
||||||
|
|
||||||
struct st_mysql_methods;
|
struct st_mysql_methods;
|
||||||
|
|
||||||
typedef struct st_mysql
|
typedef struct st_mysql
|
||||||
@ -418,6 +430,8 @@ my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q,
|
|||||||
unsigned long length);
|
unsigned long length);
|
||||||
my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
|
my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
|
||||||
unsigned long length);
|
unsigned long length);
|
||||||
|
void STDCALL mysql_get_character_set_info(MYSQL *mysql,
|
||||||
|
MY_CHARSET_INFO *charset);
|
||||||
|
|
||||||
/* local infile support */
|
/* local infile support */
|
||||||
|
|
||||||
|
@ -137,17 +137,18 @@ enum enum_server_command
|
|||||||
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16
|
#define SERVER_QUERY_NO_GOOD_INDEX_USED 16
|
||||||
#define SERVER_QUERY_NO_INDEX_USED 32
|
#define SERVER_QUERY_NO_INDEX_USED 32
|
||||||
/*
|
/*
|
||||||
The server was able to fulfill client request and open read-only
|
The server was able to fulfill the clients request and opened a
|
||||||
non-scrollable cursor for the query. This flag comes in server
|
read-only non-scrollable cursor for a query. This flag comes
|
||||||
status with reply to COM_EXECUTE and COM_EXECUTE_DIRECT commands.
|
in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
|
||||||
*/
|
*/
|
||||||
#define SERVER_STATUS_CURSOR_EXISTS 64
|
#define SERVER_STATUS_CURSOR_EXISTS 64
|
||||||
/*
|
/*
|
||||||
This flag is sent with last row of read-only cursor, in reply to
|
This flag is sent when a read-only cursor is exhausted, in reply to
|
||||||
COM_FETCH command.
|
COM_STMT_FETCH command.
|
||||||
*/
|
*/
|
||||||
#define SERVER_STATUS_LAST_ROW_SENT 128
|
#define SERVER_STATUS_LAST_ROW_SENT 128
|
||||||
#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */
|
#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */
|
||||||
|
#define SERVER_STATUS_NO_BACKSLASH_ESCAPES 512
|
||||||
|
|
||||||
#define MYSQL_ERRMSG_SIZE 512
|
#define MYSQL_ERRMSG_SIZE 512
|
||||||
#define NET_READ_TIMEOUT 30 /* Timeout on read */
|
#define NET_READ_TIMEOUT 30 /* Timeout on read */
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
target = libmysqlclient.la
|
target = libmysqlclient.la
|
||||||
target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@
|
target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@
|
||||||
LIBS = @CLIENT_LIBS@
|
LIBS = @CLIENT_LIBS@
|
||||||
INCLUDES = -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ \
|
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
|
||||||
-I$(top_builddir)/include
|
$(openssl_includes) @ZLIB_INCLUDES@
|
||||||
|
|
||||||
include $(srcdir)/Makefile.shared
|
include $(srcdir)/Makefile.shared
|
||||||
|
|
||||||
|
@ -1495,6 +1495,21 @@ const char * STDCALL mysql_character_set_name(MYSQL *mysql)
|
|||||||
return mysql->charset->csname;
|
return mysql->charset->csname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo)
|
||||||
|
{
|
||||||
|
csinfo->number = mysql->charset->number;
|
||||||
|
csinfo->state = mysql->charset->state;
|
||||||
|
csinfo->csname = mysql->charset->csname;
|
||||||
|
csinfo->name = mysql->charset->name;
|
||||||
|
csinfo->comment = mysql->charset->comment;
|
||||||
|
csinfo->mbminlen = mysql->charset->mbminlen;
|
||||||
|
csinfo->mbmaxlen = mysql->charset->mbmaxlen;
|
||||||
|
|
||||||
|
if (mysql->options.charset_dir)
|
||||||
|
csinfo->dir = mysql->options.charset_dir;
|
||||||
|
else
|
||||||
|
csinfo->dir = charsets_dir;
|
||||||
|
}
|
||||||
|
|
||||||
int STDCALL mysql_set_character_set(MYSQL *mysql, char *cs_name)
|
int STDCALL mysql_set_character_set(MYSQL *mysql, char *cs_name)
|
||||||
{
|
{
|
||||||
@ -1616,7 +1631,14 @@ ulong STDCALL
|
|||||||
mysql_real_escape_string(MYSQL *mysql, char *to,const char *from,
|
mysql_real_escape_string(MYSQL *mysql, char *to,const char *from,
|
||||||
ulong length)
|
ulong length)
|
||||||
{
|
{
|
||||||
return escape_string_for_mysql(mysql->charset, to, 0, from, length);
|
if (mysql->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES)
|
||||||
|
{
|
||||||
|
return escape_quotes_for_mysql(mysql->charset, to, 0, from, length);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return escape_string_for_mysql(mysql->charset, to, 0, from, length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2726,7 +2748,6 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
|
|||||||
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
|
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
stmt->server_status= mysql->server_status;
|
|
||||||
if (cli_read_binary_rows(stmt))
|
if (cli_read_binary_rows(stmt))
|
||||||
return 1;
|
return 1;
|
||||||
stmt->server_status= mysql->server_status;
|
stmt->server_status= mysql->server_status;
|
||||||
|
@ -149,5 +149,6 @@ EXPORTS
|
|||||||
mysql_server_init
|
mysql_server_init
|
||||||
mysql_server_end
|
mysql_server_end
|
||||||
mysql_set_character_set
|
mysql_set_character_set
|
||||||
|
mysql_get_character_set_info
|
||||||
get_defaults_files
|
get_defaults_files
|
||||||
modify_defaults_file
|
modify_defaults_file
|
||||||
|
@ -24,8 +24,8 @@ target = libmysqlclient_r.la
|
|||||||
target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
|
target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
|
||||||
LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
|
LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ \
|
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
|
||||||
-I$(top_builddir)/include
|
$(openssl_includes) @ZLIB_INCLUDES@
|
||||||
## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include
|
## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include
|
||||||
include $(top_srcdir)/libmysql/Makefile.shared
|
include $(top_srcdir)/libmysql/Makefile.shared
|
||||||
|
|
||||||
|
@ -25,10 +25,10 @@ DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
|
|||||||
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
|
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
|
||||||
-DDATADIR="\"$(MYSQLDATAdir)\"" \
|
-DDATADIR="\"$(MYSQLDATAdir)\"" \
|
||||||
-DSHAREDIR="\"$(MYSQLSHAREdir)\""
|
-DSHAREDIR="\"$(MYSQLSHAREdir)\""
|
||||||
INCLUDES= @bdb_includes@ -I$(top_srcdir)/include \
|
INCLUDES= @bdb_includes@ \
|
||||||
|
-I$(top_builddir)/include -I$(top_srcdir)/include \
|
||||||
-I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples \
|
-I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples \
|
||||||
-I$(top_srcdir)/regex \
|
-I$(top_srcdir)/regex \
|
||||||
-I$(top_builddir)/include \
|
|
||||||
$(openssl_includes) @ZLIB_INCLUDES@
|
$(openssl_includes) @ZLIB_INCLUDES@
|
||||||
|
|
||||||
noinst_LIBRARIES = libmysqld_int.a
|
noinst_LIBRARIES = libmysqld_int.a
|
||||||
|
@ -31,9 +31,9 @@ link_sources:
|
|||||||
done;
|
done;
|
||||||
|
|
||||||
DEFS = -DEMBEDDED_LIBRARY
|
DEFS = -DEMBEDDED_LIBRARY
|
||||||
INCLUDES = -I$(top_srcdir)/include -I$(srcdir) \
|
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) \
|
||||||
-I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \
|
-I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \
|
||||||
-I$(top_builddir)/include $(openssl_includes)
|
$(openssl_includes)
|
||||||
LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@
|
LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@
|
||||||
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS)
|
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS)
|
||||||
|
|
||||||
|
@ -773,7 +773,7 @@ send_ok(THD *thd,ha_rows affected_rows,ulonglong id,const char *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
send_eof(THD *thd, bool no_flush)
|
send_eof(THD *thd)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem
|
|||||||
std_data/server-cert.pem std_data/server-key.pem
|
std_data/server-cert.pem std_data/server-key.pem
|
||||||
CLEANFILES = $(test_SCRIPTS) $(test_DATA)
|
CLEANFILES = $(test_SCRIPTS) $(test_DATA)
|
||||||
|
|
||||||
INCLUDES = -I$(srcdir)/../include -I../include -I..
|
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
|
||||||
EXTRA_PROGRAMS = mysql_test_run_new
|
EXTRA_PROGRAMS = mysql_test_run_new
|
||||||
noinst_HEADERS = my_manage.h
|
noinst_HEADERS = my_manage.h
|
||||||
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c
|
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c
|
||||||
@ -48,6 +48,7 @@ mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c
|
|||||||
dist-hook:
|
dist-hook:
|
||||||
mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \
|
mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \
|
||||||
$(distdir)/std_data $(distdir)/lib
|
$(distdir)/std_data $(distdir)/lib
|
||||||
|
-$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t
|
||||||
$(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t
|
$(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t
|
||||||
$(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t
|
$(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t
|
||||||
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t
|
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t
|
||||||
@ -70,6 +71,7 @@ install-data-local:
|
|||||||
$(DESTDIR)$(testdir)/std_data \
|
$(DESTDIR)$(testdir)/std_data \
|
||||||
$(DESTDIR)$(testdir)/lib
|
$(DESTDIR)$(testdir)/lib
|
||||||
$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir)
|
$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir)
|
||||||
|
-$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t
|
||||||
$(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t
|
$(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t
|
||||||
$(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t
|
$(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t
|
||||||
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t
|
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t
|
||||||
|
4
mysql-test/include/not_openssl.inc
Normal file
4
mysql-test/include/not_openssl.inc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
-- require r/not_openssl.require
|
||||||
|
disable_query_log;
|
||||||
|
show variables like "have_openssl";
|
||||||
|
enable_query_log;
|
@ -33,7 +33,7 @@ eval create table t9
|
|||||||
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
||||||
c5 integer, c6 bigint, c7 float, c8 double,
|
c5 integer, c6 bigint, c7 float, c8 double,
|
||||||
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
||||||
c13 date, c14 datetime, c15 timestamp(14), c16 time,
|
c13 date, c14 datetime, c15 timestamp, c16 time,
|
||||||
c17 year, c18 tinyint, c19 bool, c20 char,
|
c17 year, c18 tinyint, c19 bool, c20 char,
|
||||||
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
||||||
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
||||||
|
@ -128,7 +128,7 @@ CREATE TABLE tables_priv (
|
|||||||
Table_name char(64) binary DEFAULT '' NOT NULL,
|
Table_name char(64) binary DEFAULT '' NOT NULL,
|
||||||
Grantor char(77) DEFAULT '' NOT NULL,
|
Grantor char(77) DEFAULT '' NOT NULL,
|
||||||
Timestamp timestamp(14),
|
Timestamp timestamp(14),
|
||||||
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
|
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
|
||||||
Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
|
Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
|
||||||
PRIMARY KEY (Host,Db,User,Table_name),KEY Grantor (Grantor)
|
PRIMARY KEY (Host,Db,User,Table_name),KEY Grantor (Grantor)
|
||||||
) engine=MyISAM
|
) engine=MyISAM
|
||||||
|
@ -8,7 +8,7 @@ use File::Basename;
|
|||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
sub collect_test_cases ($);
|
sub collect_test_cases ($);
|
||||||
sub collect_one_test_case ($$$$$);
|
sub collect_one_test_case ($$$$$$);
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@ -46,18 +46,36 @@ sub collect_test_cases ($) {
|
|||||||
{
|
{
|
||||||
mtr_error("Test case $tname ($testdir/$elem) is not found");
|
mtr_error("Test case $tname ($testdir/$elem) is not found");
|
||||||
}
|
}
|
||||||
collect_one_test_case($testdir,$resdir,$tname,$elem,$cases);
|
collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,{});
|
||||||
}
|
}
|
||||||
closedir TESTDIR;
|
closedir TESTDIR;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# Skip some tests listed in disabled.def
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
my %skiplist;
|
||||||
|
my $skipfile= "$testdir/disabled.def";
|
||||||
|
if ( open(SKIPFILE, $skipfile) )
|
||||||
|
{
|
||||||
|
while ( <SKIPFILE> )
|
||||||
|
{
|
||||||
|
chomp;
|
||||||
|
if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
|
||||||
|
{
|
||||||
|
$skiplist{$1}= $2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close SKIPFILE;
|
||||||
|
}
|
||||||
|
|
||||||
foreach my $elem ( sort readdir(TESTDIR) ) {
|
foreach my $elem ( sort readdir(TESTDIR) ) {
|
||||||
my $tname= mtr_match_extension($elem,"test");
|
my $tname= mtr_match_extension($elem,"test");
|
||||||
next if ! defined $tname;
|
next if ! defined $tname;
|
||||||
next if $::opt_do_test and ! defined mtr_match_prefix($elem,$::opt_do_test);
|
next if $::opt_do_test and ! defined mtr_match_prefix($elem,$::opt_do_test);
|
||||||
|
|
||||||
collect_one_test_case($testdir,$resdir,$tname,$elem,$cases);
|
collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%skiplist);
|
||||||
}
|
}
|
||||||
closedir TESTDIR;
|
closedir TESTDIR;
|
||||||
}
|
}
|
||||||
@ -95,12 +113,13 @@ sub collect_test_cases ($) {
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
|
||||||
sub collect_one_test_case($$$$$) {
|
sub collect_one_test_case($$$$$$) {
|
||||||
my $testdir= shift;
|
my $testdir= shift;
|
||||||
my $resdir= shift;
|
my $resdir= shift;
|
||||||
my $tname= shift;
|
my $tname= shift;
|
||||||
my $elem= shift;
|
my $elem= shift;
|
||||||
my $cases= shift;
|
my $cases= shift;
|
||||||
|
my $skiplist=shift;
|
||||||
|
|
||||||
my $path= "$testdir/$elem";
|
my $path= "$testdir/$elem";
|
||||||
|
|
||||||
@ -272,6 +291,14 @@ sub collect_one_test_case($$$$$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# FIXME why this late?
|
||||||
|
if ( $skiplist->{$tname} )
|
||||||
|
{
|
||||||
|
$tinfo->{'skip'}= 1;
|
||||||
|
$tinfo->{'disable'}= 1; # Sub type of 'skip'
|
||||||
|
$tinfo->{'comment'}= $skiplist->{$tname} if $skiplist->{$tname};
|
||||||
|
}
|
||||||
|
|
||||||
if ( -f $disabled )
|
if ( -f $disabled )
|
||||||
{
|
{
|
||||||
$tinfo->{'skip'}= 1;
|
$tinfo->{'skip'}= 1;
|
||||||
|
@ -83,18 +83,19 @@ sub mtr_script_exists (@) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub mtr_exe_exists (@) {
|
sub mtr_exe_exists (@) {
|
||||||
foreach my $path ( @_ )
|
my @path= @_;
|
||||||
|
map {$_.= ".exe"} @path if $::glob_win32;
|
||||||
|
foreach my $path ( @path )
|
||||||
{
|
{
|
||||||
$path.= ".exe" if $::opt_win32;
|
|
||||||
return $path if -x $path;
|
return $path if -x $path;
|
||||||
}
|
}
|
||||||
if ( @_ == 1 )
|
if ( @path == 1 )
|
||||||
{
|
{
|
||||||
mtr_error("Could not find $_[0]");
|
mtr_error("Could not find $path[0]");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mtr_error("Could not find any of " . join(" ", @_));
|
mtr_error("Could not find any of " . join(" ", @path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ sub mysqld_arguments ($$$$$);
|
|||||||
sub stop_masters_slaves ();
|
sub stop_masters_slaves ();
|
||||||
sub stop_masters ();
|
sub stop_masters ();
|
||||||
sub stop_slaves ();
|
sub stop_slaves ();
|
||||||
sub run_mysqltest ($$);
|
sub run_mysqltest ($);
|
||||||
sub usage ($);
|
sub usage ($);
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
@ -419,7 +419,8 @@ sub initial_setup () {
|
|||||||
{
|
{
|
||||||
# Windows programs like 'mysqld' needs Windows paths
|
# Windows programs like 'mysqld' needs Windows paths
|
||||||
$glob_mysql_test_dir= `cygpath -m $glob_mysql_test_dir`;
|
$glob_mysql_test_dir= `cygpath -m $glob_mysql_test_dir`;
|
||||||
$glob_cygwin_shell= `cygpath -w $ENV{'SHELL'}`; # The Windows path c:\...
|
my $shell= $ENV{'SHELL'} || "/bin/bash";
|
||||||
|
$glob_cygwin_shell= `cygpath -w $shell`; # The Windows path c:\...
|
||||||
chomp($glob_mysql_test_dir);
|
chomp($glob_mysql_test_dir);
|
||||||
chomp($glob_cygwin_shell);
|
chomp($glob_cygwin_shell);
|
||||||
}
|
}
|
||||||
@ -791,13 +792,15 @@ sub executable_setup () {
|
|||||||
my $path_examples= "$glob_basedir/libmysqld/examples";
|
my $path_examples= "$glob_basedir/libmysqld/examples";
|
||||||
$exe_mysqltest= mtr_exe_exists("$path_examples/mysqltest");
|
$exe_mysqltest= mtr_exe_exists("$path_examples/mysqltest");
|
||||||
$exe_mysql_client_test=
|
$exe_mysql_client_test=
|
||||||
mtr_exe_exists("$path_examples/mysql_client_test_embedded");
|
mtr_exe_exists("$path_examples/mysql_client_test_embedded",
|
||||||
|
"/usr/bin/false");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
|
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
|
||||||
$exe_mysql_client_test=
|
$exe_mysql_client_test=
|
||||||
mtr_exe_exists("$glob_basedir/tests/mysql_client_test");
|
mtr_exe_exists("$glob_basedir/tests/mysql_client_test",
|
||||||
|
"/usr/bin/false");
|
||||||
}
|
}
|
||||||
$exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump");
|
$exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump");
|
||||||
$exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow");
|
$exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow");
|
||||||
@ -819,7 +822,8 @@ sub executable_setup () {
|
|||||||
$exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin");
|
$exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin");
|
||||||
$exe_mysql= mtr_exe_exists("$path_client_bindir/mysql");
|
$exe_mysql= mtr_exe_exists("$path_client_bindir/mysql");
|
||||||
$exe_mysql_fix_system_tables=
|
$exe_mysql_fix_system_tables=
|
||||||
mtr_script_exists("$path_client_bindir/mysql_fix_privilege_tables");
|
mtr_script_exists("$path_client_bindir/mysql_fix_privilege_tables",
|
||||||
|
"$glob_basedir/scripts/mysql_fix_privilege_tables");
|
||||||
|
|
||||||
$path_language= mtr_path_exists("$glob_basedir/share/mysql/english/",
|
$path_language= mtr_path_exists("$glob_basedir/share/mysql/english/",
|
||||||
"$glob_basedir/share/english/");
|
"$glob_basedir/share/english/");
|
||||||
@ -833,13 +837,15 @@ sub executable_setup () {
|
|||||||
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest_embedded");
|
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest_embedded");
|
||||||
$exe_mysql_client_test=
|
$exe_mysql_client_test=
|
||||||
mtr_exe_exists("$glob_basedir/tests/mysql_client_test_embedded",
|
mtr_exe_exists("$glob_basedir/tests/mysql_client_test_embedded",
|
||||||
"$path_client_bindir/mysql_client_test_embedded");
|
"$path_client_bindir/mysql_client_test_embedded",
|
||||||
|
"/usr/bin/false");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
|
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
|
||||||
$exe_mysql_client_test=
|
$exe_mysql_client_test=
|
||||||
mtr_exe_exists("$path_client_bindir/mysql_client_test");
|
mtr_exe_exists("$path_client_bindir/mysql_client_test",
|
||||||
|
"/usr/bin/false"); # FIXME temporary
|
||||||
}
|
}
|
||||||
|
|
||||||
$path_ndb_tools_dir= "$glob_basedir/bin";
|
$path_ndb_tools_dir= "$glob_basedir/bin";
|
||||||
@ -1342,10 +1348,11 @@ sub run_testcase ($) {
|
|||||||
|
|
||||||
if ( ! $glob_use_running_server and ! $glob_use_embedded_server )
|
if ( ! $glob_use_running_server and ! $glob_use_embedded_server )
|
||||||
{
|
{
|
||||||
if ( $tinfo->{'master_restart'} or $master->[0]->{'uses_special_flags'} )
|
if ( $tinfo->{'master_restart'} or
|
||||||
|
$master->[0]->{'running_master_is_special'} )
|
||||||
{
|
{
|
||||||
stop_masters();
|
stop_masters();
|
||||||
$master->[0]->{'uses_special_flags'}= 0; # Forget about why we stopped
|
$master->[0]->{'running_master_is_special'}= 0; # Forget why we stopped
|
||||||
}
|
}
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
@ -1423,9 +1430,9 @@ sub run_testcase ($) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( @{$tinfo->{'master_opt'}} )
|
if ( $tinfo->{'master_restart'} )
|
||||||
{
|
{
|
||||||
$master->[0]->{'uses_special_flags'}= 1;
|
$master->[0]->{'running_master_is_special'}= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1472,7 +1479,7 @@ sub run_testcase ($) {
|
|||||||
}
|
}
|
||||||
unlink($path_timefile);
|
unlink($path_timefile);
|
||||||
|
|
||||||
my $res= run_mysqltest($tinfo, $tinfo->{'master_opt'});
|
my $res= run_mysqltest($tinfo);
|
||||||
|
|
||||||
if ( $res == 0 )
|
if ( $res == 0 )
|
||||||
{
|
{
|
||||||
@ -1547,17 +1554,18 @@ sub do_before_start_master ($$) {
|
|||||||
$tname ne "rpl_crash_binlog_ib_3b")
|
$tname ne "rpl_crash_binlog_ib_3b")
|
||||||
{
|
{
|
||||||
# FIXME we really want separate dir for binlogs
|
# FIXME we really want separate dir for binlogs
|
||||||
foreach my $bin ( glob("$opt_vardir/log/master*-bin.*") )
|
foreach my $bin ( glob("$opt_vardir/log/master*-bin*") )
|
||||||
{
|
{
|
||||||
unlink($bin);
|
unlink($bin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# FIXME only remove the ones that are tied to this master
|
||||||
# Remove old master.info and relay-log.info files
|
# Remove old master.info and relay-log.info files
|
||||||
unlink("$opt_vardir/master-data/master.info");
|
unlink("$master->[0]->{'path_myddir'}/master.info");
|
||||||
unlink("$opt_vardir/master-data/relay-log.info");
|
unlink("$master->[0]->{'path_myddir'}/relay-log.info");
|
||||||
unlink("$opt_vardir/master1-data/master.info");
|
unlink("$master->[1]->{'path_myddir'}/master.info");
|
||||||
unlink("$opt_vardir/master1-data/relay-log.info");
|
unlink("$master->[1]->{'path_myddir'}/relay-log.info");
|
||||||
|
|
||||||
# Run master initialization shell script if one exists
|
# Run master initialization shell script if one exists
|
||||||
if ( $init_script )
|
if ( $init_script )
|
||||||
@ -1584,13 +1592,13 @@ sub do_before_start_slave ($$) {
|
|||||||
$tname ne "rpl_crash_binlog_ib_3b" )
|
$tname ne "rpl_crash_binlog_ib_3b" )
|
||||||
{
|
{
|
||||||
# FIXME we really want separate dir for binlogs
|
# FIXME we really want separate dir for binlogs
|
||||||
foreach my $bin ( glob("$opt_vardir/log/slave*-bin.*") )
|
foreach my $bin ( glob("$opt_vardir/log/slave*-bin*") )
|
||||||
{
|
{
|
||||||
unlink($bin);
|
unlink($bin);
|
||||||
}
|
}
|
||||||
# FIXME really master?!
|
# FIXME really master?!
|
||||||
unlink("$opt_vardir/slave-data/master.info");
|
unlink("$slave->[0]->{'path_myddir'}/master.info");
|
||||||
unlink("$opt_vardir/slave-data/relay-log.info");
|
unlink("$slave->[0]->{'path_myddir'}/relay-log.info");
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run slave initialization shell script if one exists
|
# Run slave initialization shell script if one exists
|
||||||
@ -1604,8 +1612,10 @@ sub do_before_start_slave ($$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
`rm -f $opt_vardir/slave-data/log.*`;
|
foreach my $bin ( glob("$slave->[0]->{'path_myddir'}/log.*") )
|
||||||
# unlink("$opt_vardir/slave-data/log.*");
|
{
|
||||||
|
unlink($bin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub mysqld_arguments ($$$$$) {
|
sub mysqld_arguments ($$$$$) {
|
||||||
@ -1637,6 +1647,7 @@ sub mysqld_arguments ($$$$$) {
|
|||||||
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
|
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
|
||||||
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
|
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
|
||||||
mtr_add_arg($args, "%s--core", $prefix);
|
mtr_add_arg($args, "%s--core", $prefix);
|
||||||
|
mtr_add_arg($args, "%s--log-bin-trust-routine-creators", $prefix);
|
||||||
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
|
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
|
||||||
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
|
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
|
||||||
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
|
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
|
||||||
@ -1651,12 +1662,15 @@ sub mysqld_arguments ($$$$$) {
|
|||||||
|
|
||||||
if ( $type eq 'master' )
|
if ( $type eq 'master' )
|
||||||
{
|
{
|
||||||
mtr_add_arg($args, "%s--log-bin=%s/log/master-bin", $prefix, $opt_vardir);
|
my $id= $idx > 0 ? $idx + 101 : 1;
|
||||||
|
|
||||||
|
mtr_add_arg($args, "%s--log-bin=%s/log/master-bin%s", $prefix,
|
||||||
|
$opt_vardir, $sidx);
|
||||||
mtr_add_arg($args, "%s--pid-file=%s", $prefix,
|
mtr_add_arg($args, "%s--pid-file=%s", $prefix,
|
||||||
$master->[$idx]->{'path_mypid'});
|
$master->[$idx]->{'path_mypid'});
|
||||||
mtr_add_arg($args, "%s--port=%d", $prefix,
|
mtr_add_arg($args, "%s--port=%d", $prefix,
|
||||||
$master->[$idx]->{'path_myport'});
|
$master->[$idx]->{'path_myport'});
|
||||||
mtr_add_arg($args, "%s--server-id=1", $prefix);
|
mtr_add_arg($args, "%s--server-id=%d", $prefix, $id);
|
||||||
mtr_add_arg($args, "%s--socket=%s", $prefix,
|
mtr_add_arg($args, "%s--socket=%s", $prefix,
|
||||||
$master->[$idx]->{'path_mysock'});
|
$master->[$idx]->{'path_mysock'});
|
||||||
mtr_add_arg($args, "%s--innodb_data_file_path=ibdata1:128M:autoextend", $prefix);
|
mtr_add_arg($args, "%s--innodb_data_file_path=ibdata1:128M:autoextend", $prefix);
|
||||||
@ -1664,6 +1678,11 @@ sub mysqld_arguments ($$$$$) {
|
|||||||
mtr_add_arg($args, "%s--datadir=%s", $prefix,
|
mtr_add_arg($args, "%s--datadir=%s", $prefix,
|
||||||
$master->[$idx]->{'path_myddir'});
|
$master->[$idx]->{'path_myddir'});
|
||||||
|
|
||||||
|
if ( $idx > 0 )
|
||||||
|
{
|
||||||
|
mtr_add_arg($args, "%s--skip-innodb", $prefix);
|
||||||
|
}
|
||||||
|
|
||||||
if ( $opt_skip_ndbcluster )
|
if ( $opt_skip_ndbcluster )
|
||||||
{
|
{
|
||||||
mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
|
mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
|
||||||
@ -1673,7 +1692,7 @@ sub mysqld_arguments ($$$$$) {
|
|||||||
if ( $type eq 'slave' )
|
if ( $type eq 'slave' )
|
||||||
{
|
{
|
||||||
my $slave_server_id= 2 + $idx;
|
my $slave_server_id= 2 + $idx;
|
||||||
my $slave_rpl_rank= $idx > 0 ? 2 : $slave_server_id;
|
my $slave_rpl_rank= $slave_server_id;
|
||||||
|
|
||||||
mtr_add_arg($args, "%s--datadir=%s", $prefix,
|
mtr_add_arg($args, "%s--datadir=%s", $prefix,
|
||||||
$slave->[$idx]->{'path_myddir'});
|
$slave->[$idx]->{'path_myddir'});
|
||||||
@ -1973,9 +1992,8 @@ sub stop_slaves () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sub run_mysqltest ($$) {
|
sub run_mysqltest ($) {
|
||||||
my $tinfo= shift;
|
my $tinfo= shift;
|
||||||
my $master_opts= shift;
|
|
||||||
|
|
||||||
my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " .
|
my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " .
|
||||||
"--socket=$master->[0]->{'path_mysock'} --password=";
|
"--socket=$master->[0]->{'path_mysock'} --password=";
|
||||||
|
@ -307,7 +307,7 @@ while test $# -gt 0; do
|
|||||||
--ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
|
--ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
|
||||||
--ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert.pem \
|
--ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert.pem \
|
||||||
--ssl-key=$MYSQL_TEST_DIR/std_data/server-key.pem"
|
--ssl-key=$MYSQL_TEST_DIR/std_data/server-key.pem"
|
||||||
MYSQL_TEST_SSL_OPTS="--ssl-ca=$BASEDIR/SSL/cacert.pem \
|
MYSQL_TEST_SSL_OPTS="--ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
|
||||||
--ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem \
|
--ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem \
|
||||||
--ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem" ;;
|
--ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem" ;;
|
||||||
--no-manager | --skip-manager) USE_MANAGER=0 ;;
|
--no-manager | --skip-manager) USE_MANAGER=0 ;;
|
||||||
@ -707,6 +707,9 @@ MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --soc
|
|||||||
if [ "x$USE_EMBEDDED_SERVER" = "x1" ]; then
|
if [ "x$USE_EMBEDDED_SERVER" = "x1" ]; then
|
||||||
MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST -A --language=$LANGUAGE -A --datadir=$SLAVE_MYDDIR -A --character-sets-dir=$CHARSETSDIR"
|
MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST -A --language=$LANGUAGE -A --datadir=$SLAVE_MYDDIR -A --character-sets-dir=$CHARSETSDIR"
|
||||||
fi
|
fi
|
||||||
|
# Save path and name of mysqldump
|
||||||
|
MYSQL_DUMP_DIR="$MYSQL_DUMP"
|
||||||
|
export MYSQL_DUMP_DIR
|
||||||
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
|
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
|
||||||
MYSQL_SHOW="$MYSQL_SHOW -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT"
|
MYSQL_SHOW="$MYSQL_SHOW -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT"
|
||||||
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
|
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
|
||||||
|
@ -486,6 +486,7 @@ void start_master()
|
|||||||
#endif
|
#endif
|
||||||
add_arg(&al, "--local-infile");
|
add_arg(&al, "--local-infile");
|
||||||
add_arg(&al, "--core");
|
add_arg(&al, "--core");
|
||||||
|
add_arg(&al, "--log-bin-trust-routine-creators");
|
||||||
add_arg(&al, "--datadir=%s", master_dir);
|
add_arg(&al, "--datadir=%s", master_dir);
|
||||||
#ifndef __WIN__
|
#ifndef __WIN__
|
||||||
add_arg(&al, "--pid-file=%s", master_pid);
|
add_arg(&al, "--pid-file=%s", master_pid);
|
||||||
|
@ -27,7 +27,7 @@ hdl_name varchar(30) default NULL,
|
|||||||
prov_hdl_nr int(11) NOT NULL default '0',
|
prov_hdl_nr int(11) NOT NULL default '0',
|
||||||
auto_wirknetz varchar(50) default NULL,
|
auto_wirknetz varchar(50) default NULL,
|
||||||
auto_billing varchar(50) default NULL,
|
auto_billing varchar(50) default NULL,
|
||||||
touch timestamp(14) NOT NULL,
|
touch timestamp NOT NULL,
|
||||||
kategorie varchar(50) default NULL,
|
kategorie varchar(50) default NULL,
|
||||||
kundentyp varchar(20) NOT NULL default '',
|
kundentyp varchar(20) NOT NULL default '',
|
||||||
sammel_rech_msisdn varchar(30) NOT NULL default '',
|
sammel_rech_msisdn varchar(30) NOT NULL default '',
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -160,6 +160,21 @@ t1 CREATE TABLE `t1` (
|
|||||||
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) character set latin1 collate latin1_bin NOT NULL default ''
|
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) character set latin1 collate latin1_bin NOT NULL default ''
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
SELECT 'case+union+test'
|
||||||
|
UNION
|
||||||
|
SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END;
|
||||||
|
case+union+test
|
||||||
|
case+union+test
|
||||||
|
nobug
|
||||||
|
SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END;
|
||||||
|
CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END
|
||||||
|
nobug
|
||||||
|
SELECT 'case+union+test'
|
||||||
|
UNION
|
||||||
|
SELECT CASE '1' WHEN '2' THEN 'BUG' ELSE 'nobug' END;
|
||||||
|
case+union+test
|
||||||
|
case+union+test
|
||||||
|
nobug
|
||||||
CREATE TABLE t1 (EMPNUM INT);
|
CREATE TABLE t1 (EMPNUM INT);
|
||||||
INSERT INTO t1 VALUES (0), (2);
|
INSERT INTO t1 VALUES (0), (2);
|
||||||
CREATE TABLE t2 (EMPNUM DECIMAL (4, 2));
|
CREATE TABLE t2 (EMPNUM DECIMAL (4, 2));
|
||||||
|
@ -15,7 +15,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
|
|||||||
</row>
|
</row>
|
||||||
</resultset>
|
</resultset>
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<mysqldump>
|
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<database name="test">
|
<database name="test">
|
||||||
<table_structure name="t1">
|
<table_structure name="t1">
|
||||||
<field Field="a&b" Type="int(11)" Null="YES" Key="" Extra="" />
|
<field Field="a&b" Type="int(11)" Null="YES" Key="" Extra="" />
|
||||||
|
@ -638,6 +638,17 @@ Warnings:
|
|||||||
Warning 1264 Out of range value adjusted for column 'Field1' at row 1
|
Warning 1264 Out of range value adjusted for column 'Field1' at row 1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
SET NAMES latin1;
|
SET NAMES latin1;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a varchar(255) NOT NULL default '',
|
||||||
|
KEY a (a)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=ucs2 COLLATE ucs2_general_ci;
|
||||||
|
insert into t1 values (0x803d);
|
||||||
|
insert into t1 values (0x005b);
|
||||||
|
select hex(a) from t1;
|
||||||
|
hex(a)
|
||||||
|
005B
|
||||||
|
803D
|
||||||
|
drop table t1;
|
||||||
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
|
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
|
||||||
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
|
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
|
||||||
update t1 set b=a;
|
update t1 set b=a;
|
||||||
|
@ -939,3 +939,44 @@ content msisdn
|
|||||||
ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми 1234567890
|
ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми 1234567890
|
||||||
11 g 1234567890
|
11 g 1234567890
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
create table t1 (a char(20) character set utf8);
|
||||||
|
insert into t1 values ('123456'),('андрей');
|
||||||
|
alter table t1 modify a char(2) character set utf8;
|
||||||
|
Warnings:
|
||||||
|
Warning 1265 Data truncated for column 'a' at row 1
|
||||||
|
Warning 1265 Data truncated for column 'a' at row 2
|
||||||
|
select char_length(a), length(a), a from t1 order by a;
|
||||||
|
char_length(a) length(a) a
|
||||||
|
2 2 12
|
||||||
|
2 4 ан
|
||||||
|
drop table t1;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a varchar(255) NOT NULL default '',
|
||||||
|
KEY a (a)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
|
||||||
|
insert into t1 values (_utf8 0xe880bd);
|
||||||
|
insert into t1 values (_utf8 0x5b);
|
||||||
|
select hex(a) from t1;
|
||||||
|
hex(a)
|
||||||
|
5B
|
||||||
|
E880BD
|
||||||
|
drop table t1;
|
||||||
|
CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8;
|
||||||
|
INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa');
|
||||||
|
SELECT id FROM t1;
|
||||||
|
id
|
||||||
|
xxx
|
||||||
|
aa
|
||||||
|
yyy
|
||||||
|
aa
|
||||||
|
SELECT DISTINCT id FROM t1;
|
||||||
|
id
|
||||||
|
xxx
|
||||||
|
aa
|
||||||
|
yyy
|
||||||
|
SELECT DISTINCT id FROM t1 ORDER BY id;
|
||||||
|
id
|
||||||
|
aa
|
||||||
|
xxx
|
||||||
|
yyy
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -4,7 +4,7 @@ visitor_id int(10) unsigned DEFAULT '0' NOT NULL,
|
|||||||
group_id int(10) unsigned DEFAULT '0' NOT NULL,
|
group_id int(10) unsigned DEFAULT '0' NOT NULL,
|
||||||
hits int(10) unsigned DEFAULT '0' NOT NULL,
|
hits int(10) unsigned DEFAULT '0' NOT NULL,
|
||||||
sessions int(10) unsigned DEFAULT '0' NOT NULL,
|
sessions int(10) unsigned DEFAULT '0' NOT NULL,
|
||||||
ts timestamp(14),
|
ts timestamp,
|
||||||
PRIMARY KEY (visitor_id,group_id)
|
PRIMARY KEY (visitor_id,group_id)
|
||||||
)/*! engine=MyISAM */;
|
)/*! engine=MyISAM */;
|
||||||
INSERT INTO t1 VALUES (465931136,7,2,2,20000318160952);
|
INSERT INTO t1 VALUES (465931136,7,2,2,20000318160952);
|
||||||
|
@ -120,6 +120,48 @@ hello
|
|||||||
select des_decrypt(des_encrypt("hello",4),'password4');
|
select des_decrypt(des_encrypt("hello",4),'password4');
|
||||||
des_decrypt(des_encrypt("hello",4),'password4')
|
des_decrypt(des_encrypt("hello",4),'password4')
|
||||||
hello
|
hello
|
||||||
|
select des_encrypt("hello",10);
|
||||||
|
des_encrypt("hello",10)
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1108 Incorrect parameters to procedure 'des_encrypt'
|
||||||
|
select des_encrypt(NULL);
|
||||||
|
des_encrypt(NULL)
|
||||||
|
NULL
|
||||||
|
select des_encrypt(NULL, 10);
|
||||||
|
des_encrypt(NULL, 10)
|
||||||
|
NULL
|
||||||
|
select des_encrypt(NULL, NULL);
|
||||||
|
des_encrypt(NULL, NULL)
|
||||||
|
NULL
|
||||||
|
select des_encrypt(10, NULL);
|
||||||
|
des_encrypt(10, NULL)
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1108 Incorrect parameters to procedure 'des_encrypt'
|
||||||
|
select des_encrypt("hello", NULL);
|
||||||
|
des_encrypt("hello", NULL)
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1108 Incorrect parameters to procedure 'des_encrypt'
|
||||||
|
select des_decrypt("hello",10);
|
||||||
|
des_decrypt("hello",10)
|
||||||
|
hello
|
||||||
|
select des_decrypt(NULL);
|
||||||
|
des_decrypt(NULL)
|
||||||
|
NULL
|
||||||
|
select des_decrypt(NULL, 10);
|
||||||
|
des_decrypt(NULL, 10)
|
||||||
|
NULL
|
||||||
|
select des_decrypt(NULL, NULL);
|
||||||
|
des_decrypt(NULL, NULL)
|
||||||
|
NULL
|
||||||
|
select des_decrypt(10, NULL);
|
||||||
|
des_decrypt(10, NULL)
|
||||||
|
10
|
||||||
|
select des_decrypt("hello", NULL);
|
||||||
|
des_decrypt("hello", NULL)
|
||||||
|
hello
|
||||||
SET @a=des_decrypt(des_encrypt("hello"));
|
SET @a=des_decrypt(des_encrypt("hello"));
|
||||||
flush des_key_file;
|
flush des_key_file;
|
||||||
select @a = des_decrypt(des_encrypt("hello"));
|
select @a = des_decrypt(des_encrypt("hello"));
|
||||||
@ -134,6 +176,8 @@ NULL
|
|||||||
select hex(des_decrypt(des_encrypt("hello","hidden")));
|
select hex(des_decrypt(des_encrypt("hello","hidden")));
|
||||||
hex(des_decrypt(des_encrypt("hello","hidden")))
|
hex(des_decrypt(des_encrypt("hello","hidden")))
|
||||||
NULL
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1108 Incorrect parameters to procedure 'des_decrypt'
|
||||||
explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden"));
|
explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden"));
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||||
|
98
mysql-test/r/func_encrypt_nossl.result
Normal file
98
mysql-test/r/func_encrypt_nossl.result
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
select des_encrypt("test", 'akeystr');
|
||||||
|
des_encrypt("test", 'akeystr')
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select des_encrypt("test", 1);
|
||||||
|
des_encrypt("test", 1)
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select des_encrypt("test", 9);
|
||||||
|
des_encrypt("test", 9)
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select des_encrypt("test", 100);
|
||||||
|
des_encrypt("test", 100)
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select des_encrypt("test", NULL);
|
||||||
|
des_encrypt("test", NULL)
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select des_encrypt(NULL, NULL);
|
||||||
|
des_encrypt(NULL, NULL)
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select des_decrypt("test", 'anotherkeystr');
|
||||||
|
des_decrypt("test", 'anotherkeystr')
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select des_decrypt(1, 1);
|
||||||
|
des_decrypt(1, 1)
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select des_decrypt(des_encrypt("test", 'thekey'));
|
||||||
|
des_decrypt(des_encrypt("test", 'thekey'))
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select hex(des_encrypt("hello")),des_decrypt(des_encrypt("hello"));
|
||||||
|
hex(des_encrypt("hello")) des_decrypt(des_encrypt("hello"))
|
||||||
|
NULL NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select des_decrypt(des_encrypt("hello",4));
|
||||||
|
des_decrypt(des_encrypt("hello",4))
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select des_decrypt(des_encrypt("hello",'test'),'test');
|
||||||
|
des_decrypt(des_encrypt("hello",'test'),'test')
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select hex(des_encrypt("hello")),hex(des_encrypt("hello",5)),hex(des_encrypt("hello",'default_password'));
|
||||||
|
hex(des_encrypt("hello")) hex(des_encrypt("hello",5)) hex(des_encrypt("hello",'default_password'))
|
||||||
|
NULL NULL NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select des_decrypt(des_encrypt("hello"),'default_password');
|
||||||
|
des_decrypt(des_encrypt("hello"),'default_password')
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select des_decrypt(des_encrypt("hello",4),'password4');
|
||||||
|
des_decrypt(des_encrypt("hello",4),'password4')
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
SET @a=des_decrypt(des_encrypt("hello"));
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
flush des_key_file;
|
||||||
|
select @a = des_decrypt(des_encrypt("hello"));
|
||||||
|
@a = des_decrypt(des_encrypt("hello"))
|
||||||
|
NULL
|
||||||
|
select hex("hello");
|
||||||
|
hex("hello")
|
||||||
|
68656C6C6F
|
||||||
|
select hex(des_decrypt(des_encrypt("hello",4),'password2'));
|
||||||
|
hex(des_decrypt(des_encrypt("hello",4),'password2'))
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||||
|
select hex(des_decrypt(des_encrypt("hello","hidden")));
|
||||||
|
hex(des_decrypt(des_encrypt("hello","hidden")))
|
||||||
|
NULL
|
||||||
|
Warnings:
|
||||||
|
Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
@ -264,7 +264,7 @@ category int(10) unsigned default NULL,
|
|||||||
program int(10) unsigned default NULL,
|
program int(10) unsigned default NULL,
|
||||||
bugdesc text,
|
bugdesc text,
|
||||||
created datetime default NULL,
|
created datetime default NULL,
|
||||||
modified timestamp(14) NOT NULL,
|
modified timestamp NOT NULL,
|
||||||
bugstatus int(10) unsigned default NULL,
|
bugstatus int(10) unsigned default NULL,
|
||||||
submitter int(10) unsigned default NULL
|
submitter int(10) unsigned default NULL
|
||||||
) ENGINE=MyISAM;
|
) ENGINE=MyISAM;
|
||||||
@ -800,3 +800,79 @@ field(0,NULL,1,0) field("",NULL,"bar","") field(0.0,NULL,1.0,0.0)
|
|||||||
select field(NULL,1,2,NULL), field(NULL,1,2,0);
|
select field(NULL,1,2,NULL), field(NULL,1,2,0);
|
||||||
field(NULL,1,2,NULL) field(NULL,1,2,0)
|
field(NULL,1,2,NULL) field(NULL,1,2,0)
|
||||||
0 0
|
0 0
|
||||||
|
CREATE TABLE t1 (str varchar(20) PRIMARY KEY);
|
||||||
|
CREATE TABLE t2 (num int primary key);
|
||||||
|
INSERT INTO t1 VALUES ('notnumber');
|
||||||
|
INSERT INTO t2 VALUES (0), (1);
|
||||||
|
SELECT * FROM t1, t2 WHERE num=str;
|
||||||
|
str num
|
||||||
|
notnumber 0
|
||||||
|
SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
|
||||||
|
str num
|
||||||
|
notnumber 0
|
||||||
|
DROP TABLE t1,t2;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
id int(11) NOT NULL auto_increment,
|
||||||
|
pc int(11) NOT NULL default '0',
|
||||||
|
title varchar(20) default NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES
|
||||||
|
(1, 0, 'Main'),
|
||||||
|
(2, 1, 'Toys'),
|
||||||
|
(3, 1, 'Games');
|
||||||
|
SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
|
||||||
|
FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
|
||||||
|
LEFT JOIN t1 AS t3 ON t2.pc=t3.id;
|
||||||
|
id col1
|
||||||
|
1 Main
|
||||||
|
2 Main->Toys
|
||||||
|
3 Main->Games
|
||||||
|
SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
|
||||||
|
FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
|
||||||
|
LEFT JOIN t1 AS t3 ON t2.pc=t3.id
|
||||||
|
WHERE CONCAT_WS('->', t3.title, t2.title, t1.title) LIKE '%Toys%';
|
||||||
|
id col1
|
||||||
|
2 Main->Toys
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
trackid int(10) unsigned NOT NULL auto_increment,
|
||||||
|
trackname varchar(100) NOT NULL default '',
|
||||||
|
PRIMARY KEY (trackid)
|
||||||
|
);
|
||||||
|
CREATE TABLE t2(
|
||||||
|
artistid int(10) unsigned NOT NULL auto_increment,
|
||||||
|
artistname varchar(100) NOT NULL default '',
|
||||||
|
PRIMARY KEY (artistid)
|
||||||
|
);
|
||||||
|
CREATE TABLE t3(
|
||||||
|
trackid int(10) unsigned NOT NULL,
|
||||||
|
artistid int(10) unsigned NOT NULL,
|
||||||
|
PRIMARY KEY (trackid,artistid)
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES (1, 'April In Paris'), (2, 'Autumn In New York');
|
||||||
|
INSERT INTO t2 VALUES (1, 'Vernon Duke');
|
||||||
|
INSERT INTO t3 VALUES (1,1);
|
||||||
|
SELECT CONCAT_WS(' ', trackname, artistname) trackname, artistname
|
||||||
|
FROM t1 LEFT JOIN t3 ON t1.trackid=t3.trackid
|
||||||
|
LEFT JOIN t2 ON t2.artistid=t3.artistid
|
||||||
|
WHERE CONCAT_WS(' ', trackname, artistname) LIKE '%In%';
|
||||||
|
trackname artistname
|
||||||
|
April In Paris Vernon Duke Vernon Duke
|
||||||
|
Autumn In New York NULL
|
||||||
|
DROP TABLE t1,t2,t3;
|
||||||
|
create table t1 (b varchar(5));
|
||||||
|
insert t1 values ('ab'), ('abc'), ('abcd'), ('abcde');
|
||||||
|
select *,substring(b,1),substring(b,-1),substring(b,-2),substring(b,-3),substring(b,-4),substring(b,-5) from t1;
|
||||||
|
b substring(b,1) substring(b,-1) substring(b,-2) substring(b,-3) substring(b,-4) substring(b,-5)
|
||||||
|
ab ab b ab
|
||||||
|
abc abc c bc abc
|
||||||
|
abcd abcd d cd bcd abcd
|
||||||
|
abcde abcde e de cde bcde abcde
|
||||||
|
select * from (select *,substring(b,1),substring(b,-1),substring(b,-2),substring(b,-3),substring(b,-4),substring(b,-5) from t1) t;
|
||||||
|
b substring(b,1) substring(b,-1) substring(b,-2) substring(b,-3) substring(b,-4) substring(b,-5)
|
||||||
|
ab ab b ab
|
||||||
|
abc abc c bc abc
|
||||||
|
abcd abcd d cd bcd abcd
|
||||||
|
abcde abcde e de cde bcde abcde
|
||||||
|
drop table t1;
|
||||||
|
@ -465,7 +465,7 @@ extract(MONTH FROM "0000-00-00") extract(MONTH FROM d) extract(MONTH FROM dt) ex
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
CREATE TABLE t1 ( start datetime default NULL);
|
CREATE TABLE t1 ( start datetime default NULL);
|
||||||
INSERT INTO t1 VALUES ('2002-10-21 00:00:00'),('2002-10-28 00:00:00'),('2002-11-04 00:00:00');
|
INSERT INTO t1 VALUES ('2002-10-21 00:00:00'),('2002-10-28 00:00:00'),('2002-11-04 00:00:00');
|
||||||
CREATE TABLE t2 ( ctime1 timestamp(14) NOT NULL, ctime2 timestamp(14) NOT NULL);
|
CREATE TABLE t2 ( ctime1 timestamp NOT NULL, ctime2 timestamp NOT NULL);
|
||||||
INSERT INTO t2 VALUES (20021029165106,20021105164731);
|
INSERT INTO t2 VALUES (20021029165106,20021105164731);
|
||||||
CREATE TABLE t3 (ctime1 char(19) NOT NULL, ctime2 char(19) NOT NULL);
|
CREATE TABLE t3 (ctime1 char(19) NOT NULL, ctime2 char(19) NOT NULL);
|
||||||
INSERT INTO t3 VALUES ("2002-10-29 16:51:06","2002-11-05 16:47:31");
|
INSERT INTO t3 VALUES ("2002-10-29 16:51:06","2002-11-05 16:47:31");
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
|
drop database if exists mysqltest;
|
||||||
SET NAMES binary;
|
SET NAMES binary;
|
||||||
delete from mysql.user where user='mysqltest_1';
|
delete from mysql.user where user='mysqltest_1';
|
||||||
delete from mysql.db where user='mysqltest_1';
|
delete from mysql.db where user='mysqltest_1';
|
||||||
@ -473,3 +474,120 @@ ERROR 42000: INSERT,CREATE command denied to user 'mysqltest_1'@'localhost' for
|
|||||||
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
||||||
delete from mysql.user where user=_binary'mysqltest_1';
|
delete from mysql.user where user=_binary'mysqltest_1';
|
||||||
drop database mysqltest;
|
drop database mysqltest;
|
||||||
|
CREATE USER dummy@localhost;
|
||||||
|
CREATE DATABASE mysqltest;
|
||||||
|
CREATE TABLE mysqltest.dummytable (dummyfield INT);
|
||||||
|
CREATE VIEW mysqltest.dummyview AS SELECT dummyfield FROM mysqltest.dummytable;
|
||||||
|
GRANT ALL PRIVILEGES ON mysqltest.dummytable TO dummy@localhost;
|
||||||
|
GRANT ALL PRIVILEGES ON mysqltest.dummyview TO dummy@localhost;
|
||||||
|
SHOW GRANTS FOR dummy@localhost;
|
||||||
|
Grants for dummy@localhost
|
||||||
|
GRANT USAGE ON *.* TO 'dummy'@'localhost'
|
||||||
|
GRANT ALL PRIVILEGES ON `mysqltest`.`dummyview` TO 'dummy'@'localhost'
|
||||||
|
GRANT ALL PRIVILEGES ON `mysqltest`.`dummytable` TO 'dummy'@'localhost'
|
||||||
|
use INFORMATION_SCHEMA;
|
||||||
|
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
|
||||||
|
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
|
||||||
|
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
|
||||||
|
TABLE_SCHEMA TABLE_NAME PRIVILEGES
|
||||||
|
mysqltest dummytable ALTER, CREATE, CREATE VIEW, DELETE, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, UPDATE
|
||||||
|
mysqltest dummyview ALTER, CREATE, CREATE VIEW, DELETE, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, UPDATE
|
||||||
|
FLUSH PRIVILEGES;
|
||||||
|
SHOW GRANTS FOR dummy@localhost;
|
||||||
|
Grants for dummy@localhost
|
||||||
|
GRANT USAGE ON *.* TO 'dummy'@'localhost'
|
||||||
|
GRANT ALL PRIVILEGES ON `mysqltest`.`dummyview` TO 'dummy'@'localhost'
|
||||||
|
GRANT ALL PRIVILEGES ON `mysqltest`.`dummytable` TO 'dummy'@'localhost'
|
||||||
|
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
|
||||||
|
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
|
||||||
|
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
|
||||||
|
TABLE_SCHEMA TABLE_NAME PRIVILEGES
|
||||||
|
mysqltest dummytable ALTER, CREATE, CREATE VIEW, DELETE, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, UPDATE
|
||||||
|
mysqltest dummyview ALTER, CREATE, CREATE VIEW, DELETE, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, UPDATE
|
||||||
|
SHOW FIELDS FROM mysql.tables_priv;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
Host char(60) NO PRI
|
||||||
|
Db char(64) NO PRI
|
||||||
|
User char(16) NO PRI
|
||||||
|
Table_name char(64) NO PRI
|
||||||
|
Grantor char(77) NO MUL
|
||||||
|
Timestamp timestamp YES CURRENT_TIMESTAMP
|
||||||
|
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') NO
|
||||||
|
Column_priv set('Select','Insert','Update','References') NO
|
||||||
|
use test;
|
||||||
|
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
|
||||||
|
DROP USER dummy@localhost;
|
||||||
|
DROP DATABASE mysqltest;
|
||||||
|
CREATE USER dummy@localhost;
|
||||||
|
CREATE DATABASE mysqltest;
|
||||||
|
CREATE TABLE mysqltest.dummytable (dummyfield INT);
|
||||||
|
CREATE VIEW mysqltest.dummyview AS SELECT dummyfield FROM mysqltest.dummytable;
|
||||||
|
GRANT CREATE VIEW ON mysqltest.dummytable TO dummy@localhost;
|
||||||
|
GRANT CREATE VIEW ON mysqltest.dummyview TO dummy@localhost;
|
||||||
|
SHOW GRANTS FOR dummy@localhost;
|
||||||
|
Grants for dummy@localhost
|
||||||
|
GRANT USAGE ON *.* TO 'dummy'@'localhost'
|
||||||
|
GRANT CREATE VIEW ON `mysqltest`.`dummyview` TO 'dummy'@'localhost'
|
||||||
|
GRANT CREATE VIEW ON `mysqltest`.`dummytable` TO 'dummy'@'localhost'
|
||||||
|
use INFORMATION_SCHEMA;
|
||||||
|
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
|
||||||
|
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
|
||||||
|
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
|
||||||
|
TABLE_SCHEMA TABLE_NAME PRIVILEGES
|
||||||
|
mysqltest dummytable CREATE VIEW
|
||||||
|
mysqltest dummyview CREATE VIEW
|
||||||
|
FLUSH PRIVILEGES;
|
||||||
|
SHOW GRANTS FOR dummy@localhost;
|
||||||
|
Grants for dummy@localhost
|
||||||
|
GRANT USAGE ON *.* TO 'dummy'@'localhost'
|
||||||
|
GRANT CREATE VIEW ON `mysqltest`.`dummyview` TO 'dummy'@'localhost'
|
||||||
|
GRANT CREATE VIEW ON `mysqltest`.`dummytable` TO 'dummy'@'localhost'
|
||||||
|
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
|
||||||
|
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
|
||||||
|
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
|
||||||
|
TABLE_SCHEMA TABLE_NAME PRIVILEGES
|
||||||
|
mysqltest dummytable CREATE VIEW
|
||||||
|
mysqltest dummyview CREATE VIEW
|
||||||
|
use test;
|
||||||
|
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
|
||||||
|
DROP USER dummy@localhost;
|
||||||
|
DROP DATABASE mysqltest;
|
||||||
|
CREATE USER dummy@localhost;
|
||||||
|
CREATE DATABASE mysqltest;
|
||||||
|
CREATE TABLE mysqltest.dummytable (dummyfield INT);
|
||||||
|
CREATE VIEW mysqltest.dummyview AS SELECT dummyfield FROM mysqltest.dummytable;
|
||||||
|
GRANT SHOW VIEW ON mysqltest.dummytable TO dummy@localhost;
|
||||||
|
GRANT SHOW VIEW ON mysqltest.dummyview TO dummy@localhost;
|
||||||
|
SHOW GRANTS FOR dummy@localhost;
|
||||||
|
Grants for dummy@localhost
|
||||||
|
GRANT USAGE ON *.* TO 'dummy'@'localhost'
|
||||||
|
GRANT SHOW VIEW ON `mysqltest`.`dummyview` TO 'dummy'@'localhost'
|
||||||
|
GRANT SHOW VIEW ON `mysqltest`.`dummytable` TO 'dummy'@'localhost'
|
||||||
|
use INFORMATION_SCHEMA;
|
||||||
|
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
|
||||||
|
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
|
||||||
|
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
|
||||||
|
TABLE_SCHEMA TABLE_NAME PRIVILEGES
|
||||||
|
mysqltest dummytable SHOW VIEW
|
||||||
|
mysqltest dummyview SHOW VIEW
|
||||||
|
FLUSH PRIVILEGES;
|
||||||
|
SHOW GRANTS FOR dummy@localhost;
|
||||||
|
Grants for dummy@localhost
|
||||||
|
GRANT USAGE ON *.* TO 'dummy'@'localhost'
|
||||||
|
GRANT SHOW VIEW ON `mysqltest`.`dummyview` TO 'dummy'@'localhost'
|
||||||
|
GRANT SHOW VIEW ON `mysqltest`.`dummytable` TO 'dummy'@'localhost'
|
||||||
|
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
|
||||||
|
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
|
||||||
|
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
|
||||||
|
TABLE_SCHEMA TABLE_NAME PRIVILEGES
|
||||||
|
mysqltest dummytable SHOW VIEW
|
||||||
|
mysqltest dummyview SHOW VIEW
|
||||||
|
use test;
|
||||||
|
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
|
||||||
|
DROP USER dummy@localhost;
|
||||||
|
DROP DATABASE mysqltest;
|
||||||
|
use mysql;
|
||||||
|
insert into tables_priv values ('','test_db','mysqltest_1','test_table','test_grantor',CURRENT_TIMESTAMP,'Select','Select');
|
||||||
|
flush privileges;
|
||||||
|
delete from tables_priv where host = '' and user = 'mysqltest_1';
|
||||||
|
flush privileges;
|
||||||
|
@ -117,7 +117,7 @@ bug_file_loc text,
|
|||||||
bug_severity enum('blocker','critical','major','normal','minor','trivial','enhancement') DEFAULT 'blocker' NOT NULL,
|
bug_severity enum('blocker','critical','major','normal','minor','trivial','enhancement') DEFAULT 'blocker' NOT NULL,
|
||||||
bug_status enum('','NEW','ASSIGNED','REOPENED','RESOLVED','VERIFIED','CLOSED') DEFAULT 'NEW' NOT NULL,
|
bug_status enum('','NEW','ASSIGNED','REOPENED','RESOLVED','VERIFIED','CLOSED') DEFAULT 'NEW' NOT NULL,
|
||||||
creation_ts datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
creation_ts datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
||||||
delta_ts timestamp(14),
|
delta_ts timestamp,
|
||||||
short_desc mediumtext,
|
short_desc mediumtext,
|
||||||
long_desc mediumtext,
|
long_desc mediumtext,
|
||||||
op_sys enum('All','Windows 3.1','Windows 95','Windows 98','Windows NT','Windows 2000','Linux','other') DEFAULT 'All' NOT NULL,
|
op_sys enum('All','Windows 3.1','Windows 95','Windows 98','Windows NT','Windows 2000','Linux','other') DEFAULT 'All' NOT NULL,
|
||||||
@ -751,3 +751,32 @@ COUNT(DISTINCT(t1.id)) comment
|
|||||||
1 NULL
|
1 NULL
|
||||||
1 a problem
|
1 a problem
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
CREATE TABLE t1 (n int);
|
||||||
|
INSERT INTO t1 VALUES (1);
|
||||||
|
SELECT n+1 AS n FROM t1 GROUP BY n;
|
||||||
|
n
|
||||||
|
2
|
||||||
|
Warnings:
|
||||||
|
Warning 1052 Column 'n' in group statement is ambiguous
|
||||||
|
DROP TABLE t1;
|
||||||
|
create table t1 (c1 char(3), c2 char(3));
|
||||||
|
create table t2 (c3 char(3), c4 char(3));
|
||||||
|
insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2');
|
||||||
|
insert into t2 values ('aaa', 'bb1'), ('aaa', 'bb2');
|
||||||
|
select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
|
||||||
|
group by c2;
|
||||||
|
c2
|
||||||
|
aaa
|
||||||
|
aaa
|
||||||
|
Warnings:
|
||||||
|
Warning 1052 Column 'c2' in group statement is ambiguous
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
Warning 1052 Column 'c2' in group statement is ambiguous
|
||||||
|
select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
|
||||||
|
group by t1.c1;
|
||||||
|
c2
|
||||||
|
aaa
|
||||||
|
show warnings;
|
||||||
|
Level Code Message
|
||||||
|
drop table t1, t2;
|
||||||
|
@ -367,13 +367,13 @@ count(*)
|
|||||||
9
|
9
|
||||||
explain select count(*) from t1 where v='a ';
|
explain select count(*) from t1 where v='a ';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref v v 13 const 9 Using where
|
1 SIMPLE t1 ref v v 13 const 10 Using where
|
||||||
explain select count(*) from t1 where c='a ';
|
explain select count(*) from t1 where c='a ';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref c c 11 const 9 Using where
|
1 SIMPLE t1 ref c c 11 const 10 Using where
|
||||||
explain select count(*) from t1 where t='a ';
|
explain select count(*) from t1 where t='a ';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref t t 13 const 9 Using where
|
1 SIMPLE t1 ref t t 13 const 10 Using where
|
||||||
explain select count(*) from t1 where v like 'a%';
|
explain select count(*) from t1 where v like 'a%';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ALL v NULL NULL NULL 271 Using where
|
1 SIMPLE t1 ALL v NULL NULL NULL 271 Using where
|
||||||
@ -399,7 +399,7 @@ qq
|
|||||||
*a *a*a *
|
*a *a*a *
|
||||||
explain select * from t1 where v='a';
|
explain select * from t1 where v='a';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref v v 13 const 9 Using where
|
1 SIMPLE t1 ref v v 13 const 10 Using where
|
||||||
select v,count(*) from t1 group by v limit 10;
|
select v,count(*) from t1 group by v limit 10;
|
||||||
v count(*)
|
v count(*)
|
||||||
a 1
|
a 1
|
||||||
|
@ -231,18 +231,19 @@ explain select * from t1 where a='aaad';
|
|||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref a a 8 const 1 Using where
|
1 SIMPLE t1 ref a a 8 const 1 Using where
|
||||||
insert into t1 select * from t1;
|
insert into t1 select * from t1;
|
||||||
|
flush tables;
|
||||||
explain select * from t1 where a='aaaa';
|
explain select * from t1 where a='aaaa';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref a a 8 const 1 Using where
|
1 SIMPLE t1 ref a a 8 const 2 Using where
|
||||||
explain select * from t1 where a='aaab';
|
explain select * from t1 where a='aaab';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref a a 8 const 1 Using where
|
1 SIMPLE t1 ref a a 8 const 2 Using where
|
||||||
explain select * from t1 where a='aaac';
|
explain select * from t1 where a='aaac';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref a a 8 const 1 Using where
|
1 SIMPLE t1 ref a a 8 const 2 Using where
|
||||||
explain select * from t1 where a='aaad';
|
explain select * from t1 where a='aaad';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref a a 8 const 1 Using where
|
1 SIMPLE t1 ref a a 8 const 2 Using where
|
||||||
flush tables;
|
flush tables;
|
||||||
explain select * from t1 where a='aaaa';
|
explain select * from t1 where a='aaaa';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
@ -261,16 +262,16 @@ delete from t1;
|
|||||||
insert into t1 select * from t2;
|
insert into t1 select * from t2;
|
||||||
explain select * from t1 where a='aaaa';
|
explain select * from t1 where a='aaaa';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref a a 8 const 1 Using where
|
1 SIMPLE t1 ref a a 8 const 2 Using where
|
||||||
explain select * from t1 where a='aaab';
|
explain select * from t1 where a='aaab';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref a a 8 const 1 Using where
|
1 SIMPLE t1 ref a a 8 const 2 Using where
|
||||||
explain select * from t1 where a='aaac';
|
explain select * from t1 where a='aaac';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref a a 8 const 1 Using where
|
1 SIMPLE t1 ref a a 8 const 2 Using where
|
||||||
explain select * from t1 where a='aaad';
|
explain select * from t1 where a='aaad';
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 ref a a 8 const 1 Using where
|
1 SIMPLE t1 ref a a 8 const 2 Using where
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
create table t1 (
|
create table t1 (
|
||||||
id int unsigned not null primary key auto_increment,
|
id int unsigned not null primary key auto_increment,
|
||||||
@ -345,15 +346,15 @@ insert into t3 select name, name from t1;
|
|||||||
show index from t3;
|
show index from t3;
|
||||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||||
t3 1 a 1 a NULL NULL NULL NULL HASH
|
t3 1 a 1 a NULL NULL NULL NULL HASH
|
||||||
t3 1 a 2 b NULL 15 NULL NULL HASH
|
t3 1 a 2 b NULL 13 NULL NULL HASH
|
||||||
show index from t3;
|
show index from t3;
|
||||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||||
t3 1 a 1 a NULL NULL NULL NULL HASH
|
t3 1 a 1 a NULL NULL NULL NULL HASH
|
||||||
t3 1 a 2 b NULL 15 NULL NULL HASH
|
t3 1 a 2 b NULL 13 NULL NULL HASH
|
||||||
explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a = concat('',t1.name) and t3.b=t1.name;
|
explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a = concat('',t1.name) and t3.b=t1.name;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t3 ref a a 44 const,const 6 Using where
|
|
||||||
1 SIMPLE t1 ref heap_idx heap_idx 22 const 7 Using where
|
1 SIMPLE t1 ref heap_idx heap_idx 22 const 7 Using where
|
||||||
|
1 SIMPLE t3 ref a a 44 const,const 7 Using where
|
||||||
drop table t1, t2, t3;
|
drop table t1, t2, t3;
|
||||||
create temporary table t1 ( a int, index (a) ) engine=memory;
|
create temporary table t1 ( a int, index (a) ) engine=memory;
|
||||||
insert into t1 values (1),(2),(3),(4),(5);
|
insert into t1 values (1),(2),(3),(4),(5);
|
||||||
|
@ -227,6 +227,9 @@ latin1_bin latin1
|
|||||||
latin1_general_ci latin1
|
latin1_general_ci latin1
|
||||||
latin1_general_cs latin1
|
latin1_general_cs latin1
|
||||||
latin1_spanish_ci latin1
|
latin1_spanish_ci latin1
|
||||||
|
drop procedure if exists sel2;
|
||||||
|
drop function if exists sub1;
|
||||||
|
drop function if exists sub2;
|
||||||
create function sub1(i int) returns int
|
create function sub1(i int) returns int
|
||||||
return i+1;
|
return i+1;
|
||||||
create procedure sel2()
|
create procedure sel2()
|
||||||
@ -735,7 +738,7 @@ x_real NULL NULL
|
|||||||
x_float NULL NULL
|
x_float NULL NULL
|
||||||
x_double_precision NULL NULL
|
x_double_precision NULL NULL
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create user mysqltest_4@localhost;
|
grant select on test.* to mysqltest_4@localhost;
|
||||||
SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
|
SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
where COLUMN_NAME='TABLE_NAME';
|
where COLUMN_NAME='TABLE_NAME';
|
||||||
TABLE_NAME COLUMN_NAME PRIVILEGES
|
TABLE_NAME COLUMN_NAME PRIVILEGES
|
||||||
@ -748,6 +751,7 @@ COLUMN_PRIVILEGES TABLE_NAME select
|
|||||||
TABLE_CONSTRAINTS TABLE_NAME select
|
TABLE_CONSTRAINTS TABLE_NAME select
|
||||||
KEY_COLUMN_USAGE TABLE_NAME select
|
KEY_COLUMN_USAGE TABLE_NAME select
|
||||||
delete from mysql.user where user='mysqltest_4';
|
delete from mysql.user where user='mysqltest_4';
|
||||||
|
delete from mysql.db where user='mysqltest_4';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
|
SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
|
||||||
table_schema count(*)
|
table_schema count(*)
|
||||||
@ -823,6 +827,8 @@ GRANT SELECT ON *.* TO 'user4'@'localhost'
|
|||||||
drop user user1@localhost, user2@localhost, user3@localhost, user4@localhost;
|
drop user user1@localhost, user2@localhost, user3@localhost, user4@localhost;
|
||||||
use test;
|
use test;
|
||||||
drop database mysqltest;
|
drop database mysqltest;
|
||||||
|
drop procedure if exists p1;
|
||||||
|
drop procedure if exists p2;
|
||||||
create procedure p1 () modifies sql data set @a = 5;
|
create procedure p1 () modifies sql data set @a = 5;
|
||||||
create procedure p2 () set @a = 5;
|
create procedure p2 () set @a = 5;
|
||||||
select sql_data_access from information_schema.routines
|
select sql_data_access from information_schema.routines
|
||||||
|
@ -972,9 +972,9 @@ number bigint(20) NOT NULL default '0',
|
|||||||
cname char(15) NOT NULL default '',
|
cname char(15) NOT NULL default '',
|
||||||
carrier_id smallint(6) NOT NULL default '0',
|
carrier_id smallint(6) NOT NULL default '0',
|
||||||
privacy tinyint(4) NOT NULL default '0',
|
privacy tinyint(4) NOT NULL default '0',
|
||||||
last_mod_date timestamp(14) NOT NULL,
|
last_mod_date timestamp NOT NULL,
|
||||||
last_mod_id smallint(6) NOT NULL default '0',
|
last_mod_id smallint(6) NOT NULL default '0',
|
||||||
last_app_date timestamp(14) NOT NULL,
|
last_app_date timestamp NOT NULL,
|
||||||
last_app_id smallint(6) default '-1',
|
last_app_id smallint(6) default '-1',
|
||||||
version smallint(6) NOT NULL default '0',
|
version smallint(6) NOT NULL default '0',
|
||||||
assigned_scps int(11) default '0',
|
assigned_scps int(11) default '0',
|
||||||
@ -991,9 +991,9 @@ number bigint(20) NOT NULL default '0',
|
|||||||
cname char(15) NOT NULL default '',
|
cname char(15) NOT NULL default '',
|
||||||
carrier_id smallint(6) NOT NULL default '0',
|
carrier_id smallint(6) NOT NULL default '0',
|
||||||
privacy tinyint(4) NOT NULL default '0',
|
privacy tinyint(4) NOT NULL default '0',
|
||||||
last_mod_date timestamp(14) NOT NULL,
|
last_mod_date timestamp NOT NULL,
|
||||||
last_mod_id smallint(6) NOT NULL default '0',
|
last_mod_id smallint(6) NOT NULL default '0',
|
||||||
last_app_date timestamp(14) NOT NULL,
|
last_app_date timestamp NOT NULL,
|
||||||
last_app_id smallint(6) default '-1',
|
last_app_id smallint(6) default '-1',
|
||||||
version smallint(6) NOT NULL default '0',
|
version smallint(6) NOT NULL default '0',
|
||||||
assigned_scps int(11) default '0',
|
assigned_scps int(11) default '0',
|
||||||
@ -1721,12 +1721,13 @@ count(*)
|
|||||||
0
|
0
|
||||||
explain select count(*) from t1 where x > -16;
|
explain select count(*) from t1 where x > -16;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 1 Using where; Using index
|
1 SIMPLE t1 index PRIMARY PRIMARY 8 NULL 2 Using where; Using index
|
||||||
select count(*) from t1 where x > -16;
|
select count(*) from t1 where x > -16;
|
||||||
count(*)
|
count(*)
|
||||||
1
|
2
|
||||||
select * from t1 where x > -16;
|
select * from t1 where x > -16;
|
||||||
x
|
x
|
||||||
|
18446744073709551600
|
||||||
18446744073709551601
|
18446744073709551601
|
||||||
select count(*) from t1 where x = 18446744073709551601;
|
select count(*) from t1 where x = 18446744073709551601;
|
||||||
count(*)
|
count(*)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
drop table if exists t1,t2;
|
drop table if exists t1,t2,t3;
|
||||||
create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLINT UNSIGNED NOT NULL);
|
create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLINT UNSIGNED NOT NULL);
|
||||||
insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12);
|
insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12);
|
||||||
create table t2 (payoutID SMALLINT UNSIGNED NOT NULL PRIMARY KEY);
|
create table t2 (payoutID SMALLINT UNSIGNED NOT NULL PRIMARY KEY);
|
||||||
@ -636,16 +636,35 @@ ff1 ff2
|
|||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
create table t1 (a int unique);
|
create table t1 (a int unique);
|
||||||
create table t2 (a int, b int);
|
create table t2 (a int, b int);
|
||||||
|
create table t3 (c int, d int);
|
||||||
insert into t1 values (1),(2);
|
insert into t1 values (1),(2);
|
||||||
insert into t2 values (1,2);
|
insert into t2 values (1,2);
|
||||||
|
insert into t3 values (1,6),(3,7);
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
2
|
2
|
||||||
insert into t1 select t2.a from t2 on duplicate key update a= a + t2.b;
|
insert into t1 select a from t2 on duplicate key update a= t1.a + t2.b;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
drop table t1;
|
insert into t1 select a+1 from t2 on duplicate key update t1.a= t1.a + t2.b+1;
|
||||||
drop table t2;
|
select * from t1;
|
||||||
|
a
|
||||||
|
3
|
||||||
|
5
|
||||||
|
insert into t1 select t3.c from t3 on duplicate key update a= a + t3.d;
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
5
|
||||||
|
10
|
||||||
|
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= a + 10;
|
||||||
|
insert into t1 select t2.a from t2 on duplicate key update a= a + t2.b;
|
||||||
|
ERROR 23000: Column 'a' in field list is ambiguous
|
||||||
|
insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b;
|
||||||
|
ERROR 42S02: Unknown table 't2' in field list
|
||||||
|
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
|
||||||
|
ERROR 42S02: Unknown table 't2' in field list
|
||||||
|
drop table t1,t2,t3;
|
||||||
|
@ -143,7 +143,7 @@ INSERT t1 VALUES (1,2,10), (3,4,20);
|
|||||||
CREATE TABLE t2 (a INT, b INT, c INT, d INT);
|
CREATE TABLE t2 (a INT, b INT, c INT, d INT);
|
||||||
INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1);
|
INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1);
|
||||||
INSERT t2 VALUES (2,1,11,2), (7,4,40,2);
|
INSERT t2 VALUES (2,1,11,2), (7,4,40,2);
|
||||||
INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100;
|
INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=t1.c+100;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
a b c
|
a b c
|
||||||
1 2 10
|
1 2 10
|
||||||
@ -158,6 +158,8 @@ a b c
|
|||||||
5 0 30
|
5 0 30
|
||||||
8 9 60
|
8 9 60
|
||||||
INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
|
INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
|
||||||
|
ERROR 23000: Column 'c' in field list is ambiguous
|
||||||
|
INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=t1.c+VALUES(t1.a);
|
||||||
SELECT *, VALUES(a) FROM t1;
|
SELECT *, VALUES(a) FROM t1;
|
||||||
a b c VALUES(a)
|
a b c VALUES(a)
|
||||||
1 2 10 NULL
|
1 2 10 NULL
|
||||||
@ -174,7 +176,7 @@ select * from t1;
|
|||||||
a
|
a
|
||||||
1
|
1
|
||||||
2
|
2
|
||||||
insert ignore into t1 select a from t1 on duplicate key update a=a+1 ;
|
insert ignore into t1 select a from t1 as t2 on duplicate key update a=t1.a+1 ;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
@ -185,5 +187,7 @@ a
|
|||||||
2
|
2
|
||||||
3
|
3
|
||||||
insert into t1 select a from t1 on duplicate key update a=a+1 ;
|
insert into t1 select a from t1 on duplicate key update a=a+1 ;
|
||||||
ERROR 23000: Duplicate entry '3' for key 1
|
ERROR 23000: Column 'a' in field list is ambiguous
|
||||||
|
insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ;
|
||||||
|
ERROR 23000: Column 't1.a' in field list is ambiguous
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
DROP TABLE IF EXISTS t1,t2,t3;
|
DROP TABLE IF EXISTS t1,t2,t3,t2aA,t1Aa;
|
||||||
DROP DATABASE IF EXISTS `TEST_$1`;
|
DROP DATABASE IF EXISTS `TEST_$1`;
|
||||||
DROP DATABASE IF EXISTS `test_$1`;
|
DROP DATABASE IF EXISTS `test_$1`;
|
||||||
|
DROP DATABASE IF EXISTS mysqltest_LC2;
|
||||||
CREATE TABLE T1 (a int);
|
CREATE TABLE T1 (a int);
|
||||||
INSERT INTO T1 VALUES (1);
|
INSERT INTO T1 VALUES (1);
|
||||||
SHOW TABLES LIKE "T1";
|
SHOW TABLES LIKE "T1";
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa;
|
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa;
|
||||||
drop database if exists mysqldump_test_db;
|
drop database if exists mysqldump_test_db;
|
||||||
drop database if exists db1;
|
drop database if exists db1;
|
||||||
drop view if exists v1, v2;
|
drop view if exists v1, v2, v3;
|
||||||
CREATE TABLE t1(a int);
|
CREATE TABLE t1(a int);
|
||||||
INSERT INTO t1 VALUES (1), (2);
|
INSERT INTO t1 VALUES (1), (2);
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<mysqldump>
|
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<database name="test">
|
<database name="test">
|
||||||
<table_structure name="t1">
|
<table_structure name="t1">
|
||||||
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
|
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
|
||||||
@ -108,7 +108,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1(a int, b text, c varchar(3));
|
CREATE TABLE t1(a int, b text, c varchar(3));
|
||||||
INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
|
INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<mysqldump>
|
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<database name="test">
|
<database name="test">
|
||||||
<table_structure name="t1">
|
<table_structure name="t1">
|
||||||
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
|
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
|
||||||
@ -133,7 +133,7 @@ DROP TABLE t1;
|
|||||||
CREATE TABLE t1 (`a"b"` char(2));
|
CREATE TABLE t1 (`a"b"` char(2));
|
||||||
INSERT INTO t1 VALUES ("1\""), ("\"2");
|
INSERT INTO t1 VALUES ("1\""), ("\"2");
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<mysqldump>
|
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<database name="test">
|
<database name="test">
|
||||||
<table_structure name="t1">
|
<table_structure name="t1">
|
||||||
<field Field="a"b"" Type="char(2)" Null="YES" Key="" Extra="" />
|
<field Field="a"b"" Type="char(2)" Null="YES" Key="" Extra="" />
|
||||||
@ -380,6 +380,11 @@ UNLOCK TABLES;
|
|||||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||||
DROP TABLE IF EXISTS `v1`;
|
DROP TABLE IF EXISTS `v1`;
|
||||||
DROP VIEW IF EXISTS `v1`;
|
DROP VIEW IF EXISTS `v1`;
|
||||||
|
CREATE TABLE `v1` (
|
||||||
|
`a` int(11) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
DROP TABLE IF EXISTS `v1`;
|
||||||
|
DROP VIEW IF EXISTS `v1`;
|
||||||
CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from `test`.`t1`;
|
CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` from `test`.`t1`;
|
||||||
|
|
||||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||||
@ -1458,6 +1463,11 @@ UNLOCK TABLES;
|
|||||||
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
||||||
DROP TABLE IF EXISTS `v2`;
|
DROP TABLE IF EXISTS `v2`;
|
||||||
DROP VIEW IF EXISTS `v2`;
|
DROP VIEW IF EXISTS `v2`;
|
||||||
|
CREATE TABLE `v2` (
|
||||||
|
`a` varchar(30) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
DROP TABLE IF EXISTS `v2`;
|
||||||
|
DROP VIEW IF EXISTS `v2`;
|
||||||
CREATE ALGORITHM=UNDEFINED VIEW `db1`.`v2` AS select `db1`.`t2`.`a` AS `a` from `db1`.`t2` where (`db1`.`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION;
|
CREATE ALGORITHM=UNDEFINED VIEW `db1`.`v2` AS select `db1`.`t2`.`a` AS `a` from `db1`.`t2` where (`db1`.`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION;
|
||||||
|
|
||||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||||
@ -1471,3 +1481,195 @@ CREATE ALGORITHM=UNDEFINED VIEW `db1`.`v2` AS select `db1`.`t2`.`a` AS `a` from
|
|||||||
drop table t2;
|
drop table t2;
|
||||||
drop view v2;
|
drop view v2;
|
||||||
drop database db1;
|
drop database db1;
|
||||||
|
CREATE DATABASE mysqldump_test_db;
|
||||||
|
USE mysqldump_test_db;
|
||||||
|
CREATE TABLE t1 ( a INT );
|
||||||
|
CREATE TABLE t2 ( a INT );
|
||||||
|
INSERT INTO t1 VALUES (1), (2);
|
||||||
|
INSERT INTO t2 VALUES (1), (2);
|
||||||
|
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||||
|
/*!40101 SET NAMES utf8 */;
|
||||||
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||||
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||||
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||||
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||||
|
DROP TABLE IF EXISTS `t1`;
|
||||||
|
CREATE TABLE `t1` (
|
||||||
|
`a` int(11) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
DROP TABLE IF EXISTS `t2`;
|
||||||
|
CREATE TABLE `t2` (
|
||||||
|
`a` int(11) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||||
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||||
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||||
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
|
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||||
|
/*!40101 SET NAMES utf8 */;
|
||||||
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||||
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||||
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||||
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||||
|
DROP TABLE IF EXISTS `t1`;
|
||||||
|
CREATE TABLE `t1` (
|
||||||
|
`a` int(11) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
DROP TABLE IF EXISTS `t2`;
|
||||||
|
CREATE TABLE `t2` (
|
||||||
|
`a` int(11) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||||
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||||
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||||
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<database name="mysqldump_test_db">
|
||||||
|
<table_structure name="t1">
|
||||||
|
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
|
||||||
|
</table_structure>
|
||||||
|
<table_structure name="t2">
|
||||||
|
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
|
||||||
|
</table_structure>
|
||||||
|
</database>
|
||||||
|
</mysqldump>
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<database name="mysqldump_test_db">
|
||||||
|
<table_structure name="t1">
|
||||||
|
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
|
||||||
|
</table_structure>
|
||||||
|
<table_structure name="t2">
|
||||||
|
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
|
||||||
|
</table_structure>
|
||||||
|
</database>
|
||||||
|
</mysqldump>
|
||||||
|
DROP TABLE t1, t2;
|
||||||
|
DROP DATABASE mysqldump_test_db;
|
||||||
|
create database mysqldump_test_db;
|
||||||
|
use mysqldump_test_db;
|
||||||
|
create table t1(a varchar(30) primary key, b int not null);
|
||||||
|
create table t2(a varchar(30) primary key, b int not null);
|
||||||
|
create table t3(a varchar(30) primary key, b int not null);
|
||||||
|
test_sequence
|
||||||
|
------ Testing with illegal table names ------
|
||||||
|
mysqldump: Couldn't find table: "\d-2-1.sql"
|
||||||
|
|
||||||
|
mysqldump: Couldn't find table: "\t1"
|
||||||
|
|
||||||
|
mysqldump: Couldn't find table: "\t1"
|
||||||
|
|
||||||
|
mysqldump: Couldn't find table: "\\t1"
|
||||||
|
|
||||||
|
mysqldump: Couldn't find table: "t\1"
|
||||||
|
|
||||||
|
mysqldump: Couldn't find table: "t\1"
|
||||||
|
|
||||||
|
mysqldump: Couldn't find table: "t/1"
|
||||||
|
|
||||||
|
test_sequence
|
||||||
|
------ Testing with illegal database names ------
|
||||||
|
mysqldump: Got error: 1049: Unknown database 'mysqldump_test_d' when selecting the database
|
||||||
|
mysqldump: Got error: 1102: Incorrect database name 'mysqld\ump_test_db' when selecting the database
|
||||||
|
drop table t1, t2, t3;
|
||||||
|
drop database mysqldump_test_db;
|
||||||
|
use test;
|
||||||
|
create table t1 (a int(10));
|
||||||
|
create table t2 (pk int primary key auto_increment,
|
||||||
|
a int(10), b varchar(30), c datetime, d blob, e text);
|
||||||
|
insert into t1 values (NULL), (10), (20);
|
||||||
|
insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thirty");
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<database name="test">
|
||||||
|
<table_data name="t1">
|
||||||
|
<row>
|
||||||
|
<field name="a" xsi:nil="true" />
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<field name="a">10</field>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<field name="a">20</field>
|
||||||
|
</row>
|
||||||
|
</table_data>
|
||||||
|
<table_data name="t2">
|
||||||
|
<row>
|
||||||
|
<field name="pk">1</field>
|
||||||
|
<field name="a" xsi:nil="true" />
|
||||||
|
<field name="b" xsi:nil="true" />
|
||||||
|
<field name="c" xsi:nil="true" />
|
||||||
|
<field name="d" xsi:nil="true" />
|
||||||
|
<field name="e" xsi:nil="true" />
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<field name="pk">2</field>
|
||||||
|
<field name="a">10</field>
|
||||||
|
<field name="b" xsi:nil="true" />
|
||||||
|
<field name="c" xsi:nil="true" />
|
||||||
|
<field name="d" xsi:nil="true" />
|
||||||
|
<field name="e" xsi:nil="true" />
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<field name="pk">3</field>
|
||||||
|
<field name="a" xsi:nil="true" />
|
||||||
|
<field name="b">twenty</field>
|
||||||
|
<field name="c" xsi:nil="true" />
|
||||||
|
<field name="d" xsi:nil="true" />
|
||||||
|
<field name="e" xsi:nil="true" />
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<field name="pk">4</field>
|
||||||
|
<field name="a">30</field>
|
||||||
|
<field name="b">thirty</field>
|
||||||
|
<field name="c" xsi:nil="true" />
|
||||||
|
<field name="d" xsi:nil="true" />
|
||||||
|
<field name="e" xsi:nil="true" />
|
||||||
|
</row>
|
||||||
|
</table_data>
|
||||||
|
</database>
|
||||||
|
</mysqldump>
|
||||||
|
drop table t1, t2;
|
||||||
|
create table t1(a int, b int, c varchar(30));
|
||||||
|
insert into t1 values(1, 2, "one"), (2, 4, "two"), (3, 6, "three");
|
||||||
|
create view v3 as
|
||||||
|
select * from t1;
|
||||||
|
create view v1 as
|
||||||
|
select * from v3 where b in (1, 2, 3, 4, 5, 6, 7);
|
||||||
|
create view v2 as
|
||||||
|
select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
|
||||||
|
drop view v1, v2, v3;
|
||||||
|
drop table t1;
|
||||||
|
show full tables;
|
||||||
|
Tables_in_test Table_type
|
||||||
|
t1 BASE TABLE
|
||||||
|
v1 VIEW
|
||||||
|
v2 VIEW
|
||||||
|
v3 VIEW
|
||||||
|
show create view v1;
|
||||||
|
View Create View
|
||||||
|
v1 CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `test`.`v3` where (`v3`.`b` in (1,2,3,4,5,6,7))
|
||||||
|
select * from v1;
|
||||||
|
a b c
|
||||||
|
1 2 one
|
||||||
|
2 4 two
|
||||||
|
3 6 three
|
||||||
|
drop view v1, v2, v3;
|
||||||
|
drop table t1;
|
||||||
|
@ -93,7 +93,7 @@ name char(20), a int, b float, c char(24)
|
|||||||
ERROR 42S01: Table 't3' already exists
|
ERROR 42S01: Table 't3' already exists
|
||||||
show status like 'handler_discover%';
|
show status like 'handler_discover%';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Handler_discover 1
|
Handler_discover 0
|
||||||
create table IF NOT EXISTS t3(
|
create table IF NOT EXISTS t3(
|
||||||
id int not null primary key,
|
id int not null primary key,
|
||||||
id2 int not null,
|
id2 int not null,
|
||||||
@ -101,7 +101,7 @@ name char(20)
|
|||||||
) engine=ndb;
|
) engine=ndb;
|
||||||
show status like 'handler_discover%';
|
show status like 'handler_discover%';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Handler_discover 2
|
Handler_discover 0
|
||||||
SHOW CREATE TABLE t3;
|
SHOW CREATE TABLE t3;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t3 CREATE TABLE `t3` (
|
t3 CREATE TABLE `t3` (
|
||||||
@ -114,7 +114,7 @@ id name
|
|||||||
1 Explorer
|
1 Explorer
|
||||||
show status like 'handler_discover%';
|
show status like 'handler_discover%';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Handler_discover 2
|
Handler_discover 1
|
||||||
drop table t3;
|
drop table t3;
|
||||||
flush status;
|
flush status;
|
||||||
create table t7(
|
create table t7(
|
||||||
|
2
mysql-test/r/not_openssl.require
Normal file
2
mysql-test/r/not_openssl.require
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Variable_name Value
|
||||||
|
have_openssl NO
|
@ -555,3 +555,25 @@ IFNULL(a, 'TEST') COALESCE(b, 'TEST')
|
|||||||
4 TEST
|
4 TEST
|
||||||
TEST TEST
|
TEST TEST
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
CREATE TABLE t1(id int, type char(1));
|
||||||
|
INSERT INTO t1 VALUES
|
||||||
|
(1,"A"),(2,"C"),(3,"A"),(4,"A"),(5,"B"),
|
||||||
|
(6,"B"),(7,"A"),(8,"C"),(9,"A"),(10,"C");
|
||||||
|
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||||
|
SELECT type FROM t1 GROUP BY type WITH ROLLUP;
|
||||||
|
type
|
||||||
|
A
|
||||||
|
B
|
||||||
|
C
|
||||||
|
NULL
|
||||||
|
SELECT type FROM v1 GROUP BY type WITH ROLLUP;
|
||||||
|
type
|
||||||
|
A
|
||||||
|
B
|
||||||
|
C
|
||||||
|
NULL
|
||||||
|
EXPLAIN SELECT type FROM v1 GROUP BY type WITH ROLLUP;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 10 Using filesort
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -138,7 +138,7 @@ create table t1
|
|||||||
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
||||||
c5 integer, c6 bigint, c7 float, c8 double,
|
c5 integer, c6 bigint, c7 float, c8 double,
|
||||||
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
||||||
c13 date, c14 datetime, c15 timestamp(14), c16 time,
|
c13 date, c14 datetime, c15 timestamp, c16 time,
|
||||||
c17 year, c18 bit, c19 bool, c20 char,
|
c17 year, c18 bit, c19 bool, c20 char,
|
||||||
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
||||||
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
||||||
|
@ -17,7 +17,7 @@ create table t9
|
|||||||
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
||||||
c5 integer, c6 bigint, c7 float, c8 double,
|
c5 integer, c6 bigint, c7 float, c8 double,
|
||||||
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
||||||
c13 date, c14 datetime, c15 timestamp(14), c16 time,
|
c13 date, c14 datetime, c15 timestamp, c16 time,
|
||||||
c17 year, c18 tinyint, c19 bool, c20 char,
|
c17 year, c18 tinyint, c19 bool, c20 char,
|
||||||
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
||||||
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
||||||
@ -290,11 +290,11 @@ t2 1 t2_idx 1 b A NULL NULL NULL YES BTREE
|
|||||||
prepare stmt4 from ' show table status from test like ''t2%'' ';
|
prepare stmt4 from ' show table status from test like ''t2%'' ';
|
||||||
execute stmt4;
|
execute stmt4;
|
||||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
t2 MyISAM 10 Fixed 0 0 0 4222124650659839 1024 0 NULL # # # latin1_swedish_ci NULL
|
t2 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # # latin1_swedish_ci NULL
|
||||||
prepare stmt4 from ' show table status from test like ''t9%'' ';
|
prepare stmt4 from ' show table status from test like ''t9%'' ';
|
||||||
execute stmt4;
|
execute stmt4;
|
||||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
t9 MyISAM 10 Dynamic 2 216 432 281474976710655 2048 0 NULL # # # latin1_swedish_ci NULL
|
t9 MyISAM 10 Dynamic 2 216 432 # 2048 0 NULL # # # latin1_swedish_ci NULL
|
||||||
prepare stmt4 from ' show status like ''Threads_running'' ';
|
prepare stmt4 from ' show status like ''Threads_running'' ';
|
||||||
execute stmt4;
|
execute stmt4;
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
|
@ -10,7 +10,7 @@ create table t9
|
|||||||
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
||||||
c5 integer, c6 bigint, c7 float, c8 double,
|
c5 integer, c6 bigint, c7 float, c8 double,
|
||||||
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
||||||
c13 date, c14 datetime, c15 timestamp(14), c16 time,
|
c13 date, c14 datetime, c15 timestamp, c16 time,
|
||||||
c17 year, c18 tinyint, c19 bool, c20 char,
|
c17 year, c18 tinyint, c19 bool, c20 char,
|
||||||
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
||||||
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
||||||
|
@ -10,7 +10,7 @@ create table t9
|
|||||||
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
||||||
c5 integer, c6 bigint, c7 float, c8 double,
|
c5 integer, c6 bigint, c7 float, c8 double,
|
||||||
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
||||||
c13 date, c14 datetime, c15 timestamp(14), c16 time,
|
c13 date, c14 datetime, c15 timestamp, c16 time,
|
||||||
c17 year, c18 tinyint, c19 bool, c20 char,
|
c17 year, c18 tinyint, c19 bool, c20 char,
|
||||||
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
||||||
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
||||||
|
@ -11,7 +11,7 @@ create table t9
|
|||||||
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
||||||
c5 integer, c6 bigint, c7 float, c8 double,
|
c5 integer, c6 bigint, c7 float, c8 double,
|
||||||
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
||||||
c13 date, c14 datetime, c15 timestamp(14), c16 time,
|
c13 date, c14 datetime, c15 timestamp, c16 time,
|
||||||
c17 year, c18 tinyint, c19 bool, c20 char,
|
c17 year, c18 tinyint, c19 bool, c20 char,
|
||||||
c21 char(10), c22 varchar(30), c23 varchar(100), c24 varchar(100),
|
c21 char(10), c22 varchar(30), c23 varchar(100), c24 varchar(100),
|
||||||
c25 varchar(100), c26 varchar(100), c27 varchar(100), c28 varchar(100),
|
c25 varchar(100), c26 varchar(100), c27 varchar(100), c28 varchar(100),
|
||||||
|
@ -12,7 +12,7 @@ create table t9
|
|||||||
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
||||||
c5 integer, c6 bigint, c7 float, c8 double,
|
c5 integer, c6 bigint, c7 float, c8 double,
|
||||||
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
||||||
c13 date, c14 datetime, c15 timestamp(14), c16 time,
|
c13 date, c14 datetime, c15 timestamp, c16 time,
|
||||||
c17 year, c18 tinyint, c19 bool, c20 char,
|
c17 year, c18 tinyint, c19 bool, c20 char,
|
||||||
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
||||||
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
||||||
@ -32,7 +32,7 @@ create table t9
|
|||||||
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
||||||
c5 integer, c6 bigint, c7 float, c8 double,
|
c5 integer, c6 bigint, c7 float, c8 double,
|
||||||
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
||||||
c13 date, c14 datetime, c15 timestamp(14), c16 time,
|
c13 date, c14 datetime, c15 timestamp, c16 time,
|
||||||
c17 year, c18 tinyint, c19 bool, c20 char,
|
c17 year, c18 tinyint, c19 bool, c20 char,
|
||||||
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
||||||
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
||||||
@ -52,7 +52,7 @@ create table t9
|
|||||||
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
||||||
c5 integer, c6 bigint, c7 float, c8 double,
|
c5 integer, c6 bigint, c7 float, c8 double,
|
||||||
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
||||||
c13 date, c14 datetime, c15 timestamp(14), c16 time,
|
c13 date, c14 datetime, c15 timestamp, c16 time,
|
||||||
c17 year, c18 tinyint, c19 bool, c20 char,
|
c17 year, c18 tinyint, c19 bool, c20 char,
|
||||||
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
||||||
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
||||||
@ -3064,7 +3064,7 @@ create table t9
|
|||||||
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
||||||
c5 integer, c6 bigint, c7 float, c8 double,
|
c5 integer, c6 bigint, c7 float, c8 double,
|
||||||
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
||||||
c13 date, c14 datetime, c15 timestamp(14), c16 time,
|
c13 date, c14 datetime, c15 timestamp, c16 time,
|
||||||
c17 year, c18 tinyint, c19 bool, c20 char,
|
c17 year, c18 tinyint, c19 bool, c20 char,
|
||||||
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
||||||
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
||||||
|
@ -10,7 +10,7 @@ create table t9
|
|||||||
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
||||||
c5 integer, c6 bigint, c7 float, c8 double,
|
c5 integer, c6 bigint, c7 float, c8 double,
|
||||||
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
||||||
c13 date, c14 datetime, c15 timestamp(14), c16 time,
|
c13 date, c14 datetime, c15 timestamp, c16 time,
|
||||||
c17 year, c18 tinyint, c19 bool, c20 char,
|
c17 year, c18 tinyint, c19 bool, c20 char,
|
||||||
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
||||||
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
||||||
|
@ -10,7 +10,7 @@ create table t9
|
|||||||
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
|
||||||
c5 integer, c6 bigint, c7 float, c8 double,
|
c5 integer, c6 bigint, c7 float, c8 double,
|
||||||
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
|
||||||
c13 date, c14 datetime, c15 timestamp(14), c16 time,
|
c13 date, c14 datetime, c15 timestamp, c16 time,
|
||||||
c17 year, c18 tinyint, c19 bool, c20 char,
|
c17 year, c18 tinyint, c19 bool, c20 char,
|
||||||
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
|
||||||
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
|
||||||
|
File diff suppressed because one or more lines are too long
@ -549,6 +549,66 @@ select count(*) from t2 where x = 18446744073709551601;
|
|||||||
count(*)
|
count(*)
|
||||||
0
|
0
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
create table t1 (x bigint unsigned not null primary key) engine=innodb;
|
||||||
|
insert into t1(x) values (0xfffffffffffffff0);
|
||||||
|
insert into t1(x) values (0xfffffffffffffff1);
|
||||||
|
select * from t1;
|
||||||
|
x
|
||||||
|
18446744073709551600
|
||||||
|
18446744073709551601
|
||||||
|
select count(*) from t1 where x>0;
|
||||||
|
count(*)
|
||||||
|
2
|
||||||
|
select count(*) from t1 where x=0;
|
||||||
|
count(*)
|
||||||
|
0
|
||||||
|
select count(*) from t1 where x<0;
|
||||||
|
count(*)
|
||||||
|
0
|
||||||
|
select count(*) from t1 where x < -16;
|
||||||
|
count(*)
|
||||||
|
0
|
||||||
|
select count(*) from t1 where x = -16;
|
||||||
|
count(*)
|
||||||
|
0
|
||||||
|
select count(*) from t1 where x > -16;
|
||||||
|
count(*)
|
||||||
|
2
|
||||||
|
select count(*) from t1 where x = 18446744073709551601;
|
||||||
|
count(*)
|
||||||
|
1
|
||||||
|
drop table t1;
|
||||||
|
create table t1 (a bigint unsigned);
|
||||||
|
create index t1i on t1(a);
|
||||||
|
insert into t1 select 18446744073709551615;
|
||||||
|
insert into t1 select 18446744073709551614;
|
||||||
|
explain select * from t1 where a <> -1;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 index t1i t1i 9 NULL 2 Using where; Using index
|
||||||
|
select * from t1 where a <> -1;
|
||||||
|
a
|
||||||
|
18446744073709551614
|
||||||
|
18446744073709551615
|
||||||
|
explain select * from t1 where a > -1 or a < -1;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 index t1i t1i 9 NULL 2 Using where; Using index
|
||||||
|
select * from t1 where a > -1 or a < -1;
|
||||||
|
a
|
||||||
|
18446744073709551614
|
||||||
|
18446744073709551615
|
||||||
|
explain select * from t1 where a > -1;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 index t1i t1i 9 NULL 2 Using where; Using index
|
||||||
|
select * from t1 where a > -1;
|
||||||
|
a
|
||||||
|
18446744073709551614
|
||||||
|
18446744073709551615
|
||||||
|
explain select * from t1 where a < -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
|
||||||
|
select * from t1 where a < -1;
|
||||||
|
a
|
||||||
|
drop table t1;
|
||||||
set names latin1;
|
set names latin1;
|
||||||
create table t1 (a char(10), b text, key (a)) character set latin1;
|
create table t1 (a char(10), b text, key (a)) character set latin1;
|
||||||
INSERT INTO t1 (a) VALUES
|
INSERT INTO t1 (a) VALUES
|
||||||
@ -660,3 +720,27 @@ id status
|
|||||||
59 C
|
59 C
|
||||||
60 C
|
60 C
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (a int, b int, primary key(a,b));
|
||||||
|
INSERT INTO t1 VALUES
|
||||||
|
(1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3),(4,1),(4,2),(4,3);
|
||||||
|
CREATE VIEW v1 as SELECT a,b FROM t1 WHERE b=3;
|
||||||
|
EXPLAIN SELECT a,b FROM t1 WHERE a < 2 and b=3;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 4 Using where; Using index
|
||||||
|
EXPLAIN SELECT a,b FROM v1 WHERE a < 2 and b=3;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL 4 Using where; Using index
|
||||||
|
EXPLAIN SELECT a,b FROM t1 WHERE a < 2;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 4 Using where; Using index
|
||||||
|
EXPLAIN SELECT a,b FROM v1 WHERE a < 2;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL 4 Using where; Using index
|
||||||
|
SELECT a,b FROM t1 WHERE a < 2 and b=3;
|
||||||
|
a b
|
||||||
|
1 3
|
||||||
|
SELECT a,b FROM v1 WHERE a < 2 and b=3;
|
||||||
|
a b
|
||||||
|
1 3
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
37
mysql-test/r/rpl_innodb.result
Normal file
37
mysql-test/r/rpl_innodb.result
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
stop slave;
|
||||||
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
|
reset master;
|
||||||
|
reset slave;
|
||||||
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
|
start slave;
|
||||||
|
CREATE TABLE t4 (
|
||||||
|
id INT(5) unsigned NOT NULL auto_increment,
|
||||||
|
name varchar(15) NOT NULL default '',
|
||||||
|
number varchar(35) NOT NULL default 'default',
|
||||||
|
PRIMARY KEY (id),
|
||||||
|
UNIQUE KEY unique_rec (name,number)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
LOAD DATA
|
||||||
|
INFILE '../../std_data/loaddata_pair.dat'
|
||||||
|
REPLACE INTO TABLE t4
|
||||||
|
(name,number);
|
||||||
|
SELECT * FROM t4;
|
||||||
|
id name number
|
||||||
|
1 XXX 12345
|
||||||
|
2 XXY 12345
|
||||||
|
SELECT * FROM t4;
|
||||||
|
id name number
|
||||||
|
1 XXX 12345
|
||||||
|
2 XXY 12345
|
||||||
|
LOAD DATA
|
||||||
|
INFILE '../../std_data/loaddata_pair.dat'
|
||||||
|
REPLACE INTO TABLE t4
|
||||||
|
(name,number);
|
||||||
|
SELECT * FROM t4;
|
||||||
|
id name number
|
||||||
|
3 XXX 12345
|
||||||
|
4 XXY 12345
|
||||||
|
SELECT * FROM t4;
|
||||||
|
id name number
|
||||||
|
3 XXX 12345
|
||||||
|
4 XXY 12345
|
@ -4,6 +4,8 @@ reset master;
|
|||||||
reset slave;
|
reset slave;
|
||||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
start slave;
|
start slave;
|
||||||
|
|
||||||
|
-------- Test for BUG#9361 --------
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
a int unsigned not null auto_increment primary key,
|
a int unsigned not null auto_increment primary key,
|
||||||
b int unsigned
|
b int unsigned
|
||||||
@ -41,3 +43,82 @@ a b
|
|||||||
1 6
|
1 6
|
||||||
2 6
|
2 6
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
|
||||||
|
-------- Test 1 for BUG#9361 --------
|
||||||
|
DROP TABLE IF EXISTS t1;
|
||||||
|
DROP TABLE IF EXISTS t2;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
a1 char(30),
|
||||||
|
a2 int,
|
||||||
|
a3 int,
|
||||||
|
a4 char(30),
|
||||||
|
a5 char(30)
|
||||||
|
);
|
||||||
|
CREATE TABLE t2 (
|
||||||
|
b1 int,
|
||||||
|
b2 char(30)
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar');
|
||||||
|
INSERT INTO t2 VALUES (1, 'baz');
|
||||||
|
UPDATE t1 a, t2
|
||||||
|
SET a.a1 = 'No'
|
||||||
|
WHERE a.a2 =
|
||||||
|
(SELECT b1
|
||||||
|
FROM t2
|
||||||
|
WHERE b2 = 'baz')
|
||||||
|
AND a.a3 IS NULL
|
||||||
|
AND a.a4 = 'foo'
|
||||||
|
AND a.a5 = 'bar';
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a1 a2 a3 a4 a5
|
||||||
|
No 1 NULL foo bar
|
||||||
|
SELECT * FROM t2;
|
||||||
|
b1 b2
|
||||||
|
1 baz
|
||||||
|
DROP TABLE t1, t2;
|
||||||
|
|
||||||
|
-------- Test 2 for BUG#9361 --------
|
||||||
|
DROP TABLE IF EXISTS t1;
|
||||||
|
DROP TABLE IF EXISTS t2;
|
||||||
|
DROP TABLE IF EXISTS t3;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
i INT,
|
||||||
|
j INT,
|
||||||
|
x INT,
|
||||||
|
y INT,
|
||||||
|
z INT
|
||||||
|
);
|
||||||
|
CREATE TABLE t2 (
|
||||||
|
i INT,
|
||||||
|
k INT,
|
||||||
|
x INT,
|
||||||
|
y INT,
|
||||||
|
z INT
|
||||||
|
);
|
||||||
|
CREATE TABLE t3 (
|
||||||
|
j INT,
|
||||||
|
k INT,
|
||||||
|
x INT,
|
||||||
|
y INT,
|
||||||
|
z INT
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES ( 1, 2,13,14,15);
|
||||||
|
INSERT INTO t2 VALUES ( 1, 3,23,24,25);
|
||||||
|
INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
|
||||||
|
UPDATE t1 AS a
|
||||||
|
INNER JOIN t2 AS b
|
||||||
|
ON a.i = b.i
|
||||||
|
INNER JOIN t3 AS c
|
||||||
|
ON a.j = c.j AND b.k = c.k
|
||||||
|
SET a.x = b.x,
|
||||||
|
a.y = b.y,
|
||||||
|
a.z = (
|
||||||
|
SELECT sum(z)
|
||||||
|
FROM t3
|
||||||
|
WHERE y = 34
|
||||||
|
)
|
||||||
|
WHERE b.x = 23;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
i j x y z
|
||||||
|
1 2 23 24 71
|
||||||
|
DROP TABLE t1, t2, t3;
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
stop slave;
|
|
||||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
||||||
reset master;
|
|
||||||
reset slave;
|
|
||||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
||||||
start slave;
|
|
||||||
stop slave;
|
|
||||||
flush logs;
|
|
||||||
create table t1 (a int) engine=bdb;
|
|
||||||
reset slave;
|
|
||||||
start slave;
|
|
||||||
show slave status;
|
|
||||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
|
||||||
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 4 # # master-bin.000002 Yes Yes 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 4 # None 0 No #
|
|
||||||
select * from t1;
|
|
||||||
a
|
|
||||||
drop table t1;
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user