Commit 63f48580 authored by pem@mysql.com's avatar pem@mysql.com

Merged 4.1 -> 5.0

parents a1c593f1 0ca7f54b
...@@ -74,6 +74,7 @@ Docs/safe-mysql.xml ...@@ -74,6 +74,7 @@ Docs/safe-mysql.xml
Docs/tex.fmt Docs/tex.fmt
Docs/texi2dvi.out Docs/texi2dvi.out
INSTALL-SOURCE INSTALL-SOURCE
INSTALL-WIN-SOURCE
Logs/* Logs/*
MIRRORS MIRRORS
Makefile Makefile
......
...@@ -9,6 +9,7 @@ acurtis@pcgem.rdg.cyberkinetica.com ...@@ -9,6 +9,7 @@ acurtis@pcgem.rdg.cyberkinetica.com
administrador@light.hegel.local administrador@light.hegel.local
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
akishkin@work.mysql.com akishkin@work.mysql.com
antony@ltantony.rdg.cyberkinetica.homeunix.net
arjen@co3064164-a.bitbike.com arjen@co3064164-a.bitbike.com
arjen@fred.bitbike.com arjen@fred.bitbike.com
arjen@george.bitbike.com arjen@george.bitbike.com
......
...@@ -26,7 +26,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt \ ...@@ -26,7 +26,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt \
all: $(targets) txt_files all: $(targets) txt_files
txt_files: ../INSTALL-SOURCE ../COPYING \ txt_files: ../INSTALL-SOURCE ../COPYING ../INSTALL-WIN-SOURCE \
INSTALL-BINARY ../support-files/MacOSX/ReadMe.txt INSTALL-BINARY ../support-files/MacOSX/ReadMe.txt
CLEAN_FILES: $(BUILD_SOURCES) CLEAN_FILES: $(BUILD_SOURCES)
...@@ -194,6 +194,9 @@ GT = $(srcdir)/Support/generate-text-files.pl ...@@ -194,6 +194,9 @@ GT = $(srcdir)/Support/generate-text-files.pl
../INSTALL-SOURCE: mysql.info $(GT) ../INSTALL-SOURCE: mysql.info $(GT)
perl -w $(GT) mysql.info "Installing" "Tutorial" > $@ perl -w $(GT) mysql.info "Installing" "Tutorial" > $@
../INSTALL-WIN-SOURCE: mysql.info $(GT)
perl -w $(GT) mysql.info "Windows source build" "Post-installation" > $@
# We put the description for the binary installation here so that # We put the description for the binary installation here so that
# people who download source wont have to see it. It is moved up to # people who download source wont have to see it. It is moved up to
# the toplevel by the script that makes the binary tar files. # the toplevel by the script that makes the binary tar files.
......
#########################################################
# #
# 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 known 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
...@@ -340,3 +340,38 @@ inline double ulonglong2double(ulonglong value) ...@@ -340,3 +340,38 @@ inline double ulonglong2double(ulonglong value)
#define default_shared_memory_base_name "MYSQL" #define default_shared_memory_base_name "MYSQL"
#define MYSQL_DEFAULT_CHARSET_NAME "latin1" #define MYSQL_DEFAULT_CHARSET_NAME "latin1"
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci" #define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
/* Define charsets you want */
/* #undef HAVE_CHARSET_armscii8 */
/* #undef HAVE_CHARSET_ascii */
#define HAVE_CHARSET_big5 1
#define HAVE_CHARSET_cp1250 1
/* #undef HAVE_CHARSET_cp1251 */
/* #undef HAVE_CHARSET_cp1256 */
/* #undef HAVE_CHARSET_cp1257 */
/* #undef HAVE_CHARSET_cp850 */
/* #undef HAVE_CHARSET_cp852 */
/* #undef HAVE_CHARSET_cp866 */
/* #undef HAVE_CHARSET_dec8 */
#define HAVE_CHARSET_euckr 1
#define HAVE_CHARSET_gb2312 1
#define HAVE_CHARSET_gbk 1
/* #undef HAVE_CHARSET_greek */
/* #undef HAVE_CHARSET_hebrew */
/* #undef HAVE_CHARSET_hp8 */
/* #undef HAVE_CHARSET_keybcs2 */
/* #undef HAVE_CHARSET_koi8r */
/* #undef HAVE_CHARSET_koi8u */
#define HAVE_CHARSET_latin1 1
#define HAVE_CHARSET_latin2 1
/* #undef HAVE_CHARSET_latin5 */
/* #undef HAVE_CHARSET_latin7 */
/* #undef HAVE_CHARSET_macce */
/* #undef HAVE_CHARSET_macroman */
#define HAVE_CHARSET_sjis 1
/* #undef HAVE_CHARSET_swe7 */
#define HAVE_CHARSET_tis620 1
#define HAVE_CHARSET_ucs2 1
#define HAVE_CHARSET_ujis 1
#define HAVE_CHARSET_utf8 1
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
extern "C" { extern "C" {
#endif #endif
#define FT_QUERY_MAXLEN 1024 #define HA_FT_MAXBYTELEN 254
#define HA_FT_MAXLEN 254 #define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/3)
typedef struct st_ft_info FT_INFO; typedef struct st_ft_info FT_INFO;
struct _ft_vft struct _ft_vft
......
...@@ -301,37 +301,38 @@ ...@@ -301,37 +301,38 @@
#define ER_BAD_FT_COLUMN 1282 #define ER_BAD_FT_COLUMN 1282
#define ER_UNKNOWN_KEY_CACHE 1283 #define ER_UNKNOWN_KEY_CACHE 1283
#define ER_WARN_HOSTNAME_WONT_WORK 1284 #define ER_WARN_HOSTNAME_WONT_WORK 1284
#define ER_SP_NO_RECURSIVE_CREATE 1285 #define ER_UNKNOWN_TABLE_ENGINE 1285
#define ER_SP_ALREADY_EXISTS 1286 #define ER_SP_NO_RECURSIVE_CREATE 1286
#define ER_SP_DOES_NOT_EXIST 1287 #define ER_SP_ALREADY_EXISTS 1287
#define ER_SP_DROP_FAILED 1288 #define ER_SP_DOES_NOT_EXIST 1288
#define ER_SP_STORE_FAILED 1289 #define ER_SP_DROP_FAILED 1289
#define ER_SP_LILABEL_MISMATCH 1290 #define ER_SP_STORE_FAILED 1290
#define ER_SP_LABEL_REDEFINE 1291 #define ER_SP_LILABEL_MISMATCH 1291
#define ER_SP_LABEL_MISMATCH 1292 #define ER_SP_LABEL_REDEFINE 1292
#define ER_SP_UNINIT_VAR 1293 #define ER_SP_LABEL_MISMATCH 1293
#define ER_SP_BADSELECT 1294 #define ER_SP_UNINIT_VAR 1294
#define ER_SP_BADRETURN 1295 #define ER_SP_BADSELECT 1295
#define ER_SP_BADSTATEMENT 1296 #define ER_SP_BADRETURN 1296
#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1297 #define ER_SP_BADSTATEMENT 1297
#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1298 #define ER_UPDATE_LOG_DEPRECATED_IGNORED 1298
#define ER_QUERY_INTERRUPTED 1299 #define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1299
#define ER_SP_WRONG_NO_OF_ARGS 1300 #define ER_QUERY_INTERRUPTED 1300
#define ER_SP_COND_MISMATCH 1301 #define ER_SP_WRONG_NO_OF_ARGS 1301
#define ER_SP_NORETURN 1302 #define ER_SP_COND_MISMATCH 1302
#define ER_SP_NORETURNEND 1303 #define ER_SP_NORETURN 1303
#define ER_SP_BAD_CURSOR_QUERY 1304 #define ER_SP_NORETURNEND 1304
#define ER_SP_BAD_CURSOR_SELECT 1305 #define ER_SP_BAD_CURSOR_QUERY 1305
#define ER_SP_CURSOR_MISMATCH 1306 #define ER_SP_BAD_CURSOR_SELECT 1306
#define ER_SP_CURSOR_ALREADY_OPEN 1307 #define ER_SP_CURSOR_MISMATCH 1307
#define ER_SP_CURSOR_NOT_OPEN 1308 #define ER_SP_CURSOR_ALREADY_OPEN 1308
#define ER_SP_UNDECLARED_VAR 1309 #define ER_SP_CURSOR_NOT_OPEN 1309
#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1310 #define ER_SP_UNDECLARED_VAR 1310
#define ER_SP_FETCH_NO_DATA 1311 #define ER_SP_WRONG_NO_OF_FETCH_ARGS 1311
#define ER_SP_DUP_PARAM 1312 #define ER_SP_FETCH_NO_DATA 1312
#define ER_SP_DUP_VAR 1313 #define ER_SP_DUP_PARAM 1313
#define ER_SP_DUP_COND 1314 #define ER_SP_DUP_VAR 1314
#define ER_SP_DUP_CURS 1315 #define ER_SP_DUP_COND 1315
#define ER_SP_CANT_ALTER 1316 #define ER_SP_DUP_CURS 1316
#define ER_SP_SUBSELECT_NYI 1317 #define ER_SP_CANT_ALTER 1317
#define ER_ERROR_MESSAGES 318 #define ER_SP_SUBSELECT_NYI 1318
#define ER_ERROR_MESSAGES 319
...@@ -161,6 +161,7 @@ ER_WARN_DATA_OUT_OF_RANGE, "01000", "", ...@@ -161,6 +161,7 @@ ER_WARN_DATA_OUT_OF_RANGE, "01000", "",
ER_WARN_DATA_TRUNCATED, "01000", "", ER_WARN_DATA_TRUNCATED, "01000", "",
ER_WRONG_NAME_FOR_INDEX, "42000", "", ER_WRONG_NAME_FOR_INDEX, "42000", "",
ER_WRONG_NAME_FOR_CATALOG, "42000", "", ER_WRONG_NAME_FOR_CATALOG, "42000", "",
ER_UNKNOWN_TABLE_ENGINE, "42000", "",
/* 5.0 */ /* 5.0 */
ER_SP_NO_RECURSIVE_CREATE, "2F003", "", ER_SP_NO_RECURSIVE_CREATE, "2F003", "",
ER_SP_ALREADY_EXISTS, "42000", "", ER_SP_ALREADY_EXISTS, "42000", "",
......
...@@ -29,7 +29,7 @@ static my_bool verbose; ...@@ -29,7 +29,7 @@ static my_bool verbose;
static char *query=NULL; static char *query=NULL;
static uint lengths[256]; static uint lengths[256];
#define MAX_LEN (HA_FT_MAXLEN+10) #define MAX_LEN (HA_FT_MAXBYTELEN+10)
#define HOW_OFTEN_TO_WRITE 10000 #define HOW_OFTEN_TO_WRITE 10000
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "ftdefs.h" #include "ftdefs.h"
ulong ft_min_word_len=4; ulong ft_min_word_len=4;
ulong ft_max_word_len=HA_FT_MAXLEN; ulong ft_max_word_len=HA_FT_MAXCHARLEN;
ulong ft_query_expansion_limit=5; ulong ft_query_expansion_limit=5;
const char *ft_boolean_syntax="+ -><()~*:\"\"&|"; const char *ft_boolean_syntax="+ -><()~*:\"\"&|";
...@@ -29,7 +29,7 @@ const HA_KEYSEG ft_keysegs[FT_SEGS]={ ...@@ -29,7 +29,7 @@ const HA_KEYSEG ft_keysegs[FT_SEGS]={
63, /* language (will be overwritten) */ 63, /* language (will be overwritten) */
0, 0, 0, /* null_bit, bit_start, bit_end */ 0, 0, 0, /* null_bit, bit_start, bit_end */
HA_VAR_LENGTH | HA_PACK_KEY, /* flag */ HA_VAR_LENGTH | HA_PACK_KEY, /* flag */
HA_FT_MAXLEN, /* length */ HA_FT_MAXBYTELEN, /* length */
HA_FT_WLEN, /* start */ HA_FT_WLEN, /* start */
0, /* null_pos */ 0, /* null_pos */
NULL /* charset */ NULL /* charset */
......
...@@ -279,7 +279,7 @@ int _mi_ft_del(MI_INFO *info, uint keynr, byte *keybuf, const byte *record, ...@@ -279,7 +279,7 @@ int _mi_ft_del(MI_INFO *info, uint keynr, byte *keybuf, const byte *record,
uint _ft_make_key(MI_INFO *info, uint keynr, byte *keybuf, FT_WORD *wptr, uint _ft_make_key(MI_INFO *info, uint keynr, byte *keybuf, FT_WORD *wptr,
my_off_t filepos) my_off_t filepos)
{ {
byte buf[HA_FT_MAXLEN+16]; byte buf[HA_FT_MAXBYTELEN+16];
DBUG_ENTER("_ft_make_key"); DBUG_ENTER("_ft_make_key");
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT #if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
......
...@@ -1979,7 +1979,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, ...@@ -1979,7 +1979,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
sort_param.key_read=sort_ft_key_read; sort_param.key_read=sort_ft_key_read;
sort_param.key_write=sort_ft_key_write; sort_param.key_write=sort_ft_key_write;
sort_param.key_length+=FT_MAX_WORD_LEN_FOR_SORT-HA_FT_MAXLEN; sort_param.key_length+=FT_MAX_WORD_LEN_FOR_SORT-HA_FT_MAXBYTELEN;
} }
else else
{ {
...@@ -2375,7 +2375,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, ...@@ -2375,7 +2375,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
total_key_length+=sort_param[i].key_length; total_key_length+=sort_param[i].key_length;
if (sort_param[i].keyinfo->flag & HA_FULLTEXT) if (sort_param[i].keyinfo->flag & HA_FULLTEXT)
sort_param[i].key_length+=FT_MAX_WORD_LEN_FOR_SORT-ft_max_word_len; sort_param[i].key_length+=FT_MAX_WORD_LEN_FOR_SORT-HA_FT_MAXBYTELEN;
} }
sort_info.total_keys=i; sort_info.total_keys=i;
sort_param[0].master= 1; sort_param[0].master= 1;
...@@ -3913,7 +3913,7 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows) ...@@ -3913,7 +3913,7 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows)
{ {
uint key_maxlength=key->maxlength; uint key_maxlength=key->maxlength;
if (key->flag & HA_FULLTEXT) if (key->flag & HA_FULLTEXT)
key_maxlength+=FT_MAX_WORD_LEN_FOR_SORT-HA_FT_MAXLEN; key_maxlength+=FT_MAX_WORD_LEN_FOR_SORT-HA_FT_MAXBYTELEN;
return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) &&
((ulonglong) rows * key_maxlength > ((ulonglong) rows * key_maxlength >
(ulonglong) myisam_max_temp_length)); (ulonglong) myisam_max_temp_length));
......
...@@ -289,9 +289,9 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, ...@@ -289,9 +289,9 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
} }
fulltext_keys++; fulltext_keys++;
key_length+= HA_FT_MAXLEN+HA_FT_WLEN; key_length+= HA_FT_MAXBYTELEN+HA_FT_WLEN;
length++; /* At least one length byte */ length++; /* At least one length byte */
min_key_length_skipp+=HA_FT_MAXLEN; min_key_length_skipp+=HA_FT_MAXBYTELEN;
} }
else else
{ {
......
...@@ -322,11 +322,11 @@ static struct my_option my_long_options[] = ...@@ -322,11 +322,11 @@ static struct my_option my_long_options[] =
{ "decode_bits", OPT_DECODE_BITS, "", (gptr*) &decode_bits, { "decode_bits", OPT_DECODE_BITS, "", (gptr*) &decode_bits,
(gptr*) &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0}, (gptr*) &decode_bits, 0, GET_UINT, REQUIRED_ARG, 9L, 4L, 17L, 0L, 1L, 0},
{ "ft_min_word_len", OPT_FT_MIN_WORD_LEN, "", (gptr*) &ft_min_word_len, { "ft_min_word_len", OPT_FT_MIN_WORD_LEN, "", (gptr*) &ft_min_word_len,
(gptr*) &ft_min_word_len, 0, GET_ULONG, REQUIRED_ARG, 4, 1, HA_FT_MAXLEN, (gptr*) &ft_min_word_len, 0, GET_ULONG, REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN,
0, 1, 0}, 0, 1, 0},
{ "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "", (gptr*) &ft_max_word_len, { "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "", (gptr*) &ft_max_word_len,
(gptr*) &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXLEN, 10, (gptr*) &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXCHARLEN, 10,
HA_FT_MAXLEN, 0, 1, 0}, HA_FT_MAXCHARLEN, 0, 1, 0},
{ 0, 0, 0, 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}
}; };
......
...@@ -156,7 +156,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, ...@@ -156,7 +156,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
while ((maxbuffer= (int) (records/(keys-1)+1)) != skr); while ((maxbuffer= (int) (records/(keys-1)+1)) != skr);
if ((sort_keys=(uchar **)my_malloc(keys*(sort_length+sizeof(char*))+ if ((sort_keys=(uchar **)my_malloc(keys*(sort_length+sizeof(char*))+
HA_FT_MAXLEN, MYF(0)))) HA_FT_MAXBYTELEN, MYF(0))))
{ {
if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer,
maxbuffer/2)) maxbuffer/2))
...@@ -365,7 +365,7 @@ pthread_handler_decl(thr_find_all_keys,arg) ...@@ -365,7 +365,7 @@ pthread_handler_decl(thr_find_all_keys,arg)
} }
if ((sort_keys=(uchar **)my_malloc(keys*(sort_length+sizeof(char*))+ if ((sort_keys=(uchar **)my_malloc(keys*(sort_length+sizeof(char*))+
((info->keyinfo->flag & HA_FULLTEXT) ? ((info->keyinfo->flag & HA_FULLTEXT) ?
HA_FT_MAXLEN : 0), MYF(0)))) HA_FT_MAXBYTELEN : 0), MYF(0))))
{ {
if (my_init_dynamic_array(&info->buffpek, sizeof(BUFFPEK), if (my_init_dynamic_array(&info->buffpek, sizeof(BUFFPEK),
maxbuffer, maxbuffer/2)) maxbuffer, maxbuffer/2))
......
...@@ -201,17 +201,16 @@ t1 CREATE TABLE `t1` ( ...@@ -201,17 +201,16 @@ t1 CREATE TABLE `t1` (
) TYPE=HEAP DEFAULT CHARSET=latin1 ) TYPE=HEAP DEFAULT CHARSET=latin1
drop table t1; drop table t1;
SET SESSION table_type="gemini"; SET SESSION table_type="gemini";
ERROR 42000: Unknown table engine 'gemini'
SELECT @@table_type; SELECT @@table_type;
@@table_type @@table_type
GEMINI HEAP
CREATE TABLE t1 (a int not null); CREATE TABLE t1 (a int not null);
Warnings:
Warning 1265 Using storage engine MYISAM for table 't1'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0' `a` int(11) NOT NULL default '0'
) TYPE=MyISAM DEFAULT CHARSET=latin1 ) TYPE=HEAP DEFAULT CHARSET=latin1
SET SESSION table_type=default; SET SESSION table_type=default;
drop table t1; drop table t1;
create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2)); create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));
...@@ -347,17 +346,16 @@ t1 CREATE TABLE `t1` ( ...@@ -347,17 +346,16 @@ t1 CREATE TABLE `t1` (
) TYPE=HEAP DEFAULT CHARSET=latin1 ) TYPE=HEAP DEFAULT CHARSET=latin1
drop table t1; drop table t1;
SET SESSION table_type="gemini"; SET SESSION table_type="gemini";
ERROR 42000: Unknown table engine 'gemini'
SELECT @@table_type; SELECT @@table_type;
@@table_type @@table_type
GEMINI HEAP
CREATE TABLE t1 (a int not null); CREATE TABLE t1 (a int not null);
Warnings:
Warning 1265 Using storage engine MYISAM for table 't1'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0' `a` int(11) NOT NULL default '0'
) TYPE=MyISAM DEFAULT CHARSET=latin1 ) TYPE=HEAP DEFAULT CHARSET=latin1
SET SESSION table_type=default; SET SESSION table_type=default;
drop table t1; drop table t1;
create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob); create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob);
......
...@@ -2,6 +2,6 @@ show variables like "ft\_%"; ...@@ -2,6 +2,6 @@ show variables like "ft\_%";
Variable_name Value Variable_name Value
ft_boolean_syntax + -><()~*:""&| ft_boolean_syntax + -><()~*:""&|
ft_min_word_len 4 ft_min_word_len 4
ft_max_word_len 254 ft_max_word_len 84
ft_query_expansion_limit 20 ft_query_expansion_limit 20
ft_stopword_file (built-in) ft_stopword_file (built-in)
...@@ -143,7 +143,7 @@ Variable_name Value ...@@ -143,7 +143,7 @@ Variable_name Value
table_type HEAP table_type HEAP
show global variables like 'table_type'; show global variables like 'table_type';
Variable_name Value Variable_name Value
table_type INNODB table_type InnoDB
set GLOBAL query_cache_size=100000; set GLOBAL query_cache_size=100000;
set GLOBAL myisam_max_sort_file_size=2000000; set GLOBAL myisam_max_sort_file_size=2000000;
show global variables like 'myisam_max_sort_file_size'; show global variables like 'myisam_max_sort_file_size';
...@@ -241,7 +241,7 @@ ERROR HY000: Unknown system variable 'unknown_variable' ...@@ -241,7 +241,7 @@ ERROR HY000: Unknown system variable 'unknown_variable'
set max_join_size="hello"; set max_join_size="hello";
ERROR 42000: Wrong argument type to variable 'max_join_size' ERROR 42000: Wrong argument type to variable 'max_join_size'
set table_type=UNKNOWN_TABLE_TYPE; set table_type=UNKNOWN_TABLE_TYPE;
ERROR 42000: Variable 'table_type' can't be set to the value of 'UNKNOWN_TABLE_TYPE' ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE'
set table_type=INNODB, big_tables=2; set table_type=INNODB, big_tables=2;
ERROR 42000: Variable 'big_tables' can't be set to the value of '2' ERROR 42000: Variable 'big_tables' can't be set to the value of '2'
show local variables like 'table_type'; show local variables like 'table_type';
......
...@@ -121,8 +121,8 @@ select @@warning_count; ...@@ -121,8 +121,8 @@ select @@warning_count;
drop table t1; drop table t1;
create table t1 (id int) type=isam; create table t1 (id int) type=isam;
Warnings: Warnings:
Warning 1265 Using storage engine MYISAM for table 't1' Warning 1265 Using storage engine MyISAM for table 't1'
alter table t1 type=isam; alter table t1 type=isam;
Warnings: Warnings:
Warning 1265 Using storage engine MYISAM for table 't1' Warning 1265 Using storage engine MyISAM for table 't1'
drop table t1; drop table t1;
...@@ -157,7 +157,7 @@ SELECT @@table_type; ...@@ -157,7 +157,7 @@ SELECT @@table_type;
CREATE TABLE t1 (a int not null); CREATE TABLE t1 (a int not null);
show create table t1; show create table t1;
drop table t1; drop table t1;
# Test what happens when using a non existing table type --error 1285
SET SESSION table_type="gemini"; SET SESSION table_type="gemini";
SELECT @@table_type; SELECT @@table_type;
CREATE TABLE t1 (a int not null); CREATE TABLE t1 (a int not null);
...@@ -277,7 +277,7 @@ SELECT @@table_type; ...@@ -277,7 +277,7 @@ SELECT @@table_type;
CREATE TABLE t1 (a int not null); CREATE TABLE t1 (a int not null);
show create table t1; show create table t1;
drop table t1; drop table t1;
# Test what happens when using a non existing table type --error 1285
SET SESSION table_type="gemini"; SET SESSION table_type="gemini";
SELECT @@table_type; SELECT @@table_type;
CREATE TABLE t1 (a int not null); CREATE TABLE t1 (a int not null);
......
...@@ -136,7 +136,7 @@ set big_tables="OFFF"; ...@@ -136,7 +136,7 @@ set big_tables="OFFF";
set unknown_variable=1; set unknown_variable=1;
--error 1232 --error 1232
set max_join_size="hello"; set max_join_size="hello";
--error 1231 --error 1285
set table_type=UNKNOWN_TABLE_TYPE; set table_type=UNKNOWN_TABLE_TYPE;
--error 1231 --error 1231
set table_type=INNODB, big_tables=2; set table_type=INNODB, big_tables=2;
......
The MySQL Benchmarks The MySQL Benchmarks
These tests needs a MySQL version of at least 3.20.28 or 3.21.10. These tests require a MySQL version of at least 3.20.28 or 3.21.10.
NOTE: With MySQL 3.20.# you have to use '--skip-in', because MySQL 3.20
doesn't support the IN operator.
Currently the following servers are supported: Currently the following servers are supported:
MySQL 3.20 and 3.21, PostgreSQL 6.#, mSQL 2.# and Solid Server 2.2 MySQL 3.20 and 3.21, PostgreSQL 6.#, mSQL 2.# and Solid Server 2.2
In this directory are the queries and raw data files used to populate The benchmark directory contains the query files and raw data files used to
the MySQL benchmarks. In order to run the benchmarks you should normally populate the MySQL benchmark tables. In order to run the benchmarks, you
execute a command like the following: should normally execute a command such as the following:
run-all-tests --server=mysql --cmp=mysql,pg,solid --user=test --password=test --log run-all-tests --server=mysql --cmp=mysql,pg,solid --user=test --password=test --log
The above means that one wants to run the benchmark with MySQL. The limits This means that you want to run the benchmarks with MySQL. The
should be taken from all of mysql,PostgreSQL and Solid. Login name and limits should be taken from all of MySQL, PostgreSQL, and Solid.
password is 'test'. The result should be saved as a RUN file in the output The login name and password for connecting to the server both are
``test''. The result should be saved as a RUN file in the output
directory. directory.
When the above script has run you will have the individual results and the When run-all-tests has finished, will have the individual results and the
the total RUN- file in the output directory. the total RUN- file in the output directory.
If you want to look at some old results, try: If you want to look at some old results, use the compare-results script.
For example:
compare-results --dir=Results --cmp=mysql,pg,solid compare-results --dir=Results --cmp=mysql,pg,solid
compare-results --dir=Results --cmp=mysql,pg,solid --relative compare-results --dir=Results --cmp=mysql,pg,solid --relative
...@@ -29,8 +29,9 @@ compare-results --dir=Results --cmp=mysql,pg,solid --relative ...@@ -29,8 +29,9 @@ compare-results --dir=Results --cmp=mysql,pg,solid --relative
compare-results --dir=Results --cmp=msql,mysql,pg,solid compare-results --dir=Results --cmp=msql,mysql,pg,solid
compare-results --dir=Results --cmp=msql,mysql,pg,solid --relative compare-results --dir=Results --cmp=msql,mysql,pg,solid --relative
compare-results --dir=results --server=mysql --same-server --cmp=mysql,pg,solid compare-results --dir=Results --server=mysql --same-server --cmp=mysql,pg,solid
Some of the files in the benchmark directory are:
File Description File Description
...@@ -38,24 +39,21 @@ Data/ATIS Contains data for 29 related tables used in the ATIS tests. ...@@ -38,24 +39,21 @@ Data/ATIS Contains data for 29 related tables used in the ATIS tests.
Data/Wisconsin Contains data for the Wisconsin benchmark. Data/Wisconsin Contains data for the Wisconsin benchmark.
Results Contains old benchmark results. Results Contains old benchmark results.
Makefile.am Automake Makefile Makefile.am Automake Makefile
Overview-paper A paper nicked from the net about database bench-
marking.
README This file. README This file.
test-ATIS.sh Cretation of 29 tables and a lot of selects on them. test-ATIS.sh Creation of 29 tables and a lot of selects on them.
test-connect.sh Test how fast a connection to the server is. test-connect.sh Test how fast a connection to the server is.
test-create.sh Test how fast a table is created. test-create.sh Test how fast a table is created.
test-insert.sh Test create and fill of a table. test-insert.sh Test create and fill of a table.
test-wisconsin.sh This is a port of the PostgreSQL version of this test-wisconsin.sh A port of the PostgreSQL version of this benchmark.
benchmark. run-all-tests Use this to run all tests. When all tests are run,
run-all-test Use this to run all tests. When all test are run, use the --log and --use-old options to get a RUN-file.
use the --log --use-old option to get a RUN-file. compare-results Generates a comparison table from different RUN files.
compare-results Makes a compare table from different RUN files. server-cfg Contains the limits and functions for all supported
server-cfg Contains the limit and functions for all supported
SQL servers. If you want to add a new server, this SQL servers. If you want to add a new server, this
should be the only file that neads to be changed. should be the only file that neads to be changed.
Most of the test should use portable SQL to make it possible to Most of the tests should use portable SQL to make it possible to
compare different databases. Sometimes SQL extensions can make things compare different databases. Sometimes SQL extensions can make things
a lot faster. In this case the test may use the extensions if the --fast a lot faster. In this case the test may use the extensions if the --fast
option is used. option is used.
...@@ -65,12 +63,10 @@ Useful options to all test-scripts (and run-all-tests): ...@@ -65,12 +63,10 @@ Useful options to all test-scripts (and run-all-tests):
--host=# Hostname for MySQL server (default: localhost) --host=# Hostname for MySQL server (default: localhost)
--db=# Database to use (default: test) --db=# Database to use (default: test)
--fast Allow use of any non-standard SQL extension to --fast Allow use of any non-standard SQL extension to
do the get things done faster. get things done faster.
--skip-in Don't do test with the IN operation (if the SQL server
hasn't implemented this, for example mSQL and MySQL 3.20).
--lock-tables Use table locking to get more speed. --lock-tables Use table locking to get more speed.
From a text at http://www.mgt.ncu.edu.tw/CSIM/Paper/sixth/11.html From a text at http://www.mgt.ncu.edu.tw/CSIM/Paper/sixth/11.html:
The Wisconsin Benchmark The Wisconsin Benchmark
...@@ -81,13 +77,13 @@ systematically measure and compare the performance of relational ...@@ -81,13 +77,13 @@ systematically measure and compare the performance of relational
database systems with database machines. The benchmark is a database systems with database machines. The benchmark is a
single-user and single-factor experiment using a synthetic database single-user and single-factor experiment using a synthetic database
and a controlled workload. It measures the query optimization and a controlled workload. It measures the query optimization
performance of database systems with 32 query types to exe cise the performance of database systems with 32 query types to exercise the
components of the proposed systems. The query suites include components of the proposed systems. The query suites include
selection, join, projection, aggregate, and simple update queries. selection, join, projection, aggregate, and simple update queries.
The test database consists of four generic relations. The tenk The test database consists of four generic relations. The tenk
relation is the key table and most used. Two data types of small relation is the key table and most used. Two data types of small
integer number and character string are utilized. Data values are integer numbers and character strings are utilized. Data values are
uniformly distributed. The primary metric is the query elapsed uniformly distributed. The primary metric is the query elapsed
time. The main criticisms of the benchmark include the nature of time. The main criticisms of the benchmark include the nature of
single-user workload, the simplistic database structure, and the single-user workload, the simplistic database structure, and the
......
...@@ -50,14 +50,33 @@ ulong ha_read_count, ha_write_count, ha_delete_count, ha_update_count, ...@@ -50,14 +50,33 @@ ulong ha_read_count, ha_write_count, ha_delete_count, ha_update_count,
ha_commit_count, ha_rollback_count, ha_commit_count, ha_rollback_count,
ha_read_rnd_count, ha_read_rnd_next_count; ha_read_rnd_count, ha_read_rnd_next_count;
const char *ha_table_type[] = { static SHOW_COMP_OPTION have_yes= SHOW_OPTION_YES;
"", "DIAB_ISAM","HASH","MISAM","PISAM","RMS_ISAM","HEAP", "ISAM",
"MRG_ISAM","MYISAM", "MRG_MYISAM", "BDB", "INNODB", "GEMINI", "?", "?",NullS
};
TYPELIB ha_table_typelib= struct show_table_type_st sys_table_types[]=
{ {
array_elements(ha_table_type)-3, "", ha_table_type {"MyISAM", &have_yes,
"Default type from 3.23 with great performance", DB_TYPE_MYISAM},
{"HEAP", &have_yes,
"Hash based, stored in memory, useful for temporary tables", DB_TYPE_HEAP},
{"MEMORY", &have_yes,
"Alias for HEAP", DB_TYPE_HEAP},
{"MERGE", &have_yes,
"Collection of identical MyISAM tables", DB_TYPE_MRG_MYISAM},
{"MRG_MYISAM",&have_yes,
"Alias for MERGE", DB_TYPE_MRG_MYISAM},
{"ISAM", &have_isam,
"Obsolete table type; Is replaced by MyISAM", DB_TYPE_ISAM},
{"MRG_ISAM", &have_isam,
"Obsolete table type; Is replaced by MRG_MYISAM", DB_TYPE_MRG_ISAM},
{"InnoDB", &have_innodb,
"Supports transactions, row-level locking and foreign keys", DB_TYPE_INNODB},
{"INNOBASE", &have_innodb,
"Alias for INNODB", DB_TYPE_INNODB},
{"BDB", &have_berkeley_db,
"Supports transactions and page-level locking", DB_TYPE_BERKELEY_DB},
{"BERKELEYDB",&have_berkeley_db,
"Alias for BDB", DB_TYPE_BERKELEY_DB},
{NullS, NULL, NullS, DB_TYPE_UNKNOWN}
}; };
const char *ha_row_type[] = { const char *ha_row_type[] = {
...@@ -70,35 +89,31 @@ const char *tx_isolation_names[] = ...@@ -70,35 +89,31 @@ const char *tx_isolation_names[] =
TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"", TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"",
tx_isolation_names}; tx_isolation_names};
enum db_type ha_resolve_by_name(char *name, uint namelen) enum db_type ha_resolve_by_name(const char *name, uint namelen)
{ {
enum db_type result = DB_TYPE_UNKNOWN;
if (!my_strcasecmp(&my_charset_latin1, name, "HEAP") ||
!my_strcasecmp(&my_charset_latin1, name, "MEMORY")) {
result = DB_TYPE_HEAP;
} else
if (!my_strcasecmp(&my_charset_latin1, name, "MRG_MYISAM") ||
!my_strcasecmp(&my_charset_latin1, name, "MERGE")) {
result = DB_TYPE_MRG_MYISAM;
} else
if (!my_strcasecmp(&my_charset_latin1, name, "MYISAM")) {
result = DB_TYPE_MYISAM;
} else
if (!my_strcasecmp(&my_charset_latin1, name, "BDB") ||
!my_strcasecmp(&my_charset_latin1, name, "BERKELEYDB")) {
result = DB_TYPE_BERKELEY_DB;
} else
if (!my_strcasecmp(&my_charset_latin1, name, "INNODB") ||
!my_strcasecmp(&my_charset_latin1, name, "INNOBASE")) {
result = DB_TYPE_INNODB;
} else
if (!my_strcasecmp(&my_charset_latin1, name, "ISAM")) {
result = DB_TYPE_ISAM;
} else
if (!my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) { if (!my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) {
result = (enum db_type) current_thd->variables.table_type; return(enum db_type) current_thd->variables.table_type;
} }
return result;
show_table_type_st *types;
for (types= sys_table_types; types->type; types++)
{
if (!my_strcasecmp(&my_charset_latin1, name, types->type))
return(enum db_type)types->db_type;
}
return DB_TYPE_UNKNOWN;
}
const char *ha_get_table_type(enum db_type db_type)
{
show_table_type_st *types;
for (types= sys_table_types; types->type; types++)
{
if (db_type == types->db_type)
return types->type;
}
return "none";
} }
/* Use other database handler if databasehandler is not incompiled */ /* Use other database handler if databasehandler is not incompiled */
...@@ -136,12 +151,13 @@ enum db_type ha_checktype(enum db_type database_type) ...@@ -136,12 +151,13 @@ enum db_type ha_checktype(enum db_type database_type)
default: default:
break; break;
} }
/* Use this as default */
#if 0 return
return((enum db_type) current_thd->variables.table_type); DB_TYPE_UNKNOWN != (enum db_type) current_thd->variables.table_type ?
#else (enum db_type) current_thd->variables.table_type :
return(DB_TYPE_MYISAM); DB_TYPE_UNKNOWN != (enum db_type) global_system_variables.table_type ?
#endif (enum db_type) global_system_variables.table_type :
DB_TYPE_MYISAM;
} /* ha_checktype */ } /* ha_checktype */
......
...@@ -131,6 +131,13 @@ enum db_type { DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1, ...@@ -131,6 +131,13 @@ enum db_type { DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1,
DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB, DB_TYPE_GEMINI, DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB, DB_TYPE_GEMINI,
DB_TYPE_DEFAULT }; DB_TYPE_DEFAULT };
struct show_table_type_st {
const char *type;
SHOW_COMP_OPTION *value;
const char *comment;
enum db_type db_type;
};
enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED, enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED}; ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED};
...@@ -372,8 +379,9 @@ public: ...@@ -372,8 +379,9 @@ public:
/* Some extern variables used with handlers */ /* Some extern variables used with handlers */
extern struct show_table_type_st sys_table_types[];
extern const char *ha_row_type[]; extern const char *ha_row_type[];
extern TYPELIB ha_table_typelib, tx_isolation_typelib; extern TYPELIB tx_isolation_typelib;
/* Wrapper functions */ /* Wrapper functions */
#define ha_commit_stmt(thd) (ha_commit_trans((thd), &((thd)->transaction.stmt))) #define ha_commit_stmt(thd) (ha_commit_trans((thd), &((thd)->transaction.stmt)))
...@@ -383,7 +391,8 @@ extern TYPELIB ha_table_typelib, tx_isolation_typelib; ...@@ -383,7 +391,8 @@ extern TYPELIB ha_table_typelib, tx_isolation_typelib;
#define ha_supports_generate(T) (T != DB_TYPE_INNODB) #define ha_supports_generate(T) (T != DB_TYPE_INNODB)
enum db_type ha_resolve_by_name(char *name, uint namelen); enum db_type ha_resolve_by_name(const char *name, uint namelen);
const char *ha_get_table_type(enum db_type db_type);
handler *get_new_handler(TABLE *table, enum db_type db_type); handler *get_new_handler(TABLE *table, enum db_type db_type);
my_off_t ha_get_ptr(byte *ptr, uint pack_length); my_off_t ha_get_ptr(byte *ptr, uint pack_length);
void ha_store_ptr(byte *buff, uint pack_length, my_off_t pos); void ha_store_ptr(byte *buff, uint pack_length, my_off_t pos);
......
...@@ -860,7 +860,6 @@ extern MY_BITMAP temp_pool; ...@@ -860,7 +860,6 @@ extern MY_BITMAP temp_pool;
extern String my_empty_string; extern String my_empty_string;
extern String my_null_string; extern String my_null_string;
extern SHOW_VAR init_vars[],status_vars[], internal_vars[]; extern SHOW_VAR init_vars[],status_vars[], internal_vars[];
extern struct show_table_type_st table_type_vars[];
extern SHOW_COMP_OPTION have_isam; extern SHOW_COMP_OPTION have_isam;
extern SHOW_COMP_OPTION have_innodb; extern SHOW_COMP_OPTION have_innodb;
extern SHOW_COMP_OPTION have_berkeley_db; extern SHOW_COMP_OPTION have_berkeley_db;
......
...@@ -3650,7 +3650,7 @@ enum options_mysqld ...@@ -3650,7 +3650,7 @@ enum options_mysqld
OPT_MAX_SEEKS_FOR_KEY, OPT_MAX_TMP_TABLES, OPT_MAX_USER_CONNECTIONS, OPT_MAX_SEEKS_FOR_KEY, OPT_MAX_TMP_TABLES, OPT_MAX_USER_CONNECTIONS,
OPT_MAX_LENGTH_FOR_SORT_DATA, OPT_MAX_LENGTH_FOR_SORT_DATA,
OPT_MAX_WRITE_LOCK_COUNT, OPT_BULK_INSERT_BUFFER_SIZE, OPT_MAX_WRITE_LOCK_COUNT, OPT_BULK_INSERT_BUFFER_SIZE,
OPT_MAX_ERROR_COUNT, OPT_MAX_PREP_STMT, OPT_MAX_ERROR_COUNT,
OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE, OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE,
OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT, OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT,
...@@ -4277,11 +4277,11 @@ log and this option does nothing anymore.", ...@@ -4277,11 +4277,11 @@ log and this option does nothing anymore.",
{ "ft_min_word_len", OPT_FT_MIN_WORD_LEN, { "ft_min_word_len", OPT_FT_MIN_WORD_LEN,
"The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.", "The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.",
(gptr*) &ft_min_word_len, (gptr*) &ft_min_word_len, 0, GET_ULONG, (gptr*) &ft_min_word_len, (gptr*) &ft_min_word_len, 0, GET_ULONG,
REQUIRED_ARG, 4, 1, HA_FT_MAXLEN, 0, 1, 0}, REQUIRED_ARG, 4, 1, HA_FT_MAXCHARLEN, 0, 1, 0},
{ "ft_max_word_len", OPT_FT_MAX_WORD_LEN, { "ft_max_word_len", OPT_FT_MAX_WORD_LEN,
"The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.", "The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.",
(gptr*) &ft_max_word_len, (gptr*) &ft_max_word_len, 0, GET_ULONG, (gptr*) &ft_max_word_len, (gptr*) &ft_max_word_len, 0, GET_ULONG,
REQUIRED_ARG, HA_FT_MAXLEN, 10, HA_FT_MAXLEN, 0, 1, 0}, REQUIRED_ARG, HA_FT_MAXCHARLEN, 10, HA_FT_MAXCHARLEN, 0, 1, 0},
{ "ft_query_expansion_limit", OPT_FT_QUERY_EXPANSION_LIMIT, { "ft_query_expansion_limit", OPT_FT_QUERY_EXPANSION_LIMIT,
"Number of best matches to use for query expansion", "Number of best matches to use for query expansion",
(gptr*) &ft_query_expansion_limit, (gptr*) &ft_query_expansion_limit, 0, GET_ULONG, (gptr*) &ft_query_expansion_limit, (gptr*) &ft_query_expansion_limit, 0, GET_ULONG,
...@@ -4440,11 +4440,6 @@ The minimum value for this variable is 4096.", ...@@ -4440,11 +4440,6 @@ The minimum value for this variable is 4096.",
(gptr*) &global_system_variables.max_length_for_sort_data, (gptr*) &global_system_variables.max_length_for_sort_data,
(gptr*) &max_system_variables.max_length_for_sort_data, 0, GET_ULONG, (gptr*) &max_system_variables.max_length_for_sort_data, 0, GET_ULONG,
REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0}, REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0},
{"max_prepared_statements", OPT_MAX_PREP_STMT,
"Max number of prepared_statements for a thread.",
(gptr*) &global_system_variables.max_prep_stmt_count,
(gptr*) &max_system_variables.max_prep_stmt_count, 0, GET_ULONG,
REQUIRED_ARG, DEFAULT_PREP_STMT_COUNT, 0, ~0L, 0, 1, 0},
{"max_relay_log_size", OPT_MAX_RELAY_LOG_SIZE, {"max_relay_log_size", OPT_MAX_RELAY_LOG_SIZE,
"If non-zero: relay log will be rotated automatically when the size exceeds this value; if zero (the default): when the size exceeds max_binlog_size. 0 expected, the minimum value for this variable is 4096.", "If non-zero: relay log will be rotated automatically when the size exceeds this value; if zero (the default): when the size exceeds max_binlog_size. 0 expected, the minimum value for this variable is 4096.",
(gptr*) &max_relay_log_size, (gptr*) &max_relay_log_size, 0, GET_ULONG, (gptr*) &max_relay_log_size, (gptr*) &max_relay_log_size, 0, GET_ULONG,
...@@ -5457,13 +5452,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -5457,13 +5452,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break; break;
case OPT_TABLE_TYPE: case OPT_TABLE_TYPE:
{ {
int type; if ((enum db_type)((global_system_variables.table_type=
if ((type=find_type(argument, &ha_table_typelib, 2)) <= 0) ha_resolve_by_name(argument, strlen(argument)))) == DB_TYPE_UNKNOWN)
{ {
fprintf(stderr,"Unknown table type: %s\n",argument); fprintf(stderr,"Unknown table type: %s\n",argument);
exit(1); exit(1);
} }
global_system_variables.table_type= type-1;
break; break;
} }
case OPT_SERVER_ID: case OPT_SERVER_ID:
......
...@@ -203,8 +203,6 @@ sys_var_thd_ha_rows sys_sql_max_join_size("sql_max_join_size", ...@@ -203,8 +203,6 @@ sys_var_thd_ha_rows sys_sql_max_join_size("sql_max_join_size",
&SV::max_join_size, &SV::max_join_size,
fix_max_join_size); fix_max_join_size);
#endif #endif
sys_var_thd_ulong sys_max_prep_stmt_count("max_prepared_statements",
&SV::max_prep_stmt_count);
sys_var_long_ptr sys_max_relay_log_size("max_relay_log_size", sys_var_long_ptr sys_max_relay_log_size("max_relay_log_size",
&max_relay_log_size, &max_relay_log_size,
fix_max_relay_log_size); fix_max_relay_log_size);
...@@ -285,8 +283,8 @@ sys_var_thd_ulong sys_sort_buffer("sort_buffer_size", ...@@ -285,8 +283,8 @@ sys_var_thd_ulong sys_sort_buffer("sort_buffer_size",
&SV::sortbuff_size); &SV::sortbuff_size);
sys_var_thd_sql_mode sys_sql_mode("sql_mode", sys_var_thd_sql_mode sys_sql_mode("sql_mode",
&SV::sql_mode); &SV::sql_mode);
sys_var_thd_enum sys_table_type("table_type", &SV::table_type, sys_var_thd_table_type sys_table_type("table_type",
&ha_table_typelib); &SV::table_type);
sys_var_long_ptr sys_table_cache_size("table_cache", sys_var_long_ptr sys_table_cache_size("table_cache",
&table_cache_size); &table_cache_size);
sys_var_long_ptr sys_thread_cache_size("thread_cache_size", sys_var_long_ptr sys_thread_cache_size("thread_cache_size",
...@@ -463,7 +461,6 @@ sys_var *sys_variables[]= ...@@ -463,7 +461,6 @@ sys_var *sys_variables[]=
&sys_max_heap_table_size, &sys_max_heap_table_size,
&sys_max_join_size, &sys_max_join_size,
&sys_max_length_for_sort_data, &sys_max_length_for_sort_data,
&sys_max_prep_stmt_count,
&sys_max_relay_log_size, &sys_max_relay_log_size,
&sys_max_seeks_for_key, &sys_max_seeks_for_key,
&sys_max_sort_length, &sys_max_sort_length,
...@@ -654,7 +651,6 @@ struct show_var_st init_vars[]= { ...@@ -654,7 +651,6 @@ struct show_var_st init_vars[]= {
{sys_max_seeks_for_key.name, (char*) &sys_max_seeks_for_key, SHOW_SYS}, {sys_max_seeks_for_key.name, (char*) &sys_max_seeks_for_key, SHOW_SYS},
{sys_max_length_for_sort_data.name, (char*) &sys_max_length_for_sort_data, {sys_max_length_for_sort_data.name, (char*) &sys_max_length_for_sort_data,
SHOW_SYS}, SHOW_SYS},
{sys_max_prep_stmt_count.name,(char*) &sys_max_prep_stmt_count, SHOW_SYS},
{sys_max_sort_length.name, (char*) &sys_max_sort_length, SHOW_SYS}, {sys_max_sort_length.name, (char*) &sys_max_sort_length, SHOW_SYS},
{sys_max_user_connections.name,(char*) &sys_max_user_connections, SHOW_SYS}, {sys_max_user_connections.name,(char*) &sys_max_user_connections, SHOW_SYS},
{sys_max_tmp_tables.name, (char*) &sys_max_tmp_tables, SHOW_SYS}, {sys_max_tmp_tables.name, (char*) &sys_max_tmp_tables, SHOW_SYS},
...@@ -2434,6 +2430,61 @@ int set_var_password::update(THD *thd) ...@@ -2434,6 +2430,61 @@ int set_var_password::update(THD *thd)
#endif #endif
} }
/****************************************************************************
Functions to handle table_type
****************************************************************************/
bool sys_var_thd_table_type::check(THD *thd, set_var *var)
/* Based upon sys_var::check_enum() */
{
char buff[80];
const char *value;
String str(buff, sizeof(buff), &my_charset_latin1), *res;
if (var->value->result_type() == STRING_RESULT)
{
if (!(res=var->value->val_str(&str)) ||
!(var->save_result.ulong_value=
(ulong) ha_resolve_by_name(res->ptr(), res->length())))
{
value= res ? res->c_ptr() : "NULL";
goto err;
}
return 0;
}
err:
my_error(ER_UNKNOWN_TABLE_ENGINE, MYF(0), value);
return 1;
}
byte *sys_var_thd_table_type::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
ulong val;
val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
thd->variables.*offset);
const char *table_type= ha_get_table_type((enum db_type)val);
return (byte *)table_type;
}
void sys_var_thd_table_type::set_default(THD *thd, enum_var_type type)
{
if (type == OPT_GLOBAL)
global_system_variables.*offset= (ulong) DB_TYPE_MYISAM;
else
thd->variables.*offset= (ulong) (global_system_variables.*offset);
}
bool sys_var_thd_table_type::update(THD *thd, set_var *var)
{
if (var->type == OPT_GLOBAL)
global_system_variables.*offset= var->save_result.ulong_value;
else
thd->variables.*offset= var->save_result.ulong_value;
return 0;
}
/**************************************************************************** /****************************************************************************
Functions to handle sql_mode Functions to handle sql_mode
****************************************************************************/ ****************************************************************************/
......
...@@ -343,6 +343,26 @@ public: ...@@ -343,6 +343,26 @@ public:
}; };
class sys_var_thd_table_type :public sys_var_thd
{
protected:
ulong SV::*offset;
public:
sys_var_thd_table_type(const char *name_arg, ulong SV::*offset_arg)
:sys_var_thd(name_arg), offset(offset_arg)
{}
bool check(THD *thd, set_var *var);
SHOW_TYPE type() { return SHOW_CHAR; }
bool check_update_type(Item_result type)
{
return type != STRING_RESULT; /* Only accept strings */
}
void set_default(THD *thd, enum_var_type type);
bool update(THD *thd, set_var *var);
byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
class sys_var_thd_bit :public sys_var_thd class sys_var_thd_bit :public sys_var_thd
{ {
sys_update_func update_func; sys_update_func update_func;
......
...@@ -297,6 +297,7 @@ character-set=latin2 ...@@ -297,6 +297,7 @@ character-set=latin2
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -291,6 +291,7 @@ character-set=latin1 ...@@ -291,6 +291,7 @@ character-set=latin1
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -299,6 +299,7 @@ character-set=latin1 ...@@ -299,6 +299,7 @@ character-set=latin1
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -288,6 +288,7 @@ character-set=latin1 ...@@ -288,6 +288,7 @@ character-set=latin1
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -293,6 +293,7 @@ character-set=latin7 ...@@ -293,6 +293,7 @@ character-set=latin7
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -288,6 +288,7 @@ character-set=latin1 ...@@ -288,6 +288,7 @@ character-set=latin1
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -300,6 +300,7 @@ character-set=latin1 ...@@ -300,6 +300,7 @@ character-set=latin1
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -288,6 +288,7 @@ character-set=greek ...@@ -288,6 +288,7 @@ character-set=greek
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -290,6 +290,7 @@ character-set=latin2 ...@@ -290,6 +290,7 @@ character-set=latin2
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -288,6 +288,7 @@ character-set=latin1 ...@@ -288,6 +288,7 @@ character-set=latin1
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -290,6 +290,7 @@ character-set=ujis ...@@ -290,6 +290,7 @@ character-set=ujis
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -288,6 +288,7 @@ character-set=euckr ...@@ -288,6 +288,7 @@ character-set=euckr
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -290,6 +290,7 @@ character-set=latin1 ...@@ -290,6 +290,7 @@ character-set=latin1
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -290,6 +290,7 @@ character-set=latin1 ...@@ -290,6 +290,7 @@ character-set=latin1
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -292,6 +292,7 @@ character-set=latin2 ...@@ -292,6 +292,7 @@ character-set=latin2
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -289,6 +289,7 @@ character-set=latin1 ...@@ -289,6 +289,7 @@ character-set=latin1
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -292,6 +292,7 @@ character-set=latin2 ...@@ -292,6 +292,7 @@ character-set=latin2
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -290,6 +290,7 @@ character-set=koi8r ...@@ -290,6 +290,7 @@ character-set=koi8r
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -283,6 +283,7 @@ character-set=cp1250 ...@@ -283,6 +283,7 @@ character-set=cp1250
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -296,6 +296,7 @@ character-set=latin2 ...@@ -296,6 +296,7 @@ character-set=latin2
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -290,6 +290,7 @@ character-set=latin1 ...@@ -290,6 +290,7 @@ character-set=latin1
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -288,6 +288,7 @@ character-set=latin1 ...@@ -288,6 +288,7 @@ character-set=latin1
"Kolumn '%-.64s' kan inte vara del av ett FULLTEXT index", "Kolumn '%-.64s' kan inte vara del av ett FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -293,6 +293,7 @@ character-set=koi8u ...@@ -293,6 +293,7 @@ character-set=koi8u
"Column '%-.64s' cannot be part of FULLTEXT index", "Column '%-.64s' cannot be part of FULLTEXT index",
"Unknown key cache '%-.100s'", "Unknown key cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
"Can't create a %s from within another stored routine" "Can't create a %s from within another stored routine"
"%s %s already exists" "%s %s already exists"
"%s %s does not exist" "%s %s does not exist"
......
...@@ -375,7 +375,6 @@ struct system_variables ...@@ -375,7 +375,6 @@ struct system_variables
ulong max_error_count; ulong max_error_count;
ulong max_heap_table_size; ulong max_heap_table_size;
ulong max_length_for_sort_data; ulong max_length_for_sort_data;
ulong max_prep_stmt_count;
ulong max_sort_length; ulong max_sort_length;
ulong max_tmp_tables; ulong max_tmp_tables;
ulong myisam_repair_threads; ulong myisam_repair_threads;
...@@ -621,6 +620,11 @@ public: ...@@ -621,6 +620,11 @@ public:
// TODO: document the variables below // TODO: document the variables below
MYSQL_LOCK *lock; /* Current locks */ MYSQL_LOCK *lock; /* Current locks */
MYSQL_LOCK *locked_tables; /* Tables locked with LOCK */ MYSQL_LOCK *locked_tables; /* Tables locked with LOCK */
/*
One thread can hold up to one named user-level lock. This variable
points to a lock object if the lock is present. See item_func.cc and
chapter 'Miscellaneous functions', for functions GET_LOCK, RELEASE_LOCK.
*/
ULL *ull; ULL *ull;
PREP_STMT *last_prepared_stmt; PREP_STMT *last_prepared_stmt;
#ifndef DBUG_OFF #ifndef DBUG_OFF
......
...@@ -173,33 +173,6 @@ int mysqld_show_tables(THD *thd,const char *db,const char *wild) ...@@ -173,33 +173,6 @@ int mysqld_show_tables(THD *thd,const char *db,const char *wild)
** List all table types supported ** List all table types supported
***************************************************************************/ ***************************************************************************/
struct show_table_type_st {
const char *type;
SHOW_COMP_OPTION *value;
const char *comment;
};
SHOW_COMP_OPTION have_yes= SHOW_OPTION_YES;
static struct show_table_type_st sys_table_types[]=
{
{"MyISAM", &have_yes,
"Default type from 3.23 with great performance"},
{"HEAP" , &have_yes,
"Hash based, stored in memory, useful for temporary tables"},
{"MERGE", &have_yes,
"Collection of identical MyISAM tables"},
{"ISAM", &have_isam,
"Obsolete table type; Is replaced by MyISAM"},
{"InnoDB", &have_innodb,
"Supports transactions, row-level locking and foreign keys"},
{"BDB", &have_berkeley_db,
"Supports transactions and page-level locking"},
{NullS, NULL, NullS}
};
int mysqld_show_table_types(THD *thd) int mysqld_show_table_types(THD *thd)
{ {
List<Item> field_list; List<Item> field_list;
...@@ -214,7 +187,7 @@ int mysqld_show_table_types(THD *thd) ...@@ -214,7 +187,7 @@ int mysqld_show_table_types(THD *thd)
DBUG_RETURN(1); DBUG_RETURN(1);
const char *default_type_name= const char *default_type_name=
ha_table_typelib.type_names[thd->variables.table_type]; ha_get_table_type((enum db_type)thd->variables.table_type);
show_table_type_st *types; show_table_type_st *types;
for (types= sys_table_types; types->type; types++) for (types= sys_table_types; types->type; types++)
......
...@@ -400,7 +400,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -400,7 +400,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_USING_OTHER_HANDLER, ER_WARN_USING_OTHER_HANDLER,
ER(ER_WARN_USING_OTHER_HANDLER), ER(ER_WARN_USING_OTHER_HANDLER),
ha_table_typelib.type_names[new_db_type], ha_get_table_type(new_db_type),
table_name); table_name);
} }
db_options=create_info->table_options; db_options=create_info->table_options;
...@@ -2007,7 +2007,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -2007,7 +2007,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_USING_OTHER_HANDLER, ER_WARN_USING_OTHER_HANDLER,
ER(ER_WARN_USING_OTHER_HANDLER), ER(ER_WARN_USING_OTHER_HANDLER),
ha_table_typelib.type_names[new_db_type], ha_get_table_type(new_db_type),
new_name); new_name);
} }
if (create_info->row_type == ROW_TYPE_NOT_USED) if (create_info->row_type == ROW_TYPE_NOT_USED)
......
...@@ -2089,7 +2089,7 @@ table_types: ...@@ -2089,7 +2089,7 @@ table_types:
{ {
$$ = ha_resolve_by_name($1.str,$1.length); $$ = ha_resolve_by_name($1.str,$1.length);
if ($$ == DB_TYPE_UNKNOWN) { if ($$ == DB_TYPE_UNKNOWN) {
net_printf(YYTHD, ER_UNKNOWN_TABLE, $1.str); net_printf(YYTHD, ER_UNKNOWN_TABLE_ENGINE, $1.str);
YYABORT; YYABORT;
} }
}; };
......
...@@ -84,7 +84,6 @@ ...@@ -84,7 +84,6 @@
#define TRANS_MEM_ROOT_PREALLOC 4096 #define TRANS_MEM_ROOT_PREALLOC 4096
#define DEFAULT_ERROR_COUNT 64 #define DEFAULT_ERROR_COUNT 64
#define DEFAULT_PREP_STMT_COUNT 64
#define EXTRA_RECORDS 10 /* Extra records in sort */ #define EXTRA_RECORDS 10 /* Extra records in sort */
#define SCROLL_EXTRA 5 /* Extra scroll-rows. */ #define SCROLL_EXTRA 5 /* Extra scroll-rows. */
#define FIELD_NAME_USED ((uint) 32768) /* Bit set if fieldname used */ #define FIELD_NAME_USED ((uint) 32768) /* Bit set if fieldname used */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment