Skip to content

Commit 89c3e00

Browse files
Alexey KopytovAlexey Kopytov
authored andcommitted
Manual merge of mysql-trunk into mysql-trunk-merge.
Conflicts: Text conflict in client/mysqlbinlog.cc Text conflict in mysql-test/Makefile.am Text conflict in mysql-test/collections/default.daily Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test Text conflict in mysys/charset.c Text conflict in sql/field.cc Text conflict in sql/field.h Text conflict in sql/item.h Text conflict in sql/item_func.cc Text conflict in sql/log.cc Text conflict in sql/log_event.cc Text conflict in sql/log_event_old.cc Text conflict in sql/mysqld.cc Text conflict in sql/rpl_utility.cc Text conflict in sql/rpl_utility.h Text conflict in sql/set_var.cc Text conflict in sql/share/Makefile.am Text conflict in sql/sql_delete.cc Text conflict in sql/sql_plugin.cc Text conflict in sql/sql_select.cc Text conflict in sql/sql_table.cc Text conflict in storage/example/ha_example.h Text conflict in storage/federated/ha_federated.cc Text conflict in storage/myisammrg/ha_myisammrg.cc Text conflict in storage/myisammrg/myrg_open.c --BZR-- revision-id: [email protected] property-branch-nick: mysql-trunk-merge testament3-sha1: 2a55f11e05fc8b01e210cc30eaecd3f9d726d811
2 parents 75095dd + e17a2ba commit 89c3e00

2,461 files changed

Lines changed: 596345 additions & 232461 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bzrfileids

72.6 KB
Binary file not shown.

.bzrignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ client/rpl_record_old.h
392392
client/rpl_tblmap.h
393393
client/rpl_tblmap.cc
394394
client/rpl_utility.h
395+
client/rpl_utility.cc
395396
client/select_test
396397
client/sql_string.cpp
397398
client/ssl_test
@@ -1143,6 +1144,7 @@ libmysqld/rpl_handler.cc
11431144
libmysqld/rpl_injector.cc
11441145
libmysqld/rpl_record.cc
11451146
libmysqld/rpl_record_old.cc
1147+
libmysqld/rpl_utility.cc
11461148
libmysqld/scheduler.cc
11471149
libmysqld/set_var.cc
11481150
libmysqld/simple-test
@@ -3070,3 +3072,11 @@ libmysqld/rpl_handler.cc
30703072
libmysqld/debug_sync.cc
30713073
libmysqld/rpl_handler.cc
30723074
dbug/tests
3075+
libmysqld/mdl.cc
3076+
client/transaction.h
3077+
libmysqld/transaction.cc
3078+
libmysqld/sys_vars.cc
3079+
libmysqld/keycaches.cc
3080+
client/dtoa.c
3081+
libmysqld/sql_audit.cc
3082+
configure.am

BUILD-CMAKE

Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
How to Build MySQL server with CMake
2+
3+
WHAT YOU NEED
4+
---------------------------------------------------------------
5+
CMake version 2.6 or later installed on your system.
6+
7+
HOW TO INSTALL:
8+
9+
Linux distributions:
10+
shell> sudo apt-get install cmake
11+
12+
The above works on do Debian/Ubuntu based distributions.On others, command
13+
line needs to be modified to e.g "yum install" on Fedora or "zypper install"
14+
on OpenSUSE.
15+
16+
OpenSolaris:
17+
shell> pfexec pkgadd install SUNWcmake
18+
19+
Windows and Mac OSX:
20+
Download and install the latest distribution from
21+
http://www.cmake.org/cmake/resources/software.html.On Windows, download
22+
installer exe file and run it. On Mac, download the .dmg image and open it.
23+
24+
Other Unixes:
25+
Precompiled packages for other Unix flavors (HPUX, AIX) are available from
26+
http://www.cmake.org/cmake/resources/software.html
27+
28+
Alternatively, you can build from source, source package is also available on
29+
CMake download page.
30+
31+
32+
Compiler Tools
33+
--------------
34+
You will need a working compiler and make utility on your OS.
35+
On Windows, install Visual Studio (Express editions will work too).
36+
On Mac OSX, install Xcode tools.
37+
38+
39+
40+
BUILD
41+
---------------------------------------------------------------
42+
Ensure that compiler and cmake are in PATH.
43+
The following description assumes that current working directory
44+
is the source directory.
45+
46+
47+
- Generic build on Unix, using "Unix Makefiles" generator
48+
49+
shell>cmake .
50+
shell>make
51+
52+
Note: by default, cmake build is less verbose than automake build. Use
53+
"make VERBOSE=1" if you want to see add command lines for each compiled source.
54+
55+
- Windows, using "Visual Studio 9 2008" generator
56+
shell>cmake . -G "Visual Studio 9 2008"
57+
shell>devenv MySQL.sln /build /relwithdebinfo
58+
(alternatively, open MySQL.sln and build using the IDE)
59+
60+
- Windows, using "NMake Makefiles" generator
61+
shell>cmake . -G "NMake Makefiles"
62+
shell>nmake
63+
64+
- Mac OSX build with Xcode
65+
shell>cmake . -G Xcode
66+
shell>xcodebuild -configuration Relwithdebinfo
67+
(alternatively, open MySQL.xcodeproj and build using the IDE)
68+
69+
Command line build with CMake 2.8
70+
After creating project with cmake -G as above, issue
71+
cmake . --build
72+
this works with any CMake generator.
73+
74+
For Visual Studio and Xcode you might want to add an extra
75+
configuration parameter, to avoid building all configurations.
76+
77+
cmake . --build --config Relwithdebinfo
78+
79+
80+
Building "out-of-source"
81+
---------------------------------------------------------------
82+
Building out-of-source provides additional benefits. For example it allows to
83+
build both Release and Debug configurations using the single source tree.Or
84+
build the same source with different version of the same compiler or with
85+
different compilers. Also you will prevent polluting the source tree with the
86+
objects and binaries produced during the make.
87+
88+
Here is an example on how to do it (generic Unix), assuming the source tree is
89+
in directory named src and the current working directory is source root.
90+
91+
shell>mkdir ../build # build directory is called build
92+
shell>cd ../build
93+
shell>cmake ../src
94+
95+
Note: if a directory was used for in-source build, out-of-source will
96+
not work. To reenable out-of-source build, remove <source-root>/CMakeCache.txt
97+
file.
98+
99+
100+
CONFIGURATION PARAMETERS
101+
---------------------------------------------------------------
102+
The procedure above will build with default configuration.
103+
104+
Let's you want to change the configuration parameters and have archive
105+
storage engine compiled into the server instead of building it as pluggable
106+
module.
107+
108+
1)You can provide parameters on the command line, like
109+
110+
shell> cmake . -DWITH_ARCHIVE_STORAGE_ENGINE=1
111+
112+
This can be done during the initial configuration or any time later.
113+
114+
Note, that parameters are "sticky", that is they are remebered in the CMake
115+
cache (CMakeCache.txt file in the build directory)
116+
117+
2) Configuration using cmake-gui (Windows, OSX, or Linux with cmake-gui
118+
installed)
119+
120+
From the build directory, issue
121+
shell> cmake-gui .
122+
123+
- Check the WITH_INNOBASE_STORAGE_ENGINE checkbox
124+
- Click on "Configure" button
125+
- Click on "Generate" button
126+
- Close cmake-gui
127+
shell> make
128+
129+
3)Using ccmake (Unix)
130+
ccmake is curses-based GUI application that provides the same functionality
131+
as cmake-gui. It is less user-friendly compared to cmake-gui but works also
132+
on exotic Unixes like HPUX, AIX or Solaris.
133+
134+
Besides storage engines, probably the most important parameter from a
135+
developer's point of view is WITH_DEBUG (this allows to build server with
136+
dbug tracing library and with debug compile flags).
137+
138+
After changing the configuration, recompile using
139+
shell> make
140+
141+
142+
Listing configuration parameters
143+
---------------------------------------------------------------
144+
shell> cmake -L
145+
146+
Gives a brief overview of important configuration parameters (dump to stdout)
147+
148+
shell> cmake -LH
149+
150+
Does the same but also provides a short help text for each parameter.
151+
152+
shell> cmake -LAH
153+
154+
Dumps all config parameters (including advanced) to the stdout.
155+
156+
PACKAGING
157+
---------------------------------------------------------------
158+
-- Binary distribution --
159+
Packaging in form of tar.gz archives (or .zip on Windows) is also supported
160+
To create a tar.gz package,
161+
162+
1)If you're using "generic" Unix build with makefiles
163+
164+
shell> make package
165+
this will create a tar.gz file in the top level build directory.
166+
167+
2)On Windows, using "NMake Makefiles" generator
168+
169+
shell> nmake package
170+
171+
3)On Windows, using "Visual Studio" generator
172+
173+
shell> devenv mysql.sln /build relwithdebinfo /project package
174+
175+
Note On Windows, 7Zip or Winzip must be installed and 7z.exe rsp winzip.exe
176+
need to be in the PATH.
177+
178+
179+
Another way to build packages is calling cpack executable directly like
180+
shell> cpack -G TGZ --config CPackConfig.cmake
181+
(-G TGZ is for tar.gz generator, there is also -GZIP)
182+
183+
-- Source distribution --
184+
"make dist" target is provided.
185+
186+
ADDITIONAL MAKE TARGETS: "make install" AND "make test"
187+
----------------------------------------------------------------
188+
install target also provided for Makefile based generators. Installation
189+
directory can be controlled using configure-time parameter
190+
CMAKE_INSTALL_PREFIX (default is /usr/local. It is also possible to install to
191+
non-configured directory, using
192+
193+
shell> make install DESTDIR="/some/absolute/path"
194+
195+
"make test" runs unit tests (uses CTest for it)
196+
"make test-force" runs mysql-test-run.pl tests with --test-force parameter
197+
198+
FOR PROGRAMMERS: WRITING PLATFORM CHECKS
199+
--------------------------------------------------------------
200+
If you modify MySQL source and want to add a new platform check,please read
201+
http://www.vtk.org/Wiki/CMake_HowToDoPlatformChecks first. In MySQL, most of
202+
the platform tests are implemented in configure.cmake and the template header
203+
file is config.h.cmake
204+
205+
Bigger chunks of functionality, for example non-trivial macros are implemented
206+
in files <src-root>/cmake subdirectory.
207+
208+
For people with autotools background, it is important to remember CMake does
209+
not provide autoheader functionality. That is, when you add a check
210+
211+
CHECK_FUNCTION_EXISTS(foo HAVE_FOO)
212+
to config.cmake, then you will also need to add
213+
#cmakedefine HAVE_FOO 1
214+
to config.h.cmake
215+
216+
Troubleshooting platform checks
217+
--------------------------------
218+
If you suspect that a platform check returned wrong result, examine
219+
<build-root>/CMakeFiles/CMakeError.log and
220+
<build-root>/CMakeFiles/CMakeOutput.log
221+
These files they contain compiler command line, and exact error messages.
222+
223+
Troubleshooting CMake code
224+
----------------------------------
225+
While there are advanced flags for cmake like -debug-trycompile and --trace,
226+
a simple and efficient way to debug to add
227+
MESSAGE("interesting variable=${some_invariable}")
228+
to the interesting places in CMakeLists.txt
229+
230+
231+
Tips:
232+
- When using Makefile generator it is easy to examine which compiler flags are
233+
used to build. For example, compiler flags for mysqld are in
234+
<build-root>/sql/CMakeFiles/mysqld.dir/flags.make and the linker command line
235+
is in <build-root>/sql/CMakeFiles/mysqld.dir/link.txt
236+
237+
- CMake caches results of platform checks in CMakeCache.txt. It is a nice
238+
feature because tests do not rerun when reconfiguring (e.g when a new test was
239+
added).The downside of caching is that when a platform test was wrong and was
240+
later corrected, the cached result is still used. If you encounter this
241+
situation, which should be a rare occation, you need either to remove the
242+
offending entry from CMakeCache.txt (if test was for HAVE_FOO, remove lines
243+
containing HAVE_FOO from CMakeCache.txt) or just remove the cache file.

BUILD/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
EXTRA_DIST = FINISH.sh \
2121
SETUP.sh \
2222
autorun.sh \
23+
choose_configure.sh \
2324
build_mccge.sh \
2425
check-cpu \
2526
cleanup \

BUILD/autorun.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ do
2020
done
2121
IFS="$save_ifs"
2222

23+
rm -rf configure
2324
aclocal || die "Can't execute aclocal"
2425
autoheader || die "Can't execute autoheader"
2526
# --force means overwrite ltmain.sh script if it already exists
@@ -29,3 +30,9 @@ $LIBTOOLIZE --automake --force --copy || die "Can't execute libtoolize"
2930
# and --force to overwrite them if they already exist
3031
automake --add-missing --force --copy || die "Can't execute automake"
3132
autoconf || die "Can't execute autoconf"
33+
# Do not use autotools generated configure directly. Instead, use a script
34+
# that will either call CMake or original configure shell script at build
35+
# time (CMake is preferred if installed).
36+
mv configure configure.am
37+
cp BUILD/choose_configure.sh configure
38+
chmod a+x configure

BUILD/build_mccge.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,11 @@ set_linux_configs()
13031303
compiler_flags="$compiler_flags -m32"
13041304
fi
13051305
if test "x$fast_flag" != "xno" ; then
1306-
compiler_flags="$compiler_flags -O2"
1306+
if test "x$fast_flag" = "xyes" ; then
1307+
compiler_flags="$compiler_flags -O3"
1308+
else
1309+
compiler_flags="$compiler_flags -O2"
1310+
fi
13071311
else
13081312
compiler_flags="$compiler_flags -O0"
13091313
fi

BUILD/choose_configure.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
# Choose whether to use autoconf created configure
3+
# of perl script that calls cmake.
4+
5+
# Ensure cmake and perl are there
6+
cmake -P cmake/check_minimal_version.cmake >/dev/null 2>&1 || HAVE_CMAKE=no
7+
perl --version >/dev/null 2>&1 || HAVE_CMAKE=no
8+
if test "$HAVE_CMAKE" = "no"
9+
then
10+
sh ./configure.am "$@"
11+
else
12+
perl ./cmake/configure.pl "$@"
13+
fi
14+

BUILD/compile-dist

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
#!/bin/sh
2+
3+
# Copyright (C) 2009 Sun Microsystems, Inc
4+
#
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; version 2 of the License.
8+
#
9+
# This program is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
# GNU General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU General Public License
15+
# along with this program; if not, write to the Free Software
16+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17+
218
#
319
# This script's purpose is to update the automake/autoconf helper scripts and
420
# to run a plain "configure" without any special compile flags. Only features
@@ -61,6 +77,7 @@ fi
6177
# Remember that configure restricts the man pages to the configured features !
6278
./configure \
6379
--with-embedded-server \
80+
--with-perfschema \
6481
--with-ndbcluster
6582
$gmake
6683

0 commit comments

Comments
 (0)