1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
This commit is contained in:
bell@sanja.is.com.ua
2003-06-27 23:14:20 +03:00
568 changed files with 22858 additions and 20323 deletions

View File

@ -38,7 +38,11 @@ COPYING.LIB
Docs/#manual.texi#
Docs/INSTALL-BINARY
Docs/include.texi
Docs/internals.html
Docs/internals.info
Docs/internals.pdf
Docs/internals.txt
Docs/internals_toc.html
Docs/manual.aux
Docs/manual.cp
Docs/manual.cps
@ -239,6 +243,7 @@ client/select_test
client/ssl_test
client/thimble
client/thread_test
client_test
cmd-line-utils/libedit/common.h
comon.h
config.cache
@ -272,6 +277,7 @@ help.h
include/my_config.h
include/my_global.h
include/mysql_version.h
include/readline/*.h
include/readline/readline.h
include/widec.h
innobase/autom4te-2.53.cache/output.0
@ -287,6 +293,7 @@ innobase/conftest.subs
innobase/ib_config.h
innobase/ib_config.h.in
innobase/stamp-h1
insert_test
isam/isamchk
isam/isamlog
isam/pack_isam
@ -341,6 +348,7 @@ libmysqld/item_buff.cc
libmysqld/item_cmpfunc.cc
libmysqld/item_create.cc
libmysqld/item_func.cc
libmysqld/item_geofunc.cc
libmysqld/item_row.cc
libmysqld/item_strfunc.cc
libmysqld/item_sum.cc
@ -391,6 +399,7 @@ libmysqld/sql_rename.cc
libmysqld/sql_repl.cc
libmysqld/sql_select.cc
libmysqld/sql_show.cc
libmysqld/sql_state.c
libmysqld/sql_string.cc
libmysqld/sql_table.cc
libmysqld/sql_test.cc
@ -497,6 +506,7 @@ scripts/make_win_src_distribution
scripts/msql2mysql
scripts/mysql_config
scripts/mysql_convert_table_format
scripts/mysql_create_system_tables
scripts/mysql_explain_log
scripts/mysql_find_rows
scripts/mysql_fix_extensions
@ -513,6 +523,7 @@ scripts/mysqld_safe
scripts/mysqldumpslow
scripts/mysqlhotcopy
scripts/safe_mysqld
select_test
sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686
sql-bench/bench-count-distinct
sql-bench/bench-init.pl
@ -542,6 +553,7 @@ sql-bench/test-select
sql-bench/test-transactions
sql-bench/test-wisconsin
sql/.gdbinit
sql/client.c
sql/gen_lex_hash
sql/gmon.out
sql/lex_hash.h
@ -576,8 +588,10 @@ stamp-h4
strings/conf_to_src
strings/ctype_autoconf.c
strings/ctype_extra_sources.c
strings/str_test
support-files/MacOSX/Description.plist
support-files/MacOSX/Info.plist
support-files/MacOSX/ReadMe.txt
support-files/MacOSX/StartupParameters.plist
support-files/MacOSX/postinstall
support-files/MacOSX/preinstall
@ -597,6 +611,7 @@ support-files/mysql.spec
tags
test_xml
tests/client_test
thread_test
tmp/*
tools/my_vsnprintf.c
tools/mysqlmanager
@ -607,7 +622,3 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
client_test
thread_test
select_test
insert_test

View File

@ -52,7 +52,7 @@ debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMA
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
base_configs="--prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client"
base_configs="--prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-readline"
static_link="--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static"
alpha_configs="" # Not used yet
pentium_configs=""
@ -71,4 +71,22 @@ else
make=make
fi
CXX=gcc
if test -z "$CXX" ; then
CXX=gcc
fi
# If ccache (a compiler cache which reduces build time)
# (http://samba.org/ccache) is installed, use it.
# We use 'grep' and hope 'grep' will work as expected
# (returns 0 if finds lines)
if ccache -V > /dev/null 2>&1
then
if ! (echo "$CC" | grep "ccache" > /dev/null)
then
CC="ccache $CC"
fi
if ! (echo "$CXX" | grep "ccache" > /dev/null)
then
CXX="ccache $CXX"
fi
fi

View File

@ -5,6 +5,7 @@ Administrator@fred.
Miguel@light.local
Sinisa@sinisa.nasamreza.org
WAX@sergbook.mysql.com
administrador@light.hegel.local
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
akishkin@work.mysql.com
arjen@co3064164-a.bitbike.com
@ -16,6 +17,8 @@ bar@gw.udmsearch.izhnet.ru
bell@laptop.sanja.is.com.ua
bell@sanja.is.com.ua
bk@admin.bk
bk@mysql.r18.ru
carsten@tsort.bitbybit.dk
davida@isil.mysql.com
gluh@gluh.(none)
gluh@gluh.mysql.r18.ru
@ -28,9 +31,11 @@ heikki@rescue.
heikki@work.mysql.com
hf@bison.(none)
hf@bisonxp.(none)
hf@deer.(none)
hf@deer.mysql.r18.ru
hf@genie.(none)
igor@hundin.mysql.fi
igor@rurik.mysql.com
jani@dsl-jkl1657.dial.inet.fi
jani@dsl-kpogw4gb5.dial.inet.fi
jani@hynda.(none)
@ -38,6 +43,7 @@ jani@hynda.mysql.fi
jani@janikt.pp.saunalahti.fi
jani@rhols221.adsl.netsonic.fi
jani@rhols221.arenanet.fi
jani@ua126d19.elisa.omakaista.fi
jcole@abel.spaceapes.com
jcole@main.burghcom.com
jcole@mugatu.spaceapes.com
@ -47,10 +53,12 @@ jorge@linux.jorge.mysql.com
kaj@work.mysql.com
lenz@kallisto.mysql.com
lenz@mysql.com
miguel@hegel.(none)
miguel@hegel.br
miguel@hegel.local
miguel@light.
miguel@light.local
mmatthew@markslaptop.
monty@bitch.mysql.fi
monty@butch.
monty@donna.mysql.fi
@ -67,14 +75,17 @@ mwagner@cash.mwagner.org
mwagner@evoq.mwagner.org
mwagner@work.mysql.com
mysql@home.(none)
mysqldev@build.mysql2.com
nick@mysql.com
nick@nick.leippe.com
papa@gbichot.local
paul@central.snake.net
paul@ice.snake.net
paul@teton.kitebird.com
pem@mysql.com
peter@linux.local
peter@mysql.com
peterg@mysql.com
pgulutzan@linux.local
ram@gw.udmsearch.izhnet.ru
ram@mysql.r18.ru
@ -89,6 +100,7 @@ sasha@mysql.sashanet.com
serg@build.mysql2.com
serg@serg.mylan
serg@serg.mysql.com
serg@sergbook.mylan
serg@sergbook.mysql.com
sinisa@rhols221.adsl.netsonic.fi
tfr@beta.frontier86.ee
@ -110,6 +122,7 @@ venu@myvenu.com
venu@work.mysql.com
vva@eagle.mysql.r18.ru
vva@genie.(none)
vva@mysql.r18.ru
walrus@kishkin.ru
walrus@mysql.com
wax@kishkin.ru

View File

@ -1,3 +0,0 @@
#! /bin/sh
echo "Test: post-incoming works"

View File

@ -1,3 +0,0 @@
#! /bin/sh
echo "Test: post-outgoing works"

12
BitKeeper/triggers/pre-commit Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
if [ "$REAL_EMAIL" = "" ]
then
echo "Error: you must set REAL_EMAIL in your profile"
echo "e.g.: export REAL_EMAIL='Joe Dow <joe@foo.bar>'"
echo ""
echo "Commit FAILED!"
echo "Set REAL_EMAIL and retry."
exit 1
fi

View File

@ -276,7 +276,11 @@ if ($opt_stage <= 3)
my $flags= "";
log_timestamp();
log_system("rm -fr mysql-3* mysql-4* $pwd/$host/*.tar.gz");
# No need to add the debug symbols, if the binaries are not stripped (saves space)
unless ($opt_with_debug || $opt_no_strip)
{
log_system("nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz | cat");
}
$flags.= "--no-strip" if ($opt_no_strip || $opt_with_debug);
check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created");

View File

@ -27,7 +27,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt \
all: $(targets) txt_files
txt_files: ../INSTALL-SOURCE ../COPYING ../COPYING.LIB \
INSTALL-BINARY
INSTALL-BINARY ../support-files/MacOSX/ReadMe.txt
CLEAN_FILES: $(BUILD_SOURCES)
touch $(BUILD_SOURCES)
@ -156,54 +156,6 @@ manual_letter.de.ps: manual.de.texi include.texi
$(DVIPS) -t letter manual.de.dvi -o $@
touch $@
#
# Internals Manual
#
# GNU Info
internals.info: internals.texi include.texi
cd $(srcdir) && $(MAKEINFO) --no-split -I $(srcdir) $<
# Plain Text
internals.txt: internals.texi include.texi
cd $(srcdir) && \
$(MAKEINFO) -I $(srcdir) --no-headers --no-split --output $@ $<
# HTML, all in one file
internals.html: internals.texi include.texi $(srcdir)/Support/texi2html
cd $(srcdir) && @PERL@ $(srcdir)/Support/texi2html $(TEXI2HTML_FLAGS) $<
internals_toc.html: internals.html
# PDF, Portable Document Format
internals.pdf: internals.texi
sed -e 's|@image{[^}]*} *||g' <$< >internals-tmp.texi
pdftex --interaction=nonstopmode internals-tmp.texi
texindex internals-tmp.??
pdftex --interaction=nonstopmode internals-tmp.texi
texindex internals-tmp.??
pdftex --interaction=nonstopmode internals-tmp.texi
mv internals-tmp.pdf $@
rm -f internals-tmp.*
touch $@
# Postscript, A4 Paper
internals_a4.ps: internals.texi include.texi
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' \
$(TEXI2DVI) --batch --texinfo --quiet '@afourpaper' $<
$(DVIPS) -t a4 internals.dvi -o $@
touch $@
# Postscript, US Letter Paper
internals_letter.ps: internals.texi include.texi
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' \
$(TEXI2DVI) --batch $<
$(DVIPS) -t letter internals.dvi -o $@
touch $@
#
# Miscellaneous
#
@ -254,5 +206,8 @@ INSTALL-BINARY: mysql.info $(GT)
../COPYING.LIB: mysql.info $(GT)
perl -w $(GT) mysql.info "LGPL license" "Function Index" > $@
../support-files/MacOSX/ReadMe.txt: mysql.info $(GT)
perl -w $(GT) mysql.info "Mac OS X installation" "Netware installation" > $@
# Don't update the files from bitkeeper
%::SCCS/s.%

File diff suppressed because it is too large Load Diff

9
Docs/manual_toc.html Normal file
View File

@ -0,0 +1,9 @@
<html>
<head>
<title>Place holder for manual_toc.html</title>
</head>
<body>
This is just a place holder for the autogenerated manual_toc.html
to make "make dist" happy.
</body>
</html>

221
INSTALL-WIN-SOURCE Executable file
View File

@ -0,0 +1,221 @@
#########################################################
# #
# HOWTO : INSTALL MySQL FROM SOURCE #
# WINDOWS PORT #
# #
# Copyright (C) MySQL AB 1995-2003 #
#########################################################
This is a simple 'HOWTO' document describing how to
build MySQL binaries for versions 4.1 and above on
Windows. Instructions are provided for building binaries
from a standard source distribution or from the BitKeeper
tree that contains the latest development source.
---------------------------------------------------------
NOTE
---------------------------------------------------------
Normally, it is best to use precompiled binary distributions
of MySQL that are built specifically for optimal performance
on Windows by MySQL AB. Binary distributions are available
from:
http://www.mysql.com/downloads/
The instructions in this document are strictly for users
who want to test MySQL on Windows from the latest source or
from the BitKeeper tree, and for internal MySQL developers.
--------------------------------------------------------
TABLE OF CONTENTS
--------------------------------------------------------
1. REQUIREMENTS
2. OBTAINING A WINDOWS SOURCE DISTRIBUTION
3. CREATING A SOURCE PACKAGE FROM THE 'BitKeeper' TREE
4. BUILDING 'mysql server and clients' FROM VC++ WORKSPACE
5. BUILDING FROM 'nmake' MAKEFILES
6. STARTING THE MYSQL SERVER FOR THE FIRST TIME
7. TESTING THE CONNECTION
8. SPECIAL NOTES AND CONSIDERATIONS
-------------------------------------------------------
1. REQUIREMENTS
-------------------------------------------------------
To build MySQL on Windows from source, you need the
following compiler and resources available on your Windows
system:
- Microsoft Visual C++ 6.0 and above
- ~45 MB disk space
- 64 MB RAM
You'll also need a MySQL source distribution, which you
can obtain as described in section 2.
-------------------------------------------------------
2. OBTAINING A WINDOWS SOURCE DISTRIBUTION
-------------------------------------------------------
There are two ways you can get a Windows source distribution
for MySQL version 4.1 and above:
I. Obtain a MySQL AB-distributed source distribution for the
particular version of MySQL in which you are interested.
Prepackaged source distributions are available for released
versions of MySQL and can be obtained from:
http://www.mysql.com/downloads/
II. Alternatively, you can package a source distribution
yourself from the latest BitKeeper developer source
tree. If you plan to do this, you must create the
package on a Unix system and then transfer it to your
Windows system. (The reason for this is that some of the
configuration and build steps require tools that work only
on Unix.) The BitKeeper approach thus requires:
- A system running Unix, or a Unix-like system such as Linux
- BitKeeper 3.0 installed on that system (you can obtain
BitKeeper from http://www.bitkeeper.com)
If you are using the first option, you can skip the next
section and go directly to "BUILDING 'mysql server & clients'
FROM VC++ WORKSPACE"
-------------------------------------------------------
3. CREATING A SOURCE PACKAGE FROM THE 'BitKeeper' TREE
-------------------------------------------------------
To build the latest Windows source package from the current
BitKeeper source tree, use the following instructions. Please
note that this procedure must be performed on a system
running a Unix or Unix-like operating system. (The procedure
is know to work well on Linux, for example.
- Clone the BitKeeper source tree for MySQL (version 4.1
or above, as desired). For more information how to clone
the source tree, see the instructions at:
http://www.mysql.com/doc/en/Installing_source_tree.html
- Configure and build the distribution so that you have a
server binary to work with. One way to do this is to run
the following command in the top-level directory of your
source tree:
./BUILD/compile-pentium-max
- After making sure that the build process completed successfully,
run the following utility script from top-level directory
of your source tree:
./scripts/make_win_src_distribution
This script creates a Windows source package, to be used on
your Windows system. You can supply different options to the
script based on your needs. It accepts the following options:
--debug Debug, without creating the package
--tmp Specify the temporary location
--suffix Suffix name for the package
--dirname Directory name to copy files (intermediate)
--silent Do not list verbosely files processed
--tar Create tar.gz package instead of .zip
--help Show this help message
By default, make_win_src_distribution creates a zipped
archive with the name mysql-$version-win-src.zip, where
$version represents the version of your MySQL source tree.
- Copy or upload to your Windows machine the Windows source
package that you have just created. To compile it, use
the instructions in the next section.
---------------------------------------------------------
4. BUILDING 'mysql server & clients' FROM VC++ WORKSPACE
---------------------------------------------------------
NOTE: MySQL 4.1 and above VC++ workspace files are compatible
with Microsoft Visual Studio 6.0 and above(7.0/.NET)
editions and tested by MySQL folks before each
release.
Unpack the Windows source zipped archive to a folder and open
mysql.dsw from your top-level directory.
If you want to build both release and debug versions, then
select 'build' -> 'buildall' option. To build only release
or debug versions, select all appropriate workspaces from
the 'build' -> 'batch build' option.
The simplest solution to building the basic clients and core
server is to set your current active workspace as 'mysqld'
release or debug version, and just hit 'build' or 'F7', which
creates the necessary client binaries in the 'client_release'
or 'client_debug' directories. The libraries are placed in the
'lib_release' and 'lib_debug' directories for release and
debug versions, respectively.
Now you have built the distribution. If you get any compiler
errors, please cross check and email the compiler output to
win32@lists.mysql.com for further assistance.
---------------------------------------------------------
5. BUILDING FROM 'nmake' MAKEFILES
---------------------------------------------------------
TODO from MySQL PIEFU team.
---------------------------------------------------------
6. STARTING THE MYSQL SERVER FOR THE FIRST TIME
---------------------------------------------------------
The server built using the preceding instructions will
expect that the MySQL base directory and data directory
are C:\mysql and C:\mysql\data by default. If you want to
test your server using the source root directory and its
data directory as the base directory and data directory,
you will need to tell the server their pathnames. You can
either do this on the command line with the --basedir
and --data-dir options, or place appropriate options in
an option file (C:\my.cnf or the my.ini file in your
Windows directory). If you have an existing data directory
elsewhere that you want to use, you can specify its pathname
instead.
Start your server from the 'client_release' or 'client_debug'
directory (depending on which server you want to use). The
general instructions are given here:
http://www.mysql.com/doc/en/Windows_installation.html
You'll have to adapt the instructions appropriately if you
want to use a different base directory and/or data directory.
That's all!!! See, it's as simple to build MySQL on Windows
as on any other platform!!!
---------------------------------------------------------
7. TESTING THE CONNECTION
---------------------------------------------------------
Once the server is running in standalone fashion or as a
service based on your configuration, try to connect to it
from the 'mysql' command line SQL interactive utility that
exists in your 'client_release' or 'client_debug' directory.
---------------------------------------------------------
8. SPECIAL NOTES AND CONSIDERATIONS
---------------------------------------------------------
- For production use, MySQL AB does not advise using a MySQL
server built by yourself from source. It is preferable to
stick to using binaries shipped by MySQL AB.
- If you find something not working as expected, or you have
suggestions about ways to improve the current build process
on Windows, please email to win32@lists.mysql.com.
Thanks
MySQL Team

View File

@ -1 +0,0 @@
logo_nusphere_b.tif

View File

@ -22,7 +22,7 @@ AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = INSTALL-SOURCE README \
COPYING COPYING.LIB
SUBDIRS = . include @docs_dirs@ \
@readline_topdir@ \
@readline_topdir@ sql-common \
@thread_dirs@ pstack @sql_client_dirs@ \
@sql_server_dirs@ scripts man tests \
BUILD @netware_dir@ os2 @libmysqld_dirs@ \
@ -70,7 +70,10 @@ linked_netware_sources:
#avoid recursive make calls in sql directory
linked_server_sources:
cd sql; rm -f mini_client_errors.c;@LN_CP_F@ ../libmysql/errmsg.c mini_client_errors.c; rm -f pack.c;@LN_CP_F@ ../sql-common/pack.c pack.c
cd sql; rm -f mini_client_errors.c;\
@LN_CP_F@ ../libmysql/errmsg.c mini_client_errors.c;\
rm -f pack.c;@LN_CP_F@ ../sql-common/pack.c pack.c;\
rm -f client.c;@LN_CP_F@ ../sql-common/client.c client.c
echo timestamp > linked_server_sources
# Create permission databases

View File

@ -87,7 +87,7 @@ LINK32=link.exe
# Name "mysql - Win32 Debug"
# Begin Source File
SOURCE=..\mysys\my_gethostbyname.c
SOURCE=.\completion_hash.cpp
# End Source File
# Begin Source File
@ -101,6 +101,14 @@ SOURCE=.\mysql.cpp
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\readline.cpp
# End Source File
# Begin Source File
SOURCE=.\sql_string.cpp
# End Source File
# End Target
# End Project

View File

@ -25,7 +25,7 @@ CFG=mysqlclient - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=xicl6.exe
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "mysqlclient - Win32 Release"
@ -48,7 +48,7 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=xilink6.exe -lib
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\mysqlclient.lib"
@ -72,7 +72,7 @@ LIB32=xilink6.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=xilink6.exe -lib
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\mysqlclient.lib"
@ -104,11 +104,7 @@ SOURCE=..\mysys\charset.c
# End Source File
# Begin Source File
SOURCE=.\completion_hash.cpp
# End Source File
# Begin Source File
SOURCE=.\completion_hash.h
SOURCE=..\libmysql\client.c
# End Source File
# Begin Source File
@ -422,30 +418,14 @@ SOURCE=..\libmysql\password.c
# End Source File
# Begin Source File
SOURCE=.\readline.cpp
# End Source File
# Begin Source File
SOURCE=..\mysys\safemalloc.c
# End Source File
# Begin Source File
SOURCE=.\select_test.c
# End Source File
# Begin Source File
SOURCE=..\mysys\sha1.c
# End Source File
# Begin Source File
SOURCE=.\sql_string.cpp
# End Source File
# Begin Source File
SOURCE=.\sql_string.h
# End Source File
# Begin Source File
SOURCE=..\strings\str2int.c
# End Source File
# Begin Source File

View File

@ -25,7 +25,7 @@ CFG=libmysql - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
CPP=xicl6.exe
MTL=midl.exe
RSC=rc.exe
@ -52,7 +52,7 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.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:windows /dll /machine:I386
# ADD LINK32 wsock32.lib 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:windows /dll /machine:I386 /def:"libmysql.def" /out:"..\lib_release\libmysql.dll" /libpath:"." /libpath:"..\lib_release"
# SUBTRACT LINK32 /pdb:none
@ -85,7 +85,7 @@ PostBuild_Cmds=xcopy release\libmysql.lib ..\lib_release /y
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.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:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 zlib.lib wsock32.lib 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:windows /dll /incremental:no /map /debug /machine:I386 /def:"libmysql.def" /out:"..\lib_debug\libmysql.dll" /pdbtype:sept /libpath:"." /libpath:"..\lib_debug"
# SUBTRACT LINK32 /pdb:none
@ -123,6 +123,10 @@ SOURCE=..\mysys\charset.c
# End Source File
# Begin Source File
SOURCE=.\client.c
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-big5.c"
# End Source File
# Begin Source File
@ -215,10 +219,6 @@ SOURCE=.\libmysql.c
# End Source File
# Begin Source File
SOURCE=.\pack.c
# End Source File
# Begin Source File
SOURCE=.\Libmysql.def
# End Source File
# Begin Source File
@ -255,6 +255,10 @@ SOURCE=..\mysys\mf_pack.c
# End Source File
# Begin Source File
SOURCE=..\mysys\mf_path.c
# End Source File
# Begin Source File
SOURCE=..\mysys\mf_unixpath.c
# End Source File
# Begin Source File
@ -399,6 +403,10 @@ SOURCE=..\sql\net_serv.cpp
# End Source File
# Begin Source File
SOURCE=.\pack.c
# End Source File
# Begin Source File
SOURCE=.\password.c
# End Source File
# Begin Source File
@ -407,10 +415,6 @@ SOURCE=..\mysys\safemalloc.c
# End Source File
# Begin Source File
SOURCE=..\client\select_test.c
# End Source File
# Begin Source File
SOURCE=..\mysys\sha1.c
# End Source File
# Begin Source File

View File

@ -55,8 +55,20 @@ LINK32=link.exe
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\client\completion_hash.cpp
# End Source File
# Begin Source File
SOURCE=..\..\client\mysql.cpp
# End Source File
# Begin Source File
SOURCE=..\..\client\readline.cpp
# End Source File
# Begin Source File
SOURCE=..\..\client\sql_string.cpp
# End Source File
# End Group
# Begin Source File

View File

@ -1,65 +1,130 @@
LIBRARY LIBMYSQLD
DESCRIPTION 'MySQL 4.0 Embedded Server Library'
VERSION 4.0
DESCRIPTION 'MySQL 4.1 Embedded Server Library'
VERSION 4.1
EXPORTS
mysql_server_end
mysql_server_init
mysql_use_result
mysql_thread_safe
mysql_thread_id
mysql_store_result
mysql_stat
mysql_shutdown
mysql_select_db
mysql_row_tell
mysql_row_seek
mysql_real_query
mysql_real_connect
mysql_query
mysql_ping
mysql_options
mysql_num_rows
mysql_num_fields
mysql_list_tables
mysql_list_processes
mysql_list_fields
mysql_list_dbs
mysql_kill
mysql_insert_id
mysql_init
mysql_info
mysql_get_server_info
mysql_get_proto_info
mysql_get_host_info
mysql_get_client_info
mysql_free_result
mysql_field_tell
_dig_vec
bmove_upp
delete_dynamic
free_defaults
getopt_compare_strings
getopt_ull_limit_value
handle_options
init_dynamic_array
insert_dynamic
int2str
is_prefix
list_add
list_delete
load_defaults
max_allowed_packet
my_end
my_getopt_print_errors
my_init
my_malloc
my_memdup
my_no_flags_free
my_path
my_print_help
my_print_variables
my_realloc
my_strdup
my_thread_end
my_thread_init
myodbc_remove_escape
mysql_affected_rows
mysql_autocommit
mysql_change_user
mysql_character_set_name
mysql_close
mysql_commit
mysql_data_seek
mysql_debug
mysql_dump_debug_info
mysql_eof
mysql_errno
mysql_error
mysql_escape_string
mysql_fetch_field
mysql_fetch_field_direct
mysql_fetch_fields
mysql_fetch_lengths
mysql_fetch_row
mysql_field_count
mysql_field_seek
mysql_fetch_row
mysql_fetch_lengths
mysql_fetch_fields
mysql_fetch_field_direct
mysql_fetch_field
mysql_escape_string
mysql_real_escape_string
mysql_error
mysql_errno
mysql_eof
mysql_dump_debug_info
mysql_drop_db
mysql_debug
mysql_data_seek
mysql_create_db
mysql_character_set_name
mysql_change_user
mysql_connect
mysql_close
mysql_affected_rows
mysql_thread_init
mysql_thread_end
mysql_send_query
mysql_read_query_result
mysql_refresh
mysql_field_tell
mysql_free_result
mysql_get_client_info
mysql_get_host_info
mysql_get_proto_info
mysql_get_server_info
mysql_info
mysql_init
mysql_insert_id
mysql_kill
mysql_list_dbs
mysql_list_fields
mysql_list_processes
mysql_list_tables
mysql_more_results
mysql_next_result
mysql_num_fields
mysql_num_rows
mysql_odbc_escape_string
myodbc_remove_escape
mysql_options
mysql_ping
mysql_query
mysql_read_query_result
mysql_real_connect
mysql_real_escape_string
mysql_real_query
mysql_refresh
mysql_rollback
mysql_row_seek
mysql_row_tell
mysql_select_db
mysql_send_query
mysql_shutdown
mysql_ssl_set
mysql_stat
mysql_store_result
mysql_sqlstate
mysql_thread_id
mysql_thread_safe
mysql_use_result
mysql_warning_count
net_buffer_length
set_dynamic
strcend
strcont
strdup_root
strfill
strinstr
strmake
strmov
strxmov
mysql_server_end
mysql_server_init
get_tty_password
sql_protocol_typelib
mysql_get_server_version
mysql_sqlstate
charsets_dir
disabled_my_option
my_charset_latin1
init_alloc_root
my_progname
get_charset_by_csname
print_defaults
find_type
strxnmov
strend
my_fopen
my_fclose
unpack_filename
str2int
int10_to_str
longlong10_to_str
my_snprintf_8bit
alloc_root
free_root
my_read

View File

@ -43,7 +43,8 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FR /FD /mktyplib203 /win32 # ADD BASE MTL /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FR /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
@ -68,7 +69,8 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MT /W3 /Gm /Zi /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /mktyplib203 /win32 # ADD BASE MTL /c
# ADD CPP /nologo /MT /W3 /Gm /Zi /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x416 /d "_DEBUG"
# ADD RSC /l 0x416 /d "_DEBUG"
@ -87,7 +89,11 @@ LINK32=link.exe
# Name "libmysqld - Win32 Debug"
# Begin Source File
SOURCE=..\sql\convert.cpp
SOURCE="..\strings\ctype-latin1.c"
# End Source File
# Begin Source File
SOURCE=..\mysys\default.c
# End Source File
# Begin Source File
@ -111,7 +117,7 @@ SOURCE=..\sql\filesort.cpp
# End Source File
# Begin Source File
SOURCE=..\libmysql\get_password.c
SOURCE=..\client\get_password.c
# End Source File
# Begin Source File
@ -159,6 +165,10 @@ SOURCE=..\sql\init.cpp
# End Source File
# Begin Source File
SOURCE=..\strings\int2str.c
# End Source File
# Begin Source File
SOURCE=..\sql\item.cpp
# End Source File
# Begin Source File
@ -180,6 +190,10 @@ SOURCE=..\sql\item_func.cpp
# End Source File
# Begin Source File
SOURCE=.\item_geofunc.cpp
# End Source File
# Begin Source File
SOURCE=.\item_row.cpp
# End Source File
# Begin Source File
@ -236,7 +250,11 @@ SOURCE=..\sql\mf_iocache.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\mini_client.cpp
SOURCE=..\mysys\my_alloc.c
# End Source File
# Begin Source File
SOURCE=..\mysys\my_getopt.c
# End Source File
# Begin Source File
@ -256,6 +274,10 @@ SOURCE=..\sql\opt_sum.cpp
# End Source File
# Begin Source File
SOURCE=..\libmysql\pack.c
# End Source File
# Begin Source File
SOURCE=..\libmysql\password.c
# End Source File
# Begin Source File
@ -380,6 +402,10 @@ SOURCE=..\sql\sql_show.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\sql_state.c
# End Source File
# Begin Source File
SOURCE=..\sql\sql_string.cpp
# End Source File
# Begin Source File
@ -408,6 +434,26 @@ SOURCE=..\sql\sql_yacc.cpp
# End Source File
# Begin Source File
SOURCE=..\strings\str2int.c
# End Source File
# Begin Source File
SOURCE=..\strings\strcend.c
# End Source File
# Begin Source File
SOURCE=..\strings\strcont.c
# End Source File
# Begin Source File
SOURCE=..\strings\strinstr.c
# End Source File
# Begin Source File
SOURCE=..\strings\strxnmov.c
# End Source File
# Begin Source File
SOURCE=..\sql\table.cpp
# End Source File
# Begin Source File

View File

@ -193,6 +193,10 @@ SOURCE=.\mi_panic.c
# End Source File
# Begin Source File
SOURCE=.\mi_preload.c
# End Source File
# Begin Source File
SOURCE=.\mi_range.c
# End Source File
# Begin Source File

View File

@ -605,6 +605,9 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name strings
End Project Dependency
}}}
###############################################################################
@ -722,19 +725,10 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name strings
End Project Dependency
Begin Project Dependency
Project_Dep_Name mysys
End Project Dependency
Begin Project Dependency
Project_Dep_Name libmysqld
End Project Dependency
Begin Project Dependency
Project_Dep_Name vio
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}

View File

@ -88,6 +88,10 @@ LINK32=link.exe
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\mysys\mf_tempdir.c
# End Source File
# Begin Source File
SOURCE=..\client\mysqlbinlog.cpp
# End Source File
# End Group

View File

@ -84,10 +84,6 @@ LIB32=xilink6.exe -lib
# Name "mysqldemb - Win32 Debug"
# Begin Source File
SOURCE=..\sql\convert.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\derror.cpp
# End Source File
# Begin Source File
@ -220,10 +216,6 @@ SOURCE=..\sql\mf_iocache.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\mini_client.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\net_serv.cpp
# End Source File
# Begin Source File

View File

@ -28,7 +28,7 @@ CFG=mysqld - Win32 Release
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=xicl6.exe
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "mysqld - Win32 Release"
@ -45,14 +45,14 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../zlib" /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x410 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.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 /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-opt.exe"
# SUBTRACT LINK32 /debug
@ -71,14 +71,14 @@ LINK32=xilink6.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../regex" /I "../bdb/build_win32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
# SUBTRACT CPP /Fr /YX
# ADD BASE RSC /l 0x410 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.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 /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\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept
@ -98,14 +98,14 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /MT /W3 /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D "DBUG_OFF" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x410 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.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 Wsock32.lib ..\lib_release\dbug.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /debug /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe"
# SUBTRACT LINK32 /pdb:none /debug
@ -126,14 +126,14 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../bdb/build_win32" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.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 Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe"
# SUBTRACT BASE LINK32 /pdb:none /debug
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-max-nt.exe"
@ -155,14 +155,14 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../bdb/build_win32" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.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 Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"../client_release/mysqld-opt.exe"
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-max.exe"
# SUBTRACT LINK32 /debug
@ -178,7 +178,7 @@ LINK32=xilink6.exe
# Name "mysqld - Win32 Max"
# Begin Source File
SOURCE=.\convert.cpp
SOURCE=.\client.c
!IF "$(CFG)" == "mysqld - Win32 Release"
@ -486,6 +486,10 @@ SOURCE=.\item_func.cpp
# End Source File
# Begin Source File
SOURCE=.\item_geofunc.cpp
# End Source File
# Begin Source File
SOURCE=.\item_row.cpp
# End Source File
# Begin Source File
@ -656,10 +660,6 @@ SOURCE=.\mf_iocache.cpp
# End Source File
# Begin Source File
SOURCE=.\mini_client.cpp
# End Source File
# Begin Source File
SOURCE=..\myisammrg\myrg_rnext_same.c
# End Source File
# Begin Source File
@ -742,6 +742,10 @@ SOURCE=.\OPT_SUM.cpp
# End Source File
# Begin Source File
SOURCE=.\pack.c
# End Source File
# Begin Source File
SOURCE=.\password.c
!IF "$(CFG)" == "mysqld - Win32 Release"
@ -889,6 +893,10 @@ SOURCE=.\sql_class.cpp
# End Source File
# Begin Source File
SOURCE=.\sql_client.cpp
# End Source File
# Begin Source File
SOURCE=.\sql_crypt.cpp
# End Source File
# Begin Source File
@ -1133,6 +1141,10 @@ SOURCE=.\sql_show.cpp
# End Source File
# Begin Source File
SOURCE=.\sql_state.c
# End Source File
# Begin Source File
SOURCE=.\sql_string.cpp
!IF "$(CFG)" == "mysqld - Win32 Release"

View File

@ -19,7 +19,10 @@
#undef CRAY_STACKSEG_END
/* Define the default charset name */
#undef DEFAULT_CHARSET_NAME
#undef MYSQL_DEFAULT_CHARSET_NAME
/* Define the default charset name */
#undef MYSQL_DEFAULT_COLLATION_NAME
/* Version of .frm files */
#undef DOT_FRM_VERSION
@ -68,40 +71,37 @@
/* Define charsets you want */
#undef HAVE_CHARSET_armscii8
#undef HAVE_CHARSET_ascii
#undef HAVE_CHARSET_big5
#undef HAVE_CHARSET_cp1250
#undef HAVE_CHARSET_cp1251
#undef HAVE_CHARSET_cp1256
#undef HAVE_CHARSET_cp1257
#undef HAVE_CHARSET_croat
#undef HAVE_CHARSET_czech
#undef HAVE_CHARSET_danish
#undef HAVE_CHARSET_cp850
#undef HAVE_CHARSET_cp852
#undef HAVE_CHARSET_cp866
#undef HAVE_CHARSET_dec8
#undef HAVE_CHARSET_dos
#undef HAVE_CHARSET_estonia
#undef HAVE_CHARSET_euc_kr
#undef HAVE_CHARSET_euckr
#undef HAVE_CHARSET_gb2312
#undef HAVE_CHARSET_gbk
#undef HAVE_CHARSET_german1
#undef HAVE_CHARSET_greek
#undef HAVE_CHARSET_hebrew
#undef HAVE_CHARSET_hp8
#undef HAVE_CHARSET_hungarian
#undef HAVE_CHARSET_koi8_ru
#undef HAVE_CHARSET_koi8_ukr
#undef HAVE_CHARSET_keybcs2
#undef HAVE_CHARSET_koi8r
#undef HAVE_CHARSET_koi8u
#undef HAVE_CHARSET_latin1
#undef HAVE_CHARSET_latin1_de
#undef HAVE_CHARSET_latin2
#undef HAVE_CHARSET_latin5
#undef HAVE_CHARSET_latin7
#undef HAVE_CHARSET_macce
#undef HAVE_CHARSET_macroman
#undef HAVE_CHARSET_sjis
#undef HAVE_CHARSET_swe7
#undef HAVE_CHARSET_tis620
#undef HAVE_CHARSET_ucs2
#undef HAVE_CHARSET_ujis
#undef HAVE_CHARSET_usa7
#undef HAVE_CHARSET_utf8
#undef HAVE_CHARSET_win1250
#undef HAVE_CHARSET_win1250ch
#undef HAVE_CHARSET_win1251ukr
#undef HAVE_CHARSET_win1251
/* ZLIB and compress: */
#undef HAVE_COMPRESS

View File

@ -78,7 +78,7 @@ AC_LANG_SAVE
AC_LANG_CPLUSPLUS
if test "$ac_cv_prog_gxx" = "yes"
then
CXXFLAGS="$CXXFLAGS -Werror"
CXXFLAGS=`echo $CXXFLAGS -Werror | sed 's/-fbranch-probabilities//'`
fi
mysql_cv_btype_last_arg_accept=none
[AC_TRY_COMPILE([#if defined(inline)
@ -1113,7 +1113,7 @@ AC_DEFUN([MYSQL_CHECK_BDB_VERSION], [
# mysql_bdb=a
# fi
dbl RAM:
dnl RAM:
want_bdb_version="4.1.24"
bdb_version_ok=yes

View File

@ -44,7 +44,7 @@
#include <locale.h>
#endif
const char *VER= "14.0";
const char *VER= "14.1";
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
@ -139,7 +139,7 @@ static my_string opt_mysql_unix_port=0;
static int connect_flag=CLIENT_INTERACTIVE;
static char *current_host,*current_db,*current_user=0,*opt_password=0,
*current_prompt=0, *delimiter_str= 0,
*default_charset= (char*) MYSQL_CHARSET;
*default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
static char *histfile;
static String glob_buffer,old_buffer;
static String processed_prompt;
@ -200,7 +200,9 @@ static int com_nopager(String *str, char*), com_pager(String *str, char*),
static int read_lines(bool execute_commands);
static int sql_connect(char *host,char *database,char *user,char *password,
uint silent);
static int put_info(const char *str,INFO_TYPE info,uint error=0);
static int put_info(const char *str,INFO_TYPE info,uint error=0,
const char *sql_state=0);
static int put_error(MYSQL *mysql);
static void safe_put_field(const char *pos,ulong length);
static void xmlencode_print(const char *src, uint length);
static void init_pager();
@ -561,12 +563,12 @@ static struct my_option my_long_options[] =
{"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
(gptr*) &current_prompt, (gptr*) &current_prompt, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory)",
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"quick", 'q',
"Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file. ",
"Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file.",
(gptr*) &quick, (gptr*) &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"raw", 'r', "Write fields without conversion. Used with --batch",
{"raw", 'r', "Write fields without conversion. Used with --batch.",
(gptr*) &opt_raw_data, (gptr*) &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default.",
@ -575,7 +577,7 @@ static struct my_option my_long_options[] =
0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"socket", 'S', "Socket file to use for connection.",
@ -599,7 +601,7 @@ static struct my_option my_long_options[] =
{"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.",
(gptr*) &safe_updates, (gptr*) &safe_updates, 0, GET_BOOL, OPT_ARG, 0, 0,
0, 0, 0, 0},
{"verbose", 'v', "Write more. (-v -v -v gives the table output format)", 0,
{"verbose", 'v', "Write more. (-v -v -v gives the table output format).", 0,
0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@ -809,7 +811,8 @@ static int get_options(int argc, char **argv)
opt_reconnect= 0;
connect_flag= 0; /* Not in interactive mode */
}
if (!(charset_info= get_charset_by_name(default_charset, MYF(MY_WME))))
if (!(charset_info= get_charset_by_csname(default_charset,
MY_CS_PRIMARY, MYF(MY_WME))))
exit(1);
if (argc > 1)
{
@ -1091,7 +1094,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
{ // Add found char to buffer
if (inchar == *in_string)
*in_string=0;
else if (!*in_string && (inchar == '\'' || inchar == '"'))
else if (!*in_string && (inchar == '\'' || inchar == '"' || inchar == '`'))
*in_string=(char) inchar;
if (!(*ml_comment))
*out++ = (char) inchar;
@ -1436,7 +1439,7 @@ int mysql_real_query_for_lazy(const char *buf, int length)
{
if (!mysql_real_query(&mysql,buf,length))
return 0;
uint error=put_info(mysql_error(&mysql),INFO_ERROR, mysql_errno(&mysql));
int error= put_error(&mysql);
if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR || retry > 1 ||
!opt_reconnect)
return error;
@ -1451,11 +1454,20 @@ int mysql_store_result_for_lazy(MYSQL_RES **result)
return 0;
if (mysql_error(&mysql)[0])
return put_info(mysql_error(&mysql),INFO_ERROR,mysql_errno(&mysql));
return put_error(&mysql);
return 0;
}
static void print_help_item(MYSQL_ROW *cur, int num_name, int num_cat, char *last_char)
{
char ccat= (*cur)[num_cat][0];
if (*last_char != ccat)
{
put_info(ccat == 'Y' ? "categories :" : "topics :", INFO_INFO);
*last_char= ccat;
}
tee_fprintf(PAGER, " %s\n", (*cur)[num_name]);
}
static int com_server_help(String *buffer __attribute__((unused)),
char *line __attribute__((unused)), char *help_arg)
@ -1464,6 +1476,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
const char *server_cmd= buffer->ptr();
char cmd_buf[100];
MYSQL_RES *result;
MYSQL_FIELD *fields;
int error;
if (help_arg[0] != '\'')
@ -1481,15 +1494,16 @@ static int com_server_help(String *buffer __attribute__((unused)),
if (!connected && reconnect())
return 1;
if ((error= mysql_real_query_for_lazy(server_cmd,strlen(server_cmd))))
return error;
if ((error= mysql_store_result_for_lazy(&result)))
if ((error= mysql_real_query_for_lazy(server_cmd,strlen(server_cmd))) ||
(error= mysql_store_result_for_lazy(&result)))
return error;
if (result)
{
ulonglong num_rows= mysql_num_rows(result);
if (num_rows == 1)
unsigned int num_fields= mysql_num_fields(result);
my_ulonglong num_rows= mysql_num_rows(result);
fields= mysql_fetch_fields(result);
if (num_fields==3 && num_rows==1)
{
if (!(cur= mysql_fetch_row(result)))
{
@ -1498,46 +1512,48 @@ static int com_server_help(String *buffer __attribute__((unused)),
}
init_pager();
if (cur[1][0] == 'Y')
{
tee_fprintf(PAGER, "Help topic \'%s\'\n", cur[0]);
tee_fprintf(PAGER, "%s\n", cur[2]);
tee_fprintf(PAGER, "For help on specific function please type 'help <function>'\nwhere function is one of next:\n%s\n", cur[3]);
}
else
{
tee_fprintf(PAGER, "Name: \'%s\'\n\n", cur[0]);
tee_fprintf(PAGER, "Description:\n%s\n\n", cur[2]);
if (cur[3])
tee_fprintf(PAGER, "Examples:\n%s\n", cur[3]);
}
tee_fprintf(PAGER, "Name: \'%s\'\n", cur[0]);
tee_fprintf(PAGER, "Description:\n%s", cur[1]);
if (cur[2] && *((char*)cur[2]))
tee_fprintf(PAGER, "Examples:\n%s", cur[2]);
tee_fprintf(PAGER, "\n");
end_pager();
}
else if (num_rows > 1)
else if (num_fields >= 2 && num_rows)
{
init_pager();
char last_char;
int num_name, num_cat;
LINT_INIT(num_name);
LINT_INIT(num_cat);
if (num_fields == 2)
{
put_info("Many help items for your request exist", INFO_INFO);
put_info("For more specific request please type 'help <item>' where item is one of next:", INFO_INFO);
put_info("For more specific request please type 'help <item>' where item is one of next", INFO_INFO);
num_name= 0;
num_cat= 1;
last_char= '_';
}
else if ((cur= mysql_fetch_row(result)))
{
tee_fprintf(PAGER, "You asked help about help category: \"%s\"\n", cur[0]);
put_info("For a more information type 'help <item>' where item is one of the following", INFO_INFO);
num_name= 1;
num_cat= 2;
print_help_item(&cur,1,2,&last_char);
}
init_pager();
char last_char= '_';
while ((cur= mysql_fetch_row(result)))
{
if (cur[1][0]!=last_char)
{
put_info("-------------------------------------------", INFO_INFO);
put_info(cur[1][0] == 'Y' ?
"categories:" : "functions:", INFO_INFO);
put_info("-------------------------------------------", INFO_INFO);
}
last_char= cur[1][0];
tee_fprintf(PAGER, "%s\n", cur[0]);
}
print_help_item(&cur,num_name,num_cat,&last_char);
tee_fprintf(PAGER, "\n");
end_pager();
}
else
{
put_info("\nNothing found\n", INFO_INFO);
put_info("\nNothing found", INFO_INFO);
put_info("Please try to run 'help contents' for list of all accessible topics\n", INFO_INFO);
}
}
@ -1652,9 +1668,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
if (quick)
{
if (!(result=mysql_use_result(&mysql)) && mysql_field_count(&mysql))
{
return put_info(mysql_error(&mysql),INFO_ERROR,mysql_errno(&mysql));
}
return put_error(&mysql);
}
else
{
@ -1716,7 +1730,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
put_info("",INFO_RESULT); // Empty row
if (result && !mysql_eof(result)) /* Something wrong when using quick */
error=put_info(mysql_error(&mysql),INFO_ERROR,mysql_errno(&mysql));
error= put_error(&mysql);
else if (unbuffered)
fflush(stdout);
mysql_free_result(result);
@ -1792,9 +1806,8 @@ print_field_types(MYSQL_RES *result)
MYSQL_FIELD *field;
while ((field = mysql_fetch_field(result)))
{
tee_fprintf(PAGER,"%s '%s' %d %d %d %d %d\n",
field->name,
field->table ? "" : field->table,
tee_fprintf(PAGER,"'%s.%s.%s.%s' %d %d %d %d %d\n",
field->catalog, field->db, field->table, field->name,
(int) field->type,
field->length, field->max_length,
field->flags, field->decimals);
@ -1831,7 +1844,7 @@ print_table_data(MYSQL_RES *result)
separator.fill(separator.length()+length+2,'-');
separator.append('+');
}
tee_puts(separator.c_ptr(), PAGER);
tee_puts(separator.c_ptr_safe(), PAGER);
if (column_names)
{
mysql_field_seek(result,0);
@ -2431,12 +2444,12 @@ com_use(String *buffer __attribute__((unused)), char *line)
if (mysql_select_db(&mysql,tmp))
{
if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR)
return put_info(mysql_error(&mysql),INFO_ERROR,mysql_errno(&mysql));
return put_error(&mysql);
if (reconnect())
return opt_reconnect ? -1 : 1; // Fatal error
if (mysql_select_db(&mysql,tmp))
return put_info(mysql_error(&mysql),INFO_ERROR,mysql_errno(&mysql));
return put_error(&mysql);
}
my_free(current_db,MYF(MY_ALLOW_ZERO_PTR));
current_db=my_strdup(tmp,MYF(MY_WME));
@ -2549,6 +2562,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
select_limit,max_join_size);
mysql_options(&mysql, MYSQL_INIT_COMMAND, init_command);
}
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (!mysql_real_connect(&mysql, host, user, password,
database, opt_mysql_port, opt_mysql_unix_port,
connect_flag | CLIENT_MULTI_QUERIES))
@ -2557,7 +2571,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
(mysql_errno(&mysql) != CR_CONN_HOST_ERROR &&
mysql_errno(&mysql) != CR_CONNECTION_ERROR))
{
put_info(mysql_error(&mysql),INFO_ERROR,mysql_errno(&mysql));
(void) put_error(&mysql);
(void) fflush(stdout);
return ignore_errors ? -1 : 1; // Abort
}
@ -2707,33 +2721,34 @@ select_limit, max_join_size);
static int
put_info(const char *str,INFO_TYPE info_type,uint error)
put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
{
FILE *file= (info_type == INFO_ERROR ? stderr : stdout);
static int inited=0;
if (status.batch)
{
if (info_type == INFO_ERROR)
{
(void) fflush(stdout);
fprintf(stderr,"ERROR");
(void) fflush(file);
fprintf(file,"ERROR");
if (error)
(void) fprintf(stderr," %d",error);
(void) fprintf(file," %d",error);
if (status.query_start_line && line_numbers)
{
(void) fprintf(stderr," at line %lu",status.query_start_line);
(void) fprintf(file," at line %lu",status.query_start_line);
if (status.file_name)
(void) fprintf(stderr," in file: '%s'", status.file_name);
(void) fprintf(file," in file: '%s'", status.file_name);
}
(void) fprintf(stderr,": %s\n",str);
(void) fflush(stderr);
(void) fprintf(file,": %s\n",str);
(void) fflush(file);
if (!ignore_errors)
return 1;
}
else if (info_type == INFO_RESULT && verbose > 1)
tee_puts(str, stdout);
tee_puts(str, file);
if (unbuffered)
fflush(stdout);
fflush(file);
return info_type == INFO_ERROR ? -1 : 0;
}
if (!opt_silent || info_type == INFO_ERROR)
@ -2751,21 +2766,34 @@ put_info(const char *str,INFO_TYPE info_type,uint error)
putchar('\007'); /* This should make a bell */
vidattr(A_STANDOUT);
if (error)
(void) tee_fprintf(stderr, "ERROR %d: ", error);
{
if (sqlstate)
(void) tee_fprintf(file, "ERROR %d (%s): ", error, sqlstate);
else
tee_puts("ERROR: ", stdout);
(void) tee_fprintf(file, "ERROR %d: ", error);
}
else
tee_puts("ERROR: ", file);
}
else
vidattr(A_BOLD);
(void) tee_puts(str, stdout);
(void) tee_puts(str, file);
vidattr(A_NORMAL);
}
if (unbuffered)
fflush(stdout);
fflush(file);
return info_type == INFO_ERROR ? -1 : 0;
}
static int
put_error(MYSQL *mysql)
{
return put_info(mysql_error(mysql), INFO_ERROR, mysql_errno(mysql),
mysql_sqlstate(mysql));
}
static void remove_cntrl(String &buffer)
{
char *start,*end;
@ -2916,14 +2944,18 @@ static const char* construct_prompt()
add_int_to_prompt(++prompt_counter);
break;
case 'v':
if (connected)
processed_prompt.append(mysql_get_server_info(&mysql));
else
processed_prompt.append("not_connected");
break;
case 'd':
processed_prompt.append(current_db ? current_db : "(none)");
break;
case 'h':
{
const char *prompt=mysql_get_host_info(&mysql);
const char *prompt;
prompt= connected ? mysql_get_host_info(&mysql) : "not_connected";
if (strstr(prompt, "Localhost"))
processed_prompt.append("localhost");
else
@ -2935,8 +2967,13 @@ static const char* construct_prompt()
}
case 'p':
#ifndef EMBEDDED_LIBRARY
if (!connected)
{
processed_prompt.append("not_connected");
break;
}
if (strstr(mysql_get_host_info(&mysql),"TCP/IP") ||
! mysql.unix_socket)
!mysql.unix_socket)
add_int_to_prompt(mysql.port);
else
{
@ -3084,4 +3121,3 @@ void sql_element_free(void *ptr)
my_free((gptr) ptr,MYF(0));
}
#endif /* EMBEDDED_LIBRARY */

View File

@ -113,16 +113,16 @@ static TYPELIB command_typelib=
static struct my_option my_long_options[] =
{
{"count", 'c',
"Number of iterations to make. This works with -i (--sleep) only",
"Number of iterations to make. This works with -i (--sleep) only.",
(gptr*) &nr_iterations, (gptr*) &nr_iterations, 0, GET_UINT,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'",
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f',
"Don't ask for confirmation on drop database; with multiple commands, continue even if an error occurs.",
(gptr*) &option_force, (gptr*) &option_force, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol",
{"compress", 'C', "Use compression in server/client protocol.",
(gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
@ -130,7 +130,7 @@ static struct my_option my_long_options[] =
(gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host", (gptr*) &host, (gptr*) &host, 0, GET_STR,
{"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
@ -141,7 +141,7 @@ static struct my_option my_long_options[] =
#endif
{"port", 'P', "Port number to use for connection.", (gptr*) &tcp_port,
(gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory)",
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"relative", 'r',
"Show difference between current and previous values when used with -i. Currently works only with extended-status.",
@ -152,10 +152,10 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"silent", 's', "Silently exit if one can't connect to server",
{"silent", 's', "Silently exit if one can't connect to server.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
(gptr*) &unix_port, (gptr*) &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
@ -170,13 +170,13 @@ static struct my_option my_long_options[] =
#endif
{"verbose", 'v', "Write more information.", (gptr*) &opt_verbose,
(gptr*) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit", 0, 0, 0, GET_NO_ARG,
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"vertical", 'E',
"Print output vertically. Is similar to --relative, but prints output vertically.",
(gptr*) &opt_vertical, (gptr*) &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"wait", 'w', "Wait and retry if connection is down", 0, 0, 0, GET_UINT,
{"wait", 'w', "Wait and retry if connection is down.", 0, 0, 0, GET_UINT,
OPT_ARG, 0, 0, 0, 0, 0, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT, "", (gptr*) &opt_connect_timeout,
(gptr*) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0,

View File

@ -45,6 +45,7 @@ static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace";
void sql_print_error(const char *format, ...);
static bool one_database = 0;
static bool force_opt= 0;
static const char* database;
static bool short_form = 0;
static ulonglong offset = 0;
@ -198,34 +199,37 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log.", (gptr*) &default_dbug_option,
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"database", 'd', "List entries for just this database (local log only)",
{"database", 'd', "List entries for just this database (local log only).",
(gptr*) &database, (gptr*) &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit",
{"force-read", 'f', "Force reading unknown binlog events.",
(gptr*) &force_opt, (gptr*) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"help", '?', "Display this help and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Get the binlog from server", (gptr*) &host, (gptr*) &host,
{"host", 'h', "Get the binlog from server.", (gptr*) &host, (gptr*) &host,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"offset", 'o', "Skip the first N entries", (gptr*) &offset, (gptr*) &offset,
{"offset", 'o', "Skip the first N entries.", (gptr*) &offset, (gptr*) &offset,
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p', "Password to connect to remote server",
{"password", 'p', "Password to connect to remote server.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Use port to connect to the remote server",
{"port", 'P', "Use port to connect to the remote server.",
(gptr*) &port, (gptr*) &port, 0, GET_INT, REQUIRED_ARG, MYSQL_PORT, 0, 0,
0, 0, 0},
{"position", 'j', "Start reading the binlog at position N",
{"position", 'j', "Start reading the binlog at position N.",
(gptr*) &position, (gptr*) &position, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
{"result-file", 'r', "Direct output to a given file", 0, 0, 0, GET_STR,
{"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"short-form", 's', "Just show the queries, no extra info",
{"short-form", 's', "Just show the queries, no extra info.",
(gptr*) &short_form, (gptr*) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"table", 't', "Get raw table dump using COM_TABLE_DUMB", (gptr*) &table,
{"table", 't', "Get raw table dump using COM_TABLE_DUMB.", (gptr*) &table,
(gptr*) &table, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "Connect to the remote server as username",
{"user", 'u', "Connect to the remote server as username.",
(gptr*) &user, (gptr*) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
{"local-load", 'l', "Prepare files for local load in directory",
{"local-load", 'l', "Prepare files for local load in directory.",
(gptr*) &dirname_for_local_load, (gptr*) &dirname_for_local_load, 0,
GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,

View File

@ -38,7 +38,8 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
static uint verbose = 0, opt_mysql_port=0;
static my_string opt_mysql_unix_port = 0;
static char *opt_password = 0, *current_user = 0,
*default_charset = (char *)MYSQL_CHARSET, *current_host = 0;
*default_charset = (char *)MYSQL_DEFAULT_CHARSET_NAME,
*current_host = 0;
static int first_error = 0;
DYNAMIC_ARRAY tables4repair;
#ifdef HAVE_SMEM
@ -66,9 +67,9 @@ static struct my_option my_long_options[] =
(gptr*) &opt_auto_repair, (gptr*) &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory where character sets are", (gptr*) &charsets_dir,
"Directory where character sets are.", (gptr*) &charsets_dir,
(gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"check", 'c', "Check table for errors", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
{"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
{"check-only-changed", 'C',
"Check only tables that have changed since last check or haven't been closed properly.",
@ -80,12 +81,12 @@ static struct my_option my_long_options[] =
"To check several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames.",
(gptr*) &opt_databases, (gptr*) &opt_databases, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'",
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set", (gptr*) &default_charset,
"Set the default character set.", (gptr*) &default_charset,
(gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fast",'F', "Check only tables that haven't been closed properly",
{"fast",'F', "Check only tables that haven't been closed properly.",
(gptr*) &opt_fast, (gptr*) &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
{"force", 'f', "Continue even if we get an sql-error.",
@ -114,7 +115,7 @@ static struct my_option my_long_options[] =
{"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
(gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory)",
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"quick", 'q',
"If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.",
@ -125,7 +126,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"silent", 's', "Print only error messages.", (gptr*) &opt_silent,
@ -308,7 +309,8 @@ static int get_options(int *argc, char ***argv)
else
what_to_do = DO_CHECK;
}
if (!(charset_info= get_charset_by_name(default_charset, MYF(MY_WME))))
if (!(charset_info= get_charset_by_csname(default_charset,
MY_CS_PRIMARY, MYF(MY_WME))))
exit(1);
if (*argc > 0 && opt_alldbs)
{

View File

@ -34,6 +34,7 @@
** XML by Gary Huntress <ghuntress@mediaone.net> 10/10/01, cleaned up
** and adapted to mysqldump 05/11/01 by Jani Tolonen
** Added --single-transaction option 06/06/2002 by Peter Zaitsev
** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov
*/
#define DUMP_VERSION "10.2"
@ -77,7 +78,7 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1,
lock_tables=1,ignore_errors=0,flush_logs=0,replace=0,
ignore=0,opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0,
opt_delayed=0,create_options=1,opt_quoted=0,opt_databases=0,
opt_alldbs=0,opt_create_db=0,opt_first_slave=0,
opt_alldbs=0,opt_create_db=0,opt_first_slave=0,opt_set_names=0,
opt_autocommit=0,opt_master_data,opt_disable_keys=1,opt_xml=0,
opt_delete_master_logs=0, tty_password=0,
opt_single_transaction=0;
@ -85,7 +86,7 @@ static MYSQL mysql_connection,*sock=0;
static char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
*current_host=0,*path=0,*fields_terminated=0,
*lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0,
*where=0, *default_charset= (char *)MYSQL_CHARSET,
*where=0, *default_charset= (char *) "binary",
*opt_compatible_mode_str= 0,
*err_ptr= 0;
static ulong opt_compatible_mode= 0;
@ -131,7 +132,7 @@ static struct my_option my_long_options[] =
"Allow creation of column names that are keywords.", (gptr*) &opt_keywords,
(gptr*) &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory where character sets are", (gptr*) &charsets_dir,
"Directory where character sets are.", (gptr*) &charsets_dir,
(gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compatible", OPT_COMPATIBLE,
"Change the dump to be compatible with a given mode. By default tables are dumped without any restrictions. Legal modes are: mysql323, mysql40, postgresql, oracle, mssql, db2, sapdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option does a no operation on earlier server versions.",
@ -205,13 +206,17 @@ static struct my_option my_long_options[] =
(gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-create-db", 'n',
"'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given.}",
"'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given.}.",
(gptr*) &opt_create_db, (gptr*) &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"no-create-info", 't', "Don't write table creation info.",
(gptr*) &tFlag, (gptr*) &tFlag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-data", 'd', "No row information.", (gptr*) &dFlag, (gptr*) &dFlag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-set-names", 'N',
"'SET NAMES charset_name' will not be put in the output.",
(gptr*) &opt_set_names, (gptr*) &opt_set_names, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -222,17 +227,17 @@ static struct my_option my_long_options[] =
"Password to use when connecting to server. If password is not given it's solicited on the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __WIN__
{"pipe", 'W', "Use named pipes to connect to server", 0, 0, 0, GET_NO_ARG,
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
(gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory)",
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"quick", 'q', "Don't buffer query, dump directly to stdout.",
(gptr*) &quick, (gptr*) &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"quote-names",'Q', "Quote table and column names with a `",
{"quote-names",'Q', "Quote table and column names with backticks (`).",
(gptr*) &opt_quoted, (gptr*) &opt_quoted, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"result-file", 'r',
@ -240,7 +245,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"skip-opt", OPT_SKIP_OPTIMIZATION,
@ -345,6 +350,8 @@ static void write_header(FILE *sql_file, char *db_name)
sql_file);
fprintf(sql_file, "-- Server version\t%s\n",
mysql_get_server_info(&mysql_connection));
if (!opt_set_names)
fprintf(sql_file,"\n/*!40101 SET NAMES %s*/;\n",default_charset);
}
return;
} /* write_header */
@ -428,6 +435,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char buff[255];
opt_quoted= 1;
opt_set_names= 1;
opt_compatible_mode_str= argument;
opt_compatible_mode= find_set(&compatible_mode_typelib,
argument, strlen(argument),
@ -492,7 +500,8 @@ static int get_options(int *argc, char ***argv)
my_progname);
return(1);
}
if (!(charset_info= get_charset_by_name(default_charset, MYF(MY_WME))))
if (!(charset_info= get_charset_by_csname(default_charset,
MY_CS_PRIMARY, MYF(MY_WME))))
exit(1);
if ((*argc < 1 && !opt_alldbs) || (*argc > 0 && opt_alldbs))
{
@ -556,6 +565,8 @@ static int dbConnect(char *host, char *user,char *passwd)
if (shared_memory_base_name)
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
if (!opt_set_names)
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(sock= mysql_real_connect(&mysql_connection,host,user,passwd,
NULL,opt_mysql_port,opt_mysql_unix_port,
0)))
@ -1613,7 +1624,7 @@ int main(int argc, char **argv)
else
{
row = mysql_fetch_row(master);
if (row[0] && row[1])
if (row && row[0] && row[1])
{
fprintf(md_result_file,
"\n--\n-- Position to start replication from\n--\n\n");

View File

@ -44,7 +44,7 @@ static char *opt_password=0, *current_user=0,
*current_host=0, *current_db=0, *fields_terminated=0,
*lines_terminated=0, *enclosed=0, *opt_enclosed=0,
*escaped=0, *opt_columns=0,
*default_charset= (char*) MYSQL_CHARSET;
*default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
static uint opt_mysql_port=0;
static my_string opt_mysql_unix_port=0;
static my_string opt_ignore_lines=0;
@ -59,7 +59,7 @@ static uint opt_protocol=0;
static struct my_option my_long_options[] =
{
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory where character sets are", (gptr*) &charsets_dir,
"Directory where character sets are.", (gptr*) &charsets_dir,
(gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (gptr*) &default_charset,
@ -71,7 +71,7 @@ static struct my_option my_long_options[] =
{"compress", 'C', "Use compression in server/client protocol.",
(gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"debug",'#', "Output debug log. Often this is 'd:t:o,filename'", 0, 0, 0,
{"debug",'#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0,
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"delete", 'd', "First delete all rows from table.", (gptr*) &opt_delete,
(gptr*) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@ -102,12 +102,12 @@ static struct my_option my_long_options[] =
{"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...",
(gptr*) &lines_terminated, (gptr*) &lines_terminated, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"local", 'L', "Read all files through the client", (gptr*) &opt_local_file,
{"local", 'L', "Read all files through the client.", (gptr*) &opt_local_file,
(gptr*) &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"lock-tables", 'l', "Lock all tables for write.", (gptr*) &lock_tables,
(gptr*) &lock_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"low-priority", OPT_LOW_PRIORITY,
"Use LOW_PRIORITY when updating the table", (gptr*) &opt_low_priority,
"Use LOW_PRIORITY when updating the table.", (gptr*) &opt_low_priority,
(gptr*) &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
@ -119,13 +119,13 @@ static struct my_option my_long_options[] =
{"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
(gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory)",
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"replace", 'r', "If duplicate unique key was found, replace old row.",
(gptr*) &replace, (gptr*) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"silent", 's', "Be more silent.", (gptr*) &silent, (gptr*) &silent, 0,
@ -239,7 +239,8 @@ static int get_options(int *argc, char ***argv)
fprintf(stderr, "You can't use --ignore (-i) and --replace (-r) at the same time.\n");
return(1);
}
if (!(charset_info= get_charset_by_name(default_charset, MYF(MY_WME))))
if (!(charset_info= get_charset_by_csname(default_charset,
MY_CS_PRIMARY, MYF(MY_WME))))
exit(1);
if (*argc < 2)
{

View File

@ -29,14 +29,14 @@ const char* outfile=0,*user="root";
static struct my_option my_long_options[] =
{
{"output-file", 'o', "Write the output to the file with the given name",
{"output-file", 'o', "Write the output to the file with the given name.",
(gptr*) &outfile, (gptr*) &outfile, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
{"user", 'u', "Put given user in the password file", (gptr*) &user,
{"user", 'u', "Put given user in the password file.", (gptr*) &user,
(gptr*) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this message and exit", 0, 0, 0, GET_NO_ARG, NO_ARG,
{"help", '?', "Display this message and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
{"version", 'V', "Display version info", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
{"version", 'V', "Display version info.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};

View File

@ -30,6 +30,7 @@
static my_string host=0,opt_password=0,user=0;
static my_bool opt_show_keys=0,opt_compress=0,opt_status=0, tty_password=0;
static uint opt_verbose=0;
static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
@ -115,6 +116,8 @@ int main(int argc, char **argv)
if (shared_memory_base_name)
mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(mysql_real_connect(&mysql,host,user,opt_password,
(first_argument_uses_wildcards) ? "" : argv[0],opt_mysql_port,opt_mysql_unix_port,
0)))
@ -152,13 +155,16 @@ int main(int argc, char **argv)
static struct my_option my_long_options[] =
{
{"character-sets-dir", 'c', "Directory where character sets are",
{"character-sets-dir", 'c', "Directory where character sets are.",
(gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
0, 0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol",
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (gptr*) &default_charset,
(gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.",
(gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'",
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
@ -167,7 +173,7 @@ static struct my_option my_long_options[] =
{"status", 'i', "Shows a lot of extra information about each table.",
(gptr*) &opt_status, (gptr*) &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"keys", 'k', "Show keys for table", (gptr*) &opt_show_keys,
{"keys", 'k', "Show keys for table.", (gptr*) &opt_show_keys,
(gptr*) &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p',
"Password to use when connecting to server. If password is not given it's asked from the tty.",
@ -179,11 +185,11 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory)",
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SMEM
{"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"socket", 'S', "Socket file to use for connection.",
@ -558,7 +564,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
mysql_error(mysql));
return 1;
}
end=strmov(strmov(query,"show /*!32332 FULL */ columns from "),table);
end=strmov(strmov(strmov(query,"show /*!32332 FULL */ columns from `"),table),"`");
if (wild && wild[0])
strxmov(end," like '",wild,"'",NullS);
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
@ -580,7 +586,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
print_res_top(result);
if (opt_show_keys)
{
end=strmov(strmov(query,"show keys from "),table);
end=strmov(strmov(strmov(query,"show keys from `"),table),"`");
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
{
fprintf(stderr,"%s: Cannot list keys in db: %s, table: %s: %s\n",

View File

@ -42,7 +42,7 @@
**********************************************************************/
#define MTEST_VERSION "1.27"
#define MTEST_VERSION "1.28"
#include <my_global.h>
#include <mysql_embed.h>
@ -523,8 +523,12 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char* fname)
if (!my_stat(eval_file, &stat_info, MYF(MY_WME)))
die(NullS);
if (!eval_result && stat_info.st_size != ds->length)
if (!eval_result && (uint) stat_info.st_size != ds->length)
{
DBUG_PRINT("info",("Size differs: result size: %u file size: %u",
ds->length, stat_info.st_size));
DBUG_RETURN(2);
}
if (!(tmp = (char*) my_malloc(stat_info.st_size + 1, MYF(MY_WME))))
die(NullS);
@ -1804,34 +1808,34 @@ int read_query(struct st_query** q_ptr)
static struct my_option my_long_options[] =
{
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'",
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"database", 'D', "Database to use.", (gptr*) &db, (gptr*) &db, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"basedir", 'b', "Basedir for tests", (gptr*) &opt_basedir,
{"basedir", 'b', "Basedir for tests.", (gptr*) &opt_basedir,
(gptr*) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"big-test", 'B', "Define BIG_TEST to 1", (gptr*) &opt_big_test,
{"big-test", 'B', "Define BIG_TEST to 1.", (gptr*) &opt_big_test,
(gptr*) &opt_big_test, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use the compressed server/client protocol",
{"compress", 'C', "Use the compressed server/client protocol.",
(gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"manager-user", OPT_MANAGER_USER, "Undocumented: Used for debugging",
{"manager-user", OPT_MANAGER_USER, "Undocumented: Used for debugging.",
(gptr*) &manager_user, (gptr*) &manager_user, 0, GET_STR, REQUIRED_ARG, 0,
0, 0, 0, 0, 0},
{"manager-host", OPT_MANAGER_HOST, "Undocumented: Used for debugging",
{"manager-host", OPT_MANAGER_HOST, "Undocumented: Used for debugging.",
(gptr*) &manager_host, (gptr*) &manager_host, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"manager-password", OPT_MANAGER_PASSWD, "Undocumented: Used for debugging",
{"manager-password", OPT_MANAGER_PASSWD, "Undocumented: Used for debugging.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"manager-port", OPT_MANAGER_PORT, "Undocumented: Used for debugging",
{"manager-port", OPT_MANAGER_PORT, "Undocumented: Used for debugging.",
(gptr*) &manager_port, (gptr*) &manager_port, 0, GET_INT, REQUIRED_ARG,
MYSQL_MANAGER_PORT, 0, 0, 0, 0, 0},
{"manager-wait-timeout", OPT_MANAGER_WAIT_TIMEOUT,
"Undocumented: Used for debugging", (gptr*) &manager_wait_timeout,
"Undocumented: Used for debugging.", (gptr*) &manager_wait_timeout,
(gptr*) &manager_wait_timeout, 0, GET_INT, REQUIRED_ARG, 3, 0, 0, 0, 0, 0},
{"password", 'p', "Password to use when connecting to server.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@ -1844,16 +1848,16 @@ static struct my_option my_long_options[] =
{"result-file", 'R', "Read/Store result from/in this file.",
(gptr*) &result_file, (gptr*) &result_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"server-arg", 'A', "Send enbedded server this as a paramenter",
{"server-arg", 'A', "Send enbedded server this as a paramenter.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"server-file", 'F', "Read embedded server arguments from file",
{"server-file", 'F', "Read embedded server arguments from file.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"silent", 's', "Suppress all normal output. Synonym for --quiet.",
(gptr*) &silent, (gptr*) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
"Don't use the memory allocation checking", 0, 0, 0, GET_NO_ARG, NO_ARG,
"Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
{"sleep", 'T', "Sleep always this many seconds on sleep commands",
{"sleep", 'T', "Sleep always this many seconds on sleep commands.",
(gptr*) &opt_sleep, (gptr*) &opt_sleep, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
@ -1862,7 +1866,7 @@ static struct my_option my_long_options[] =
#include "sslopt-longopts.h"
{"test-file", 'x', "Read test from/in this file (default stdin).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmpdir", 't', "Temporary directory where sockets are put",
{"tmpdir", 't', "Temporary directory where sockets are put.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"user", 'u', "User for login.", (gptr*) &user, (gptr*) &user, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -1873,7 +1877,6 @@ static struct my_option my_long_options[] =
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,MTEST_VERSION,
@ -2147,6 +2150,10 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
if (i == 0 && q->expected_errors == 1)
{
/* Only log error if there is one possible error */
dynstr_append_mem(ds,"ERROR ",6);
replace_dynstr_append_mem(ds, mysql_sqlstate(mysql),
strlen(mysql_sqlstate(mysql)));
dynstr_append_mem(ds,": ",2);
replace_dynstr_append_mem(ds,mysql_error(mysql),
strlen(mysql_error(mysql)));
dynstr_append_mem(ds,"\n",1);
@ -2284,7 +2291,7 @@ void get_query_type(struct st_query* q)
q->type=(enum enum_commands) type; /* Found command */
}
static byte* get_var_key(const byte* var, uint* len,
static byte *get_var_key(const byte* var, uint* len,
my_bool __attribute__((unused)) t)
{
register char* key;
@ -2293,11 +2300,11 @@ static byte* get_var_key(const byte* var, uint* len,
return (byte*)key;
}
static VAR* var_init(VAR* v, const char* name, int name_len, const char* val,
static VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
int val_len)
{
int val_alloc_len;
VAR* tmp_var;
VAR *tmp_var;
if (!name_len && name)
name_len = strlen(name);
if (!val_len && val)
@ -2327,7 +2334,7 @@ static VAR* var_init(VAR* v, const char* name, int name_len, const char* val,
return tmp_var;
}
static void var_free(void* v)
static void var_free(void *v)
{
my_free(((VAR*) v)->str_val, MYF(MY_WME));
if (((VAR*)v)->alloced)
@ -2335,10 +2342,10 @@ static void var_free(void* v)
}
static void var_from_env(const char* name, const char* def_val)
static void var_from_env(const char *name, const char *def_val)
{
const char* tmp;
VAR* v;
const char *tmp;
VAR *v;
if (!(tmp = getenv(name)))
tmp = def_val;
@ -2347,9 +2354,9 @@ static void var_from_env(const char* name, const char* def_val)
}
static void init_var_hash()
static void init_var_hash(MYSQL *mysql)
{
VAR* v;
VAR *v;
DBUG_ENTER("init_var_hash");
if (hash_init(&var_hash, charset_info,
1024, 0, 0, get_var_key, var_free, MYF(0)))
@ -2358,16 +2365,19 @@ static void init_var_hash()
var_from_env("SLAVE_MYPORT", "9307");
var_from_env("MYSQL_TEST_DIR", "/tmp");
var_from_env("BIG_TEST", opt_big_test ? "1" : "0");
v=var_init(0,"MAX_TABLES", 0, (sizeof(ulong) == 4) ? "31" : "63",0);
hash_insert(&var_hash, (byte*)v);
v= var_init(0,"MAX_TABLES", 0, (sizeof(ulong) == 4) ? "31" : "62",0);
hash_insert(&var_hash, (byte*) v);
v= var_init(0,"SERVER_VERSION", 0, mysql_get_server_info(mysql), 0);
hash_insert(&var_hash, (byte*) v);
DBUG_VOID_RETURN;
}
int main(int argc, char** argv)
int main(int argc, char **argv)
{
int error = 0;
struct st_query* q;
struct st_query *q;
my_bool require_file=0, q_send_flag=0;
char save_file[FN_REFLEN];
MY_INIT(argv[0]);
@ -2402,7 +2412,6 @@ int main(int argc, char** argv)
embedded_server_args,
(char**) embedded_server_groups))
die("Can't initialize MySQL server");
init_var_hash();
if (cur_file == file_stack)
*++cur_file = stdin;
*lineno=1;
@ -2421,14 +2430,14 @@ int main(int argc, char** argv)
opt_ssl_capath, opt_ssl_cipher);
#endif
cur_con->name = my_strdup("default", MYF(MY_WME));
if (!cur_con->name)
if (!(cur_con->name = my_strdup("default", MYF(MY_WME))))
die("Out of memory");
if (safe_connect(&cur_con->mysql, host,
user, pass, db, port, unix_sock))
if (safe_connect(&cur_con->mysql, host, user, pass, db, port, unix_sock))
die("Failed in mysql_real_connect(): %s", mysql_error(&cur_con->mysql));
init_var_hash(&cur_con->mysql);
while (!read_query(&q))
{
int current_line_inc = 1, processed = 0;
@ -2596,7 +2605,7 @@ int main(int argc, char** argv)
*/
static int read_server_arguments(const char* name)
static int read_server_arguments(const char *name)
{
char argument[1024],buff[FN_REFLEN], *str=0;
FILE *file;

View File

@ -97,13 +97,13 @@ bool String::set(longlong num, CHARSET_INFO *cs)
if (alloc(l))
return TRUE;
if (cs->snprintf == my_snprintf_8bit)
if (cs->cset->snprintf == my_snprintf_8bit)
{
str_length=(uint32) (longlong10_to_str(num,Ptr,-10)-Ptr);
}
else
{
str_length=cs->snprintf(cs,Ptr,l,"%d",num);
str_length=cs->cset->snprintf(cs,Ptr,l,"%d",num);
}
str_charset=cs;
return FALSE;
@ -115,13 +115,13 @@ bool String::set(ulonglong num, CHARSET_INFO *cs)
if (alloc(l))
return TRUE;
if (cs->snprintf == my_snprintf_8bit)
if (cs->cset->snprintf == my_snprintf_8bit)
{
str_length=(uint32) (longlong10_to_str(num,Ptr,10)-Ptr);
}
else
{
str_length=cs->snprintf(cs,Ptr,l,"%d",num);
str_length=cs->cset->snprintf(cs,Ptr,l,"%d",num);
}
str_charset=cs;
return FALSE;
@ -255,7 +255,7 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *from, CHARSET
for (str_length=new_length ; s < se && d < de ; )
{
if ((cnvres=from->mb_wc(from,&wc,s,se)) > 0 )
if ((cnvres=from->cset->mb_wc(from,&wc,s,se)) > 0 )
{
s+=cnvres;
}
@ -268,7 +268,7 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *from, CHARSET
break;
outp:
if((cnvres=to->wc_mb(to,wc,d,de)) >0 )
if((cnvres=to->cset->wc_mb(to,wc,d,de)) >0 )
{
d+=cnvres;
}

View File

@ -92,6 +92,14 @@ public:
Ptr[str_length]=0;
return Ptr;
}
inline char *c_ptr_safe()
{
if (Ptr && str_length < Alloced_length)
Ptr[str_length]=0;
else
(void) realloc(str_length);
return Ptr;
}
void set(String &str,uint32 offset,uint32 arg_length)
{

View File

@ -359,7 +359,7 @@ then
# we will gets some problems when linking static programs.
# The following code is used to fix this problem.
if test "$CXX" = "gcc"
if test "$CXX" = "gcc" -o "$CXX" = "ccache gcc"
then
if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1
then
@ -1005,8 +1005,9 @@ case $SYSTEM_TYPE in
*darwin5*)
if test "$ac_cv_prog_gcc" = "yes"
then
CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH -DFN_NO_CASE_SENCE"
CXXFLAGS="$CXXFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DFN_NO_CASE_SENCE"
FLAGS="-traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH -DFN_NO_CASE_SENCE"
CFLAGS="$CFLAGS $FLAGS"
CXXFLAGS="$CXXFLAGS $FLAGS"
MAX_C_OPTIMIZE="-O"
with_named_curses=""
fi
@ -1014,15 +1015,24 @@ case $SYSTEM_TYPE in
*darwin6*)
if test "$ac_cv_prog_gcc" = "yes"
then
CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH -DFN_NO_CASE_SENCE"
CXXFLAGS="$CXXFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DFN_NO_CASE_SENCE"
FLAGS="-traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH -DFN_NO_CASE_SENCE"
CFLAGS="$CFLAGS $FLAGS"
CXXFLAGS="$CXXFLAGS $FLAGS"
MAX_C_OPTIMIZE="-O"
fi
;;
*freebsd*)
echo "Adding fix for interrupted reads"
OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'`
if test "$OSVERSION" -gt "480100" && \
test "$OSVERSION" -lt "500000" || \
test "$OSVERSION" -gt "500109"
then
CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000"
else
CFLAGS="$CFLAGS -DHAVE_BROKEN_REALPATH"
CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000 -DHAVE_BROKEN_REALPATH"
fi
;;
*netbsd*)
echo "Adding flag -Dunix"
@ -1365,10 +1375,8 @@ then
with_named_thread="-Kthread -lsocket -lnsl"
if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
then
# AC_DEFINE(HAVE_OpenUNIX8_THREADS)
AC_DEFINE(HAVE_UNIXWARE7_THREADS)
else
# AC_DEFINE(HAVE_OpenUNIX8_POSIX)
AC_DEFINE(HAVE_UNIXWARE7_POSIX)
fi
# We must have cc
@ -1377,10 +1385,8 @@ then
then
{ echo "configure: error: On OpenUNIX8 and UnixWare7 MySQL must be compiled with cc. See the Installation chapter in the Reference Manual." 1>&2; exit 1; };
else
# CC="$CC -Kthread -DOpenUNIX8";
# CXX="$CXX -Kthread -DOpenUNIX8";
CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
fi
AC_MSG_RESULT("yes")
else
@ -1877,7 +1883,7 @@ AC_LANG_SAVE
AC_LANG_CPLUSPLUS
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
then
CXXFLAGS="$CXXFLAGS -Werror"
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'`
fi
AC_TRY_COMPILE(
[#undef inline
@ -1909,7 +1915,7 @@ AC_LANG_SAVE
AC_LANG_CPLUSPLUS
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
then
CXXFLAGS="$CXXFLAGS -Werror"
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'`
fi
AC_TRY_COMPILE(
[#undef inline
@ -2170,8 +2176,8 @@ AC_ARG_WITH(libedit,
[ with_libedit=undefined ]
)
compile_readline= no
compile_libedit= no
compile_readline="no"
compile_libedit="no"
if [test "$with_libedit" = "yes"] && [test "$with_readline" = "yes"]
then
@ -2228,29 +2234,42 @@ AC_SUBST(readline_h_ln_cmd)
dnl In order to add new charset, you must add charset name to
dnl this CHARSETS_AVAILABLE list and sql/share/charsets/Index.
dnl this CHARSETS_AVAILABLE list and sql/share/charsets/Index.xml.
dnl If the character set uses strcoll or other special handling,
dnl you must also create strings/ctype-$charset_name.c
AC_DIVERT_PUSH(0)
CHARSETS_AVAILABLE="armscii8 big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
latin1 latin1_de latin2 latin5 sjis swe7 tis620 ucs2 ujis
usa7 utf8 win1250 win1250ch win1251ukr"
CHARSETS_DEPRECATED="win1251"
CHARSETS_COMPLEX="big5 czech euc_kr gb2312 gbk latin1_de sjis tis620 ucs2 ujis utf8 win1250ch"
define(CHARSETS_AVAILABLE1,ascii armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257)
define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 dec8 euckr gb2312 gbk)
define(CHARSETS_AVAILABLE3,greek hebrew hp8 keybcs2 koi8r koi8u)
define(CHARSETS_AVAILABLE4,latin1 latin2 latin5 latin7 macce macroman)
define(CHARSETS_AVAILABLE5,sjis swe7 tis620 ucs2 ujis utf8)
DEFAULT_CHARSET=latin1
CHARSETS_AVAILABLE="CHARSETS_AVAILABLE1 CHARSETS_AVAILABLE2 CHARSETS_AVAILABLE3 CHARSETS_AVAILABLE4 CHARSETS_AVAILABLE5"
CHARSETS_COMPLEX="big5 cp1250 euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8"
AC_DIVERT_POP
dnl fix this later..
dnl [ --with-charset=CHARSET Use CHARSET by default (one of: $CHARSETS_AVAILABLE; Default is $DEFAULT_CHARSET)],
AC_ARG_WITH(charset,
[ --with-charset=CHARSET Use CHARSET by default (Default is latin1)],
[ --with-charset=CHARSET
Default character set, use one of:
CHARSETS_AVAILABLE1
CHARSETS_AVAILABLE2
CHARSETS_AVAILABLE3
CHARSETS_AVAILABLE4
CHARSETS_AVAILABLE5],
[default_charset="$withval"],
[default_charset="$DEFAULT_CHARSET"])
AC_ARG_WITH(collation,
[ --with-collation=COLLATION
Default collation],
[default_collation="$withval"],
[default_collation="default"])
AC_ARG_WITH(extra-charsets,
[ --with-extra-charsets=CHARSET[,CHARSET,...]
Use charsets in addition to default (none, complex,
@ -2258,73 +2277,76 @@ AC_ARG_WITH(extra-charsets,
[extra_charsets="$withval"],
[extra_charsets="none"])
AC_MSG_CHECKING("character sets")
CHARSETS="$default_charset latin1 utf8"
if test "$extra_charsets" = no; then
CHARSETS=""
CHARSETS="$CHARSETS"
elif test "$extra_charsets" = none; then
CHARSETS=""
CHARSETS="$CHARSETS"
elif test "$extra_charsets" = complex; then
CHARSETS="$CHARSETS_COMPLEX"
CHARSETS="$CHARSETS $CHARSETS_COMPLEX"
elif test "$extra_charsets" = all; then
CHARSETS="$CHARSETS_AVAILABLE $CHARSETS_DEPRECATED"
CHARSETS="$CHARSETS $CHARSETS_AVAILABLE"
else
CHARSETS=`echo $extra_charsets | sed -e 's/,/ /g'`
EXTRA_CHARSETS=`echo $extra_charsets | sed -e 's/,/ /g'`
CHARSETS="$CHARSETS $EXTRA_CHARSETS"
fi
CHARSETS="$default_charset $CHARSETS"
use_mb="no"
for cs in $CHARSETS
do
case $cs in
armscii8)
AC_DEFINE(HAVE_CHARSET_armscii8)
use_mb="yes"
;;
ascii)
AC_DEFINE(HAVE_CHARSET_ascii)
;;
big5)
AC_DEFINE(HAVE_CHARSET_big5)
use_mb="yes"
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
;;
cp1250)
AC_DEFINE(HAVE_CHARSET_cp1250)
;;
cp1251)
AC_DEFINE(HAVE_CHARSET_cp1251)
;;
cp1256)
AC_DEFINE(HAVE_CHARSET_cp1256)
;;
cp1257)
AC_DEFINE(HAVE_CHARSET_cp1257)
;;
croat)
AC_DEFINE(HAVE_CHARSET_croat)
cp850)
AC_DEFINE(HAVE_CHARSET_cp850)
;;
czech)
AC_DEFINE(HAVE_CHARSET_czech)
cp852)
AC_DEFINE(HAVE_CHARSET_cp852)
;;
danish)
AC_DEFINE(HAVE_CHARSET_danish)
cp866)
AC_DEFINE(HAVE_CHARSET_cp866)
;;
dec8)
AC_DEFINE(HAVE_CHARSET_dec8)
;;
dos)
AC_DEFINE(HAVE_CHARSET_dos)
;;
estonia)
AC_DEFINE(HAVE_CHARSET_estonia)
;;
euc_kr)
AC_DEFINE(HAVE_CHARSET_euc_kr)
use_mb="yes"
euckr)
AC_DEFINE(HAVE_CHARSET_euckr)
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
;;
gb2312)
AC_DEFINE(HAVE_CHARSET_gb2312)
use_mb="yes"
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
;;
gbk)
AC_DEFINE(HAVE_CHARSET_gbk)
use_mb="yes"
;;
german1)
AC_DEFINE(HAVE_CHARSET_german1)
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
;;
greek)
AC_DEFINE(HAVE_CHARSET_greek)
@ -2335,30 +2357,37 @@ do
hp8)
AC_DEFINE(HAVE_CHARSET_hp8)
;;
hungarian)
AC_DEFINE(HAVE_CHARSET_hungarian)
keybcs2)
AC_DEFINE(HAVE_CHARSET_keybcs2)
;;
koi8_ru)
AC_DEFINE(HAVE_CHARSET_koi8_ru)
koi8r)
AC_DEFINE(HAVE_CHARSET_koi8r)
;;
koi8_ukr)
AC_DEFINE(HAVE_CHARSET_koi8_ukr)
koi8u)
AC_DEFINE(HAVE_CHARSET_koi8u)
;;
latin1)
AC_DEFINE(HAVE_CHARSET_latin1)
;;
latin1_de)
AC_DEFINE(HAVE_CHARSET_latin1_de)
;;
latin2)
AC_DEFINE(HAVE_CHARSET_latin2)
;;
latin5)
AC_DEFINE(HAVE_CHARSET_latin5)
;;
latin7)
AC_DEFINE(HAVE_CHARSET_latin7)
;;
macce)
AC_DEFINE(HAVE_CHARSET_macce)
;;
macroman)
AC_DEFINE(HAVE_CHARSET_macroman)
;;
sjis)
AC_DEFINE(HAVE_CHARSET_sjis)
use_mb="yes"
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
;;
swe7)
AC_DEFINE(HAVE_CHARSET_swe7)
@ -2368,55 +2397,189 @@ do
;;
ucs2)
AC_DEFINE(HAVE_CHARSET_ucs2)
use_mb="yes"
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
;;
ujis)
AC_DEFINE(HAVE_CHARSET_ujis)
use_mb="yes"
;;
usa7)
AC_DEFINE(HAVE_CHARSET_usa7)
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
;;
utf8)
AC_DEFINE(HAVE_CHARSET_utf8)
use_mb="yes"
;;
win1250)
AC_DEFINE(HAVE_CHARSET_win1250)
;;
win1250ch)
AC_DEFINE(HAVE_CHARSET_win1250ch)
;;
win1251)
AC_DEFINE(HAVE_CHARSET_win1251)
;;
win1251ukr)
AC_DEFINE(HAVE_CHARSET_win1251ukr)
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
;;
*)
AC_MSG_ERROR([Charset $cs not available. (Available $CHARSETS_AVAILABLE).
AC_MSG_ERROR([Charset $cs not available. (Available are: $CHARSETS_AVAILABLE).
See the Installation chapter in the Reference Manual.]);
esac
done
dnl Always compile latin1
AC_DEFINE(HAVE_CHARSET_latin1)
dnl Always compile utf8
AC_DEFINE(HAVE_CHARSET_utf8)
use_mb=yes
default_charset_collations=""
if test "$use_mb" = "yes"
then
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
case $default_charset in
armscii8)
default_charset_default_collation="armscii8_general_ci"
default_charset_collations="armscii8_general_ci armscii_bin"
;;
ascii)
default_charset_default_collation="ascii_general_ci"
default_charset_collations="ascii_general_ci ascii_bin"
;;
big5)
default_charset_default_collation="big5_chinese_ci"
default_charset_collations="big5_chinese_ci big5_bin"
;;
cp1250)
default_charset_default_collation="cp1250_general_ci"
default_charset_collations="cp1250_general_ci cp1250_czech_ci cp1250_bin"
;;
cp1251)
default_charset_default_collation="cp1251_general_ci"
default_charset_collations="cp1251_general_ci cp1251_general_cs cp1251_bin cp1251_bulgarian_ci cp1251_ukrainian_ci"
;;
cp1256)
default_charset_default_collation="cp1256_general_ci"
default_charset_collations="cp1256_general_ci cp1256_bin"
;;
cp1257)
default_charset_default_collation="cp1257_general_ci"
default_charset_collations="cp1257_general_ci cp1257_lithuanian_ci cp1257_bin"
;;
cp850)
default_charset_default_collation="cp850_general_ci"
default_charset_collations="cp850_general_ci cp850_bin"
;;
cp852)
default_charset_default_collation="cp852_general_ci"
default_charset_collations="cp852_general_ci cp852_bin"
;;
cp866)
default_charset_default_collation="cp866_general_ci"
default_charset_collations="cp866_general_ci cp866_bin"
;;
dec8)
default_charset_default_collation="dec8_swedish_ci"
default_charset_collations="dec8_swedish_ci dec8_bin"
;;
euckr)
default_charset_default_collation="euckr_korean_ci"
default_charset_collations="euckr_korean_ci euckr_bin"
;;
gb2312)
default_charset_default_collation="gb2312_chinese_ci"
default_charset_collations="gb2312_chinese_ci gb2312_bin"
;;
gbk)
default_charset_default_collation="gbk_chinese_ci"
default_charset_collations="gbk_chinese_ci gbk_bin"
;;
greek)
default_charset_default_collation="greek_general_ci"
default_charset_collations="greek_general_ci greek_bin"
;;
hebrew)
default_charset_default_collation="hebrew_general_ci"
default_charset_collations="hebrew_general_ci hebrew_bin"
;;
hp8)
default_charset_default_collation="hp8_english_ci"
default_charset_collations="hp8_english_ci hp8_bin"
;;
keybcs2)
default_charset_default_collation="keybcs2_general_ci"
default_charset_collations="keybcs2_general_ci keybcs2_bin"
;;
koi8r)
default_charset_default_collation="koi8r_general_ci"
default_charset_collations="koi8r_general_ci koi8r_bin"
;;
koi8u)
default_charset_default_collation="koi8u_general_ci"
default_charset_collations="koi8u_general_ci koi8u_bin"
;;
latin1)
default_charset_default_collation="latin1_swedish_ci"
default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_swedish_ci"
;;
latin2)
default_charset_default_collation="latin2_general_ci"
default_charset_collations="latin2_general_ci latin2_bin latin2_czech_ci latin2_hungarian_ci latin2_croatian_ci"
;;
latin5)
default_charset_default_collation="latin5_turkish_ci"
default_charset_collations="latin5_turkish_ci latin5_bin"
;;
latin7)
default_charset_default_collation="latin7_general_ci"
default_charset_collations="latin7_general_ci latin7_general_cs latin7_bin latin7_estonian_cs"
;;
macce)
default_charset_default_collation="macce_general_ci"
default_charset_collations="macce_general_ci macce_bin"
;;
macroman)
default_charset_default_collation="macroman_general_ci"
default_charset_collations="macroman_general_ci macroman_bin"
;;
sjis)
default_charset_default_collation="sjis_japanese_ci"
default_charset_collations="sjis_japanese_ci sjis_bin"
;;
swe7)
default_charset_default_collation="swe7_swedish_ci"
default_charset_collations="swe7_swedish_ci swe7_bin"
;;
tis620)
default_charset_default_collation="tis620_thai_ci"
default_charset_collations="tis620_thai_ci tis620_bin"
;;
ucs2)
default_charset_default_collation="ucs2_general_ci"
default_charset_collations="ucs2_general_ci ucs2_bin"
;;
ujis)
default_charset_default_collation="ujis_japanese_ci"
default_charset_collations="ujis_japanese_ci ujis_bin"
;;
utf8)
default_charset_default_collation="utf8_general_ci"
default_charset_collations="utf8_general_ci utf8_bin"
;;
*)
AC_MSG_ERROR([Charset $cs not available. (Available are: $CHARSETS_AVAILABLE).
See the Installation chapter in the Reference Manual.]);
esac
if test "$default_collation" = default; then
default_collation=$default_charset_default_collation
fi
AC_SUBST(default_charset)
AC_DEFINE_UNQUOTED(DEFAULT_CHARSET_NAME,"$default_charset")
valid_default_collation=no
for cl in $default_charset_collations
do
if test x"$cl" = x"$default_collation"
then
valid_default_collation=yes
break
fi
done
AC_MSG_RESULT([default: $default_charset; compiled in: $CHARSETS])
if test x$valid_default_collation = xyes
then
AC_MSG_RESULT([default: $default_charset, collation: $default_collation; compiled in: $CHARSETS])
else
AC_MSG_ERROR([
Collation $default_collation is not valid for character set $default_charset.
Valid collations are: $default_charset_collations.
See the Installation chapter in the Reference Manual.
]);
fi
AC_DEFINE_UNQUOTED(MYSQL_DEFAULT_CHARSET_NAME,"$default_charset")
AC_DEFINE_UNQUOTED(MYSQL_DEFAULT_COLLATION_NAME,"$default_collation")
MYSQL_CHECK_ISAM
MYSQL_CHECK_BDB
@ -2657,6 +2820,7 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
libmysql_r/Makefile libmysqld/Makefile libmysqld/examples/Makefile dnl
libmysql/Makefile client/Makefile dnl
pstack/Makefile pstack/aout/Makefile sql/Makefile sql/share/Makefile dnl
sql-common/Makefile dnl
merge/Makefile dbug/Makefile scripts/Makefile dnl
include/Makefile sql-bench/Makefile tools/Makefile dnl
tests/Makefile Docs/Makefile support-files/Makefile dnl
@ -2677,6 +2841,7 @@ echo "Remember to check the platform specific part of the reference manual for"
echo "hints about installing MySQL on your platform. Also have a look at the"
echo "files in the Docs directory."
echo
# The following text is checked in ./Do-compile to se that the configure ends.
# The following text is checked in ./Do-compile to verify that configure
# ended sucessfully - don't remove it.
echo "Thank you for choosing MySQL!"
echo

View File

@ -280,7 +280,7 @@ static BOOLEAN Writable(char *pathname);
static void ChangeOwner(char *pathname);
/* Allocate memory for runtime support */
#endif
static char *DbugMalloc(int size);
static char *DbugMalloc(size_t size);
/* Remove leading pathname components */
static char *BaseName(const char *pathname);
static void DoPrefix(uint line);
@ -1120,7 +1120,7 @@ static void PushState ()
init_done=TRUE;
}
(void) code_state(); /* Alloc memory */
new_malloc = (struct state *) DbugMalloc (sizeof (struct state));
new_malloc = (struct state *) DbugMalloc(sizeof (struct state));
new_malloc -> flags = 0;
new_malloc -> delay = 0;
new_malloc -> maxdepth = MAXDEPTH;
@ -1341,11 +1341,10 @@ struct link *linkp)
*/
static char *StrDup (
const char *str)
static char *StrDup (const char *str)
{
reg1 char *new_malloc;
new_malloc = DbugMalloc ((int) strlen (str) + 1);
new_malloc = DbugMalloc((size_t) strlen (str) + 1);
(void) strcpy (new_malloc, str);
return (new_malloc);
}
@ -1606,12 +1605,11 @@ static void DbugExit (const char *why)
*
*/
static char *DbugMalloc (
int size)
static char *DbugMalloc (size_t size)
{
register char *new_malloc;
if (!(new_malloc = (char*) malloc ((unsigned int) size)))
if (!(new_malloc = (char*) malloc((size_t) size)))
DbugExit ("out of memory");
return (new_malloc);
}
@ -1622,9 +1620,7 @@ int size)
* separator (to allow directory-paths in dos).
*/
static char *static_strtok (
char *s1,
pchar separator)
static char *static_strtok (char *s1, pchar separator)
{
static char *end = NULL;
reg1 char *rtnval,*cpy;

View File

@ -29,10 +29,10 @@ const char *config_file="my"; /* Default config file */
static struct my_option my_long_options[] =
{
{"config-file", 'c', "The config file to be used",
{"config-file", 'c', "The config file to be used.",
(gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"defaults-file", 'c', "Synonym for --config-file",
{"defaults-file", 'c', "Synonym for --config-file.",
(gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"defaults-extra-file", 'e',
@ -40,10 +40,10 @@ static struct my_option my_long_options[] =
(gptr*) &defaults_extra_file, (gptr*) &defaults_extra_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"extra-file", 'e',
"Synonym for --defaults-extra-file",
"Synonym for --defaults-extra-file.",
(gptr*) &defaults_extra_file, (gptr*) &defaults_extra_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"no-defaults", 'n', "Return an empty string (useful for scripts)",
{"no-defaults", 'n', "Return an empty string (useful for scripts).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help message and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@ -52,7 +52,6 @@ static struct my_option my_long_options[] =
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
static void usage(my_bool version)
{
printf("%s Ver 1.5 for %s at %s\n",my_progname,SYSTEM_TYPE,

View File

@ -30,14 +30,14 @@ static struct my_option my_long_options[] =
{
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"info", 'I', "Synonym for --help", 0, 0, 0, GET_NO_ARG,
{"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef HAVE_SYS_ERRLIST
{"all", 'a', "Print all the error messages and the number.",
(gptr*) &print_all_codes, (gptr*) &print_all_codes, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#endif
{"silent", 's', "Only print the error message", 0, 0, 0, GET_NO_ARG, NO_ARG,
{"silent", 's', "Only print the error message.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Print error code and message (default).", (gptr*) &verbose,
(gptr*) &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},

View File

@ -43,7 +43,7 @@ static struct my_option my_long_options[] =
{
{"help", '?', "Displays this help and exits.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"info", 'I', "Synonym for --help",
{"info", 'I', "Synonym for --help.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"silent", 's', "Be more silent.", (gptr*) &silent, (gptr*) &silent,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},

View File

@ -215,7 +215,7 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key)
}
if (seg->type == HA_KEYTYPE_TEXT)
{
seg->charset->hash_sort(seg->charset,pos,((uchar*)key)-pos,&nr,&nr2);
seg->charset->coll->hash_sort(seg->charset,pos,((uchar*)key)-pos,&nr,&nr2);
}
else
{
@ -250,7 +250,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec)
}
if (seg->type == HA_KEYTYPE_TEXT)
{
seg->charset->hash_sort(seg->charset,pos,end-pos,&nr,&nr2);
seg->charset->coll->hash_sort(seg->charset,pos,end-pos,&nr,&nr2);
}
else
{

View File

@ -38,7 +38,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
custom_arg.keyseg= info->s->keydef[inx].seg;
custom_arg.key_length= info->lastkey_len=
hp_rb_pack_key(keyinfo, (uchar*) info->recbuf,
hp_rb_pack_key(keyinfo, (uchar*) info->lastkey,
(uchar*) key, key_len);
custom_arg.search_flag= SEARCH_FIND | SEARCH_SAME;
/* for next rkey() after deletion */
@ -48,7 +48,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
info->last_find_flag= HA_READ_KEY_OR_PREV;
else
info->last_find_flag= find_flag;
if (!(pos= tree_search_key(&keyinfo->rb_tree, info->recbuf, info->parents,
if (!(pos= tree_search_key(&keyinfo->rb_tree, info->lastkey, info->parents,
&info->last_pos, find_flag, &custom_arg)))
{
info->update= 0;

View File

@ -21,7 +21,8 @@ pkginclude_HEADERS = my_dbug.h m_string.h my_sys.h my_list.h my_xml.h \
my_semaphore.h my_pthread.h my_no_pthread.h raid.h \
errmsg.h my_global.h my_net.h my_alloc.h \
my_getopt.h sslopt-longopts.h my_dir.h typelib.h \
sslopt-vars.h sslopt-case.h $(BUILT_SOURCES)
sslopt-vars.h sslopt-case.h sql_common.h \
sql_state.h $(BUILT_SOURCES)
noinst_HEADERS = config-win.h config-os2.h config-netware.h \
nisam.h heap.h merge.h my_bitmap.h\
myisam.h myisampack.h myisammrg.h ft_global.h\
@ -35,7 +36,7 @@ noinst_HEADERS = config-win.h config-os2.h config-netware.h \
SUPERCLEANFILES = mysql_version.h my_config.h
# Some include files that may be moved and patched by configure
DISTCLEANFILES = sched.h
DISTCLEANFILES = sched.h $(SUPERCLEANFILES)
clean:
$(RM) -f readline/*

View File

@ -138,6 +138,11 @@ typedef uint rf_SetTimer;
#define SIZEOF_LONG 4
#define SIZEOF_LONG_LONG 8
#define SIZEOF_OFF_T 8
#ifdef _WIN64
#define SIZEOF_CHARP 8
#else
#define SIZEOF_CHARP 4
#endif
#define HAVE_BROKEN_NETINET_INCLUDES
#ifdef __NT__
#define HAVE_NAMED_PIPE /* We can only create pipes on NT */
@ -153,6 +158,9 @@ typedef uint rf_SetTimer;
#define USE_MB_IDENT 1
#define USE_STRCOLL 1
/* If LOAD DATA LOCAL INFILE should be enabled by default */
#define ENABLED_LOCAL_INFILE 1
/* Convert some simple functions to Posix */
#define sigset(A,B) signal((A),(B))
@ -200,6 +208,7 @@ inline double ulonglong2double(ulonglong value)
/* Optimized store functions for Intel x86 */
#ifndef _WIN64
#define sint2korr(A) (*((int16 *) (A)))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
(((uint32) 255L << 24) | \
@ -240,7 +249,7 @@ inline double ulonglong2double(ulonglong value)
#define float8get(V,M) doubleget((V),(M))
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
#define float8store(V,M) doublestore((V),(M))
#endif /* _WIN64 */
#define HAVE_PERROR
#define HAVE_VFPRINT
@ -330,3 +339,5 @@ inline double ulonglong2double(ulonglong value)
#define shared_memory_buffer_length 16000
#define default_shared_memory_base_name "MYSQL"
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"

View File

@ -61,9 +61,10 @@ typedef struct unicase_info_st
#define MY_CS_BINSORT 16 /* if binary sort order */
#define MY_CS_PRIMARY 32 /* if primary collation */
#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */
#define MY_CS_UNICODE 128 /* is a charset is full unicode */
#define MY_CS_NONTEXT 256 /* if a charset is not sprintf() compatible */
#define MY_CHARSET_UNDEFINED 0
#define MY_CHARSET_CURRENT (default_charset_info->number)
typedef struct my_uni_idx_st
@ -90,27 +91,11 @@ enum my_lex_states
MY_LEX_STRING_OR_DELIMITER
};
struct charset_info_st;
typedef struct charset_info_st
typedef struct my_collation_handler_st
{
uint number;
uint primary_number;
uint binary_number;
uint state;
const char *csname;
const char *name;
const char *comment;
uchar *ctype;
uchar *to_lower;
uchar *to_upper;
uchar *sort_order;
uint16 *tab_to_uni;
MY_UNI_IDX *tab_from_uni;
uchar state_map[256];
uchar ident_map[256];
/* Collation routines */
uint strxfrm_multiply;
int (*strnncoll)(struct charset_info_st *,
const uchar *, uint, const uchar *, uint);
int (*strnncollsp)(struct charset_info_st *,
@ -128,8 +113,20 @@ typedef struct charset_info_st
const char *wildstr,const char *wildend,
int escape,int w_one, int w_many);
int (*strcasecmp)(struct charset_info_st *, const char *, const char *);
/* Hash calculation */
void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
ulong *nr1, ulong *nr2);
} MY_COLLATION_HANDLER;
extern MY_COLLATION_HANDLER my_collation_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
typedef struct my_charset_handler_st
{
/* Multibyte routines */
uint mbmaxlen;
int (*ismbchar)(struct charset_info_st *, const char *, const char *);
int (*mbcharlen)(struct charset_info_st *, uint);
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
@ -147,15 +144,6 @@ typedef struct charset_info_st
void (*caseup)(struct charset_info_st *, char *, uint);
void (*casedn)(struct charset_info_st *, char *, uint);
/* Functions for case comparison */
int (*strcasecmp)(struct charset_info_st *, const char *, const char *);
/* Hash calculation */
void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
ulong *nr1, ulong *nr2);
char max_sort_char; /* For LIKE optimization */
/* Charset dependant snprintf() */
int (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt,
...);
@ -180,30 +168,65 @@ typedef struct charset_info_st
ulong (*scan)(struct charset_info_st *, const char *b, const char *e,
int sq);
} MY_CHARSET_HANDLER;
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
typedef struct charset_info_st
{
uint number;
uint primary_number;
uint binary_number;
uint state;
const char *csname;
const char *name;
const char *comment;
uchar *ctype;
uchar *to_lower;
uchar *to_upper;
uchar *sort_order;
uint16 *tab_to_uni;
MY_UNI_IDX *tab_from_uni;
uchar state_map[256];
uchar ident_map[256];
uint strxfrm_multiply;
uint mbmaxlen;
char max_sort_char; /* For LIKE optimization */
MY_CHARSET_HANDLER *cset;
MY_COLLATION_HANDLER *coll;
} CHARSET_INFO;
extern CHARSET_INFO my_charset_bin;
extern CHARSET_INFO my_charset_big5_chinese_ci;
extern CHARSET_INFO my_charset_big5_bin;
extern CHARSET_INFO my_charset_euckr_korean_ci;
extern CHARSET_INFO my_charset_euckr_bin;
extern CHARSET_INFO my_charset_gb2312_chinese_ci;
extern CHARSET_INFO my_charset_gb2312_bin;
extern CHARSET_INFO my_charset_gbk_chinese_ci;
extern CHARSET_INFO my_charset_gbk_bin;
extern CHARSET_INFO my_charset_latin1;
extern CHARSET_INFO my_charset_big5;
extern CHARSET_INFO my_charset_czech;
extern CHARSET_INFO my_charset_euc_kr;
extern CHARSET_INFO my_charset_gb2312;
extern CHARSET_INFO my_charset_gbk;
extern CHARSET_INFO my_charset_latin1_de;
extern CHARSET_INFO my_charset_sjis;
extern CHARSET_INFO my_charset_tis620;
extern CHARSET_INFO my_charset_ucs2;
extern CHARSET_INFO my_charset_ucse;
extern CHARSET_INFO my_charset_ujis;
extern CHARSET_INFO my_charset_utf8;
extern CHARSET_INFO my_charset_win1250ch;
extern CHARSET_INFO my_charset_latin1_german2_ci;
extern CHARSET_INFO my_charset_latin1_bin;
extern CHARSET_INFO my_charset_latin2_czech_ci;
extern CHARSET_INFO my_charset_sjis_japanese_ci;
extern CHARSET_INFO my_charset_sjis_bin;
extern CHARSET_INFO my_charset_tis620_thai_ci;
extern CHARSET_INFO my_charset_tis620_bin;
extern CHARSET_INFO my_charset_ucs2_general_ci;
extern CHARSET_INFO my_charset_ucs2_bin;
extern CHARSET_INFO my_charset_ujis_japanese_ci;
extern CHARSET_INFO my_charset_ujis_bin;
extern CHARSET_INFO my_charset_utf8_general_ci;
extern CHARSET_INFO my_charset_utf8_bin;
extern CHARSET_INFO my_charset_cp1250_czech_ci;
extern my_bool my_parse_charset_xml(const char *bug, uint len,
int (*add)(CHARSET_INFO *cs));
/* declarations for simple charsets */
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
uint);
@ -244,7 +267,6 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base,
char **e, int *err);
double my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e,
int *err);
int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
long int val);
int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
@ -269,7 +291,6 @@ uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
#ifdef USE_MB
/* Functions for multibyte charsets */
extern void my_caseup_str_mb(CHARSET_INFO *, char *);
extern void my_casedn_str_mb(CHARSET_INFO *, char *);
@ -284,7 +305,10 @@ int my_wildcmp_mb(CHARSET_INFO *,
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
#endif
extern my_bool my_parse_charset_xml(const char *bug, uint len,
int (*add)(CHARSET_INFO *cs));
#define _U 01 /* Upper case */
#define _L 02 /* Lower case */
@ -319,27 +343,26 @@ uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_')
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
#define my_strnxfrm(s, a, b, c, d) ((s)->strnxfrm((s), (a), (b), (c), (d)))
#define my_strnncoll(s, a, b, c, d) ((s)->strnncoll((s), (a), (b), (c), (d)))
#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d)))
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d)))
#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
((s)->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
#define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b)))
#define use_mb(s) ((s)->ismbchar != NULL)
#define my_ismbchar(s, a, b) ((s)->ismbchar((s), (a), (b)))
#define my_mbcharlen(s, a) ((s)->mbcharlen((s),(a)))
#define use_mb(s) ((s)->cset->ismbchar != NULL)
#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
#define my_caseup(s, a, l) ((s)->caseup((s), (a), (l)))
#define my_casedn(s, a, l) ((s)->casedn((s), (a), (l)))
#define my_caseup_str(s, a) ((s)->caseup_str((s), (a)))
#define my_casedn_str(s, a) ((s)->casedn_str((s), (a)))
#define my_strcasecmp(s, a, b) ((s)->strcasecmp((s), (a), (b)))
#define my_strntol(s, a, b, c, d, e) ((s)->strntol((s),(a),(b),(c),(d),(e)))
#define my_strntoul(s, a, b, c, d, e) ((s)->strntoul((s),(a),(b),(c),(d),(e)))
#define my_strntoll(s, a, b, c, d, e) ((s)->strntoll((s),(a),(b),(c),(d),(e)))
#define my_strntoull(s, a, b, c,d, e) ((s)->strntoull((s),(a),(b),(c),(d),(e)))
#define my_strntod(s, a, b, c, d) ((s)->strntod((s),(a),(b),(c),(d)))
#define my_caseup(s, a, l) ((s)->cset->caseup((s), (a), (l)))
#define my_casedn(s, a, l) ((s)->cset->casedn((s), (a), (l)))
#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a)))
#define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a)))
#define my_strntol(s, a, b, c, d, e) ((s)->cset->strntol((s),(a),(b),(c),(d),(e)))
#define my_strntoul(s, a, b, c, d, e) ((s)->cset->strntoul((s),(a),(b),(c),(d),(e)))
#define my_strntoll(s, a, b, c, d, e) ((s)->cset->strntoll((s),(a),(b),(c),(d),(e)))
#define my_strntoull(s, a, b, c,d, e) ((s)->cset->strntoull((s),(a),(b),(c),(d),(e)))
#define my_strntod(s, a, b, c, d) ((s)->cset->strntod((s),(a),(b),(c),(d)))
/* XXX: still need to take care of this one */

View File

@ -74,14 +74,14 @@
/* Unixware 7 */
#if !defined(HAVE_BFILL)
# define bfill(A,B,C) memset((A),(C),(B))
# define bmove_allign(A,B,C) memcpy((A),(B),(C))
# define bmove_align(A,B,C) memcpy((A),(B),(C))
#endif
#if !defined(HAVE_BCMP)
# define bcopy(s, d, n) memcpy((d), (s), (n))
# define bcmp(A,B,C) memcmp((A),(B),(C))
# define bzero(A,B) memset((A),0,(B))
# define bmove_allign(A,B,C) memcpy((A),(B),(C))
# define bmove_align(A,B,C) memcpy((A),(B),(C))
#endif
#if defined(__cplusplus) && !defined(OS2)
@ -111,11 +111,11 @@ extern char NEAR _dig_vec[]; /* Declared in int2str() */
#endif
#ifdef MSDOS
#undef bmove_allign
#define bmove512(A,B,C) bmove_allign(A,B,C)
#undef bmove_align
#define bmove512(A,B,C) bmove_align(A,B,C)
#define my_itoa(A,B,C) itoa(A,B,C)
#define my_ltoa(A,B,C) ltoa(A,B,C)
extern void bmove_allign(gptr dst,const gptr src,uint len);
extern void bmove_align(gptr dst,const gptr src,uint len);
#endif
#if (!defined(USE_BMOVE512) || defined(HAVE_purify)) && !defined(bmove512)

View File

@ -123,7 +123,8 @@ enum ha_extra_function {
HA_EXTRA_NO_IGNORE_DUP_KEY,
HA_EXTRA_DONT_USE_CURSOR_TO_UPDATE, /* Cursor will not be used for update */
HA_EXTRA_PREPARE_FOR_DELETE,
HA_EXTRA_PREPARE_FOR_UPDATE /* Remove read cache if problems */
HA_EXTRA_PREPARE_FOR_UPDATE, /* Remove read cache if problems */
HA_EXTRA_PRELOAD_BUFFER_SIZE /* Set buffer size for preloading */
};
/* The following is parameter to ha_panic() */
@ -225,6 +226,7 @@ enum ha_base_keytype {
/* Errorcodes given by functions */
/* opt_sum_query() assumes these codes are > 1 */
#define HA_ERR_KEY_NOT_FOUND 120 /* Didn't find key on read or update */
#define HA_ERR_FOUND_DUPP_KEY 121 /* Dupplicate key on write */
#define HA_ERR_RECORD_CHANGED 123 /* Uppdate with is recoverable */
@ -255,6 +257,7 @@ enum ha_base_keytype {
#define HA_ERR_CANNOT_ADD_FOREIGN 150 /* Cannot add a foreign key constr. */
#define HA_ERR_NO_REFERENCED_ROW 151 /* Cannot add a child row */
#define HA_ERR_ROW_IS_REFERENCED 152 /* Cannot delete a parent row */
#define HA_ERR_NON_UNIQUE_BLOCK_SIZE 153 /* Non unique key block size */
/* Other constants */

View File

@ -17,7 +17,12 @@
C_MODE_START
enum get_opt_var_type { GET_NO_ARG, GET_BOOL, GET_INT, GET_UINT, GET_LONG,
GET_ULONG, GET_LL, GET_ULL, GET_STR, GET_STR_ALLOC };
GET_ULONG, GET_LL, GET_ULL, GET_STR, GET_STR_ALLOC
};
#define GET_ASK_ADDR 128
#define GET_TYPE_MASK 127
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
struct my_option
@ -48,6 +53,8 @@ extern int handle_options (int *argc, char ***argv,
char *));
extern void my_print_help(const struct my_option *options);
extern void my_print_variables(const struct my_option *options);
extern void my_getopt_register_get_addr(gptr* (*func_addr)(char *, uint,
const struct my_option *));
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp);
my_bool getopt_compare_strings(const char *s, const char *t, uint length);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 MySQL AB
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -266,7 +266,7 @@ C_MODE_END
# endif
#endif /* TIME_WITH_SYS_TIME */
#ifdef HAVE_UNISTD_H
#if defined(HAVE_OPENSSL) && !defined(__FreeBSD__) && !defined(NeXT)
#if defined(HAVE_OPENSSL) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
#define crypt unistd_crypt
#endif
#include <unistd.h>
@ -287,6 +287,10 @@ C_MODE_END
#include <asm/atomic.h>
#endif
#include <errno.h> /* Recommended by debian */
/* We need the following to go around a problem with openssl on solaris */
#if defined(HAVE_CRYPT_H)
#include <crypt.h>
#endif
/* Go around some bugs in different OS and compilers */
#if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H)
@ -306,9 +310,7 @@ C_MODE_END
/* This has to be after include limits.h */
#define HAVE_ERRNO_AS_DEFINE
#define HAVE_FCNTL_LOCK
#undef HAVE_SYS_UN_H
#undef HAVE_FINITE
#undef HAVE_RINT
#undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */
#undef LONGLONG_MAX /* standard system library 'limits.h' */
#endif
@ -377,7 +379,7 @@ typedef unsigned short ushort;
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
#ifndef HAVE_RINT
#define rint(A) floor((A)+0.5)
#define rint(A) floor((A)+(((A) < 0)? -0.5 : 0.5))
#endif
/* Define some general constants */
@ -652,7 +654,13 @@ extern double my_atof(const char*);
Max size that must be added to a so that we know Size to make
adressable obj.
*/
#if SIZEOF_CHARP == 4
typedef long my_ptrdiff_t;
#else
typedef long long my_ptrdiff_t;
#endif
#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1))
#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
/* Size to make adressable obj. */
@ -729,6 +737,8 @@ typedef unsigned __int64 my_ulonglong;
typedef unsigned long long my_ulonglong;
#endif
/* typedef used for length of string; Should be unsigned! */
typedef ulong size_str;
#ifdef USE_RAID
/*
@ -867,7 +877,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
*/
/* Optimized store functions for Intel x86 */
#ifdef __i386__
#if defined(__i386__) && !defined(_WIN64)
#define sint2korr(A) (*((int16 *) (A)))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
(((uint32) 255L << 24) | \

View File

@ -248,6 +248,11 @@ extern int my_sigwait(const sigset_t *set,int *sig);
#error Requires at least rev 2 of EMX pthreads library.
#endif
#ifdef __NETWARE__
void my_pthread_exit(void *status);
#define pthread_exit(A) my_pthread_exit(A)
#endif
extern int my_pthread_getprio(pthread_t thread_id);
#define pthread_key(T,V) pthread_key_t V

View File

@ -31,6 +31,8 @@
#ifndef _my_semaphore_h_
#define _my_semaphore_h_
#ifdef THREAD
C_MODE_START
#ifdef HAVE_SEMAPHORE_H
#include <semaphore.h>
@ -56,4 +58,7 @@ int sem_getvalue(sem_t * sem, unsigned int * sval);
#endif /* !__bsdi__ */
C_MODE_END
#endif /* THREAD */
#endif /* !_my_semaphore_h_ */

View File

@ -643,6 +643,8 @@ extern int init_key_cache(ulong use_mem);
extern int resize_key_cache(ulong use_mem);
extern byte *key_cache_read(File file,my_off_t filepos,byte* buff,uint length,
uint block_length,int return_buffer);
extern int key_cache_insert(File file, my_off_t filepos,
byte *buff, uint length);
extern int key_cache_write(File file,my_off_t filepos,byte* buff,uint length,
uint block_length,int force_write);
extern int flush_key_blocks(int file, enum flush_type type);
@ -743,6 +745,7 @@ extern my_bool my_uncompress(byte *, ulong *, ulong *);
extern byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen);
extern ulong checksum(const byte *mem, uint count);
extern uint my_bit_log2(ulong value);
uint my_count_bits(ulonglong v);
extern void my_sleep(ulong m_seconds);
#ifdef __WIN__

View File

@ -410,6 +410,7 @@ my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, ulonglong key_map,
int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows);
void mi_flush_bulk_insert(MI_INFO *info, uint inx);
void mi_end_bulk_insert(MI_INFO *info);
int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves);
#ifdef __cplusplus
}

View File

@ -83,6 +83,7 @@ typedef struct st_mysql_field {
char *table; /* Table of column if column was a field */
char *org_table; /* Org table name, if table was an alias */
char *db; /* Database for table */
char *catalog; /* Catalog for table */
char *def; /* Default value (set by mysql_list_fields) */
unsigned long length; /* Width of column */
unsigned long max_length; /* Max width of selected set */
@ -91,6 +92,7 @@ typedef struct st_mysql_field {
unsigned int table_length;
unsigned int org_table_length;
unsigned int db_length;
unsigned int catalog_length;
unsigned int def_length;
unsigned int flags; /* Div flags */
unsigned int decimals; /* Number of decimals in field */
@ -133,9 +135,9 @@ typedef struct st_mysql_data {
} MYSQL_DATA;
struct st_mysql_options {
unsigned int connect_timeout;
unsigned int connect_timeout, read_timeout, write_timeout;
unsigned int port, protocol;
unsigned long client_flag;
unsigned int port;
char *host,*user,*password,*unix_socket,*db;
struct st_dynamic_array *init_commands;
char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
@ -144,6 +146,7 @@ struct st_mysql_options {
char *ssl_ca; /* PEM CA file */
char *ssl_capath; /* PEM directory of CA-s? */
char *ssl_cipher; /* cipher to use */
char *shared_memory_base_name;
unsigned long max_allowed_packet;
my_bool use_ssl; /* if to use SSL or not */
my_bool compress,named_pipe;
@ -165,18 +168,15 @@ struct st_mysql_options {
#ifdef EMBEDDED_LIBRARY
my_bool separate_thread;
#endif
char *shared_memory_base_name;
unsigned int protocol;
};
enum mysql_option
{
MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE, MYSQL_INIT_COMMAND,
MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME,
MYSQL_OPT_LOCAL_INFILE, MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME
#ifdef EMBEDDED_LIBRARY
, MYSQL_OPT_USE_RESULT
#endif
MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT,
MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT
};
enum mysql_status
@ -186,8 +186,8 @@ enum mysql_status
enum mysql_protocol_type
{
MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, MYSQL_PROTOCOL_PIPE,
MYSQL_PROTOCOL_MEMORY
MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
};
/*
There are three types of queries - the ones that have to go to
@ -266,7 +266,9 @@ typedef struct st_mysql
my_bool free_me; /* If free in mysql_close */
my_ulonglong insert_id; /* id if insert on table with NEXTNR */
unsigned int last_errno;
char *last_error;
unsigned int server_status;
char *last_error; /* Used by embedded server */
char sqlstate[SQLSTATE_LENGTH+1]; /* Used by embedded server */
} MYSQL;
#endif
@ -294,6 +296,10 @@ typedef struct st_mysql_res {
#define MANAGER_CLIENT_ERR 450
#define MANAGER_INTERNAL_ERR 500
#ifndef MYSQL_SERVER
#define MYSQL_CLIENT
#endif
typedef struct st_mysql_manager
@ -346,6 +352,7 @@ my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql);
my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql);
unsigned int STDCALL mysql_errno(MYSQL *mysql);
const char * STDCALL mysql_error(MYSQL *mysql);
const char *STDCALL mysql_sqlstate(MYSQL *mysql);
unsigned int STDCALL mysql_warning_count(MYSQL *mysql);
const char * STDCALL mysql_info(MYSQL *mysql);
unsigned long STDCALL mysql_thread_id(MYSQL *mysql);
@ -543,6 +550,7 @@ typedef struct st_mysql_stmt
unsigned int last_errno; /* error code */
enum PREP_STMT_STATE state; /* statement state */
char last_error[MYSQL_ERRMSG_SIZE]; /* error message */
char sqlstate[SQLSTATE_LENGTH+1];
my_bool long_alloced; /* flag to indicate long alloced */
my_bool send_types_to_server; /* Types sent to server */
my_bool param_buffers; /* param bound buffers */
@ -558,8 +566,10 @@ unsigned long STDCALL mysql_param_count(MYSQL_STMT * stmt);
my_bool STDCALL mysql_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
my_bool STDCALL mysql_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt);
my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt);
unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt);
const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt);
const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt);
my_bool STDCALL mysql_commit(MYSQL * mysql);
my_bool STDCALL mysql_rollback(MYSQL * mysql);
my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);

View File

@ -25,6 +25,7 @@
#define HOSTNAME_LENGTH 60
#define USERNAME_LENGTH 16
#define SERVER_VERSION_LENGTH 60
#define SQLSTATE_LENGTH 5
#define LOCAL_HOST "localhost"
#define LOCAL_HOST_NAMEDPIPE "."
@ -100,20 +101,23 @@ enum enum_server_command
#define CLIENT_ODBC 64 /* Odbc client */
#define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */
#define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */
#define CLIENT_PROTOCOL_41 512 /* New 4.1 protocol */
#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */
#define CLIENT_SSL 2048 /* Switch to SSL after handshake */
#define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */
#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
#define CLIENT_PROTOCOL_41 16384 /* New 4.1 protocol */
#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
#define CLIENT_MULTI_QUERIES 65536 /* Enable/disable multi query support */
#define CLIENT_MULTI_QUERIES 65536 /* Enable/disable multiquery support */
#define CLIENT_MULTI_RESULTS 131072 /* Enable/disable multi-results */
#define CLIENT_REMEMBER_OPTIONS (1L << 31)
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
#define SERVER_STATUS_MORE_RESULTS 4 /* More results on server */
#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */
#define MYSQL_ERRMSG_SIZE 200
#define MYSQL_ERRMSG_SIZE 512
#define NET_READ_TIMEOUT 30 /* Timeout on read */
#define NET_WRITE_TIMEOUT 60 /* Timeout on write */
#define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */
@ -149,7 +153,7 @@ typedef struct st_net {
queries in cache that have not stored its results yet
*/
#endif
char last_error[MYSQL_ERRMSG_SIZE];
char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
unsigned int last_errno;
unsigned char error;
gptr query_cache_query;
@ -321,6 +325,7 @@ my_bool check_scramble(const char *, const char *message,
unsigned long *salt,my_bool old_ver);
char *get_tty_password(char *opt_message);
void hash_password(unsigned long *result, const char *password);
const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
/* Some other useful functions */

View File

@ -10,6 +10,7 @@
#else
#define PROTOCOL_VERSION @PROTOCOL_VERSION@
#define MYSQL_SERVER_VERSION "@VERSION@"
#define MYSQL_BASE_VERSION "mysqld-@MYSQL_BASE_VERSION@"
#ifndef MYSQL_SERVER_SUFFIX
#define MYSQL_SERVER_SUFFIX "@MYSQL_SERVER_SUFFIX@"
#endif
@ -20,8 +21,5 @@
#define MYSQL_CONFIG_NAME "my"
/* mysqld compile time options */
#ifndef MYSQL_CHARSET
#define MYSQL_CHARSET "@default_charset@"
#endif /* MYSQL_CHARSET */
#endif /* _CUSTOMCONFIG_ */
#endif /* _mysql_version_h */

View File

@ -281,5 +281,9 @@
#define ER_WARN_DATA_OUT_OF_RANGE 1262
#define ER_WARN_DATA_TRUNCATED 1263
#define ER_WARN_USING_OTHER_HANDLER 1264
#define ER_CANT_AGGREGATE_COLLATIONS 1265
#define ER_ERROR_MESSAGES 266
#define ER_CANT_AGGREGATE_2COLLATIONS 1265
#define ER_DROP_USER 1266
#define ER_REVOKE_GRANTS 1267
#define ER_CANT_AGGREGATE_3COLLATIONS 1268
#define ER_CANT_AGGREGATE_NCOLLATIONS 1269
#define ER_ERROR_MESSAGES 270

46
include/sql_common.h Normal file
View File

@ -0,0 +1,46 @@
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
extern const char *unknown_sqlstate;
extern const char *not_error_sqlstate;
#ifdef __cplusplus
extern "C" {
#endif
ulong STDCALL net_field_length(uchar **packet);
my_ulonglong net_field_length_ll(uchar **packet);
MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
my_bool default_value, uint server_capabilities);
my_bool advanced_command(MYSQL *mysql, enum enum_server_command command,
const char *header, ulong header_length,
const char *arg, ulong arg_length, my_bool skip_check);
void free_rows(MYSQL_DATA *cur);
MYSQL_DATA *read_rows (MYSQL *mysql,MYSQL_FIELD *fields,
uint field_count);
my_bool mysql_autenticate(MYSQL *mysql, const char *passwd);
void fetch_lengths(ulong *to, MYSQL_ROW column, uint field_count);
void free_old_query(MYSQL *mysql);
void end_server(MYSQL *mysql);
my_bool mysql_reconnect(MYSQL *mysql);
#ifdef __cplusplus
}
#endif
#define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41)

161
include/sql_state.h Normal file
View File

@ -0,0 +1,161 @@
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
This file includes a mapping from mysql_errno.h to sql_state (as used by
MyODBC) and jdbc_state.
It's suitable to include into a C struct for further processing
The first column is the mysqld server error (declared in mysqld_error.h),
the second column is the ODBC state (which the 4.1 server sends out by
default) and the last is the state used by the JDBC driver.
If the last column is "" then it means that the JDBC driver is using the
ODBC state
The errors in this file is sorted in the same order as in mysqld_error.h
to allow on to do binary searches for the sqlstate.
*/
ER_DUP_KEY, "23000", "",
ER_OUTOFMEMORY, "HY001", "S1001",
ER_OUT_OF_SORTMEMORY, "HY001", "S1001",
ER_CON_COUNT_ERROR, "08004", "",
ER_BAD_HOST_ERROR, "08S01", "",
ER_HANDSHAKE_ERROR, "08S01", "",
ER_DBACCESS_DENIED_ERROR, "42000", "",
ER_ACCESS_DENIED_ERROR, "42000", "28000",
ER_NO_DB_ERROR, "42000", "",
ER_UNKNOWN_COM_ERROR, "08S01", "",
ER_BAD_NULL_ERROR, "23000", "",
ER_BAD_DB_ERROR, "42000", "",
ER_TABLE_EXISTS_ERROR, "42S01", "",
ER_BAD_TABLE_ERROR, "42S02", "",
ER_NON_UNIQ_ERROR, "23000", "",
ER_SERVER_SHUTDOWN, "08S01", "",
ER_BAD_FIELD_ERROR, "42S22", "S0022",
ER_WRONG_FIELD_WITH_GROUP, "42000", "S1009",
ER_WRONG_GROUP_FIELD, "42000", "S1009",
ER_WRONG_SUM_SELECT, "42000", "S1009",
ER_WRONG_VALUE_COUNT, "21S01", "",
ER_TOO_LONG_IDENT, "42000", "S1009",
ER_DUP_FIELDNAME, "42S21", "S1009",
ER_DUP_KEYNAME, "42000", "S1009",
ER_DUP_ENTRY, "23000", "S1009",
ER_WRONG_FIELD_SPEC, "42000", "S1009",
ER_PARSE_ERROR, "42000", "",
ER_EMPTY_QUERY, "42000" , "",
ER_NONUNIQ_TABLE, "42000", "S1009",
ER_INVALID_DEFAULT, "42000", "S1009",
ER_MULTIPLE_PRI_KEY, "42000", "S1009",
ER_TOO_MANY_KEYS, "42000", "S1009",
ER_TOO_MANY_KEY_PARTS, "42000", "S1009",
ER_TOO_LONG_KEY, "42000", "S1009",
ER_KEY_COLUMN_DOES_NOT_EXITS, "42000", "S1009",
ER_BLOB_USED_AS_KEY, "42000", "S1009",
ER_TOO_BIG_FIELDLENGTH, "42000", "S1009",
ER_WRONG_AUTO_KEY, "42000", "S1009",
ER_FORCING_CLOSE, "08S01", "",
ER_IPSOCK_ERROR, "088S01", "",
ER_NO_SUCH_INDEX, "42S12", "S1009",
ER_WRONG_FIELD_TERMINATORS, "42000", "S1009",
ER_BLOBS_AND_NO_TERMINATED, "42000", "S1009",
ER_CANT_REMOVE_ALL_FIELDS, "42000", "",
ER_CANT_DROP_FIELD_OR_KEY, "42000", "",
ER_BLOB_CANT_HAVE_DEFAULT, "42000", "",
ER_WRONG_DB_NAME, "42000", "",
ER_WRONG_TABLE_NAME, "42000", "",
ER_TOO_BIG_SELECT, "42000", "",
ER_UNKNOWN_PROCEDURE, "42000", "",
ER_WRONG_PARAMCOUNT_TO_PROCEDURE, "42000", "",
ER_UNKNOWN_TABLE, "42S02", "",
ER_FIELD_SPECIFIED_TWICE, "42000", "",
ER_UNSUPPORTED_EXTENSION, "42000", "",
ER_TABLE_MUST_HAVE_COLUMNS, "42000", "",
ER_UNKNOWN_CHARACTER_SET, "42000", "",
ER_TOO_BIG_ROWSIZE, "42000", "",
ER_WRONG_OUTER_JOIN, "42000", "",
ER_NULL_COLUMN_IN_INDEX, "42000", "",
ER_PASSWORD_ANONYMOUS_USER, "42000", "",
ER_PASSWORD_NOT_ALLOWED, "42000", "",
ER_PASSWORD_NO_MATCH, "42000", "",
ER_WRONG_VALUE_COUNT_ON_ROW, "21S01", "",
ER_INVALID_USE_OF_NULL, "42000", "",
ER_REGEXP_ERROR, "42000", "",
ER_MIX_OF_GROUP_FUNC_AND_FIELDS,"42000", "",
ER_NONEXISTING_GRANT, "42000", "",
ER_TABLEACCESS_DENIED_ERROR, "42000", "",
ER_COLUMNACCESS_DENIED_ERROR, "42000", "",
ER_ILLEGAL_GRANT_FOR_TABLE, "42000", "",
ER_GRANT_WRONG_HOST_OR_USER, "42000", "",
ER_NO_SUCH_TABLE, "42S02", "",
ER_NONEXISTING_TABLE_GRANT, "42000", "",
ER_NOT_ALLOWED_COMMAND, "42000", "",
ER_SYNTAX_ERROR, "42000", "",
ER_ABORTING_CONNECTION, "08S01", "",
ER_NET_PACKET_TOO_LARGE, "08S01", "",
ER_NET_READ_ERROR_FROM_PIPE, "08S01", "",
ER_NET_FCNTL_ERROR, "08S01", "",
ER_NET_PACKETS_OUT_OF_ORDER, "08S01", "",
ER_NET_UNCOMPRESS_ERROR, "08S01", "",
ER_NET_READ_ERROR, "08S01", "",
ER_NET_READ_INTERRUPTED, "08S01", "",
ER_NET_ERROR_ON_WRITE, "08S01", "",
ER_NET_WRITE_INTERRUPTED, "08S01", "",
ER_TOO_LONG_STRING, "42000", "",
ER_TABLE_CANT_HANDLE_BLOB, "42000", "",
ER_TABLE_CANT_HANDLE_AUTO_INCREMENT, "42000", "",
ER_WRONG_COLUMN_NAME, "42000", "",
ER_WRONG_KEY_COLUMN, "42000", "",
ER_DUP_UNIQUE, "23000", "",
ER_BLOB_KEY_WITHOUT_LENGTH, "42000", "",
ER_PRIMARY_CANT_HAVE_NULL, "42000", "",
ER_TOO_MANY_ROWS, "42000", "",
ER_REQUIRES_PRIMARY_KEY, "42000", "",
ER_CHECK_NO_SUCH_TABLE, "42000", "",
ER_CHECK_NOT_IMPLEMENTED, "42000", "",
ER_CANT_DO_THIS_DURING_AN_TRANSACTION, "25000", "",
ER_NEW_ABORTING_CONNECTION, "08S01", "",
ER_MASTER_NET_READ, "08S01", "",
ER_MASTER_NET_WRITE, "08S01", "",
ER_TOO_MANY_USER_CONNECTIONS, "42000", "",
ER_READ_ONLY_TRANSACTION, "25000", "",
ER_NO_PERMISSION_TO_CREATE_USER,"42000", "",
ER_LOCK_DEADLOCK, "40001", "",
ER_NO_REFERENCED_ROW, "23000", "",
ER_ROW_IS_REFERENCED, "23000", "",
ER_CONNECT_TO_MASTER, "08S01", "",
ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT,"21000", "",
ER_USER_LIMIT_REACHED, "42000", "",
ER_NO_DEFAULT, "42000", "",
ER_WRONG_VALUE_FOR_VAR, "42000", "",
ER_WRONG_TYPE_FOR_VAR, "42000", "",
ER_CANT_USE_OPTION_HERE, "42000", "",
ER_NOT_SUPPORTED_YET, "42000", "",
ER_WRONG_FK_DEF, "42000", "",
ER_CARDINALITY_COL, "21000", "",
ER_SUBSELECT_NO_1_ROW, "21000", "",
ER_ILLEGAL_REFERENCE, "42S22", "",
ER_DERIVED_MUST_HAVE_ALIAS, "42000", "",
ER_SELECT_REDUCED, "01000", "",
ER_TABLENAME_NOT_ALLOWED_HERE, "42000", "",
ER_NOT_SUPPORTED_AUTH_MODE, "08004", "",
ER_SPATIAL_CANT_HAVE_NULL, "42000", "",
ER_COLLATION_CHARSET_MISMATCH, "42000", "",
ER_WARN_TOO_FEW_RECORDS, "01000", "",
ER_WARN_TOO_MANY_RECORDS, "01000", "",
ER_WARN_NULL_TO_NOTNULL, "01000", "",
ER_WARN_DATA_OUT_OF_RANGE, "01000", "",
ER_WARN_DATA_TRUNCATED, "01000", "",

View File

@ -17,24 +17,24 @@
#ifdef HAVE_OPENSSL
{"ssl", OPT_SSL_SSL,
"Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl",
"Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.",
(gptr*) &opt_use_ssl, (gptr*) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl)",
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
(gptr*) &opt_ssl_key, (gptr*) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl)",
{"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).",
(gptr*) &opt_ssl_cert, (gptr*) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-ca", OPT_SSL_CA,
"CA file in PEM format (check OpenSSL docs, implies --ssl)",
"CA file in PEM format (check OpenSSL docs, implies --ssl).",
(gptr*) &opt_ssl_ca, (gptr*) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-capath", OPT_SSL_CAPATH,
"CA directory (check OpenSSL docs, implies --ssl)",
"CA directory (check OpenSSL docs, implies --ssl).",
(gptr*) &opt_ssl_capath, (gptr*) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl)",
{"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).",
(gptr*) &opt_ssl_cipher, (gptr*) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},

View File

@ -103,7 +103,7 @@ void init_thr_alarm(uint max_alarm);
bool thr_alarm(thr_alarm_t *alarmed, uint sec, ALARM *buff);
void thr_alarm_kill(pthread_t thread_id);
void thr_end_alarm(thr_alarm_t *alarmed);
void end_thr_alarm(void);
void end_thr_alarm(my_bool free_structures);
sig_handler process_alarm(int);
#ifndef thr_got_alarm
bool thr_got_alarm(thr_alarm_t *alrm);

View File

@ -165,7 +165,7 @@ my_bool vio_ssl_should_retry(Vio* vio);
int vio_ssl_close(Vio* vio);
/* Return last error number */
int vio_ssl_errno(Vio *vio);
my_bool vio_ssl_peer_addr(Vio* vio, char *buf);
my_bool vio_ssl_peer_addr(Vio* vio, char *buf, uint16 *port);
void vio_ssl_in_addr(Vio *vio, struct in_addr *in);
int vio_ssl_blocking(Vio * vio, my_bool set_blocking_mode, my_bool *old_mode);
@ -242,7 +242,7 @@ struct st_vio
my_bool (*is_blocking)(Vio*);
int (*viokeepalive)(Vio*, my_bool);
int (*fastsend)(Vio*);
my_bool (*peer_addr)(Vio*, gptr, uint16*);
my_bool (*peer_addr)(Vio*, char *, uint16*);
void (*in_addr)(Vio*, struct in_addr*);
my_bool (*should_retry)(Vio*);
int (*vioclose)(Vio*);

View File

@ -17,7 +17,7 @@
include ../include/Makefile.i
libs_LIBRARIES = libbtr.a
noinst_LIBRARIES = libbtr.a
libbtr_a_SOURCES = btr0btr.c btr0cur.c btr0pcur.c btr0sea.c

View File

@ -17,7 +17,7 @@
include ../include/Makefile.i
libs_LIBRARIES = libbuf.a
noinst_LIBRARIES = libbuf.a
libbuf_a_SOURCES = buf0buf.c buf0flu.c buf0lru.c buf0rea.c

View File

@ -597,8 +597,9 @@ buf_pool_init(
/* Wipe contents of frame to eliminate a Purify
warning */
#ifdef HAVE_purify
memset(block->frame, '\0', UNIV_PAGE_SIZE);
#endif
if (srv_use_awe) {
/* Add to the list of blocks mapped to
frames */
@ -1837,7 +1838,7 @@ buf_pool_invalidate(void)
freed = TRUE;
while (freed) {
freed = buf_LRU_search_and_free_block(0);
freed = buf_LRU_search_and_free_block(100);
}
mutex_enter(&(buf_pool->mutex));
@ -2056,6 +2057,29 @@ buf_get_n_pending_ios(void)
+ buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE]);
}
/*************************************************************************
Returns the ratio in percents of modified pages in the buffer pool /
database pages in the buffer pool. */
ulint
buf_get_modified_ratio_pct(void)
/*============================*/
{
ulint ratio;
mutex_enter(&(buf_pool->mutex));
ratio = (100 * UT_LIST_GET_LEN(buf_pool->flush_list))
/ (1 + UT_LIST_GET_LEN(buf_pool->LRU)
+ UT_LIST_GET_LEN(buf_pool->free));
/* 1 + is there to avoid division by zero */
mutex_exit(&(buf_pool->mutex));
return(ratio);
}
/*************************************************************************
Prints info of the buffer i/o. */
@ -2109,8 +2133,10 @@ buf_print_io(
buf += sprintf(buf,
"Pending writes: LRU %lu, flush list %lu, single page %lu\n",
buf_pool->n_flush[BUF_FLUSH_LRU],
buf_pool->n_flush[BUF_FLUSH_LIST],
buf_pool->n_flush[BUF_FLUSH_LRU]
+ buf_pool->init_flush[BUF_FLUSH_LRU],
buf_pool->n_flush[BUF_FLUSH_LIST]
+ buf_pool->init_flush[BUF_FLUSH_LIST],
buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE]);
current_time = time(NULL);
@ -2144,7 +2170,7 @@ buf_print_io(
/ (buf_pool->n_page_gets - buf_pool->n_page_gets_old)));
} else {
buf += sprintf(buf,
"No buffer pool activity since the last printout\n");
"No buffer pool page gets since the last printout\n");
}
buf_pool->n_page_gets_old = buf_pool->n_page_gets;

View File

@ -107,7 +107,7 @@ buf_flush_ready_for_replace(
BUF_BLOCK_FILE_PAGE and in the LRU list */
{
ut_ad(mutex_own(&(buf_pool->mutex)));
ut_ad(block->state == BUF_BLOCK_FILE_PAGE);
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
if ((ut_dulint_cmp(block->oldest_modification, ut_dulint_zero) > 0)
|| (block->buf_fix_count != 0)
@ -227,7 +227,9 @@ buf_flush_buffered_writes(void)
}
for (i = 0; i < trx_doublewrite->first_free; i++) {
block = trx_doublewrite->buf_block_arr[i];
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
if (block->check_index_page_at_flush
&& !page_simple_validate(block->frame)) {
@ -236,10 +238,12 @@ buf_flush_buffered_writes(void)
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Apparent corruption of an index page\n"
" InnoDB: Apparent corruption of an index page n:o %lu in space %lu\n"
"InnoDB: to be written to data file. We intentionally crash server\n"
"InnoDB: to prevent corrupt data from ending up in data\n"
"InnoDB: files.\n");
"InnoDB: files.\n",
block->offset, block->space);
ut_a(0);
}
}
@ -394,7 +398,7 @@ buf_flush_write_block_low(
"Warning: cannot force log to disk in the log debug version!\n");
#else
/* Force the log to the disk before writing the modified block */
log_flush_up_to(block->newest_modification, LOG_WAIT_ALL_GROUPS);
log_write_up_to(block->newest_modification, LOG_WAIT_ALL_GROUPS, TRUE);
#endif
buf_flush_init_for_writing(block->frame, block->newest_modification,
block->space, block->offset);
@ -432,6 +436,8 @@ buf_flush_try_page(
block = buf_page_hash_get(space, offset);
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
if (flush_type == BUF_FLUSH_LIST
&& block && buf_flush_ready_for_flush(block, flush_type)) {
@ -567,7 +573,8 @@ buf_flush_try_page(
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
if (buf_debug_prints) {
printf("Flushing single page space %lu, page no %lu \n",
printf(
"Flushing single page space %lu, page no %lu \n",
block->space, block->offset);
}
@ -606,14 +613,6 @@ buf_flush_try_neighbors(
/* If there is little space, it is better not to flush any
block except from the end of the LRU list */
low = offset;
high = offset + 1;
} else if (flush_type == BUF_FLUSH_LIST) {
/* Since semaphore waits require us to flush the
doublewrite buffer to disk, it is best that the
search area is just the page itself, to minimize
chances for semaphore waits */
low = offset;
high = offset + 1;
}
@ -639,7 +638,14 @@ buf_flush_try_neighbors(
continue;
}
if (block && buf_flush_ready_for_flush(block, flush_type)) {
if (block && buf_flush_ready_for_flush(block, flush_type)
&& (i == offset || block->buf_fix_count == 0)) {
/* We only try to flush those neighbors != offset
where the buf fix count is zero, as we then know that
we probably can latch the page without a semaphore
wait. Semaphore waits are expensive because we must
flush the doublewrite buffer before we start
waiting. */
mutex_exit(&(buf_pool->mutex));
@ -758,7 +764,6 @@ buf_flush_batch(
page_count +=
buf_flush_try_neighbors(space, offset,
flush_type);
/* printf(
"Flush type %lu, page no %lu, neighb %lu\n",
flush_type, offset,
@ -884,11 +889,19 @@ buf_flush_free_margin(void)
/*=======================*/
{
ulint n_to_flush;
ulint n_flushed;
n_to_flush = buf_flush_LRU_recommendation();
if (n_to_flush > 0) {
buf_flush_batch(BUF_FLUSH_LRU, n_to_flush, ut_dulint_zero);
n_flushed = buf_flush_batch(BUF_FLUSH_LRU, n_to_flush,
ut_dulint_zero);
if (n_flushed == ULINT_UNDEFINED) {
/* There was an LRU type flush batch already running;
let us wait for it to end */
buf_flush_wait_batch_end(BUF_FLUSH_LRU);
}
}
}

View File

@ -104,12 +104,15 @@ ibool
buf_LRU_search_and_free_block(
/*==========================*/
/* out: TRUE if freed */
ulint n_iterations __attribute__((unused))) /* in: how many times
this has been called repeatedly without
result: a high value means that we should
search farther */
ulint n_iterations) /* in: how many times this has been called
repeatedly without result: a high value means
that we should search farther; if value is
k < 10, then we only search k/10 * [number
of pages in the buffer pool] from the end
of the LRU list */
{
buf_block_t* block;
ulint distance = 0;
ibool freed;
mutex_enter(&(buf_pool->mutex));
@ -152,6 +155,18 @@ buf_LRU_search_and_free_block(
}
block = UT_LIST_GET_PREV(LRU, block);
distance++;
if (!freed && n_iterations <= 10
&& distance > 100 + (n_iterations * buf_pool->curr_size)
/ 10) {
buf_pool->LRU_flush_ended = 0;
mutex_exit(&(buf_pool->mutex));
return(FALSE);
}
}
if (buf_pool->LRU_flush_ended > 0) {
@ -186,7 +201,7 @@ buf_LRU_try_free_flushed_blocks(void)
mutex_exit(&(buf_pool->mutex));
buf_LRU_search_and_free_block(0);
buf_LRU_search_and_free_block(1);
mutex_enter(&(buf_pool->mutex));
}
@ -208,7 +223,7 @@ buf_LRU_get_free_block(void)
{
buf_block_t* block = NULL;
ibool freed;
ulint n_iterations = 0;
ulint n_iterations = 1;
ibool mon_value_was = 0; /* remove bug */
ibool started_monitor = FALSE;
loop:
@ -236,9 +251,12 @@ loop:
fprintf(stderr,
" InnoDB: WARNING: over 4 / 5 of the buffer pool is occupied by\n"
"InnoDB: lock heaps or the adaptive hash index! Check that your\n"
"InnoDB: transactions do not set too many row locks. Starting InnoDB\n"
"InnoDB: Monitor to print diagnostics, including lock heap and hash index\n"
"InnoDB: sizes.\n");
"InnoDB: transactions do not set too many row locks.\n"
"InnoDB: Your buffer pool size is %lu MB. Maybe you should make\n"
"InnoDB: the buffer pool bigger?\n"
"InnoDB: Starting the InnoDB Monitor to print diagnostics, including\n"
"InnoDB: lock heap and hash index sizes.\n",
buf_pool->curr_size / (1024 * 1024 / UNIV_PAGE_SIZE));
srv_print_innodb_monitor = TRUE;
@ -252,14 +270,6 @@ loop:
srv_print_innodb_monitor = FALSE;
}
if (buf_pool->LRU_flush_ended > 0) {
mutex_exit(&(buf_pool->mutex));
buf_LRU_try_free_flushed_blocks();
mutex_enter(&(buf_pool->mutex));
}
/* If there is a block in the free list, take it */
if (UT_LIST_GET_LEN(buf_pool->free) > 0) {
@ -340,6 +350,20 @@ loop:
os_aio_simulated_wake_handler_threads();
mutex_enter(&(buf_pool->mutex));
if (buf_pool->LRU_flush_ended > 0) {
/* We have written pages in an LRU flush. To make the insert
buffer more efficient, we try to move these pages to the free
list. */
mutex_exit(&(buf_pool->mutex));
buf_LRU_try_free_flushed_blocks();
} else {
mutex_exit(&(buf_pool->mutex));
}
if (n_iterations > 10) {
os_thread_sleep(500000);

View File

@ -17,7 +17,7 @@
include ../include/Makefile.i
libs_LIBRARIES = libcom.a
noinst_LIBRARIES = libcom.a
libcom_a_SOURCES = com0com.c com0shm.c

View File

@ -103,7 +103,8 @@ struct com_shm_endpoint_struct{
the area currently may contain a datagram;
NOTE: automatic event */
os_event_t empty; /* this is in the signaled state if the area
currently may be empty; NOTE: automatic event */
currently may be empty; NOTE: automatic
event */
ip_mutex_hdl_t* ip_mutex; /* handle to the interprocess mutex
protecting the shared memory */
UT_LIST_NODE_T(com_shm_endpoint_t) list; /* If the endpoint struct
@ -793,16 +794,18 @@ com_shm_create_or_open(
ut_strcpy(buf + len, (char*)"_IBSHM_EV_NE"),
event_ne = os_event_create_auto(buf);
event_ne = os_event_create(buf);
ut_ad(event_ne);
ut_strcpy(buf + len, (char*)"_IBSHM_EV_EM"),
event_em = os_event_create_auto(buf);
event_em = os_event_create(buf);
ut_ad(event_em);
ut_a(0); /* event_ne and event_em should be auto events! */
com_shm_endpoint_set_shm(ep, shm);
com_shm_endpoint_set_map(ep, map);

View File

@ -17,7 +17,7 @@
include ../include/Makefile.i
libs_LIBRARIES = libdata.a
noinst_LIBRARIES = libdata.a
libdata_a_SOURCES = data0data.c data0type.c

View File

@ -17,7 +17,7 @@
include ../include/Makefile.i
libs_LIBRARIES = libdict.a
noinst_LIBRARIES = libdict.a
libdict_a_SOURCES = dict0boot.c dict0crea.c dict0dict.c dict0load.c\
dict0mem.c

View File

@ -1173,6 +1173,7 @@ dict_create_add_foreigns_to_dictionary(
if (NULL == dict_table_get_low((char *) "SYS_FOREIGN")) {
fprintf(stderr,
"InnoDB: table SYS_FOREIGN not found from internal data dictionary\n");
return(DB_ERROR);
}
@ -1259,6 +1260,13 @@ loop:
"InnoDB: at http://www.innodb.com/ibman.html\n");
}
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Internal error in foreign key constraint creation for table %.500s.\n"
"See the MySQL .err log in the datadir for more information.\n", table->name);
mutex_exit(&dict_foreign_err_mutex);
return(error);
}

View File

@ -185,6 +185,14 @@ dict_foreign_free(
/*==============*/
dict_foreign_t* foreign); /* in, own: foreign key struct */
/* Buffers for storing detailed information about the latest foreign key
and unique key errors */
char* dict_foreign_err_buf = NULL;
char* dict_unique_err_buf = NULL;
mutex_t dict_foreign_err_mutex; /* mutex protecting the foreign
and unique error buffers */
/************************************************************************
Checks if the database name in two table names is the same. */
static
@ -573,6 +581,13 @@ dict_init(void)
rw_lock_create(&dict_operation_lock);
rw_lock_set_level(&dict_operation_lock, SYNC_DICT_OPERATION);
dict_foreign_err_buf = mem_alloc(DICT_FOREIGN_ERR_BUF_LEN);
dict_foreign_err_buf[0] = '\0';
dict_unique_err_buf = mem_alloc(DICT_FOREIGN_ERR_BUF_LEN);
dict_unique_err_buf[0] = '\0';
mutex_create(&dict_foreign_err_mutex);
mutex_set_level(&dict_foreign_err_mutex, SYNC_ANY_LATCH);
}
/**************************************************************************
@ -1818,6 +1833,7 @@ dict_foreign_add_to_cache(
dict_foreign_t* for_in_cache = NULL;
dict_index_t* index;
ibool added_to_referenced_list = FALSE;
char* buf = dict_foreign_err_buf;
ut_ad(mutex_own(&(dict_sys->mutex)));
@ -1850,9 +1866,29 @@ dict_foreign_add_to_cache(
for_in_cache->foreign_index);
if (index == NULL) {
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in foreign key constraint of table %.500s:\n"
"there is no index in referenced table which would contain\n"
"the columns as the first columns, or the data types in the\n"
"referenced table do not match to the ones in table. Constraint:\n",
for_in_cache->foreign_table_name);
dict_print_info_on_foreign_key_in_create_format(
for_in_cache, buf + strlen(buf));
if (for_in_cache->foreign_index) {
sprintf(buf + strlen(buf),
"\nThe index in the foreign key in table is %.500s\n"
"See http://www.innodb.com/ibman.html about correct foreign key definition.\n",
for_in_cache->foreign_index->name);
}
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
if (for_in_cache == foreign) {
mem_heap_free(foreign->heap);
}
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -1871,6 +1907,25 @@ dict_foreign_add_to_cache(
for_in_cache->referenced_index);
if (index == NULL) {
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in foreign key constraint of table %.500s:\n"
"there is no index in the table which would contain\n"
"the columns as the first columns, or the data types in the\n"
"table do not match to the ones in the referenced table. Constraint:\n",
for_in_cache->foreign_table_name);
dict_print_info_on_foreign_key_in_create_format(
for_in_cache, buf + strlen(buf));
if (for_in_cache->foreign_index) {
sprintf(buf + strlen(buf),
"\nIndex of the foreign key in the referenced table is %.500s\n"
"See http://www.innodb.com/ibman.html about correct foreign key definition.\n",
for_in_cache->referenced_index->name);
}
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
if (for_in_cache == foreign) {
if (added_to_referenced_list) {
UT_LIST_REMOVE(referenced_list,
@ -2141,18 +2196,21 @@ dict_scan_table_name(
}
/*************************************************************************
Skips one 'word', like an id. For the lexical definition of 'word', see the
code below. */
Scans an id. For the lexical definition of an 'id', see the code below.
Strips backquotes from around the id. */
static
char*
dict_skip_word(
/*===========*/
dict_scan_id(
/*=========*/
/* out: scanned to */
char* ptr, /* in: scanned to */
ibool* success)/* out: TRUE if success, FALSE if just spaces left in
string */
char** start, /* out: start of the id; NULL if no id was
scannable */
ulint* len) /* out: length of the id */
{
*success = FALSE;
ibool scanned_backquote = FALSE;
*start = NULL;
while (isspace(*ptr)) {
ptr++;
@ -2164,24 +2222,61 @@ dict_skip_word(
}
if (*ptr == '`') {
scanned_backquote = TRUE;
ptr++;
}
while (!isspace(*ptr) && *ptr != ',' && *ptr != '(' && *ptr != '`'
&& *ptr != '\0') {
*start = ptr;
while (!isspace(*ptr) && *ptr != ',' && *ptr != '(' && *ptr != ')'
&& *ptr != '\0' && *ptr != '`') {
ptr++;
}
*success = TRUE;
*len = (ulint) (ptr - *start);
if (scanned_backquote) {
if (*ptr == '`') {
ptr++;
} else {
/* Syntax error */
*start = NULL;
}
}
return(ptr);
}
/*************************************************************************
Skips one id. */
static
char*
dict_skip_word(
/*===========*/
/* out: scanned to */
char* ptr, /* in: scanned to */
ibool* success)/* out: TRUE if success, FALSE if just spaces left in
string or a syntax error */
{
char* start;
ulint len;
*success = FALSE;
ptr = dict_scan_id(ptr, &start, &len);
if (start) {
*success = TRUE;
}
return(ptr);
}
#ifdef currentlynotused
/*************************************************************************
Returns the number of opening brackets '(' subtracted by the number
of closing brackets ')' between string and ptr. */
#ifdef NOT_USED
static
int
dict_bracket_count(
@ -2206,16 +2301,116 @@ dict_bracket_count(
return(count);
}
#endif
/*************************************************************************
Removes MySQL comments from an SQL string. A comment is either
(a) '#' to the end of the line,
(b) '--<space>' to the end of the line, or
(c) '<slash><asterisk>' till the next '<asterisk><slash>' (like the familiar
C comment syntax). */
static
char*
dict_strip_comments(
/*================*/
/* out, own: SQL string stripped from
comments; the caller must free this
with mem_free()! */
char* sql_string) /* in: SQL string */
{
char* str;
char* sptr;
char* ptr;
str = mem_alloc(strlen(sql_string) + 1);
sptr = sql_string;
ptr = str;
for (;;) {
if (*sptr == '\0') {
*ptr = '\0';
return(str);
}
if (*sptr == '#'
|| (strlen(sptr) >= 3 && 0 == memcmp("-- ", sptr, 3))) {
for (;;) {
/* In Unix a newline is 0x0D while in Windows
it is 0x0A followed by 0x0D */
if (*sptr == (char)0x0A
|| *sptr == (char)0x0D
|| *sptr == '\0') {
break;
}
sptr++;
}
}
if (strlen(sptr) >= 2 && *sptr == '/' && *(sptr + 1) == '*') {
for (;;) {
if (strlen(sptr) >= 2
&& *sptr == '*' && *(sptr + 1) == '/') {
sptr += 2;
break;
}
if (*sptr == '\0') {
break;
}
sptr++;
}
}
*ptr = *sptr;
ptr++;
sptr++;
}
}
/*************************************************************************
Reports a simple foreign key create clause syntax error. */
static
void
dict_foreign_report_syntax_err(
/*===========================*/
char* name, /* in: table name */
char* start_of_latest_foreign,/* in: start of the foreign key clause
in the SQL string */
char* ptr) /* in: place of the syntax error */
{
char* buf = dict_foreign_err_buf;
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in foreign key constraint of table %.500s,\n%.500s.\n"
"Syntax error close to:\n%.500s\n", name, start_of_latest_foreign, ptr);
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
}
/*************************************************************************
Scans a table create SQL string and adds to the data dictionary the foreign
key constraints declared in the string. This function should be called after
the indexes for a table have been created. Each foreign key constraint must
be accompanied with indexes in both participating tables. The indexes are
allowed to contain more fields than mentioned in the constraint. */
static
ulint
dict_create_foreign_constraints(
/*============================*/
dict_create_foreign_constraints_low(
/*================================*/
/* out: error code or DB_SUCCESS */
trx_t* trx, /* in: transaction */
char* sql_string, /* in: table create or ALTER TABLE
@ -2232,6 +2427,8 @@ dict_create_foreign_constraints(
dict_index_t* index;
dict_foreign_t* foreign;
char* ptr = sql_string;
char* start_of_latest_foreign = sql_string;
char* buf = dict_foreign_err_buf;
ibool success;
ulint error;
ulint i;
@ -2249,6 +2446,15 @@ dict_create_foreign_constraints(
table = dict_table_get_low(name);
if (table == NULL) {
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in foreign key constraint of table %.500s.\n"
"Cannot find the table from the internal data dictionary of InnoDB.\n"
"Create table statement:\n%.2000\n", name, sql_string);
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
return(DB_ERROR);
}
loop:
@ -2264,6 +2470,8 @@ loop:
return(error);
}
start_of_latest_foreign = ptr;
ptr = dict_accept(ptr, (char *) "FOREIGN", &success);
if (!isspace(*ptr)) {
@ -2284,13 +2492,19 @@ loop:
ptr = dict_skip_word(ptr, &success);
if (!success) {
dict_foreign_report_syntax_err(name,
start_of_latest_foreign, ptr);
return(DB_CANNOT_ADD_CONSTRAINT);
}
ptr = dict_accept(ptr, (char *) "(", &success);
if (!success) {
return(DB_CANNOT_ADD_CONSTRAINT);
/* We do not flag a syntax error here because in an
ALTER TABLE we may also have DROP FOREIGN KEY abc */
goto loop;
}
}
@ -2301,6 +2515,15 @@ col_loop1:
ptr = dict_scan_col(ptr, &success, table, columns + i,
column_names + i, column_name_lens + i);
if (!success) {
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in foreign key constraint of table %.500s,\n%.500s.\n"
"Cannot resolve column name close to:\n%.500s\n", name,
start_of_latest_foreign, ptr);
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -2315,6 +2538,8 @@ col_loop1:
ptr = dict_accept(ptr, (char *) ")", &success);
if (!success) {
dict_foreign_report_syntax_err(name, start_of_latest_foreign,
ptr);
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -2324,12 +2549,24 @@ col_loop1:
index = dict_foreign_find_index(table, column_names, i, NULL);
if (!index) {
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in foreign key constraint of table %.500s:\n"
"There is no index in the table %.500s where the columns appear\n"
"as the first columns. Constraint:\n%.500s\n"
"See http://www.innodb.com/ibman.html for correct foreign key definition.\n",
name, name, start_of_latest_foreign);
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
return(DB_CANNOT_ADD_CONSTRAINT);
}
ptr = dict_accept(ptr, (char *) "REFERENCES", &success);
if (!success || !isspace(*ptr)) {
dict_foreign_report_syntax_err(name, start_of_latest_foreign,
ptr);
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -2359,6 +2596,15 @@ col_loop1:
if (!success || (!referenced_table && trx->check_foreigns)) {
dict_foreign_free(foreign);
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in foreign key constraint of table %.500s,\n%.500s.\n"
"Cannot resolve table name close to:\n"
"%.500s\n", name, start_of_latest_foreign, ptr);
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -2366,7 +2612,8 @@ col_loop1:
if (!success) {
dict_foreign_free(foreign);
dict_foreign_report_syntax_err(name, start_of_latest_foreign,
ptr);
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -2381,6 +2628,15 @@ col_loop2:
if (!success) {
dict_foreign_free(foreign);
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in foreign key constraint of table %.500s,\n%.500s\n"
"Cannot resolve column name close to:\n"
"%.500s\n", name, start_of_latest_foreign, ptr);
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -2395,6 +2651,8 @@ col_loop2:
if (!success || foreign->n_fields != i) {
dict_foreign_free(foreign);
dict_foreign_report_syntax_err(name, start_of_latest_foreign,
ptr);
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -2417,9 +2675,10 @@ scan_on_conditions:
ptr = dict_accept(ptr, "UPDATE", &success);
if (!success) {
dict_foreign_free(foreign);
dict_foreign_report_syntax_err(name,
start_of_latest_foreign, ptr);
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -2455,6 +2714,8 @@ scan_on_conditions:
if (!success) {
dict_foreign_free(foreign);
dict_foreign_report_syntax_err(name,
start_of_latest_foreign, ptr);
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -2472,7 +2733,8 @@ scan_on_conditions:
if (!success) {
dict_foreign_free(foreign);
dict_foreign_report_syntax_err(name, start_of_latest_foreign,
ptr);
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -2480,7 +2742,8 @@ scan_on_conditions:
if (!success) {
dict_foreign_free(foreign);
dict_foreign_report_syntax_err(name, start_of_latest_foreign,
ptr);
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -2494,6 +2757,15 @@ scan_on_conditions:
dict_foreign_free(foreign);
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in foreign key constraint of table %.500s,\n%.500s.\n"
"You have defined a SET NULL condition though some of the\n"
"columns is defined as NOT NULL.\n", name, start_of_latest_foreign);
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
return(DB_CANNOT_ADD_CONSTRAINT);
}
}
@ -2512,6 +2784,15 @@ try_find_index:
dict_foreign_free(foreign);
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in foreign key constraint of table %.500s,\n%.500s.\n"
"You have twice an ON DELETE clause or twice an ON UPDATE clause.\n",
name, start_of_latest_foreign);
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
return(DB_CANNOT_ADD_CONSTRAINT);
}
@ -2525,6 +2806,18 @@ try_find_index:
foreign->foreign_index);
if (!index) {
dict_foreign_free(foreign);
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in foreign key constraint of table %.500s:\n"
"Cannot find an index in the referenced table where the\n"
"referenced columns appear as the first columns, or column types\n"
"in the table and the referenced table do not match for constraint:\n%.500s\n"
"See http://www.innodb.com/ibman.html for correct foreign key definition.\n",
name, start_of_latest_foreign);
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
return(DB_CANNOT_ADD_CONSTRAINT);
}
} else {
@ -2565,6 +2858,165 @@ try_find_index:
goto loop;
}
/*************************************************************************
Scans a table create SQL string and adds to the data dictionary the foreign
key constraints declared in the string. This function should be called after
the indexes for a table have been created. Each foreign key constraint must
be accompanied with indexes in both participating tables. The indexes are
allowed to contain more fields than mentioned in the constraint. */
ulint
dict_create_foreign_constraints(
/*============================*/
/* out: error code or DB_SUCCESS */
trx_t* trx, /* in: transaction */
char* sql_string, /* in: table create or ALTER TABLE
statement where foreign keys are declared like:
FOREIGN KEY (a, b) REFERENCES table2(c, d),
table2 can be written also with the database
name before it: test.table2; the default
database id the database of parameter name */
char* name) /* in: table full name in the normalized form
database_name/table_name */
{
char* str;
ulint err;
str = dict_strip_comments(sql_string);
err = dict_create_foreign_constraints_low(trx, str, name);
mem_free(str);
return(err);
}
/**************************************************************************
Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement. */
ulint
dict_foreign_parse_drop_constraints(
/*================================*/
/* out: DB_SUCCESS or
DB_CANNOT_DROP_CONSTRAINT if
syntax error or the constraint
id does not match */
mem_heap_t* heap, /* in: heap from which we can
allocate memory */
trx_t* trx, /* in: transaction */
dict_table_t* table, /* in: table */
ulint* n, /* out: number of constraints
to drop */
char*** constraints_to_drop) /* out: id's of the
constraints to drop */
{
dict_foreign_t* foreign;
ibool success;
char* str;
char* ptr;
char* buf = dict_foreign_err_buf;
char* start;
char* id;
ulint len;
*n = 0;
*constraints_to_drop = mem_heap_alloc(heap, 1000 * sizeof(char*));
str = dict_strip_comments(*(trx->mysql_query_str));
ptr = str;
ut_ad(mutex_own(&(dict_sys->mutex)));
loop:
ptr = dict_scan_to(ptr, (char *) "DROP");
if (*ptr == '\0') {
ut_a(*n < 1000);
mem_free(str);
return(DB_SUCCESS);
}
ptr = dict_accept(ptr, (char *) "DROP", &success);
if (!isspace(*ptr)) {
goto loop;
}
ptr = dict_accept(ptr, (char *) "FOREIGN", &success);
if (!success) {
goto loop;
}
ptr = dict_accept(ptr, (char *) "KEY", &success);
if (!success) {
goto syntax_error;
}
ptr = dict_scan_id(ptr, &start, &len);
if (start == NULL) {
goto syntax_error;
}
id = mem_heap_alloc(heap, len + 1);
ut_memcpy(id, start, len);
id[len] = '\0';
(*constraints_to_drop)[*n] = id;
(*n)++;
/* Look for the given constraint id */
foreign = UT_LIST_GET_FIRST(table->foreign_list);
while (foreign != NULL) {
if (0 == ut_strcmp(foreign->id, id)) {
/* Found */
break;
}
foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
}
if (foreign == NULL) {
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in dropping of a foreign key constraint of table %.500s,\n"
"just before:\n%s\n in SQL command\n%s\nCannot find a constraint with the\n"
"given id %s.\n", table->name, ptr, str, id);
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
mem_free(str);
return(DB_CANNOT_DROP_CONSTRAINT);
}
goto loop;
syntax_error:
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Syntax error in dropping of a foreign key constraint of table %.500s,\n"
"close to:\n%s\n in SQL command\n%s\n", table->name, ptr, str);
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
mem_free(str);
return(DB_CANNOT_DROP_CONSTRAINT);
}
/*==================== END OF FOREIGN KEY PROCESSING ====================*/
/**************************************************************************
@ -3286,7 +3738,6 @@ dict_index_print_low(
n_vals = index->stat_n_diff_key_vals[1];
}
printf(
" INDEX: name %s, table name %s, id %lu %lu, fields %lu/%lu, type %lu\n",
index->name, index->table_name,
@ -3328,43 +3779,27 @@ dict_field_print_low(
}
/**************************************************************************
Sprintfs to a string info on foreign keys of a table in a format suitable
Sprintfs to a string info on a foreign key of a table in a format suitable
for CREATE TABLE. */
static
void
dict_print_info_on_foreign_keys_in_create_format(
/*=============================================*/
char* buf, /* in: auxiliary buffer */
char* str, /* in/out: pointer to a string */
ulint len, /* in: str has to be a buffer at least
len + 5000 bytes */
dict_table_t* table) /* in: table */
char*
dict_print_info_on_foreign_key_in_create_format(
/*============================================*/
/* out: how far in buf we printed */
dict_foreign_t* foreign,/* in: foreign key constraint */
char* buf) /* in: buffer of at least 5000 bytes */
{
dict_foreign_t* foreign;
char* buf2 = buf;
ulint i;
char* buf2;
buf2 = buf;
mutex_enter(&(dict_sys->mutex));
foreign = UT_LIST_GET_FIRST(table->foreign_list);
if (foreign == NULL) {
mutex_exit(&(dict_sys->mutex));
return;
}
while (foreign != NULL) {
buf2 += sprintf(buf2, ",\n FOREIGN KEY (");
buf2 += sprintf(buf2, ",\n CONSTRAINT `%s` FOREIGN KEY (",
foreign->id);
for (i = 0; i < foreign->n_fields; i++) {
if ((ulint)(buf2 - buf) >= len) {
if ((ulint)(buf2 - buf) >= 4000) {
goto no_space;
}
buf2 += sprintf(buf2, "`%s`",
buf2 += sprintf(buf2, "`%.250s`",
foreign->foreign_col_names[i]);
if (i + 1 < foreign->n_fields) {
@ -3372,15 +3807,15 @@ dict_print_info_on_foreign_keys_in_create_format(
}
}
if (dict_tables_have_same_db(table->name,
if (dict_tables_have_same_db(foreign->foreign_table_name,
foreign->referenced_table_name)) {
/* Do not print the database name of the referenced
table */
buf2 += sprintf(buf2, ") REFERENCES `%s` (",
buf2 += sprintf(buf2, ") REFERENCES `%.500s` (",
dict_remove_db_name(
foreign->referenced_table_name));
} else {
buf2 += sprintf(buf2, ") REFERENCES `%s` (",
buf2 += sprintf(buf2, ") REFERENCES `%.500s` (",
foreign->referenced_table_name);
/* Change the '/' in the table name to '.' */
@ -3395,10 +3830,11 @@ dict_print_info_on_foreign_keys_in_create_format(
}
for (i = 0; i < foreign->n_fields; i++) {
if ((ulint)(buf2 - buf) >= len) {
if ((ulint)(buf2 - buf) >= 4000) {
goto no_space;
}
buf2 += sprintf(buf2, "`%s`",
buf2 += sprintf(buf2, "`%.250s`",
foreign->referenced_col_names[i]);
if (i + 1 < foreign->n_fields) {
buf2 += sprintf(buf2, ", ");
@ -3431,6 +3867,47 @@ dict_print_info_on_foreign_keys_in_create_format(
buf2 += sprintf(buf2, " ON UPDATE NO ACTION");
}
no_space:
return(buf2);
}
/**************************************************************************
Sprintfs to a string info on foreign keys of a table in a format suitable
for CREATE TABLE. */
static
void
dict_print_info_on_foreign_keys_in_create_format(
/*=============================================*/
char* buf, /* in: auxiliary buffer */
char* str, /* in/out: pointer to a string */
ulint len, /* in: buf has to be a buffer of at least
len + 5000 bytes; str must have at least
len + 1 bytes */
dict_table_t* table) /* in: table */
{
dict_foreign_t* foreign;
char* buf2;
buf2 = buf;
mutex_enter(&(dict_sys->mutex));
foreign = UT_LIST_GET_FIRST(table->foreign_list);
if (foreign == NULL) {
mutex_exit(&(dict_sys->mutex));
return;
}
while (foreign != NULL) {
if ((ulint)(buf2 - buf) >= len) {
goto no_space;
}
buf2 = dict_print_info_on_foreign_key_in_create_format(
foreign, buf2);
foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
}
no_space:
@ -3490,7 +3967,7 @@ dict_print_info_on_foreign_keys(
goto no_space;
}
buf2 += sprintf(buf2, "%s",
buf2 += sprintf(buf2, "%.500s",
foreign->foreign_col_names[i]);
if (i + 1 < foreign->n_fields) {
@ -3498,14 +3975,14 @@ dict_print_info_on_foreign_keys(
}
}
buf2 += sprintf(buf2, ") REFER %s(",
buf2 += sprintf(buf2, ") REFER %.500s(",
foreign->referenced_table_name);
for (i = 0; i < foreign->n_fields; i++) {
if ((ulint)(buf2 - buf) >= len) {
goto no_space;
}
buf2 += sprintf(buf2, "%s",
buf2 += sprintf(buf2, "%.500s",
foreign->referenced_col_names[i]);
if (i + 1 < foreign->n_fields) {
buf2 += sprintf(buf2, " ");

View File

@ -456,7 +456,7 @@ dict_load_indexes(
ut_ad(len == 8);
id = mach_read_from_8(field);
ut_a(0 == ut_strcmp((void*) "NAME",
ut_a(0 == ut_strcmp((char*) "NAME",
dict_field_get_col(
dict_index_get_nth_field(
dict_table_get_first_index(sys_indexes), 4))->name));
@ -515,7 +515,7 @@ dict_load_indexes(
&& ((type & DICT_CLUSTERED)
|| ((table == dict_sys->sys_tables)
&& (name_len == ut_strlen("ID_IND"))
&& (0 == ut_memcmp(name_buf, (void*) "ID_IND",
&& (0 == ut_memcmp(name_buf, (char*) "ID_IND",
name_len))))) {
/* The index was created in memory already in
@ -566,6 +566,7 @@ dict_load_table(
char* buf;
ulint space;
ulint n_cols;
ulint err;
mtr_t mtr;
ut_ad(mutex_own(&(dict_sys->mutex)));
@ -674,8 +675,25 @@ dict_load_table(
dict_load_indexes(table, heap);
ut_a(DB_SUCCESS == dict_load_foreigns(table->name));
err = dict_load_foreigns(table->name);
/*
if (err != DB_SUCCESS) {
mutex_enter(&dict_foreign_err_mutex);
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: could not make a foreign key definition to match\n"
"InnoDB: the foreign key table or the referenced table!\n"
"InnoDB: The data dictionary of InnoDB is corrupt. You may need to drop\n"
"InnoDB: and recreate the foreign key table or the referenced table.\n"
"InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n"
"InnoDB: Latest foreign key error printout:\n%s\n", dict_foreign_err_buf);
mutex_exit(&dict_foreign_err_mutex);
}
*/
mem_heap_free(heap);
return(table);
@ -978,8 +996,8 @@ dict_load_foreign(
field = rec_get_nth_field(rec, 4, &len);
foreign->referenced_table_name = mem_heap_alloc(foreign->heap, 1 + len);
foreign->referenced_table_name = mem_heap_alloc(foreign->heap,
1 + len);
ut_memcpy(foreign->referenced_table_name, field, len);
foreign->referenced_table_name[len] = '\0';
@ -988,10 +1006,19 @@ dict_load_foreign(
dict_load_foreign_cols(id, foreign);
/* If the foreign table is not yet in the dictionary cache, we
have to load it so that we are able to make type comparisons
in the next function call. */
dict_table_get_low(foreign->foreign_table_name);
/* Note that there may already be a foreign constraint object in
the dictionary cache for this constraint: then the following
call only sets the pointers in it to point to the appropriate table
and index objects and frees the newly created object foreign. */
and index objects and frees the newly created object foreign.
Adding to the cache should always succeed since we are not creating
a new foreign key constraint but loading one from the data
dictionary. */
err = dict_foreign_add_to_cache(foreign);

View File

@ -17,7 +17,7 @@
include ../include/Makefile.i
libs_LIBRARIES = libdyn.a
noinst_LIBRARIES = libdyn.a
libdyn_a_SOURCES = dyn0dyn.c

View File

@ -17,7 +17,7 @@
include ../include/Makefile.i
libs_LIBRARIES = libeval.a
noinst_LIBRARIES = libeval.a
libeval_a_SOURCES = eval0eval.c eval0proc.c

View File

@ -17,7 +17,7 @@
include ../include/Makefile.i
libs_LIBRARIES = libfil.a
noinst_LIBRARIES = libfil.a
libfil_a_SOURCES = fil0fil.c

View File

@ -18,7 +18,7 @@
include ../include/Makefile.i
libs_LIBRARIES = libfsp.a
noinst_LIBRARIES = libfsp.a
libfsp_a_SOURCES = fsp0fsp.c

View File

@ -17,7 +17,7 @@
include ../include/Makefile.i
libs_LIBRARIES = libfut.a
noinst_LIBRARIES = libfut.a
libfut_a_SOURCES = fut0fut.c fut0lst.c

View File

@ -17,7 +17,7 @@
include ../include/Makefile.i
libs_LIBRARIES = libha.a
noinst_LIBRARIES = libha.a
libha_a_SOURCES = ha0ha.c hash0hash.c

View File

@ -17,7 +17,7 @@
include ../include/Makefile.i
libs_LIBRARIES = libibuf.a
noinst_LIBRARIES = libibuf.a
libibuf_a_SOURCES = ibuf0ibuf.c

View File

@ -2420,17 +2420,22 @@ ibuf_delete_rec(
fprintf(stderr, "InnoDB: ibuf cursor restoration fails!\n");
fprintf(stderr, "InnoDB: ibuf record inserted to page %lu\n",
page_no);
fflush(stderr);
rec_print(btr_pcur_get_rec(pcur));
rec_print(pcur->old_rec);
dtuple_print(search_tuple);
rec_print(page_rec_get_next(btr_pcur_get_rec(pcur)));
fflush(stdout);
mtr_commit(mtr);
fprintf(stderr, "InnoDB: Validating insert buffer tree:\n");
ut_a(btr_validate_tree(ibuf_data->index->tree));
fprintf(stderr, "InnoDB: Ibuf tree ok\n");
fprintf(stderr, "InnoDB: ibuf tree ok\n");
fflush(stderr);
}
ut_a(success);

View File

@ -1,7 +1,5 @@
# Makefile included in Makefile.am in every subdirectory
libsdir = ../libs
INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../../include -I../../include
# Don't update the files from bitkeeper

View File

@ -496,6 +496,13 @@ buf_print_io(
/*=========*/
char* buf, /* in/out: buffer where to print */
char* buf_end);/* in: buffer end */
/*************************************************************************
Returns the ratio in percents of modified pages in the buffer pool /
database pages in the buffer pool. */
ulint
buf_get_modified_ratio_pct(void);
/*============================*/
/**************************************************************************
Refreshes the statistics used to print per-second averages. */

View File

@ -46,6 +46,20 @@ buf_LRU_get_recent_limit(void);
/*==========================*/
/* out: the limit; zero if could not determine it */
/**********************************************************************
Look for a replaceable block from the end of the LRU list and put it to
the free list if found. */
ibool
buf_LRU_search_and_free_block(
/*==========================*/
/* out: TRUE if freed */
ulint n_iterations); /* in: how many times this has been called
repeatedly without result: a high value means
that we should search farther; if value is
k < 10, then we only search k/10 * number
of pages in the buffer pool from the end
of the LRU list */
/**********************************************************************
Returns a free block from the buf_pool. The block is taken off the
free list. If it is empty, blocks are moved from the end of the
LRU list to the free list. */
@ -88,17 +102,6 @@ void
buf_LRU_make_block_old(
/*===================*/
buf_block_t* block); /* in: control block */
/**********************************************************************
Look for a replaceable block from the end of the LRU list and put it to
the free list if found. */
ibool
buf_LRU_search_and_free_block(
/*==========================*/
/* out: TRUE if freed */
ulint n_iterations); /* in: how many times this has been called
repeatedly without result: a high value
means that we should search farther */
/**************************************************************************
Validates the LRU list. */

View File

@ -44,6 +44,8 @@ Created 5/24/1996 Heikki Tuuri
#define DB_CORRUPTION 39 /* data structure corruption noticed */
#define DB_COL_APPEARS_TWICE_IN_INDEX 40 /* InnoDB cannot handle an index
where same column appears twice */
#define DB_CANNOT_DROP_CONSTRAINT 40 /* dropping a foreign key constraint
from a table failed */
/* The following are partial failure codes */
#define DB_FAIL 1000

View File

@ -219,6 +219,24 @@ dict_create_foreign_constraints(
char* name); /* in: table full name in the normalized form
database_name/table_name */
/**************************************************************************
Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement. */
ulint
dict_foreign_parse_drop_constraints(
/*================================*/
/* out: DB_SUCCESS or
DB_CANNOT_DROP_CONSTRAINT if
syntax error or the constraint
id does not match */
mem_heap_t* heap, /* in: heap from which we can
allocate memory */
trx_t* trx, /* in: transaction */
dict_table_t* table, /* in: table */
ulint* n, /* out: number of constraints
to drop */
char*** constraints_to_drop); /* out: id's of the
constraints to drop */
/**************************************************************************
Returns a table object and memoryfixes it. NOTE! This is a high-level
function to be used mainly from outside the 'dict' directory. Inside this
directory dict_table_get_low is usually the appropriate function. */
@ -333,6 +351,16 @@ dict_print_info_on_foreign_keys(
char* str, /* in/out: pointer to a string */
ulint len, /* in: space in str available for info */
dict_table_t* table); /* in: table */
/**************************************************************************
Sprintfs to a string info on a foreign key of a table in a format suitable
for CREATE TABLE. */
char*
dict_print_info_on_foreign_key_in_create_format(
/*============================================*/
/* out: how far in buf we printed */
dict_foreign_t* foreign,/* in: foreign key constraint */
char* buf); /* in: buffer of at least 5000 bytes */
/************************************************************************
Gets the first index on the table (the clustered index). */
UNIV_INLINE
@ -808,6 +836,14 @@ void
dict_mutex_exit_for_mysql(void);
/*===========================*/
/* The following len must be at least 10000 bytes! */
#define DICT_FOREIGN_ERR_BUF_LEN 10000
/* Buffers for storing detailed information about the latest foreign key
and unique key errors */
extern char* dict_foreign_err_buf;
extern char* dict_unique_err_buf;
extern mutex_t dict_foreign_err_mutex; /* mutex protecting the buffers */
extern dict_sys_t* dict_sys; /* the dictionary system */
extern rw_lock_t dict_operation_lock;

View File

@ -20,7 +20,7 @@ typedef struct log_group_struct log_group_t;
extern ibool log_do_write;
extern ibool log_debug_writes;
/* Wait modes for log_flush_up_to */
/* Wait modes for log_write_up_to */
#define LOG_NO_WAIT 91
#define LOG_WAIT_ONE_GROUP 92
#define LOG_WAIT_ALL_GROUPS 93
@ -157,26 +157,21 @@ log_io_complete(
/*============*/
log_group_t* group); /* in: log group */
/**********************************************************
Flushes the log files to the disk, using, for example, the Unix fsync.
This function does the flush even if the user has set
srv_flush_log_at_trx_commit = FALSE. */
void
log_flush_to_disk(void);
/*===================*/
/**********************************************************
This function is called, e.g., when a transaction wants to commit. It checks
that the log has been flushed to disk up to the last log entry written by the
transaction. If there is a flush running, it waits and checks if the flush
flushed enough. If not, starts a new flush. */
that the log has been written to the log file up to the last log entry written
by the transaction. If there is a flush running, it waits and checks if the
flush flushed enough. If not, starts a new flush. */
void
log_flush_up_to(
log_write_up_to(
/*============*/
dulint lsn, /* in: log sequence number up to which the log should
be flushed, ut_dulint_max if not specified */
ulint wait); /* in: LOG_NO_WAIT, LOG_WAIT_ONE_GROUP,
be written, ut_dulint_max if not specified */
ulint wait, /* in: LOG_NO_WAIT, LOG_WAIT_ONE_GROUP,
or LOG_WAIT_ALL_GROUPS */
ibool flush_to_disk);
/* in: TRUE if we want the written log also to be
flushed to disk */
/********************************************************************
Advances the smallest lsn for which there are unflushed dirty blocks in the
buffer pool and also may make a new checkpoint. NOTE: this function may only
@ -741,27 +736,37 @@ struct log_struct{
be advanced, it is enough that the
write i/o has been completed for all
log groups */
dulint flush_lsn; /* end lsn for the current flush */
ulint flush_end_offset;/* the data in buffer has been flushed
dulint write_lsn; /* end lsn for the current running
write */
ulint write_end_offset;/* the data in buffer has been written
up to this offset when the current
flush ends: this field will then
write ends: this field will then
be copied to buf_next_to_write */
ulint n_pending_writes;/* number of currently pending flush
writes */
dulint current_flush_lsn;/* end lsn for the current running
write + flush operation */
dulint flushed_to_disk_lsn;
/* how far we have written the log
AND flushed to disk */
ulint n_pending_writes;/* number of currently pending flushes
or writes */
/* NOTE on the 'flush' in names of the fields below: starting from
4.0.14, we separate the write of the log file and the actual fsync()
or other method to flush it to disk. The names below shhould really
be 'flush_or_write'! */
os_event_t no_flush_event; /* this event is in the reset state
when a flush is running; a thread
should wait for this without owning
the log mutex, but NOTE that to set or
reset this event, the thread MUST own
the log mutex! */
when a flush or a write is running;
a thread should wait for this without
owning the log mutex, but NOTE that
to set or reset this event, the
thread MUST own the log mutex! */
ibool one_flushed; /* during a flush, this is first FALSE
and becomes TRUE when one log group
has been flushed */
has been written or flushed */
os_event_t one_flushed_event;/* this event is reset when the
flush has not yet completed for any
log group; e.g., this means that a
transaction has been committed when
this is set; a thread should wait
flush or write has not yet completed
for any log group; e.g., this means
that a transaction has been committed
when this is set; a thread should wait
for this without owning the log mutex,
but NOTE that to set or reset this
event, the thread MUST own the log

View File

@ -301,6 +301,13 @@ os_aio(
are ignored */
void* message2);
/****************************************************************************
Wakes up all async i/o threads so that they know to exit themselves in
shutdown. */
void
os_aio_wake_all_threads_at_shutdown(void);
/*=====================================*/
/****************************************************************************
Waits until there are no pending writes in os_aio_write_array. There can
be other, synchronous, pending writes. */

View File

@ -10,15 +10,29 @@ Created 9/6/1995 Heikki Tuuri
#define os0sync_h
#include "univ.i"
#include "ut0lst.h"
#ifdef __WIN__
#define os_fast_mutex_t CRITICAL_SECTION
typedef void* os_event_t;
typedef HANDLE os_native_event_t;
typedef struct os_event_struct os_event_struct_t;
typedef os_event_struct_t* os_event_t;
struct os_event_struct {
os_native_event_t handle;
/* Windows event */
UT_LIST_NODE_T(os_event_struct_t) os_event_list;
/* list of all created events */
};
#else
typedef pthread_mutex_t os_fast_mutex_t;
typedef struct os_event_struct os_event_struct_t;
typedef os_event_struct_t* os_event_t;
struct os_event_struct {
os_fast_mutex_t os_mutex; /* this mutex protects the next
fields */
@ -26,9 +40,9 @@ struct os_event_struct {
not reserved */
pthread_cond_t cond_var; /* condition variable is used in
waiting for the event */
UT_LIST_NODE_T(os_event_struct_t) os_event_list;
/* list of all created events */
};
typedef struct os_event_struct os_event_struct_t;
typedef os_event_struct_t* os_event_t;
#endif
typedef struct os_mutex_struct os_mutex_str_t;
@ -38,10 +52,32 @@ typedef os_mutex_str_t* os_mutex_t;
#define OS_SYNC_TIME_EXCEEDED 1
/* Mutex protecting counts and the event and OS 'slow' mutex lists */
extern os_mutex_t os_sync_mutex;
/* This is incremented by 1 in os_thread_create and decremented by 1 in
os_thread_exit */
extern ulint os_thread_count;
extern ulint os_event_count;
extern ulint os_mutex_count;
extern ulint os_fast_mutex_count;
/*************************************************************
Creates an event semaphore, i.e., a semaphore which may
just have two states: signaled and nonsignaled.
The created event is manual reset: it must be reset
Initializes global event and OS 'slow' mutex lists. */
void
os_sync_init(void);
/*==============*/
/*************************************************************
Frees created events and OS 'slow' mutexes. */
void
os_sync_free(void);
/*==============*/
/*************************************************************
Creates an event semaphore, i.e., a semaphore which may just have two states:
signaled and nonsignaled. The created event is manual reset: it must be reset
explicitly by calling sync_os_reset_event. */
os_event_t
@ -50,10 +86,10 @@ os_event_create(
/* out: the event handle */
char* name); /* in: the name of the event, if NULL
the event is created without a name */
#ifdef __WIN__
/*************************************************************
Creates an auto-reset event semaphore, i.e., an event
which is automatically reset when a single thread is
released. */
Creates an auto-reset event semaphore, i.e., an event which is automatically
reset when a single thread is released. Works only in Windows. */
os_event_t
os_event_create_auto(
@ -61,6 +97,7 @@ os_event_create_auto(
/* out: the event handle */
char* name); /* in: the name of the event, if NULL
the event is created without a name */
#endif
/**************************************************************
Sets an event semaphore to the signaled state: lets waiting threads
proceed. */
@ -85,7 +122,10 @@ os_event_free(
/*==========*/
os_event_t event); /* in: event to free */
/**************************************************************
Waits for an event object until it is in the signaled state. */
Waits for an event object until it is in the signaled state. If
srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS this also exits the
waiting thread when the event becomes signaled (or immediately if the
event is already in the signaled state). */
void
os_event_wait(
@ -93,7 +133,7 @@ os_event_wait(
os_event_t event); /* in: event to wait */
/**************************************************************
Waits for an event object until it is in the signaled state or
a timeout is exceeded. */
a timeout is exceeded. In Unix the timeout is always infinite. */
ulint
os_event_wait_time(
@ -104,8 +144,9 @@ os_event_wait_time(
os_event_t event, /* in: event to wait */
ulint time); /* in: timeout in microseconds, or
OS_SYNC_INFINITE_TIME */
#ifdef __WIN__
/**************************************************************
Waits for any event in an event array. Returns if even a single
Waits for any event in an OS native event array. Returns if even a single
one is signaled or becomes signaled. */
ulint
@ -115,12 +156,13 @@ os_event_wait_multiple(
which was signaled */
ulint n, /* in: number of events in the
array */
os_event_t* event_array); /* in: pointer to an array of event
os_native_event_t* native_event_array);
/* in: pointer to an array of event
handles */
#endif
/*************************************************************
Creates an operating system mutex semaphore.
Because these are slow, the mutex semaphore of the database
itself (sync_mutex_t) should be used where possible. */
Creates an operating system mutex semaphore. Because these are slow, the
mutex semaphore of InnoDB itself (mutex_t) should be used where possible. */
os_mutex_t
os_mutex_create(

View File

@ -44,4 +44,3 @@ os_fast_mutex_trylock(
#endif
#endif
}

View File

@ -41,7 +41,6 @@ typedef os_thread_t os_thread_id_t; /* In Unix we use the thread
the thread */
#endif
/* Define a function pointer type to use in a typecast */
typedef void* (*os_posix_f_t) (void*);
@ -66,7 +65,9 @@ os_thread_pf(
/********************************************************************
Creates a new thread of execution. The execution starts from
the function given. The start function takes a void* parameter
and returns a ulint. */
and returns a ulint.
NOTE: We count the number of threads in os_thread_exit(). A created
thread should always use that to exit and not use return() to exit. */
os_thread_t
os_thread_create(
@ -83,12 +84,13 @@ os_thread_create(
os_thread_id_t* thread_id); /* out: id of the created
thread */
/*********************************************************************
A thread calling this function ends its execution. */
Exits the current thread. */
void
os_thread_exit(
/*===========*/
ulint code); /* in: exit code */
void* exit_value); /* in: exit value; in Windows this void*
is cast as a DWORD */
/*********************************************************************
Returns the thread identifier of current thread. */
@ -144,7 +146,6 @@ ulint
os_thread_get_last_error(void);
/*==========================*/
#ifndef UNIV_NONINL
#include "os0thread.ic"
#endif

View File

@ -35,7 +35,6 @@ row_ins_check_foreign_constraint(
dictionary cache if they exist at all */
dict_table_t* table, /* in: if check_ref is TRUE, then the foreign
table, else the referenced table */
dict_index_t* index, /* in: index in table */
dtuple_t* entry, /* in: index entry for index */
que_thr_t* thr); /* in: query thread */
/*************************************************************************

View File

@ -427,13 +427,21 @@ struct row_prebuilt_struct {
index where the ordering column is
the row id: in this case this flag
is set to TRUE */
dict_index_t* index; /* current index for a search, if any */
dict_index_t* index; /* current index for a search, if
any */
ulint read_just_key; /* set to 1 when MySQL calls
ha_innobase::extra with the
argument HA_EXTRA_KEYREAD; it is enough
to read just columns defined in
the index (i.e., no read of the
clustered index record necessary) */
ibool used_in_HANDLER;/* TRUE if we have been using this
handle in a MySQL HANDLER low level
index cursor command: then we must
store the pcur position even in a
unique search from a clustered index,
because HANDLER allows NEXT and PREV
in such a situation */
ulint template_type; /* ROW_MYSQL_WHOLE_ROW,
ROW_MYSQL_REC_FIELDS,
ROW_MYSQL_DUMMY_TEMPLATE, or

View File

@ -75,6 +75,9 @@ extern ulint srv_lock_wait_timeout;
extern char* srv_file_flush_method_str;
extern ulint srv_unix_file_flush_method;
extern ulint srv_win_file_flush_method;
extern ulint srv_max_dirty_pages_pct;
extern ulint srv_force_recovery;
extern ulint srv_thread_concurrency;
@ -209,6 +212,12 @@ void
srv_init(void);
/*==========*/
/*************************************************************************
Frees the OS fast mutex created in srv_init(). */
void
srv_free(void);
/*==========*/
/*************************************************************************
Initializes the synchronization primitives, memory system, and the thread
local storage. */

View File

@ -86,11 +86,12 @@ extern ibool srv_startup_is_before_trx_rollback_phase;
extern ibool srv_is_being_shut_down;
/* At a shutdown the value first climbs from 0 to SRV_SHUTDOWN_CLEANUP
and then to SRV_SHUTDOWN_LAST_PHASE */
and then to SRV_SHUTDOWN_LAST_PHASE, and so on */
extern ulint srv_shutdown_state;
#define SRV_SHUTDOWN_CLEANUP 1
#define SRV_SHUTDOWN_LAST_PHASE 2
#define SRV_SHUTDOWN_EXIT_THREADS 3
#endif

View File

@ -157,6 +157,15 @@ trx_commit_for_mysql(
/* out: 0 or error number */
trx_t* trx); /* in: trx handle */
/**************************************************************************
If required, flushes the log to disk if we called trx_commit_for_mysql()
with trx->flush_log_later == TRUE. */
ulint
trx_commit_complete_for_mysql(
/*==========================*/
/* out: 0 or error number */
trx_t* trx); /* in: trx handle */
/**************************************************************************
Marks the latest SQL statement ended. */
void
@ -343,6 +352,11 @@ struct trx_struct{
dulint no; /* transaction serialization number ==
max trx id when the transaction is
moved to COMMITTED_IN_MEMORY state */
ibool flush_log_later;/* when we commit the transaction
in MySQL's binlog write, we will
flush the log to disk later in
a separate call */
dulint commit_lsn; /* lsn at the time of the commit */
ibool dict_operation; /* TRUE if the trx is used to create
a table, create an index, or drop a
table */
@ -418,10 +432,6 @@ struct trx_struct{
lock_t* auto_inc_lock; /* possible auto-inc lock reserved by
the transaction; note that it is also
in the lock list trx_locks */
ibool ignore_duplicates_in_insert;
/* in an insert roll back only insert
of the latest row in case
of a duplicate key error */
UT_LIST_NODE_T(trx_t)
trx_list; /* list of transactions */
UT_LIST_NODE_T(trx_t)

View File

@ -100,6 +100,15 @@ memory is read outside the allocated blocks. */
#define YYDEBUG 1
#ifdef HAVE_purify
/* The following sets all new allocated memory to zero before use:
this can be used to eliminate unnecessary Purify warnings, but note that
it also masks many bugs Purify could detect. For detailed Purify analysis it
is best to remove the define below and look through the warnings one
by one. */
#define UNIV_SET_MEM_TO_ZERO
#endif
/*
#define UNIV_SQL_DEBUG
#define UNIV_LOG_DEBUG
@ -178,7 +187,11 @@ management to ensure correct alignment for doubles etc. */
/* Another basic type we use is unsigned long integer which is intended to be
equal to the word size of the machine. */
#ifdef _WIN64
typedef unsigned __int64 ulint;
#else
typedef unsigned long int ulint;
#endif
typedef long int lint;

Some files were not shown because too many files have changed in this diff Show More