Commit ef2ed501 authored by unknown's avatar unknown

Merge mskold@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb

into mysql.com:/usr/local/home/marty/MySQL/mysql-4.1-ndb


mysql-test/r/ndb_alter_table.result:
  Auto merged
mysql-test/r/ndb_basic.result:
  Auto merged
mysql-test/r/ndb_lock.result:
  Auto merged
mysql-test/t/ndb_alter_table.test:
  Auto merged
mysql-test/t/ndb_basic.test:
  Auto merged
mysql-test/t/ndb_lock.test:
  Auto merged
ndb/src/ndbapi/Ndb.cpp:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
parents 9480aab2 dc3a5040
......@@ -13,7 +13,7 @@ fi
# Also sends +Oprocelim and +Ofastaccess to the linker
# (see ld(1)).
release_flags="-fast +O4"
release_flags="-fast +O3"
# -z Do not bind anything to address zero. This option
# allows runtime detection of null pointers. See the
......
......@@ -6,7 +6,7 @@ if [ ! -f "sql/mysqld.cc" ]; then
fi
cflags="-64 -mips4"
config_args=
if [ "$#" != 0 ]; then
case "$1" in
--help)
......@@ -25,8 +25,7 @@ if [ "$#" != 0 ]; then
cflags=""
;;
*)
echo "$0: invalid option '$1'; use --help to show usage"
exit 1
config_args="$config_args $1"; shift
;;
esac
else
......@@ -79,6 +78,7 @@ cxxflags="$cxxflags -LANG:libc_in_namespace_std=OFF"
CC=cc CXX=CC CFLAGS="$cflags" CXXFLAGS="$cxxflags" \
./configure --prefix=/usr/local/mysql --disable-shared \
--with-extra-charsets=complex --enable-thread-safe-client \
--without-extra-tools --disable-dependency-tracking
--without-extra-tools --disable-dependency-tracking \
$config_args
make
......@@ -7,11 +7,6 @@ extra_flags="$pentium_cflags $fast_cflags -g"
extra_configs="$pentium_configs"
#strip=yes
#extra_configs="$extra_configs --with-innodb --with-berkeley-db \
# --with-embedded-server --enable-thread-safe-client \
# --with-openssl --with-vio --with-raid --with-ndbcluster"
# removed per discussion with Brian and Sanja because it makes Bootstrap
# fail
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
--with-embedded-server --enable-thread-safe-client \
--with-openssl --with-vio --with-raid --with-ndbcluster"
......
......@@ -9,7 +9,7 @@ cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
# We want to test isam when building with valgrind
extra_configs="$extra_configs --with-berkeley-db --with-innodb --with-isam --with-embedded-server --with-openssl"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --with-isam --with-embedded-server --with-openssl --with-vio --with-raid --with-ndbcluster"
. "$path/FINISH.sh"
......
......@@ -61,6 +61,7 @@ hf@genie.(none)
igor@hundin.mysql.fi
igor@rurik.mysql.com
ingo@mysql.com
jan@hundin.mysql.fi
jani@a80-186-24-72.elisa-laajakaista.fi
jani@dsl-jkl1657.dial.inet.fi
jani@dsl-kpogw4gb5.dial.inet.fi
......@@ -83,6 +84,7 @@ joreland@mysql.com
jorge@linux.jorge.mysql.com
jplindst@t41.(none)
kaj@work.mysql.com
kent@mysql.com
konstantin@mysql.com
kostja@oak.local
lenz@kallisto.mysql.com
......@@ -96,6 +98,7 @@ miguel@hegel.txg
miguel@light.
miguel@light.local
miguel@sartre.local
mikron@c-fb0ae253.1238-1-64736c10.cust.bredbandsbolaget.se
mikron@mikael-ronstr-ms-dator.local
mmatthew@markslaptop.
monty@bitch.mysql.fi
......@@ -126,6 +129,8 @@ mysql@home.(none)
mysqldev@build.mysql2.com
mysqldev@melody.local
mysqldev@mysql.com
mysqldev@o2k.irixworld.net
ndbdev@eel.hemma.oreland.se
ndbdev@ndbmaster.mysql.com
nick@mysql.com
nick@nick.leippe.com
......
......@@ -10,12 +10,13 @@ use Sys::Hostname;
$opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env="";
$opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix="";
$opt_tmp=$opt_version_suffix="";
$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0;
GetOptions(
"bdb",
"build-thread=i",
"bundled-zlib",
"config-env=s" => \@config_env,
"config-extra-env=s" => \@config_extra_env,
"config-options=s" => \@config_options,
......@@ -255,6 +256,7 @@ if ($opt_stage <= 1)
log_system("$make clean") if ($opt_use_old_distribution);
$opt_config_options.= " --disable-shared" if (!$opt_enable_shared); # Default for binary versions
$opt_config_options.= " --with-berkeley-db" if ($opt_bdb);
$opt_config_options.= " --with-zlib-dir=bundled" if ($opt_bundled_zlib);
$opt_config_options.= " --with-client-ldflags=-all-static" if ($opt_static_client);
$opt_config_options.= " --with-debug" if ($opt_with_debug);
$opt_config_options.= " --with-libwrap" if ($opt_libwrap);
......
......@@ -19,8 +19,15 @@
AUTOMAKE_OPTIONS = foreign
# These are built from source in the Docs directory
EXTRA_DIST = INSTALL-SOURCE README COPYING zlib
SUBDIRS = . include @docs_dirs@ \
EXTRA_DIST = INSTALL-SOURCE README COPYING
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
@readline_topdir@ sql-common \
@thread_dirs@ pstack @sql_client_dirs@ \
@sql_server_dirs@ scripts man tests \
netware @libmysqld_dirs@ \
@bench_dirs@ support-files @fs_dirs@ @tools_dirs@
DIST_SUBDIRS = . include @docs_dirs@ zlib \
@readline_topdir@ sql-common \
@thread_dirs@ pstack @sql_client_dirs@ \
@sql_server_dirs@ scripts man tests SSL\
......
......@@ -167,32 +167,116 @@ then
fi
])
AC_DEFUN(MYSQL_CHECK_ZLIB_WITH_COMPRESS, [
dnl Define zlib paths to point at bundled zlib
AC_DEFUN([MYSQL_USE_BUNDLED_ZLIB], [
ZLIB_INCLUDES="-I\$(top_srcdir)/zlib"
ZLIB_LIBS="\$(top_builddir)/zlib/libz.la"
zlib_dir="zlib"
AC_SUBST([zlib_dir])
mysql_cv_compress="yes"
])
dnl Auxiliary macro to check for zlib at given path
AC_DEFUN([MYSQL_CHECK_ZLIB_DIR], [
save_INCLUDES="$INCLUDES"
save_LIBS="$LIBS"
LIBS="-l$1 $LIBS"
AC_CACHE_CHECK([if libz with compress], mysql_cv_compress,
[AC_TRY_RUN([#include <zlib.h>
#ifdef __cplusplus
extern "C"
#endif
int main(int argv, char **argc)
{
return 0;
}
INCLUDES="$INCLUDES $ZLIB_INCLUDES"
LIBS="$LIBS $ZLIB_LIBS"
AC_CACHE_VAL([mysql_cv_compress],
[AC_TRY_LINK([#include <zlib.h>],
[int link_test() { return compress(0, (unsigned long*) 0, "", 0); }],
[mysql_cv_compress="yes"
AC_MSG_RESULT([ok])],
[mysql_cv_compress="no"])
])
INCLUDES="$save_INCLUDES"
LIBS="$save_LIBS"
])
int link_test()
{
return compress(0, (unsigned long*) 0, "", 0);
}
], mysql_cv_compress=yes, mysql_cv_compress=no)])
if test "$mysql_cv_compress" = "yes"
then
AC_DEFINE([HAVE_COMPRESS], [1], [ZLIB and compress])
else
LIBS="$save_LIBS"
fi
dnl MYSQL_CHECK_ZLIB_WITH_COMPRESS
dnl ------------------------------------------------------------------------
dnl @synopsis MYSQL_CHECK_ZLIB_WITH_COMPRESS
dnl
dnl Provides the following configure options:
dnl --with-zlib-dir=DIR
dnl Possible DIR values are:
dnl - "no" - the macro will disable use of compression functions
dnl - "bundled" - means use zlib bundled along with MySQL sources
dnl - empty, or not specified - the macro will try default system
dnl library (if present), and in case of error will fall back to
dnl bundled zlib
dnl - zlib location prefix - given location prefix, the macro expects
dnl to find the library headers in $prefix/include, and binaries in
dnl $prefix/lib. If zlib headers or binaries weren't found at $prefix, the
dnl macro bails out with error.
dnl
dnl If the library was found, this function #defines HAVE_COMPRESS
dnl and configure variables ZLIB_INCLUDES (i.e. -I/path/to/zlib/include) and
dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz).
AC_DEFUN([MYSQL_CHECK_ZLIB_WITH_COMPRESS], [
AC_MSG_CHECKING([for zlib compression library])
case $SYSTEM_TYPE in
dnl This is a quick fix for Netware if AC_TRY_LINK for some reason
dnl won't work there. Uncomment in case of failure and on Netware
dnl we'll always assume that zlib is present
dnl *netware* | *modesto*)
dnl AC_MSG_RESULT(ok)
dnl AC_DEFINE([HAVE_COMPRESS], [1], [Define to enable compression support])
dnl ;;
*)
AC_ARG_WITH([zlib-dir],
AC_HELP_STRING([--with-zlib-dir=DIR],
[Provide MySQL with a custom location of
compression library. Given DIR, zlib binary is
assumed to be in $DIR/lib and header files
in $DIR/include.]),
[mysql_zlib_dir=${withval}],
[mysql_zlib_dir=""])
case "$mysql_zlib_dir" in
"no")
mysql_cv_compress="no"
AC_MSG_RESULT([disabled])
;;
"bundled")
MYSQL_USE_BUNDLED_ZLIB
AC_MSG_RESULT([using bundled zlib])
;;
"")
ZLIB_INCLUDES=""
ZLIB_LIBS="-lz"
MYSQL_CHECK_ZLIB_DIR
if test "$mysql_cv_compress" = "no"; then
MYSQL_USE_BUNDLED_ZLIB
AC_MSG_RESULT([system-wide zlib not found, using one bundled with MySQL])
fi
;;
*)
if test -f "$mysql_zlib_dir/lib/libz.a" -a \
-f "$mysql_zlib_dir/include/zlib.h"; then
ZLIB_INCLUDES="-I$mysql_zlib_dir/include"
ZLIB_LIBS="-L$mysql_zlib_dir/lib -lz"
MYSQL_CHECK_ZLIB_DIR
fi
if test "x$mysql_cv_compress" != "xyes"; then
AC_MSG_ERROR([headers or binaries were not found in $mysql_zlib_dir/{include,lib}])
fi
;;
esac
if test "$mysql_cv_compress" = "yes"; then
AC_SUBST([ZLIB_LIBS])
AC_SUBST([ZLIB_INCLUDES])
AC_DEFINE([HAVE_COMPRESS], [1], [Define to enable compression support])
fi
;;
esac
])
dnl ------------------------------------------------------------------------
#---START: Used in for client configure
AC_DEFUN(MYSQL_CHECK_ULONG,
[AC_MSG_CHECKING(for type ulong)
......
......@@ -43,5 +43,6 @@ enum options_client
OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION,OPT_MYSQL_PROTOCOL,
OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM, OPT_SKIP_OPTIMIZATION,
OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH,
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS,
OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME
};
This diff is collapsed.
......@@ -641,7 +641,7 @@ VAR* var_get(const char* var_name, const char** var_name_end, my_bool raw,
if (*var_name != '$')
goto err;
digit = *++var_name - '0';
if (!(digit < 10 && digit >= 0))
if (digit < 0 || digit >= 10)
{
const char* save_var_name = var_name, *end;
uint length;
......@@ -660,7 +660,7 @@ VAR* var_get(const char* var_name, const char** var_name_end, my_bool raw,
length < MAX_VAR_NAME)
{
char buff[MAX_VAR_NAME+1];
strmake(buff, save_var_name, length);
strmake(buff, save_var_name, length);
v= var_from_env(buff, "");
}
var_name--; /* Point at last character */
......
......@@ -396,7 +396,7 @@ then
# we will gets some problems when linking static programs.
# The following code is used to fix this problem.
if test "$CXX" = "gcc" -o "$CXX" = "ccache gcc"
if echo $CXX | grep gcc > /dev/null 2>&1
then
if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1
then
......@@ -664,15 +664,6 @@ AC_ARG_WITH(named-curses-libs,
[ with_named_curses=no ]
)
# Force use of a zlib (compress)
AC_ARG_WITH(named-z-libs,
[ --with-named-z-libs=ARG
Use specified zlib libraries instead of
those automatically found by configure.],
[ with_named_zlib=$withval ],
[ with_named_zlib=z ]
)
# Make thread safe client
AC_ARG_ENABLE(thread-safe-client,
[ --enable-thread-safe-client
......@@ -806,16 +797,7 @@ AC_CHECK_FUNC(crypt, AC_DEFINE([HAVE_CRYPT], [1], [crypt]))
# For sem_xxx functions on Solaris 2.6
AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(posix4, sem_init))
# For compress in zlib
case $SYSTEM_TYPE in
*netware* | *modesto*)
AC_DEFINE(HAVE_COMPRESS, [1])
;;
*)
MYSQL_CHECK_ZLIB_WITH_COMPRESS($with_named_zlib)
;;
esac
MYSQL_CHECK_ZLIB_WITH_COMPRESS
#--------------------------------------------------------------------
# Check for TCP wrapper support
......@@ -945,7 +927,7 @@ then
fi
# We make a special variable for client library's to avoid including
# thread libs in the client.
NON_THREADED_CLIENT_LIBS="$LIBS"
NON_THREADED_CLIENT_LIBS="$LIBS $ZLIB_LIBS"
AC_MSG_CHECKING([for int8])
case $SYSTEM_TYPE in
......@@ -2580,7 +2562,7 @@ case $default_charset in
;;
cp1250)
default_charset_default_collation="cp1250_general_ci"
default_charset_collations="cp1250_general_ci cp1250_czech_ci cp1250_bin"
default_charset_collations="cp1250_general_ci cp1250_czech_cs cp1250_bin"
;;
cp1251)
default_charset_default_collation="cp1251_general_ci"
......@@ -2656,7 +2638,7 @@ case $default_charset in
;;
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"
default_charset_collations="latin2_general_ci latin2_bin latin2_czech_cs latin2_hungarian_ci latin2_croatian_ci"
;;
latin5)
default_charset_default_collation="latin5_turkish_ci"
......@@ -2979,10 +2961,10 @@ then
if test "$with_debug" = "yes"
then
# Medium debug.
NDB_DEFS="-DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
elif test "$with_debug" = "full"
then
NDB_DEFS="-DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
else
NDB_DEFS="-DNDEBUG"
fi
......@@ -3082,6 +3064,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
include/mysql_version.h dnl
cmd-line-utils/Makefile dnl
cmd-line-utils/libedit/Makefile dnl
zlib/Makefile dnl
cmd-line-utils/readline/Makefile)
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
AC_OUTPUT
......
......@@ -28,6 +28,15 @@ C_MODE_START
extern ulonglong log_10_int[20];
/*
Portable time_t replacement.
Should be signed and hold seconds for 1902-2038 range.
*/
typedef long my_time_t;
#define MY_TIME_T_MAX LONG_MAX
#define MY_TIME_T_MIN LONG_MIN
#define YY_PART_YEAR 70
/* Flags to str_to_datetime */
......@@ -41,6 +50,13 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time,
int *was_cut);
long calc_daynr(uint year,uint month,uint day);
void init_time(void);
my_time_t
my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap);
C_MODE_END
#endif /* _my_time_h_ */
This diff is collapsed.
......@@ -17,7 +17,14 @@
#ifndef _mysql_time_h_
#define _mysql_time_h_
/* Time declarations shared between server and client library */
/*
Time declarations shared between the server and client API:
you should not add anything to this header unless it's used
(and hence should be visible) in mysql.h.
If you're looking for a place to add new time-related declaration,
it's most likely my_time.h. See also "C API Handling of Date
and Time Values" chapter in documentation.
*/
enum enum_mysql_timestamp_type
{
......
......@@ -1513,6 +1513,8 @@ fil_decr_pending_ibuf_merges(
mutex_exit(&(system->mutex));
}
/************************************************************
Creates the database directory for a table if it does not exist yet. */
static
void
fil_create_directory_for_tablename(
......
......@@ -42,6 +42,7 @@ extern char* srv_arch_dir;
#endif /* UNIV_LOG_ARCHIVE */
extern ibool srv_file_per_table;
extern ibool srv_locks_unsafe_for_binlog;
extern ulint srv_n_data_files;
extern char** srv_data_file_names;
......
......@@ -631,10 +631,24 @@ row_sel_get_clust_rec(
if (!node->read_view) {
/* Try to place a lock on the index record */
/* If innodb_locks_unsafe_for_binlog option is used,
we lock only the record, i.e. next-key locking is
not used.
*/
if ( srv_locks_unsafe_for_binlog )
{
err = lock_clust_rec_read_check_and_lock(0, clust_rec,
index,node->row_lock_mode, LOCK_REC_NOT_GAP, thr);
}
else
{
err = lock_clust_rec_read_check_and_lock(0, clust_rec, index,
node->row_lock_mode, LOCK_ORDINARY, thr);
if (err != DB_SUCCESS) {
}
if (err != DB_SUCCESS) {
return(err);
}
......@@ -1184,9 +1198,23 @@ row_sel(
search result set, resulting in the phantom problem. */
if (!consistent_read) {
/* If innodb_locks_unsafe_for_binlog option is used,
we lock only the record, i.e. next-key locking is
not used.
*/
if ( srv_locks_unsafe_for_binlog )
{
err = sel_set_rec_lock(page_rec_get_next(rec), index,
node->row_lock_mode, LOCK_REC_NOT_GAP, thr);
}
else
{
err = sel_set_rec_lock(page_rec_get_next(rec), index,
node->row_lock_mode, LOCK_ORDINARY, thr);
if (err != DB_SUCCESS) {
}
if (err != DB_SUCCESS) {
/* Note that in this case we will store in pcur
the PREDECESSOR of the record we are waiting
the lock for */
......@@ -1211,8 +1239,22 @@ row_sel(
if (!consistent_read) {
/* Try to place a lock on the index record */
err = sel_set_rec_lock(rec, index, node->row_lock_mode,
/* If innodb_locks_unsafe_for_binlog option is used,
we lock only the record, i.e. next-key locking is
not used.
*/
if ( srv_locks_unsafe_for_binlog )
{
err = sel_set_rec_lock(rec, index, node->row_lock_mode,
LOCK_REC_NOT_GAP, thr);
}
else
{
err = sel_set_rec_lock(rec, index, node->row_lock_mode,
LOCK_ORDINARY, thr);
}
if (err != DB_SUCCESS) {
goto lock_wait_or_error;
......@@ -3144,10 +3186,24 @@ row_search_for_mysql(
/* Try to place a lock on the index record */
err = sel_set_rec_lock(rec, index,
/* If innodb_locks_unsafe_for_binlog option is used,
we lock only the record, i.e. next-key locking is
not used.
*/
if ( srv_locks_unsafe_for_binlog )
{
err = sel_set_rec_lock(rec, index,
prebuilt->select_lock_type,
LOCK_REC_NOT_GAP, thr);
}
else
{
err = sel_set_rec_lock(rec, index,
prebuilt->select_lock_type,
LOCK_ORDINARY, thr);
if (err != DB_SUCCESS) {
}
if (err != DB_SUCCESS) {
goto lock_wait_or_error;
}
......@@ -3300,9 +3356,22 @@ row_search_for_mysql(
prebuilt->select_lock_type,
LOCK_REC_NOT_GAP, thr);
} else {
err = sel_set_rec_lock(rec, index,
/* If innodb_locks_unsafe_for_binlog option is used,
we lock only the record, i.e. next-key locking is
not used.
*/
if ( srv_locks_unsafe_for_binlog )
{
err = sel_set_rec_lock(rec, index,
prebuilt->select_lock_type,
LOCK_REC_NOT_GAP, thr);
}
else
{
err = sel_set_rec_lock(rec, index,
prebuilt->select_lock_type,
LOCK_ORDINARY, thr);
}
}
if (err != DB_SUCCESS) {
......
......@@ -77,6 +77,10 @@ ibool srv_file_per_table = FALSE; /* store to its own file each table
created by an user; data dictionary
tables are in the system tablespace
0 */
ibool srv_locks_unsafe_for_binlog = FALSE; /* Place locks to records only
i.e. do not use next-key locking
except on duplicate key checking and
foreign key checking */
ulint srv_n_data_files = 0;
char** srv_data_file_names = NULL;
ulint* srv_data_file_sizes = NULL; /* size in database pages */
......
......@@ -20,7 +20,7 @@
target = libmysqlclient.la
target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@
LIBS = @CLIENT_LIBS@
INCLUDES = -I$(top_srcdir)/include $(openssl_includes)
INCLUDES = -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@
include $(srcdir)/Makefile.shared
......
This diff is collapsed.
......@@ -21,7 +21,8 @@ target = libmysqlclient_r.la
target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
LIBS = @LIBS@ @openssl_libs@
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include $(openssl_includes)
INCLUDES = @MT_INCLUDES@ \
-I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@
## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include
include $(top_srcdir)/libmysql/Makefile.shared
......
......@@ -27,7 +27,7 @@ DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
-DSHAREDIR="\"$(MYSQLSHAREdir)\""
INCLUDES= @MT_INCLUDES@ @bdb_includes@ -I$(top_srcdir)/include \
-I$(top_srcdir)/sql -I$(top_srcdir)/regex \
$(openssl_includes)
$(openssl_includes) @ZLIB_INCLUDES@
noinst_LIBRARIES = libmysqld_int.a
pkglib_LIBRARIES = libmysqld.a
......
......@@ -609,9 +609,9 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
client_field->org_table_length= strlen(client_field->org_table);
client_field->charsetnr= server_field.charsetnr;
client_field->catalog= strdup_root(field_alloc, "std");
client_field->catalog= strdup_root(field_alloc, "def");
client_field->catalog_length= 3;
if (INTERNAL_NUM_FIELD(client_field))
client_field->flags|= NUM_FLAG;
......
......@@ -18,8 +18,11 @@ EXTRA_DIST = mi_test_all.sh mi_test_all.res
pkgdata_DATA = mi_test_all mi_test_all.res
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include
LDADD = @CLIENT_EXTRA_LDFLAGS@ libmyisam.a ../mysys/libmysys.a \
../dbug/libdbug.a ../strings/libmystrings.a
LDADD = @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
@ZLIB_LIBS@ \
$(top_builddir)/strings/libmystrings.a
pkglib_LIBRARIES = libmyisam.a
bin_PROGRAMS = myisamchk myisamlog myisampack myisam_ftdump
myisamchk_DEPENDENCIES= $(LIBRARIES)
......
......@@ -1450,9 +1450,11 @@ then
then
echo "Starting ndbcluster"
./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT --small --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
export NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT"
NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT"
export NDB_CONNECTSTRING
else
export NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
export NDB_CONNECTSTRING
echo "Using ndbcluster at $NDB_CONNECTSTRING"
fi
fi
......
......@@ -4,6 +4,7 @@ MaxNoOfConcurrentOperations: CHOOSE_MaxNoOfConcurrentOperations
DataMemory: CHOOSE_DataMemory
IndexMemory: CHOOSE_IndexMemory
Diskless: CHOOSE_Diskless
TimeBetweenWatchDogCheck: 30000
[COMPUTER]
Id: 1
......
......@@ -86,7 +86,6 @@ fs_name_1=$fs_ndb/node-1-fs
fs_name_2=$fs_ndb/node-2-fs
NDB_HOME=
export NDB_CONNECTSTRING
if [ ! -x $fsdir ]; then
echo "$fsdir missing"
exit 1
......@@ -102,7 +101,8 @@ fi
ndb_host="localhost"
ndb_mgmd_port=$port_base
export NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port"
NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port"
export NDB_CONNECTSTRING
start_default_ndbcluster() {
......
......@@ -201,6 +201,24 @@ a b
202 5
203 6
204 7
alter table t1 modify b mediumint;
select * from t1 order by b;
a b
1 1
200 2
0 3
201 4
202 5
203 6
204 7
create table t2 (a int);
insert t2 values (1),(2);
alter table t2 add b int auto_increment primary key;
select * from t2;
a b
1 1
2 2
drop table t2;
delete from t1 where a=0;
update t1 set a=0 where b=5;
select * from t1 order by b;
......
......@@ -40,6 +40,8 @@ show tables;
Tables_in_test
update mysql.user set password=old_password("gambling2") where user=_binary"test";
flush privileges;
set password='gambling3';
ERROR HY000: Password hash should be a 41-digit hexadecimal number
set password=old_password('gambling3');
show tables;
Tables_in_mysql
......
......@@ -90,16 +90,23 @@ insert into t1 values
('2003-01-02 11:11:12Pm', '%Y-%m-%d %h:%i:%S%p'),
('10:20:10', '%H:%i:%s'),
('10:20:10', '%h:%i:%s.%f'),
('10:20:10', '%T'),
('10:20:10AM', '%h:%i:%s%p'),
('10:20:10AM', '%r'),
('10:20:10.44AM', '%h:%i:%s.%f%p'),
('15-01-2001 12:59:58', '%d-%m-%Y %H:%i:%S'),
('15 September 2001', '%d %M %Y'),
('15 SEPTEMB 2001', '%d %M %Y'),
('15 MAY 2001', '%d %b %Y'),
('15th May 2001', '%D %b %Y'),
('Sunday 15 MAY 2001', '%W %d %b %Y'),
('Sund 15 MAY 2001', '%W %d %b %Y'),
('Tuesday 00 2002', '%W %U %Y'),
('Thursday 53 1998', '%W %u %Y'),
('Sunday 01 2001', '%W %v %x'),
('Tuesday 52 2001', '%W %V %X'),
('060 2004', '%j %Y'),
('4 53 1998', '%w %u %Y'),
('15-01-2001', '%d-%m-%Y %H:%i:%S'),
('15-01-20', '%d-%m-%y'),
('15-2001-1', '%d-%Y-%c');
......@@ -114,16 +121,23 @@ date format str_to_date
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12
10:20:10 %H:%i:%s 0000-00-00 10:20:10
10:20:10 %h:%i:%s.%f 0000-00-00 10:20:10
10:20:10 %T 0000-00-00 10:20:10
10:20:10AM %h:%i:%s%p 0000-00-00 10:20:10
10:20:10AM %r 0000-00-00 10:20:10
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
15 MAY 2001 %d %b %Y 2001-05-15 00:00:00
15th May 2001 %D %b %Y 2001-05-15 00:00:00
Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
Tuesday 00 2002 %W %U %Y 2002-01-01 00:00:00
Thursday 53 1998 %W %u %Y 1998-12-31 00:00:00
Sunday 01 2001 %W %v %x 2001-01-07 00:00:00
Tuesday 52 2001 %W %V %X 2002-01-01 00:00:00
060 2004 %j %Y 2004-02-29 00:00:00
4 53 1998 %w %u %Y 1998-12-31 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00
15-01-20 %d-%m-%y 2020-01-15 00:00:00
15-2001-1 %d-%Y-%c 2001-01-15 00:00:00
......@@ -138,16 +152,23 @@ date format con
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12
10:20:10 %H:%i:%s 0000-00-00 10:20:10
10:20:10 %h:%i:%s.%f 0000-00-00 10:20:10
10:20:10 %T 0000-00-00 10:20:10
10:20:10AM %h:%i:%s%p 0000-00-00 10:20:10
10:20:10AM %r 0000-00-00 10:20:10
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
15 MAY 2001 %d %b %Y 2001-05-15 00:00:00
15th May 2001 %D %b %Y 2001-05-15 00:00:00
Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
Tuesday 00 2002 %W %U %Y 2002-01-01 00:00:00
Thursday 53 1998 %W %u %Y 1998-12-31 00:00:00
Sunday 01 2001 %W %v %x 2001-01-07 00:00:00
Tuesday 52 2001 %W %V %X 2002-01-01 00:00:00
060 2004 %j %Y 2004-02-29 00:00:00
4 53 1998 %w %u %Y 1998-12-31 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00
15-01-20 %d-%m-%y 2020-01-15 00:00:00
15-2001-1 %d-%Y-%c 2001-01-15 00:00:00
......@@ -162,16 +183,23 @@ date format datetime
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12
10:20:10 %H:%i:%s 0000-00-00 10:20:10
10:20:10 %h:%i:%s.%f 0000-00-00 10:20:10
10:20:10 %T 0000-00-00 10:20:10
10:20:10AM %h:%i:%s%p 0000-00-00 10:20:10
10:20:10AM %r 0000-00-00 10:20:10
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
15 MAY 2001 %d %b %Y 2001-05-15 00:00:00
15th May 2001 %D %b %Y 2001-05-15 00:00:00
Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
Tuesday 00 2002 %W %U %Y 2002-01-01 00:00:00
Thursday 53 1998 %W %u %Y 1998-12-31 00:00:00
Sunday 01 2001 %W %v %x 2001-01-07 00:00:00
Tuesday 52 2001 %W %V %X 2002-01-01 00:00:00
060 2004 %j %Y 2004-02-29 00:00:00
4 53 1998 %w %u %Y 1998-12-31 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15 00:00:00
15-01-20 %d-%m-%y 2020-01-15 00:00:00
15-2001-1 %d-%Y-%c 2001-01-15 00:00:00
......@@ -186,16 +214,23 @@ date format date2
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02
10:20:10 %H:%i:%s 0000-00-00
10:20:10 %h:%i:%s.%f 0000-00-00
10:20:10 %T 0000-00-00
10:20:10AM %h:%i:%s%p 0000-00-00
10:20:10AM %r 0000-00-00
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15
15 September 2001 %d %M %Y 2001-09-15
15 SEPTEMB 2001 %d %M %Y 2001-09-15
15 MAY 2001 %d %b %Y 2001-05-15
15th May 2001 %D %b %Y 2001-05-15
Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15
Sund 15 MAY 2001 %W %d %b %Y 2001-05-15
Tuesday 00 2002 %W %U %Y 2002-01-01
Thursday 53 1998 %W %u %Y 1998-12-31
Sunday 01 2001 %W %v %x 2001-01-07
Tuesday 52 2001 %W %V %X 2002-01-01
060 2004 %j %Y 2004-02-29
4 53 1998 %w %u %Y 1998-12-31
15-01-2001 %d-%m-%Y %H:%i:%S 2001-01-15
15-01-20 %d-%m-%y 2020-01-15
15-2001-1 %d-%Y-%c 2001-01-15
......@@ -210,16 +245,23 @@ date format time
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
10:20:10 %H:%i:%s 10:20:10
10:20:10 %h:%i:%s.%f 10:20:10
10:20:10 %T 10:20:10
10:20:10AM %h:%i:%s%p 10:20:10
10:20:10AM %r 10:20:10
10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15 September 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00
15 MAY 2001 %d %b %Y 00:00:00
15th May 2001 %D %b %Y 00:00:00
Sunday 15 MAY 2001 %W %d %b %Y 00:00:00
Sund 15 MAY 2001 %W %d %b %Y 00:00:00
Tuesday 00 2002 %W %U %Y 00:00:00
Thursday 53 1998 %W %u %Y 00:00:00
Sunday 01 2001 %W %v %x 00:00:00
Tuesday 52 2001 %W %V %X 00:00:00
060 2004 %j %Y 00:00:00
4 53 1998 %w %u %Y 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00
15-01-20 %d-%m-%y 00:00:00
15-2001-1 %d-%Y-%c 00:00:00
......@@ -234,16 +276,23 @@ date format time2
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
10:20:10 %H:%i:%s 10:20:10
10:20:10 %h:%i:%s.%f 10:20:10
10:20:10 %T 10:20:10
10:20:10AM %h:%i:%s%p 10:20:10
10:20:10AM %r 10:20:10
10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15 September 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00
15 MAY 2001 %d %b %Y 00:00:00
15th May 2001 %D %b %Y 00:00:00
Sunday 15 MAY 2001 %W %d %b %Y 00:00:00
Sund 15 MAY 2001 %W %d %b %Y 00:00:00
Tuesday 00 2002 %W %U %Y 00:00:00
Thursday 53 1998 %W %u %Y 00:00:00
Sunday 01 2001 %W %v %x 00:00:00
Tuesday 52 2001 %W %V %X 00:00:00
060 2004 %j %Y 00:00:00
4 53 1998 %w %u %Y 00:00:00
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00
15-01-20 %d-%m-%y 00:00:00
15-2001-1 %d-%Y-%c 00:00:00
......@@ -258,10 +307,13 @@ insert into t1 values
('15 Septembei 2001', '%d %M %Y'),
('15 Ju 2001', '%d %M %Y'),
('Sund 15 MA', '%W %d %b %Y'),
('Sunday 01 2001', '%W %V %X'),
('Thursdai 12 1998', '%W %u %Y'),
(NULL, get_format(DATE,'USA')),
('Tuesday 52 2001', '%W %V %X');
('Sunday 01 2001', '%W %v %X'),
('Tuesday 52 2001', '%W %V %x'),
('Tuesday 52 2001', '%W %V %Y'),
('Tuesday 52 2001', '%W %u %x'),
('7 53 1998', '%w %u %Y'),
(NULL, get_format(DATE,'USA'));
select date,format,str_to_date(date, format) as str_to_date from t1;
date format str_to_date
2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL
......@@ -273,10 +325,13 @@ date format str_to_date
15 Septembei 2001 %d %M %Y NULL
15 Ju 2001 %d %M %Y NULL
Sund 15 MA %W %d %b %Y NULL
Sunday 01 2001 %W %V %X NULL
Thursdai 12 1998 %W %u %Y NULL
Sunday 01 2001 %W %v %X NULL
Tuesday 52 2001 %W %V %x NULL
Tuesday 52 2001 %W %V %Y NULL
Tuesday 52 2001 %W %u %x NULL
7 53 1998 %w %u %Y NULL
NULL %m.%d.%Y NULL
Tuesday 52 2001 %W %V %X NULL
select date,format,concat(str_to_date(date, format),'') as con from t1;
date format con
2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL
......@@ -288,10 +343,13 @@ date format con
15 Septembei 2001 %d %M %Y NULL
15 Ju 2001 %d %M %Y NULL
Sund 15 MA %W %d %b %Y NULL
Sunday 01 2001 %W %V %X NULL
Thursdai 12 1998 %W %u %Y NULL
Sunday 01 2001 %W %v %X NULL
Tuesday 52 2001 %W %V %x NULL
Tuesday 52 2001 %W %V %Y NULL
Tuesday 52 2001 %W %u %x NULL
7 53 1998 %w %u %Y NULL
NULL %m.%d.%Y NULL
Tuesday 52 2001 %W %V %X NULL
truncate table t1;
insert into t1 values
('10:20:10AM', '%h:%i:%s'),
......
......@@ -283,6 +283,12 @@ ID Value1 Value2
SELECT * FROM t1 NATURAL JOIN t2 WHERE (Value1 = 'A' AND Value2 <> 'B') AND 1;
ID Value1 Value2
drop table t1,t2;
CREATE TABLE t1 (a int);
CREATE TABLE t2 (b int);
CREATE TABLE t3 (c int);
SELECT * FROM t1 NATURAL JOIN t2 NATURAL JOIN t3;
a b c
DROP TABLE t1, t2, t3;
create table t1 (i int);
create table t2 (i int);
create table t3 (i int);
......
......@@ -21,7 +21,7 @@ def test t1 t1 g g 5 4 0 Y 32768 3 63
def test t1 t1 h h 0 7 0 Y 32768 4 63
def test t1 t1 i i 13 4 0 Y 32864 0 63
def test t1 t1 j j 10 10 0 Y 128 0 63
def test t1 t1 k k 7 19 0 N 1217 0 63
def test t1 t1 k k 7 19 0 N 1249 0 63
def test t1 t1 l l 12 19 0 Y 128 0 63
def test t1 t1 m m 254 1 0 Y 256 0 8
def test t1 t1 n n 254 3 0 Y 2048 0 8
......
This diff is collapsed.
......@@ -15,7 +15,7 @@ col2 varchar(30) not null,
col3 varchar (20) not null,
col4 varchar(4) not null,
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
col6 int not null, to_be_deleted int);
col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
insert into t1 values (2,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (25, 4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
select * from t1 order by col1;
col1 col2 col3 col4 col5 col6 to_be_deleted
......
DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
c int unsigned
) engine=ndbcluster;
select count(*) from t2;
count(*)
10000
delete from t2 limit 1;
select count(*) from t2;
count(*)
9999
delete from t2 limit 100;
select count(*) from t2;
count(*)
9899
delete from t2 limit 1000;
select count(*) from t2;
count(*)
8899
update t2 set c=12345678 limit 100;
select count(*) from t2 where c=12345678;
count(*)
100
select count(*) from t2 where c=12345678 limit 1000;
count(*)
100
select * from t2 limit 0;
a b c
drop table t2;
DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
c int unsigned
) engine=ndbcluster;
select count(*) from t2;
count(*)
5000
truncate table t2;
select count(*) from t2;
count(*)
0
drop table t2;
......@@ -870,7 +870,7 @@ def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63
def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63
def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63
def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63
def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63
def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63
def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63
def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63
def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63
......
......@@ -870,7 +870,7 @@ def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63
def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63
def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63
def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63
def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63
def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63
def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63
def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63
def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63
......
......@@ -871,7 +871,7 @@ def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63
def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63
def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63
def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63
def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63
def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63
def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63
def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63
def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63
......
......@@ -913,7 +913,7 @@ def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63
def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63
def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63
def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63
def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63
def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63
def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63
def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63
def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63
......@@ -2106,7 +2106,7 @@ def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63
def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63
def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63
def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63
def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63
def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63
def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63
def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63
def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63
......
......@@ -870,7 +870,7 @@ def test t_many_col_types t_many_col_types c11 c11 0 9 6 Y 32768 4 63
def test t_many_col_types t_many_col_types c12 c12 0 10 6 Y 32768 4 63
def test t_many_col_types t_many_col_types c13 c13 10 10 10 Y 128 0 63
def test t_many_col_types t_many_col_types c14 c14 12 19 19 Y 128 0 63
def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1217 0 63
def test t_many_col_types t_many_col_types c15 c15 7 19 19 N 1249 0 63
def test t_many_col_types t_many_col_types c16 c16 11 8 8 Y 128 0 63
def test t_many_col_types t_many_col_types c17 c17 13 4 4 Y 32864 0 63
def test t_many_col_types t_many_col_types c18 c18 1 1 1 Y 32768 0 63
......
......@@ -81,7 +81,10 @@ email varchar(50) NOT NULL default '',
PRIMARY KEY (id),
UNIQUE KEY e_n (email,name)
);
INSERT INTO t2 VALUES (1,'name1','email1'),(2,'name2','email2'),(3,'name3','email3'),(4,'name4','email4'),(5,'name5','email5'),(6,'name6','email6'),(7,'name7','email7'),(8,'name8','email8'),(9,'name9','email9'),(10,'name10','email10'),(11,'name11','email11'),(12,'name12','email12'),(13,'name13','email13'),(14,'name14','email14'),(15,'name15','email15'),(16,'name16','email16'),(17,'name17','email17'),(18,'name18','email18'),(19,'name19','email19'),(20,'name20','email20'),(21,'name21','email21'),(22,'name22','email22'),(23,'name23','email23'),(24,'name24','email24'),(25,'name25','email25'),(26,'name26','email26'),(27,'name27','email27'),(28,'name28','email28'),(29,'name29','email29'),(30,'name30','email30'),(31,'name31','email31'),(32,'name32','email32'),(33,'name33','email33'),(34,'name34','email34'),(35,'name35','email35'),(36,'name36','email36'),(37,'name37','email37'),(38,'name38','email38'),(39,'name39','email39'),(40,'name40','email40'),(41,'name41','email41'),(42,'name42','email42'),(43,'name43','email43'),(44,'name44','email44'),(45,'name45','email45'),(46,'name46','email46'),(47,'name47','email47'),(48,'name48','email48'),(49,'name49','email49'),(50,'name50','email50'),(51,'name51','email51'),(52,'name52','email52'),(53,'name53','email53'),(54,'name54','email54'),(55,'name55','email55'),(56,'name56','email56'),(57,'name57','email57'),(58,'name58','email58'),(59,'name59','email59'),(60,'name60','email60'),(61,'name61','email61'),(62,'name62','email62'),(63,'name63','email63'),(64,'name64','email64'),(65,'name65','email65'),(66,'name66','email66'),(67,'name67','email67'),(68,'name68','email68'),(69,'name69','email69'),(70,'name70','email70'),(71,'name71','email71'),(72,'name72','email72'),(73,'name73','email73'),(74,'name74','email74'),(75,'name75','email75'),(76,'name76','email76'),(77,'name77','email77'),(78,'name78','email78'),(79,'name79','email79'),(80,'name80','email80'),(81,'name81','email81'),(82,'name82','email82'),(83,'name83','email83'),(84,'name84','email84'),(85,'name85','email85'),(86,'name86','email86'),(87,'name87','email87'),(88,'name88','email88'),(89,'name89','email89'),(90,'name90','email90'),(91,'name91','email91'),(92,'name92','email92'),(93,'name93','email93'),(94,'name94','email94'),(95,'name95','email95'),(96,'name96','email96'),(97,'name97','email97'),(98,'name98','email98'),(99,'name99','email99'),(100,'name100','email100'),(101,'name101','email101'),(102,'name102','email102'),(103,'name103','email103'),(104,'name104','email104'),(105,'name105','email105'),(106,'name106','email106'),(107,'name107','email107'),(108,'name108','email108'),(109,'name109','email109'),(110,'name110','email110'),(111,'name111','email111'),(112,'name112','email112'),(113,'name113','email113'),(114,'name114','email114'),(115,'name115','email115'),(116,'name116','email116'),(117,'name117','email117'),(118,'name118','email118'),(119,'name119','email119'),(120,'name120','email120'),(121,'name121','email121'),(122,'name122','email122'),(123,'name123','email123'),(124,'name124','email124'),(125,'name125','email125'),(126,'name126','email126'),(127,'name127','email127'),(128,'name128','email128'),(129,'name129','email129'),(130,'name130','email130'),(131,'name131','email131'),(132,'name132','email132'),(133,'name133','email133'),(134,'name134','email134'),(135,'name135','email135'),(136,'name136','email136'),(137,'name137','email137'),(138,'name138','email138'),(139,'name139','email139'),(140,'name140','email140'),(141,'name141','email141'),(142,'name142','email142'),(143,'name143','email143'),(144,'name144','email144'),(145,'name145','email145'),(146,'name146','email146'),(147,'name147','email147'),(148,'name148','email148'),(149,'name149','email149'),(150,'name150','email150'),(151,'name151','email151'),(152,'name152','email152'),(153,'name153','email153'),(154,'name154','email154'),(155,'name155','email155'),(156,'name156','email156'),(157,'name157','email157'),(158,'name158','email158'),(159,'name159','email159'),(160,'name160','email160'),(161,'name161','email161'),(162,'name162','email162'),(163,'name163','email163'),(164,'name164','email164'),(165,'name165','email165'),(166,'name166','email166'),(167,'name167','email167'),(168,'name168','email168'),(169,'name169','email169'),(170,'name170','email170'),(171,'name171','email171'),(172,'name172','email172'),(173,'name173','email173'),(174,'name174','email174'),(175,'name175','email175'),(176,'name176','email176'),(177,'name177','email177'),(178,'name178','email178'),(179,'name179','email179'),(180,'name180','email180'),(181,'name181','email181'),(182,'name182','email182'),(183,'name183','email183'),(184,'name184','email184'),(185,'name185','email185'),(186,'name186','email186'),(187,'name187','email187'),(188,'name188','email188'),(189,'name189','email189'),(190,'name190','email190'),(191,'name191','email191'),(192,'name192','email192'),(193,'name193','email193'),(194,'name194','email194'),(195,'name195','email195'),(196,'name196','email196'),(197,'name197','email197'),(198,'name198','email198'),(199,'name199','email199'),(200,'name200','email200');
EXPLAIN SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system PRIMARY,kid NULL NULL NULL 0 const row not found
1 SIMPLE t2 index NULL e_n 100 NULL 200
SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
email
email1
......
......@@ -138,6 +138,13 @@ insert into t1(b)values(5);
insert into t1(b)values(6);
insert into t1(b)values(7);
select * from t1 order by b;
alter table t1 modify b mediumint;
select * from t1 order by b;
create table t2 (a int);
insert t2 values (1),(2);
alter table t2 add b int auto_increment primary key;
select * from t2;
drop table t2;
delete from t1 where a=0;
update t1 set a=0 where b=5;
select * from t1 order by b;
......
......@@ -48,6 +48,8 @@ flush privileges;
#connect (con1,localhost,test,gambling2,"");
#show tables;
connect (con1,localhost,test,gambling2,mysql);
--error 1105
set password='gambling3';
set password=old_password('gambling3');
show tables;
connect (con1,localhost,test,gambling3,test);
......
......@@ -132,16 +132,23 @@ insert into t1 values
('2003-01-02 11:11:12Pm', '%Y-%m-%d %h:%i:%S%p'),
('10:20:10', '%H:%i:%s'),
('10:20:10', '%h:%i:%s.%f'),
('10:20:10', '%T'),
('10:20:10AM', '%h:%i:%s%p'),
('10:20:10AM', '%r'),
('10:20:10.44AM', '%h:%i:%s.%f%p'),
('15-01-2001 12:59:58', '%d-%m-%Y %H:%i:%S'),
('15 September 2001', '%d %M %Y'),
('15 SEPTEMB 2001', '%d %M %Y'),
('15 MAY 2001', '%d %b %Y'),
('15th May 2001', '%D %b %Y'),
('Sunday 15 MAY 2001', '%W %d %b %Y'),
('Sund 15 MAY 2001', '%W %d %b %Y'),
('Tuesday 00 2002', '%W %U %Y'),
('Thursday 53 1998', '%W %u %Y'),
('Sunday 01 2001', '%W %v %x'),
('Tuesday 52 2001', '%W %V %X'),
('060 2004', '%j %Y'),
('4 53 1998', '%w %u %Y'),
('15-01-2001', '%d-%m-%Y %H:%i:%S'),
('15-01-20', '%d-%m-%y'),
('15-2001-1', '%d-%Y-%c');
......@@ -156,7 +163,7 @@ select date,format,DATE(str_to_date(date, format)) as date2 from t1;
select date,format,TIME(str_to_date(date, format)) as time from t1;
select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1;
# Test wrong dates
# Test wrong dates or converion specifiers
truncate table t1;
insert into t1 values
......@@ -169,10 +176,13 @@ insert into t1 values
('15 Septembei 2001', '%d %M %Y'),
('15 Ju 2001', '%d %M %Y'),
('Sund 15 MA', '%W %d %b %Y'),
('Sunday 01 2001', '%W %V %X'),
('Thursdai 12 1998', '%W %u %Y'),
(NULL, get_format(DATE,'USA')),
('Tuesday 52 2001', '%W %V %X');
('Sunday 01 2001', '%W %v %X'),
('Tuesday 52 2001', '%W %V %x'),
('Tuesday 52 2001', '%W %V %Y'),
('Tuesday 52 2001', '%W %u %x'),
('7 53 1998', '%w %u %Y'),
(NULL, get_format(DATE,'USA'));
select date,format,str_to_date(date, format) as str_to_date from t1;
select date,format,concat(str_to_date(date, format),'') as con from t1;
......
......@@ -284,6 +284,16 @@ SELECT * FROM t1 NATURAL JOIN t2 WHERE 1 AND Value1 = 'A' AND Value2 <> 'B';
SELECT * FROM t1 NATURAL JOIN t2 WHERE (Value1 = 'A' AND Value2 <> 'B') AND 1;
drop table t1,t2;
#
# dummy natural join (no common columns) Bug #4807
#
CREATE TABLE t1 (a int);
CREATE TABLE t2 (b int);
CREATE TABLE t3 (c int);
SELECT * FROM t1 NATURAL JOIN t2 NATURAL JOIN t3;
DROP TABLE t1, t2, t3;
#
# Test combination of join methods
#
......
# Test for the new options --start-datetime, stop-datetime,
# and a few others.
--disable_warnings
drop table if exists t1;
--enable_warnings
reset master;
# We need this for getting fixed timestamps inside of this test.
# I use a date in the future to keep a growing timestamp along the
# binlog (including the Start_log_event). This test will work
# unchanged everywhere, because mysql-test-run has fixed TZ, which it
# exports (so mysqlbinlog has same fixed TZ).
set @a=UNIX_TIMESTAMP("2020-01-21 15:32:22");
set timestamp=@a;
create table t1 (a int auto_increment not null primary key, b char(3));
insert into t1 values(null, "a");
insert into t1 values(null, "b");
set timestamp=@a+2;
insert into t1 values(null, "c");
set timestamp=@a+4;
insert into t1 values(null, "d");
insert into t1 values(null, "e");
flush logs;
set timestamp=@a+1; # this could happen on a slave
insert into t1 values(null, "f");
# delimiters are for easier debugging in future
--disable_query_log
select "--- Local --" as "";
--enable_query_log
#
# We should use --short-form everywhere because in other case output will
# be time dependent (the Start events). Better than nothing.
#
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001
--disable_query_log
select "--- offset --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQL_TEST_DIR/var/log/master-bin.000001
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=497 $MYSQL_TEST_DIR/var/log/master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=497 $MYSQL_TEST_DIR/var/log/master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQL_TEST_DIR/var/log/master-bin.000001
--disable_query_log
select "--- stop-datetime --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQL_TEST_DIR/var/log/master-bin.000001
--disable_query_log
select "--- Local with 2 binlogs on command line --" as "";
--enable_query_log
# This is to verify that some options apply only to first, or last binlog
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
--disable_query_log
select "--- offset --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=497 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=32 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
--disable_query_log
select "--- stop-datetime --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
--disable_query_log
select "--- Remote --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- offset --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --offset=2 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=497 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=497 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- stop-datetime --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- Remote with 2 binlogs on command line --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- offset --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --offset=2 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=497 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=32 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form "--start-datetime=20200121153224" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- stop-datetime --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020/01/21 15@32@24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- to-last-log --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --to-last-log master-bin.000001
# clean up
--disable_query_log
select "--- end of test --" as "";
--enable_query_log
drop table t1;
......@@ -29,7 +29,7 @@ col2 varchar(30) not null,
col3 varchar (20) not null,
col4 varchar(4) not null,
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
col6 int not null, to_be_deleted int);
col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
insert into t1 values (2,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (25, 4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
select * from t1 order by col1;
alter table t1
......
-- source include/have_ndb.inc
--disable_warnings
DROP TABLE IF EXISTS t2;
--enable_warnings
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
c int unsigned
) engine=ndbcluster;
#
# insert records into table
#
let $1=1000;
disable_query_log;
while ($1)
{
eval insert into t2 values($1*10, $1+9, 5*$1), ($1*10+1, $1+10, 7),($1*10+2, $1+10, 7*$1), ($1*10+3, $1+10, 10+$1), ($1*10+4, $1+10, 70*$1), ($1*10+5, $1+10, 7), ($1*10+6, $1+10, 9), ($1*10+7, $1+299, 899), ($1*10+8, $1+10, 12), ($1*10+9, $1+10, 14*$1);
dec $1;
}
enable_query_log;
select count(*) from t2;
delete from t2 limit 1;
select count(*) from t2;
delete from t2 limit 100;
select count(*) from t2;
delete from t2 limit 1000;
select count(*) from t2;
update t2 set c=12345678 limit 100;
select count(*) from t2 where c=12345678;
select count(*) from t2 where c=12345678 limit 1000;
select * from t2 limit 0;
drop table t2;
-- source include/have_ndb.inc
--disable_warnings
DROP TABLE IF EXISTS t2;
--enable_warnings
CREATE TABLE t2 (
a bigint unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
c int unsigned
) engine=ndbcluster;
#
# insert records into table
#
let $1=500;
disable_query_log;
while ($1)
{
eval insert into t2 values($1*10, $1+9, 5*$1), ($1*10+1, $1+10, 7),($1*10+2, $1+10, 7*$1), ($1*10+3, $1+10, 10+$1), ($1*10+4, $1+10, 70*$1), ($1*10+5, $1+10, 7), ($1*10+6, $1+10, 9), ($1*10+7, $1+299, 899), ($1*10+8, $1+10, 12), ($1*10+9, $1+10, 14*$1);
dec $1;
}
enable_query_log;
select count(*) from t2;
truncate table t2;
select count(*) from t2;
drop table t2;
......@@ -8,8 +8,7 @@
# The slave is started with max_binlog_size=16384 bytes,
# to force many rotations (approximately 30 rotations)
# If the master or slave does not support InnoDB, this test will pass
source include/have_innodb.inc;
source include/master-slave.inc;
connection slave;
stop slave;
......
......@@ -54,8 +54,18 @@ CREATE TABLE t2 (
UNIQUE KEY e_n (email,name)
);
INSERT INTO t2 VALUES (1,'name1','email1'),(2,'name2','email2'),(3,'name3','email3'),(4,'name4','email4'),(5,'name5','email5'),(6,'name6','email6'),(7,'name7','email7'),(8,'name8','email8'),(9,'name9','email9'),(10,'name10','email10'),(11,'name11','email11'),(12,'name12','email12'),(13,'name13','email13'),(14,'name14','email14'),(15,'name15','email15'),(16,'name16','email16'),(17,'name17','email17'),(18,'name18','email18'),(19,'name19','email19'),(20,'name20','email20'),(21,'name21','email21'),(22,'name22','email22'),(23,'name23','email23'),(24,'name24','email24'),(25,'name25','email25'),(26,'name26','email26'),(27,'name27','email27'),(28,'name28','email28'),(29,'name29','email29'),(30,'name30','email30'),(31,'name31','email31'),(32,'name32','email32'),(33,'name33','email33'),(34,'name34','email34'),(35,'name35','email35'),(36,'name36','email36'),(37,'name37','email37'),(38,'name38','email38'),(39,'name39','email39'),(40,'name40','email40'),(41,'name41','email41'),(42,'name42','email42'),(43,'name43','email43'),(44,'name44','email44'),(45,'name45','email45'),(46,'name46','email46'),(47,'name47','email47'),(48,'name48','email48'),(49,'name49','email49'),(50,'name50','email50'),(51,'name51','email51'),(52,'name52','email52'),(53,'name53','email53'),(54,'name54','email54'),(55,'name55','email55'),(56,'name56','email56'),(57,'name57','email57'),(58,'name58','email58'),(59,'name59','email59'),(60,'name60','email60'),(61,'name61','email61'),(62,'name62','email62'),(63,'name63','email63'),(64,'name64','email64'),(65,'name65','email65'),(66,'name66','email66'),(67,'name67','email67'),(68,'name68','email68'),(69,'name69','email69'),(70,'name70','email70'),(71,'name71','email71'),(72,'name72','email72'),(73,'name73','email73'),(74,'name74','email74'),(75,'name75','email75'),(76,'name76','email76'),(77,'name77','email77'),(78,'name78','email78'),(79,'name79','email79'),(80,'name80','email80'),(81,'name81','email81'),(82,'name82','email82'),(83,'name83','email83'),(84,'name84','email84'),(85,'name85','email85'),(86,'name86','email86'),(87,'name87','email87'),(88,'name88','email88'),(89,'name89','email89'),(90,'name90','email90'),(91,'name91','email91'),(92,'name92','email92'),(93,'name93','email93'),(94,'name94','email94'),(95,'name95','email95'),(96,'name96','email96'),(97,'name97','email97'),(98,'name98','email98'),(99,'name99','email99'),(100,'name100','email100'),(101,'name101','email101'),(102,'name102','email102'),(103,'name103','email103'),(104,'name104','email104'),(105,'name105','email105'),(106,'name106','email106'),(107,'name107','email107'),(108,'name108','email108'),(109,'name109','email109'),(110,'name110','email110'),(111,'name111','email111'),(112,'name112','email112'),(113,'name113','email113'),(114,'name114','email114'),(115,'name115','email115'),(116,'name116','email116'),(117,'name117','email117'),(118,'name118','email118'),(119,'name119','email119'),(120,'name120','email120'),(121,'name121','email121'),(122,'name122','email122'),(123,'name123','email123'),(124,'name124','email124'),(125,'name125','email125'),(126,'name126','email126'),(127,'name127','email127'),(128,'name128','email128'),(129,'name129','email129'),(130,'name130','email130'),(131,'name131','email131'),(132,'name132','email132'),(133,'name133','email133'),(134,'name134','email134'),(135,'name135','email135'),(136,'name136','email136'),(137,'name137','email137'),(138,'name138','email138'),(139,'name139','email139'),(140,'name140','email140'),(141,'name141','email141'),(142,'name142','email142'),(143,'name143','email143'),(144,'name144','email144'),(145,'name145','email145'),(146,'name146','email146'),(147,'name147','email147'),(148,'name148','email148'),(149,'name149','email149'),(150,'name150','email150'),(151,'name151','email151'),(152,'name152','email152'),(153,'name153','email153'),(154,'name154','email154'),(155,'name155','email155'),(156,'name156','email156'),(157,'name157','email157'),(158,'name158','email158'),(159,'name159','email159'),(160,'name160','email160'),(161,'name161','email161'),(162,'name162','email162'),(163,'name163','email163'),(164,'name164','email164'),(165,'name165','email165'),(166,'name166','email166'),(167,'name167','email167'),(168,'name168','email168'),(169,'name169','email169'),(170,'name170','email170'),(171,'name171','email171'),(172,'name172','email172'),(173,'name173','email173'),(174,'name174','email174'),(175,'name175','email175'),(176,'name176','email176'),(177,'name177','email177'),(178,'name178','email178'),(179,'name179','email179'),(180,'name180','email180'),(181,'name181','email181'),(182,'name182','email182'),(183,'name183','email183'),(184,'name184','email184'),(185,'name185','email185'),(186,'name186','email186'),(187,'name187','email187'),(188,'name188','email188'),(189,'name189','email189'),(190,'name190','email190'),(191,'name191','email191'),(192,'name192','email192'),(193,'name193','email193'),(194,'name194','email194'),(195,'name195','email195'),(196,'name196','email196'),(197,'name197','email197'),(198,'name198','email198'),(199,'name199','email199'),(200,'name200','email200');
disable_query_log;
let $1=200;
let $2=0;
while ($1)
{
inc $2;
eval INSERT INTO t2 VALUES ($2,'name$2','email$2');
dec $1;
}
enable_query_log;
EXPLAIN SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
SELECT FOUND_ROWS();
......
......@@ -17,7 +17,8 @@
MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir)
INCLUDES = @MT_INCLUDES@ \
@ZLIB_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir)
pkglib_LIBRARIES = libmysys.a
LDADD = libmysys.a ../dbug/libdbug.a \
../strings/libmystrings.a
......
......@@ -461,17 +461,6 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
else
finfo.mystat= NULL;
/*
If the directory is the root directory of the drive, Windows sometimes
creates hidden or system files there (like RECYCLER); do not show
them. We would need to see how this can be achieved with a Borland
compiler.
*/
#ifndef __BORLANDC__
if (attrib & (_A_HIDDEN | _A_SYSTEM))
continue;
#endif
if (push_dynamic(dir_entries_storage, (gptr)&finfo))
goto error;
......
......@@ -23,6 +23,7 @@ ndbapi/NdbReceiver.hpp \
ndbapi/NdbResultSet.hpp \
ndbapi/NdbScanFilter.hpp \
ndbapi/NdbScanOperation.hpp \
ndbapi/NdbIndexScanOperation.hpp \
ndbapi/ndberror.h
mgmapiinclude_HEADERS = \
......
......@@ -109,7 +109,8 @@ public:
NodeState(StartLevel);
NodeState(StartLevel, bool systemShutdown);
NodeState(StartLevel, Uint32 startPhase, StartType);
void init();
/**
* Current start level
*/
......@@ -180,6 +181,12 @@ public:
inline
NodeState::NodeState(){
init();
}
inline
void
NodeState::init(){
startLevel = SL_CMVMI;
nodeGroup = 0xFFFFFFFF;
dynamicId = 0xFFFFFFFF;
......@@ -190,7 +197,7 @@ NodeState::NodeState(){
inline
NodeState::NodeState(StartLevel sl){
NodeState::NodeState();
init();
startLevel = sl;
singleUserMode = 0;
singleUserApi = 0xFFFFFFFF;
......@@ -198,7 +205,7 @@ NodeState::NodeState(StartLevel sl){
inline
NodeState::NodeState(StartLevel sl, Uint32 sp, StartType typeOfStart){
NodeState::NodeState();
init();
startLevel = sl;
starting.startPhase = sp;
starting.restartType = typeOfStart;
......@@ -208,7 +215,7 @@ NodeState::NodeState(StartLevel sl, Uint32 sp, StartType typeOfStart){
inline
NodeState::NodeState(StartLevel sl, bool sys){
NodeState::NodeState();
init();
startLevel = sl;
stopping.systemShutdown = sys;
singleUserMode = 0;
......
......@@ -14,10 +14,7 @@
#define CFG_ACC_SCAN (PRIVATE_BASE + 9)
#define CFG_DICT_ATTRIBUTE (PRIVATE_BASE + 10)
#define CFG_DICT_CONNECT (PRIVATE_BASE + 11)
#define CFG_DICT_FRAG_CONNECT (PRIVATE_BASE + 12)
#define CFG_DICT_TABLE (PRIVATE_BASE + 13)
#define CFG_DICT_TC_CONNECT (PRIVATE_BASE + 14)
#define CFG_DIH_API_CONNECT (PRIVATE_BASE + 15)
#define CFG_DIH_CONNECT (PRIVATE_BASE + 16)
......@@ -27,10 +24,8 @@
#define CFG_DIH_TABLE (PRIVATE_BASE + 20)
#define CFG_LQH_FRAG (PRIVATE_BASE + 21)
#define CFG_LQH_CONNECT (PRIVATE_BASE + 22)
#define CFG_LQH_TABLE (PRIVATE_BASE + 23)
#define CFG_LQH_TC_CONNECT (PRIVATE_BASE + 24)
#define CFG_LQH_REPLICAS (PRIVATE_BASE + 25)
#define CFG_LQH_LOG_FILES (PRIVATE_BASE + 26)
#define CFG_LQH_SCAN (PRIVATE_BASE + 27)
......
......@@ -94,6 +94,7 @@ public:
TcDumpOneApiConnectRec = 2505,
TcDumpAllApiConnectRec = 2506,
TcSetTransactionTimeout = 2507,
TcSetApplTransactionTimeout = 2508,
CmvmiDumpConnections = 2600,
CmvmiDumpLongSignalMemory = 2601,
CmvmiSetRestartOnErrorInsert = 2602,
......
......@@ -21,20 +21,10 @@
#include <ndb_limits.h>
#include <kernel_types.h>
#ifndef NDB_ASSERT
#ifdef VM_TRACE
#define NDB_ASSERT(test, message) { if(!(test)) { printf(message); exit(-1); }}
#else
#define NDB_ASSERT(test, message)
#endif
#endif
// Useful ASSERT macros...
#define ASSERT_BOOL(flag, message) NDB_ASSERT( (flag<=1), (message) )
#define ASSERT_BOOL(flag, message) assert(flag<=1)
#define ASSERT_RANGE(value, min, max, message) \
NDB_ASSERT((value) >= (min) && (value) <= (max), (message))
#define ASSERT_MAX(value, max, message) \
NDB_ASSERT((value) <= (max), (message))
assert((value) >= (min) && (value) <= (max))
#define ASSERT_MAX(value, max, message) assert((value) <= (max))
#define SECTION(x) STATIC_CONST(x)
......
......@@ -106,6 +106,31 @@ extern "C" {
struct ndb_mgm_reply* reply);
/**
*
* @param handle the NDB management handle.
* @param nodeId the node id. 0 = all db nodes
* @param errrorCode the errorCode.
* @param reply the reply message.
* @return 0 if successful or an error code.
*/
int ndb_mgm_set_int_parameter(NdbMgmHandle handle,
int node,
int param,
unsigned value,
struct ndb_mgm_reply* reply);
int ndb_mgm_set_int64_parameter(NdbMgmHandle handle,
int node,
int param,
unsigned long long value,
struct ndb_mgm_reply* reply);
int ndb_mgm_set_string_parameter(NdbMgmHandle handle,
int node,
int param,
const char * value,
struct ndb_mgm_reply* reply);
#ifdef __cplusplus
}
#endif
......
......@@ -19,6 +19,8 @@
#include <ndb_types.h>
#include <mgmapi.h>
#include <BaseString.hpp>
#include <LocalConfig.hpp>
/**
* @class ConfigRetriever
......@@ -26,15 +28,16 @@
*/
class ConfigRetriever {
public:
ConfigRetriever();
ConfigRetriever(const int id, const char* remoteHost, const int port);
ConfigRetriever(Uint32 version, Uint32 nodeType);
~ConfigRetriever();
/**
* Read local config
* @return Own node id, -1 means fail
*/
int init(bool onlyNodeId = false);
int init();
int do_connect();
/**
* Get configuration for current (nodeId given in local config file) node.
......@@ -47,7 +50,7 @@ public:
* @return ndb_mgm_configuration object if succeeded,
* NULL if erroneous local config file or configuration error.
*/
struct ndb_mgm_configuration * getConfig(int versionId, int nodeType);
struct ndb_mgm_configuration * getConfig();
const char * getErrorString();
......@@ -61,29 +64,22 @@ public:
*/
void setLocalConfigFileName(const char * connectString);
/**
* Sets connectstring which can be used instead of local config file
* environment variables and Ndb.cfg has precidence over this
*/
void setDefaultConnectString(const char * defaultConnectString);
/**
* @return Node id of this node (as stated in local config or connectString)
*/
inline Uint32 getOwnNodeId() { return _ownNodeId; }
Uint32 allocNodeId();
/**
* Get config using socket
*/
struct ndb_mgm_configuration * getConfig(const char * mgmhost, short port,
int versionId, int nodetype);
struct ndb_mgm_configuration * getConfig(NdbMgmHandle handle);
/**
* Get config from file
*/
struct ndb_mgm_configuration * getConfig(const char * file, int versionId);
struct ndb_mgm_configuration * getConfig(const char * file);
private:
char * errorString;
BaseString errorString;
enum ErrorType {
CR_ERROR = 0,
CR_RETRY = 1
......@@ -91,20 +87,21 @@ private:
ErrorType latestErrorType;
void setError(ErrorType, const char * errorMsg);
char * _localConfigFileName;
struct LocalConfig * _localConfig;
BaseString _localConfigFileName;
struct LocalConfig _localConfig;
int _ownNodeId;
char * m_connectString;
char * m_defaultConnectString;
BaseString m_connectString;
Uint32 m_version;
Uint32 m_node_type;
NdbMgmHandle m_handle;
/**
* Verify config
*/
bool verifyConfig(const struct ndb_mgm_configuration *, int type);
bool verifyConfig(const struct ndb_mgm_configuration *);
};
#endif
......
......@@ -32,49 +32,35 @@ enum MgmtSrvrId_Type {
struct MgmtSrvrId {
MgmtSrvrId_Type type;
union {
struct {
char * remoteHost;
unsigned int port;
} tcp;
struct {
char * filename;
} file;
} data;
BaseString name;
unsigned int port;
};
struct LocalConfig {
int _ownNodeId;
int size;
int items;
MgmtSrvrId ** ids;
Vector<MgmtSrvrId> ids;
int error_line;
char error_msg[256];
LocalConfig();
~LocalConfig();
bool init(bool onlyNodeId = false,
const char *connectString = 0,
const char *fileName = 0,
const char *defaultConnectString = 0);
void add(MgmtSrvrId *i);
bool init(const char *connectString = 0,
const char *fileName = 0);
void printError() const;
void printUsage() const;
void setError(int lineNumber, const char * _msg);
bool readConnectString(const char * connectString, bool onlyNodeId = false);
bool readFile(const char * filename, bool &fopenError, bool onlyNodeId = false);
bool readConnectString(const char *);
bool readFile(const char * file, bool &fopenError);
bool parseLine(char * line, int lineNumber);
bool parseNodeId(const char *buf);
bool parseHostName(const char *buf);
bool parseFileName(const char *buf);
bool parseString(const char *buf, bool onlyNodeId, char *line);
bool parseString(const char *buf, char *line);
};
#endif // LocalConfig_H
......
......@@ -63,12 +63,6 @@
// Returns: -
//****************************************************************************
#ifndef NDB_ASSERT
#define NDB_ASSERT(trueToContinue, message) \
if ( !(trueToContinue) ) { \
ndbout << "ASSERT FAILED. FILE: " << __FILE__ << ", LINE: " << __LINE__ << ", MSG: " << message << endl;exit(-1);}
#endif
#define MGM_REQUIRE(x) \
if (!(x)) { ndbout << __FILE__ << " " << __LINE__ \
<< ": Warning! Requirement failed" << endl; }
......@@ -325,7 +325,7 @@ public:
/**
* Get size of element
*/
int Column::getSize() const;
int getSize() const;
/**
* Set distribution key
......
......@@ -746,8 +746,6 @@ protected:
int prepareSendInterpreted(); // Help routine to prepare*
void TCOPCONF(Uint32 anNdbColumnImplLen); // Handle TC[KEY/INDX]CONF signal
int receiveTCKEYREF(NdbApiSignal*);
......
......@@ -19,11 +19,6 @@
#include <ndb_global.h>
#ifndef NDB_ASSERT
#define NDB_ASSERT(x, s) \
do { if (!(x)) { printf("%s\n", s); abort(); } } while (0)
#endif
/**
* Bitmask implementation. Size is given explicitly
* (as first argument). All methods are static.
......@@ -140,7 +135,7 @@ public:
inline bool
BitmaskImpl::get(unsigned size, const Uint32 data[], unsigned n)
{
NDB_ASSERT(n < (size << 5), "bit get out of range");
assert(n < (size << 5));
return (data[n >> 5] & (1 << (n & 31))) != 0;
}
......@@ -153,7 +148,7 @@ BitmaskImpl::set(unsigned size, Uint32 data[], unsigned n, bool value)
inline void
BitmaskImpl::set(unsigned size, Uint32 data[], unsigned n)
{
NDB_ASSERT(n < (size << 5), "bit set out of range");
assert(n < (size << 5));
data[n >> 5] |= (1 << (n & 31));
}
......@@ -176,7 +171,7 @@ BitmaskImpl::assign(unsigned size, Uint32 dst[], const Uint32 src[])
inline void
BitmaskImpl::clear(unsigned size, Uint32 data[], unsigned n)
{
NDB_ASSERT(n < (size << 5), "bit clear out of range");
assert(n < (size << 5));
data[n >> 5] &= ~(1 << (n & 31));
}
......@@ -493,14 +488,14 @@ template <unsigned size>
inline void
BitmaskPOD<size>::assign(const typename BitmaskPOD<size>::Data & src)
{
assign(rep.data, src.data);
BitmaskPOD<size>::assign(rep.data, src.data);
}
template <unsigned size>
inline void
BitmaskPOD<size>::assign(const BitmaskPOD<size> & src)
{
assign(rep.data, src.rep.data);
BitmaskPOD<size>::assign(rep.data, src.rep.data);
}
template <unsigned size>
......@@ -528,7 +523,7 @@ template <unsigned size>
inline bool
BitmaskPOD<size>::get(unsigned n) const
{
return get(rep.data, n);
return BitmaskPOD<size>::get(rep.data, n);
}
template <unsigned size>
......@@ -542,7 +537,7 @@ template <unsigned size>
inline void
BitmaskPOD<size>::set(unsigned n, bool value)
{
set(rep.data, n, value);
BitmaskPOD<size>::set(rep.data, n, value);
}
template <unsigned size>
......@@ -556,7 +551,7 @@ template <unsigned size>
inline void
BitmaskPOD<size>::set(unsigned n)
{
set(rep.data, n);
BitmaskPOD<size>::set(rep.data, n);
}
template <unsigned size>
......@@ -570,7 +565,7 @@ template <unsigned size>
inline void
BitmaskPOD<size>::set()
{
set(rep.data);
BitmaskPOD<size>::set(rep.data);
}
template <unsigned size>
......@@ -584,7 +579,7 @@ template <unsigned size>
inline void
BitmaskPOD<size>::clear(unsigned n)
{
clear(rep.data, n);
BitmaskPOD<size>::clear(rep.data, n);
}
template <unsigned size>
......@@ -598,7 +593,7 @@ template <unsigned size>
inline void
BitmaskPOD<size>::clear()
{
clear(rep.data);
BitmaskPOD<size>::clear(rep.data);
}
template <unsigned size>
......@@ -612,7 +607,7 @@ template <unsigned size>
inline bool
BitmaskPOD<size>::isclear() const
{
return isclear(rep.data);
return BitmaskPOD<size>::isclear(rep.data);
}
template <unsigned size>
......@@ -626,7 +621,7 @@ template <unsigned size>
inline unsigned
BitmaskPOD<size>::count() const
{
return count(rep.data);
return BitmaskPOD<size>::count(rep.data);
}
template <unsigned size>
......@@ -640,7 +635,7 @@ template <unsigned size>
inline unsigned
BitmaskPOD<size>::find(unsigned n) const
{
return find(rep.data, n);
return BitmaskPOD<size>::find(rep.data, n);
}
template <unsigned size>
......@@ -654,7 +649,7 @@ template <unsigned size>
inline bool
BitmaskPOD<size>::equal(const BitmaskPOD<size>& mask2) const
{
return equal(rep.data, mask2.rep.data);
return BitmaskPOD<size>::equal(rep.data, mask2.rep.data);
}
template <unsigned size>
......@@ -668,7 +663,7 @@ template <unsigned size>
inline BitmaskPOD<size>&
BitmaskPOD<size>::bitOR(const BitmaskPOD<size>& mask2)
{
bitOR(rep.data, mask2.rep.data);
BitmaskPOD<size>::bitOR(rep.data, mask2.rep.data);
return *this;
}
......@@ -683,7 +678,7 @@ template <unsigned size>
inline BitmaskPOD<size>&
BitmaskPOD<size>::bitAND(const BitmaskPOD<size>& mask2)
{
bitAND(rep.data, mask2.rep.data);
BitmaskPOD<size>::bitAND(rep.data, mask2.rep.data);
return *this;
}
......@@ -698,7 +693,7 @@ template <unsigned size>
inline BitmaskPOD<size>&
BitmaskPOD<size>::bitANDC(const BitmaskPOD<size>& mask2)
{
bitANDC(rep.data, mask2.rep.data);
BitmaskPOD<size>::bitANDC(rep.data, mask2.rep.data);
return *this;
}
......@@ -713,7 +708,7 @@ template <unsigned size>
inline BitmaskPOD<size>&
BitmaskPOD<size>::bitXOR(const BitmaskPOD<size>& mask2)
{
bitXOR(rep.data, mask2.rep.data);
BitmaskPOD<size>::bitXOR(rep.data, mask2.rep.data);
return *this;
}
......@@ -728,7 +723,7 @@ template <unsigned size>
inline char *
BitmaskPOD<size>::getText(char* buf) const
{
return getText(rep.data, buf);
return BitmaskPOD<size>::getText(rep.data, buf);
}
template <unsigned size>
......@@ -742,7 +737,7 @@ template <unsigned size>
inline bool
BitmaskPOD<size>::contains(BitmaskPOD<size> that)
{
return contains(this->rep.data, that.rep.data);
return BitmaskPOD<size>::contains(this->rep.data, that.rep.data);
}
template <unsigned size>
......@@ -756,13 +751,13 @@ template <unsigned size>
inline bool
BitmaskPOD<size>::overlaps(BitmaskPOD<size> that)
{
return overlaps(this->rep.data, that.rep.data);
return BitmaskPOD<size>::overlaps(this->rep.data, that.rep.data);
}
template <unsigned size>
class Bitmask : public BitmaskPOD<size> {
public:
Bitmask() { clear();}
Bitmask() { this->clear();}
};
#endif
......@@ -32,9 +32,8 @@ public:
class ConstIterator {
friend class ConfigValuesFactory;
const ConfigValues & m_cfg;
protected:
Uint32 m_currentSection;
public:
Uint32 m_currentSection;
ConstIterator(const ConfigValues&c) : m_cfg(c) { m_currentSection = 0;}
bool openSection(Uint32 key, Uint32 no);
......@@ -57,6 +56,9 @@ public:
ConfigValues & m_cfg;
public:
Iterator(ConfigValues&c) : ConstIterator(c), m_cfg(c) {}
Iterator(ConfigValues&c, const ConstIterator& i):ConstIterator(c),m_cfg(c){
m_currentSection = i.m_currentSection;
}
bool set(Uint32 key, Uint32 value);
bool set(Uint32 key, Uint64 value);
......
......@@ -29,10 +29,11 @@ static const char * localBlockNames[NO_OF_BLOCKS];
static
int
initSignalNames(const char * dst[], const GsnName src[], unsigned short len){
for(int i = 0; i<=MAX_GSN; i++)
int i;
for(i = 0; i<=MAX_GSN; i++)
dst[i] = 0;
for(int i = 0; i<len; i++){
for(i = 0; i<len; i++){
unsigned short gsn = src[i].gsn;
const char * name = src[i].name;
......@@ -54,10 +55,11 @@ int
initSignalPrinters(SignalDataPrintFunction dst[],
const NameFunctionPair src[],
unsigned short len){
for(int i = 0; i<=MAX_GSN; i++)
int i;
for(i = 0; i<=MAX_GSN; i++)
dst[i] = 0;
for(int i = 0; i<len; i++){
for(i = 0; i<len; i++){
unsigned short gsn = src[i].gsn;
SignalDataPrintFunction fun = src[i].function;
......@@ -79,10 +81,11 @@ int
initBlockNames(const char * dst[],
const BlockName src[],
unsigned len){
for(int i = 0; i<NO_OF_BLOCKS; i++)
int i;
for(i = 0; i<NO_OF_BLOCKS; i++)
dst[i] = 0;
for(unsigned i = 0; i<len; i++){
for(i = 0; i<len; i++){
const int index = src[i].number - MIN_BLOCK_NO;
if(index < 0 && index >= NO_OF_BLOCKS || dst[index] != 0){
fprintf(stderr,
......
......@@ -1303,14 +1303,15 @@ bool
EventLogger::matchEventCategory(const char * str,
LogLevel::EventCategory * cat,
bool exactMatch){
unsigned i;
if(cat == 0 || str == 0)
return false;
char * tmp = strdup(str);
for(size_t i = 0; i<strlen(tmp); i++)
for(i = 0; i<strlen(tmp); i++)
tmp[i] = toupper(tmp[i]);
for(Uint32 i = 0; i<noOfEventCategoryNames; i++){
for(i = 0; i<noOfEventCategoryNames; i++){
if(strcmp(tmp, eventCategoryNames[i].name) == 0){
* cat = eventCategoryNames[i].category;
free(tmp);
......
......@@ -487,31 +487,6 @@ SignalLoggerManager::printLinearSection(FILE * output,
putc('\n', output);
}
void
SignalLoggerManager::printSegmentedSection(FILE * output,
const SignalHeader & sh,
const SegmentedSectionPtr ptr[3],
unsigned i)
{
fprintf(output, "SECTION %u type=segmented", i);
if (i >= 3) {
fprintf(output, " *** invalid ***\n");
return;
}
const Uint32 len = ptr[i].sz;
SectionSegment * ssp = ptr[i].p;
Uint32 pos = 0;
fprintf(output, " size=%u\n", (unsigned)len);
while (pos < len) {
if (pos > 0 && pos % SectionSegment::DataLength == 0) {
ssp = g_sectionSegmentPool.getPtr(ssp->m_nextSegment);
}
printDataWord(output, pos, ssp->theData[pos % SectionSegment::DataLength]);
}
if (len > 0)
putc('\n', output);
}
void
SignalLoggerManager::printDataWord(FILE * output, Uint32 & pos, const Uint32 data)
{
......
......@@ -25,7 +25,8 @@ printSTART_LCP_REQ(FILE * output, const Uint32 * theData,
const StartLcpReq * const sig = (StartLcpReq *) theData;
char buf1[sig->participatingDIH.TextLength+1], buf2[sig->participatingLQH.TextLength+1];
char buf1[8*_NDB_NODE_BITMASK_SIZE+1];
char buf2[8*_NDB_NODE_BITMASK_SIZE+1];
fprintf(output,
" Sender: %d LcpId: %d\n"
" ParticipatingDIH = %s\n"
......
......@@ -254,5 +254,9 @@ SignalDataPrintFunctions[] = {
const unsigned short NO_OF_PRINT_FUNCTIONS = sizeof(SignalDataPrintFunctions)/sizeof(NameFunctionPair);
template class Bitmask<1>;
template class Bitmask<2>;
template class Bitmask<4>;
template struct BitmaskPOD<1>;
template struct BitmaskPOD<2>;
template struct BitmaskPOD<4>;
......@@ -350,3 +350,4 @@ Logger::log(LoggerLevel logLevel, const char* pMsg, va_list ap) const
// PRIVATE
//
template class Vector<LogHandler*>;
......@@ -1878,13 +1878,14 @@ const int ConfigInfo::m_NoOfParams = sizeof(m_ParamInfo) / sizeof(ParamInfo);
static void require(bool v) { if(!v) abort();}
ConfigInfo::ConfigInfo() {
int i;
Properties *section;
const Properties *oldpinfo;
m_info.setCaseInsensitiveNames(true);
m_systemDefaults.setCaseInsensitiveNames(true);
for (int i=0; i<m_NoOfParams; i++) {
for (i=0; i<m_NoOfParams; i++) {
const ParamInfo & param = m_ParamInfo[i];
// Create new section if it did not exist
......@@ -1939,7 +1940,7 @@ ConfigInfo::ConfigInfo() {
}
}
for (int i=0; i<m_NoOfParams; i++) {
for (i=0; i<m_NoOfParams; i++) {
if(m_ParamInfo[i]._section == NULL){
ndbout << "Check that each entry has a section failed." << endl;
ndbout << "Parameter \"" << m_ParamInfo[i]._fname << endl;
......@@ -2777,13 +2778,14 @@ transform(InitConfigFileParser::Context & ctx,
bool
fixDepricated(InitConfigFileParser::Context & ctx, const char * data){
const char * name;
/**
* Transform old values to new values
* Transform new values to old values (backward compatible)
*/
Properties tmp;
Properties::Iterator it(ctx.m_currentSection);
for (const char* name = it.first(); name != NULL; name = it.next()) {
for (name = it.first(); name != NULL; name = it.next()) {
const DepricationTransform * p = &f_deprication[0];
while(p->m_section != 0){
if(strcmp(p->m_section, ctx.fname) == 0){
......@@ -2804,7 +2806,7 @@ fixDepricated(InitConfigFileParser::Context & ctx, const char * data){
}
Properties::Iterator it2(&tmp);
for (const char* name = it2.first(); name != NULL; name = it2.next()) {
for (name = it2.first(); name != NULL; name = it2.next()) {
PropertiesType type;
require(tmp.getTypeOf(name, &type));
switch(type){
......@@ -2910,11 +2912,12 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
struct InitConfigFileParser::Context &ctx,
const char * rule_data)
{
Uint32 i;
Properties * props= ctx.m_config;
Properties p_connections;
Properties p_connections2;
for (Uint32 i = 0;; i++){
for (i = 0;; i++){
const Properties * tmp;
Uint32 nodeId1, nodeId2;
......@@ -2935,8 +2938,8 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
Properties p_db_nodes;
Properties p_api_mgm_nodes;
Uint32 i_db= 0, i_api_mgm= 0;
for (Uint32 i= 0, n= 0; n < nNodes; i++){
Uint32 i_db= 0, i_api_mgm= 0, n;
for (i= 0, n= 0; n < nNodes; i++){
const Properties * tmp;
if(!props->get("Node", i, &tmp)) continue;
n++;
......@@ -2953,7 +2956,7 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
Uint32 nodeId1, nodeId2, dummy;
for (Uint32 i= 0; p_db_nodes.get("", i, &nodeId1); i++){
for (i= 0; p_db_nodes.get("", i, &nodeId1); i++){
for (Uint32 j= i+1;; j++){
if(!p_db_nodes.get("", j, &nodeId2)) break;
if(!p_connections2.get("", nodeId1+nodeId2<<16, &dummy)) {
......@@ -2970,7 +2973,7 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
}
}
for (Uint32 i= 0; p_api_mgm_nodes.get("", i, &nodeId1); i++){
for (i= 0; p_api_mgm_nodes.get("", i, &nodeId1); i++){
if(!p_connections.get("", nodeId1, &dummy)) {
for (Uint32 j= 0;; j++){
if(!p_db_nodes.get("", j, &nodeId2)) break;
......@@ -2989,6 +2992,7 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
return true;
}
bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections,
struct InitConfigFileParser::Context &ctx,
const char * rule_data)
......@@ -3028,3 +3032,4 @@ bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections,
return true;
}
template class Vector<ConfigInfo::ConfigRuleSection>;
......@@ -20,16 +20,13 @@
#include <NdbAutoPtr.hpp>
LocalConfig::LocalConfig(){
ids = 0; size = 0; items = 0;
error_line = 0; error_msg[0] = 0;
_ownNodeId= 0;
}
bool
LocalConfig::init(bool onlyNodeId,
const char *connectString,
const char *fileName,
const char *defaultConnectString) {
LocalConfig::init(const char *connectString,
const char *fileName) {
/**
* Escalation:
* 1. Check connectString
......@@ -41,8 +38,8 @@ LocalConfig::init(bool onlyNodeId,
*/
//1. Check connectString
if(connectString != 0) {
if(readConnectString(connectString, onlyNodeId)){
if(connectString != 0 && connectString[0] != 0){
if(readConnectString(connectString)){
return true;
}
return false;
......@@ -51,7 +48,7 @@ LocalConfig::init(bool onlyNodeId,
//2. Check given filename
if (fileName && strlen(fileName) > 0) {
bool fopenError;
if(readFile(fileName, fopenError, onlyNodeId)){
if(readFile(fileName, fopenError)){
return true;
}
return false;
......@@ -61,7 +58,7 @@ LocalConfig::init(bool onlyNodeId,
char buf[255];
if(NdbEnv_GetEnv("NDB_CONNECTSTRING", buf, sizeof(buf)) &&
strlen(buf) != 0){
if(readConnectString(buf, onlyNodeId)){
if(readConnectString(buf)){
return true;
}
return false;
......@@ -72,7 +69,7 @@ LocalConfig::init(bool onlyNodeId,
bool fopenError;
char *buf= NdbConfig_NdbCfgName(1 /*true*/);
NdbAutoPtr<char> tmp_aptr(buf);
if(readFile(buf, fopenError, onlyNodeId))
if(readFile(buf, fopenError))
return true;
if (!fopenError)
return false;
......@@ -83,24 +80,17 @@ LocalConfig::init(bool onlyNodeId,
bool fopenError;
char *buf= NdbConfig_NdbCfgName(0 /*false*/);
NdbAutoPtr<char> tmp_aptr(buf);
if(readFile(buf, fopenError, onlyNodeId))
if(readFile(buf, fopenError))
return true;
if (!fopenError)
return false;
}
//6. Check defaultConnectString
if(defaultConnectString != 0) {
if(readConnectString(defaultConnectString, onlyNodeId))
return true;
return false;
}
//7. Check
{
char buf[256];
snprintf(buf, sizeof(buf), "host=localhost:%u", NDB_BASE_PORT);
if(readConnectString(buf, onlyNodeId))
if(readConnectString(buf))
return true;
}
......@@ -110,30 +100,8 @@ LocalConfig::init(bool onlyNodeId,
}
LocalConfig::~LocalConfig(){
for(int i = 0; i<items; i++){
if(ids[i]->type == MgmId_TCP)
free(ids[i]->data.tcp.remoteHost);
else if(ids[i]->type == MgmId_File)
free(ids[i]->data.file.filename);
delete ids[i];
}
if(ids != 0)
delete[] ids;
}
void LocalConfig::add(MgmtSrvrId * i){
if(items == size){
MgmtSrvrId ** tmp = new MgmtSrvrId * [size+10];
if(ids != 0){
memcpy(tmp, ids, items*sizeof(MgmtSrvrId *));
delete []ids;
}
ids = tmp;
}
ids[items] = i;
items++;
}
void LocalConfig::setError(int lineNumber, const char * _msg) {
error_line = lineNumber;
strncpy(error_msg, _msg, sizeof(error_msg));
......@@ -162,13 +130,13 @@ void LocalConfig::printUsage() const {
<<endl<<endl;
}
char *nodeIdTokens[] = {
const char *nodeIdTokens[] = {
"OwnProcessId %i",
"nodeid=%i",
0
};
char *hostNameTokens[] = {
const char *hostNameTokens[] = {
"host://%[^:]:%i",
"host=%[^:]:%i",
"%[^:]:%i",
......@@ -176,7 +144,7 @@ char *hostNameTokens[] = {
0
};
char *fileNameTokens[] = {
const char *fileNameTokens[] = {
"file://%s",
"file=%s",
0
......@@ -196,11 +164,11 @@ LocalConfig::parseHostName(const char * buf){
int port;
for(int i = 0; hostNameTokens[i] != 0; i++) {
if (sscanf(buf, hostNameTokens[i], tempString, &port) == 2) {
MgmtSrvrId* mgmtSrvrId = new MgmtSrvrId();
mgmtSrvrId->type = MgmId_TCP;
mgmtSrvrId->data.tcp.remoteHost = strdup(tempString);
mgmtSrvrId->data.tcp.port = port;
add(mgmtSrvrId);
MgmtSrvrId mgmtSrvrId;
mgmtSrvrId.type = MgmId_TCP;
mgmtSrvrId.name.assign(tempString);
mgmtSrvrId.port = port;
ids.push_back(mgmtSrvrId);
return true;
}
}
......@@ -212,10 +180,10 @@ LocalConfig::parseFileName(const char * buf){
char tempString[1024];
for(int i = 0; fileNameTokens[i] != 0; i++) {
if (sscanf(buf, fileNameTokens[i], tempString) == 1) {
MgmtSrvrId* mgmtSrvrId = new MgmtSrvrId();
mgmtSrvrId->type = MgmId_File;
mgmtSrvrId->data.file.filename = strdup(tempString);
add(mgmtSrvrId);
MgmtSrvrId mgmtSrvrId;
mgmtSrvrId.type = MgmId_File;
mgmtSrvrId.name.assign(tempString);
ids.push_back(mgmtSrvrId);
return true;
}
}
......@@ -223,7 +191,7 @@ LocalConfig::parseFileName(const char * buf){
}
bool
LocalConfig::parseString(const char * connectString, bool onlyNodeId, char *line){
LocalConfig::parseString(const char * connectString, char *line){
char * for_strtok;
char * copy = strdup(connectString);
NdbAutoPtr<char> tmp_aptr(copy);
......@@ -231,8 +199,7 @@ LocalConfig::parseString(const char * connectString, bool onlyNodeId, char *line
bool b_nodeId = false;
bool found_other = false;
for (char *tok = strtok_r(copy,";",&for_strtok);
tok != 0 && !(onlyNodeId && b_nodeId);
for (char *tok = strtok_r(copy,";",&for_strtok); tok != 0;
tok = strtok_r(NULL, ";", &for_strtok)) {
if (tok[0] == '#') continue;
......@@ -240,8 +207,6 @@ LocalConfig::parseString(const char * connectString, bool onlyNodeId, char *line
if (!b_nodeId) // only one nodeid definition allowed
if (b_nodeId = parseNodeId(tok))
continue;
if (onlyNodeId)
continue;
if (found_other = parseHostName(tok))
continue;
if (found_other = parseFileName(tok))
......@@ -252,16 +217,17 @@ LocalConfig::parseString(const char * connectString, bool onlyNodeId, char *line
return false;
}
if (!onlyNodeId && !found_other) {
if (!found_other) {
if (line)
snprintf(line, 150, "Missing host/file name extry in \"%s\"", connectString);
snprintf(line, 150, "Missing host/file name extry in \"%s\"",
connectString);
return false;
}
return true;
}
bool LocalConfig::readFile(const char * filename, bool &fopenError, bool onlyNodeId)
bool LocalConfig::readFile(const char * filename, bool &fopenError)
{
char line[150], line2[150];
......@@ -292,7 +258,7 @@ bool LocalConfig::readFile(const char * filename, bool &fopenError, bool onlyNod
strcat(theString, line);
}
bool return_value = parseString(theString, onlyNodeId, line);
bool return_value = parseString(theString, line);
if (!return_value) {
snprintf(line2, 150, "Reading %s: %s", filename, line);
......@@ -305,9 +271,9 @@ bool LocalConfig::readFile(const char * filename, bool &fopenError, bool onlyNod
}
bool
LocalConfig::readConnectString(const char * connectString, bool onlyNodeId){
LocalConfig::readConnectString(const char * connectString){
char line[150], line2[150];
bool return_value = parseString(connectString, onlyNodeId, line);
bool return_value = parseString(connectString, line);
if (!return_value) {
snprintf(line2, 150, "Reading NDB_CONNECTSTRING \"%s\": %s", connectString, line);
setError(0,line2);
......
......@@ -391,6 +391,7 @@ Packer::pack(Uint32 * insertPtr,
const SignalHeader * header,
const Uint32 * theData,
const LinearSectionPtr ptr[3]) const {
Uint32 i;
Uint32 dataLen32 = header->theLength;
Uint32 no_segs = header->m_noOfSections;
......@@ -400,7 +401,7 @@ Packer::pack(Uint32 * insertPtr,
checksumUsed + signalIdUsed + (sizeof(Protocol6)/4);
for(Uint32 i = 0; i<no_segs; i++){
for(i = 0; i<no_segs; i++){
len32 += ptr[i].sz;
}
......@@ -429,12 +430,12 @@ Packer::pack(Uint32 * insertPtr,
memcpy(tmpInserPtr, theData, 4 * dataLen32);
tmpInserPtr += dataLen32;
for(Uint32 i = 0; i<no_segs; i++){
for(i = 0; i<no_segs; i++){
tmpInserPtr[i] = ptr[i].sz;
}
tmpInserPtr += no_segs;
for(Uint32 i = 0; i<no_segs; i++){
for(i = 0; i<no_segs; i++){
import(tmpInserPtr, ptr[i]);
}
......@@ -450,6 +451,7 @@ Packer::pack(Uint32 * insertPtr,
const Uint32 * theData,
class SectionSegmentPool & thePool,
const SegmentedSectionPtr ptr[3]) const {
Uint32 i;
Uint32 dataLen32 = header->theLength;
Uint32 no_segs = header->m_noOfSections;
......@@ -458,7 +460,7 @@ Packer::pack(Uint32 * insertPtr,
dataLen32 + no_segs +
checksumUsed + signalIdUsed + (sizeof(Protocol6)/4);
for(Uint32 i = 0; i<no_segs; i++){
for(i = 0; i<no_segs; i++){
len32 += ptr[i].sz;
}
......@@ -487,12 +489,12 @@ Packer::pack(Uint32 * insertPtr,
memcpy(tmpInserPtr, theData, 4 * dataLen32);
tmpInserPtr += dataLen32;
for(Uint32 i = 0; i<no_segs; i++){
for(i = 0; i<no_segs; i++){
tmpInserPtr[i] = ptr[i].sz;
}
tmpInserPtr += no_segs;
for(Uint32 i = 0; i<no_segs; i++){
for(i = 0; i<no_segs; i++){
copy(tmpInserPtr, thePool, ptr[i]);
}
......
......@@ -412,3 +412,6 @@ int main()
}
#endif
template class Vector<char *>;
template class Vector<BaseString>;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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