Commit 04519f43 authored by unknown's avatar unknown

Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.0

into avenger.(none):/export/brian/mysql/test/5.0


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
parents aebe9454 593c7ce9
...@@ -742,6 +742,7 @@ ndb/tools/ndb_drop_table ...@@ -742,6 +742,7 @@ ndb/tools/ndb_drop_table
ndb/tools/ndb_select_all ndb/tools/ndb_select_all
ndb/tools/ndb_select_count ndb/tools/ndb_select_count
ndb/tools/ndb_show_tables ndb/tools/ndb_show_tables
ndb/tools/ndb_test_platform
ndb/tools/ndb_waiter ndb/tools/ndb_waiter
pull.log pull.log
regex/re regex/re
......
...@@ -1614,9 +1614,14 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ ...@@ -1614,9 +1614,14 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
--with-ndb-docs Include the NDB Cluster ndbapi and mgmapi documentation], --with-ndb-docs Include the NDB Cluster ndbapi and mgmapi documentation],
[ndb_docs="$withval"], [ndb_docs="$withval"],
[ndb_docs=no]) [ndb_docs=no])
AC_ARG_WITH([ndb-port],
[
--with-ndb-port Port for NDB Cluster management server],
[ndb_port="$withval"],
[ndb_port="default"])
AC_ARG_WITH([ndb-port-base], AC_ARG_WITH([ndb-port-base],
[ [
--with-ndb-port-base Base port for NDB Cluster], --with-ndb-port-base Base port for NDB Cluster transporters],
[ndb_port_base="$withval"], [ndb_port_base="$withval"],
[ndb_port_base="default"]) [ndb_port_base="default"])
......
...@@ -229,7 +229,7 @@ int Load_log_processor::load_old_format_file(NET* net, const char*server_fname, ...@@ -229,7 +229,7 @@ int Load_log_processor::load_old_format_file(NET* net, const char*server_fname,
for (;;) for (;;)
{ {
uint packet_len = my_net_read(net); ulong packet_len = my_net_read(net);
if (packet_len == 0) if (packet_len == 0)
{ {
if (my_net_write(net, "", 0) || net_flush(net)) if (my_net_write(net, "", 0) || net_flush(net))
...@@ -251,7 +251,13 @@ int Load_log_processor::load_old_format_file(NET* net, const char*server_fname, ...@@ -251,7 +251,13 @@ int Load_log_processor::load_old_format_file(NET* net, const char*server_fname,
return -1; return -1;
} }
if (my_write(file, (byte*) net->read_pos, packet_len,MYF(MY_WME|MY_NABP))) if (packet_len > UINT_MAX)
{
sql_print_error("Illegal length of packet read from net");
return -1;
}
if (my_write(file, (byte*) net->read_pos,
(uint) packet_len, MYF(MY_WME|MY_NABP)))
return -1; return -1;
} }
...@@ -850,7 +856,15 @@ could be out of memory"); ...@@ -850,7 +856,15 @@ could be out of memory");
*/ */
int4store(buf, (uint32)start_position); int4store(buf, (uint32)start_position);
int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags); int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags);
logname_len = (uint) strlen(logname);
size_s tlen = strlen(logname);
if (tlen > UINT_MAX)
{
fprintf(stderr,"Log name too long\n");
error= 1;
goto err;
}
logname_len = (uint) tlen;
int4store(buf + 6, 0); int4store(buf + 6, 0);
memcpy(buf + 10, logname, logname_len); memcpy(buf + 10, logname, logname_len);
if (simple_command(mysql, COM_BINLOG_DUMP, buf, logname_len + 10, 1)) if (simple_command(mysql, COM_BINLOG_DUMP, buf, logname_len + 10, 1))
......
This diff is collapsed.
...@@ -3065,9 +3065,15 @@ AC_SUBST([NDB_DEFS]) ...@@ -3065,9 +3065,15 @@ AC_SUBST([NDB_DEFS])
AC_SUBST([ndb_cxxflags_fix]) AC_SUBST([ndb_cxxflags_fix])
if test X"$ndb_port" = Xdefault
then
ndb_port="1186"
fi
AC_SUBST([ndb_port])
if test X"$ndb_port_base" = Xdefault if test X"$ndb_port_base" = Xdefault
then then
ndb_port_base="2200" ndb_port_base="2202"
fi fi
AC_SUBST([ndb_port_base]) AC_SUBST([ndb_port_base])
...@@ -3106,7 +3112,6 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl ...@@ -3106,7 +3112,6 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl
ndb/src/common/logger/Makefile dnl ndb/src/common/logger/Makefile dnl
ndb/src/common/transporter/Makefile dnl ndb/src/common/transporter/Makefile dnl
ndb/src/common/mgmcommon/Makefile dnl ndb/src/common/mgmcommon/Makefile dnl
ndb/src/common/editline/Makefile dnl
ndb/src/kernel/Makefile dnl ndb/src/kernel/Makefile dnl
ndb/src/kernel/error/Makefile dnl ndb/src/kernel/error/Makefile dnl
ndb/src/kernel/blocks/Makefile dnl ndb/src/kernel/blocks/Makefile dnl
......
...@@ -227,14 +227,15 @@ static my_bool init_done = FALSE; /* Set to TRUE when initialization done */ ...@@ -227,14 +227,15 @@ static my_bool init_done = FALSE; /* Set to TRUE when initialization done */
static struct state *stack=0; static struct state *stack=0;
typedef struct st_code_state { typedef struct st_code_state {
int lineno; /* Current debugger output line number */
int level; /* Current function nesting level */
const char *func; /* Name of current user function */ const char *func; /* Name of current user function */
const char *file; /* Name of current user file */ const char *file; /* Name of current user file */
char **framep; /* Pointer to current frame */ char **framep; /* Pointer to current frame */
int jmplevel; /* Remember nesting level at setjmp () */
const char *jmpfunc; /* Remember current function for setjmp */ const char *jmpfunc; /* Remember current function for setjmp */
const char *jmpfile; /* Remember current file for setjmp */ const char *jmpfile; /* Remember current file for setjmp */
int lineno; /* Current debugger output line number */
int level; /* Current function nesting level */
int disable_output; /* Set to it if output is disabled */
int jmplevel; /* Remember nesting level at setjmp () */
/* /*
* The following variables are used to hold the state information * The following variables are used to hold the state information
...@@ -247,8 +248,8 @@ typedef struct st_code_state { ...@@ -247,8 +248,8 @@ typedef struct st_code_state {
*/ */
uint u_line; /* User source code line number */ uint u_line; /* User source code line number */
const char *u_keyword; /* Keyword for current macro */
int locked; /* If locked with _db_lock_file */ int locked; /* If locked with _db_lock_file */
const char *u_keyword; /* Keyword for current macro */
} CODE_STATE; } CODE_STATE;
/* Parse a debug command string */ /* Parse a debug command string */
...@@ -370,8 +371,10 @@ static CODE_STATE *code_state(void) ...@@ -370,8 +371,10 @@ static CODE_STATE *code_state(void)
#define code_state() (&static_code_state) #define code_state() (&static_code_state)
#define pthread_mutex_lock(A) {} #define pthread_mutex_lock(A) {}
#define pthread_mutex_unlock(A) {} #define pthread_mutex_unlock(A) {}
static CODE_STATE static_code_state = { 0,0,"?func","?file",NULL,0,NULL, static CODE_STATE static_code_state=
NULL,0,"?",0}; {
"?func", "?file", NULL, NullS, NullS, 0,0,0,0,0,0, NullS
};
#endif #endif
...@@ -728,9 +731,12 @@ char ***_sframep_ __attribute__((unused))) ...@@ -728,9 +731,12 @@ char ***_sframep_ __attribute__((unused)))
if (DoProfile ()) if (DoProfile ())
{ {
long stackused; long stackused;
if (*state->framep == NULL) { if (*state->framep == NULL)
{
stackused = 0; stackused = 0;
} else { }
else
{
stackused = ((long)(*state->framep)) - ((long)(state->framep)); stackused = ((long)(*state->framep)) - ((long)(state->framep));
stackused = stackused > 0 ? stackused : -stackused; stackused = stackused > 0 ? stackused : -stackused;
} }
...@@ -744,7 +750,7 @@ char ***_sframep_ __attribute__((unused))) ...@@ -744,7 +750,7 @@ char ***_sframep_ __attribute__((unused)))
(void) fflush (_db_pfp_); (void) fflush (_db_pfp_);
} }
#endif #endif
if (DoTrace (state)) if (DoTrace(state))
{ {
if (!state->locked) if (!state->locked)
pthread_mutex_lock(&THR_LOCK_dbug); pthread_mutex_lock(&THR_LOCK_dbug);
...@@ -754,7 +760,7 @@ char ***_sframep_ __attribute__((unused))) ...@@ -754,7 +760,7 @@ char ***_sframep_ __attribute__((unused)))
dbug_flush (state); /* This does a unlock */ dbug_flush (state); /* This does a unlock */
} }
#ifdef SAFEMALLOC #ifdef SAFEMALLOC
if (stack -> flags & SANITY_CHECK_ON) if (stack->flags & SANITY_CHECK_ON && !state->disable_output)
if (_sanity(_file_,_line_)) /* Check of safemalloc */ if (_sanity(_file_,_line_)) /* Check of safemalloc */
stack -> flags &= ~SANITY_CHECK_ON; stack -> flags &= ~SANITY_CHECK_ON;
#endif #endif
...@@ -809,9 +815,11 @@ uint *_slevel_) ...@@ -809,9 +815,11 @@ uint *_slevel_)
else else
{ {
#ifdef SAFEMALLOC #ifdef SAFEMALLOC
if (stack -> flags & SANITY_CHECK_ON) if (stack->flags & SANITY_CHECK_ON && !state->disable_output)
{
if (_sanity(*_sfile_,_line_)) if (_sanity(*_sfile_,_line_))
stack->flags &= ~SANITY_CHECK_ON; stack->flags &= ~SANITY_CHECK_ON;
}
#endif #endif
#ifndef THREAD #ifndef THREAD
if (DoProfile ()) if (DoProfile ())
...@@ -954,7 +962,6 @@ uint length) ...@@ -954,7 +962,6 @@ uint length)
int pos; int pos;
char dbuff[90]; char dbuff[90];
CODE_STATE *state; CODE_STATE *state;
/* Sasha: pre-my_thread_init() safety */
if (!(state=code_state())) if (!(state=code_state()))
return; return;
...@@ -994,6 +1001,25 @@ uint length) ...@@ -994,6 +1001,25 @@ uint length)
} }
} }
/*
Enable/Disable output for this thread
SYNOPSIS
_db_output_()
flag 1 = enable output, 0 = disable_output
*/
void _db_output_(uint flag)
{
CODE_STATE *state;
if (!(state=code_state()))
return;
state->disable_output= !flag;
}
/* /*
* FUNCTION * FUNCTION
* *
...@@ -1159,7 +1185,7 @@ static BOOLEAN DoTrace (CODE_STATE *state) ...@@ -1159,7 +1185,7 @@ static BOOLEAN DoTrace (CODE_STATE *state)
{ {
reg2 BOOLEAN trace=FALSE; reg2 BOOLEAN trace=FALSE;
if (TRACING && if (TRACING && !state->disable_output &&
state->level <= stack -> maxdepth && state->level <= stack -> maxdepth &&
InList (stack -> functions, state->func) && InList (stack -> functions, state->func) &&
InList (stack -> processes, _db_process_)) InList (stack -> processes, _db_process_))
...@@ -1195,7 +1221,7 @@ static BOOLEAN DoProfile () ...@@ -1195,7 +1221,7 @@ static BOOLEAN DoProfile ()
state=code_state(); state=code_state();
profile = FALSE; profile = FALSE;
if (PROFILING && if (PROFILING && !state->disable_output &&
state->level <= stack -> maxdepth && state->level <= stack -> maxdepth &&
InList (stack -> p_functions, state->func) && InList (stack -> p_functions, state->func) &&
InList (stack -> processes, _db_process_)) InList (stack -> processes, _db_process_))
...@@ -1242,7 +1268,7 @@ const char *keyword) ...@@ -1242,7 +1268,7 @@ const char *keyword)
if (!(state=code_state())) if (!(state=code_state()))
return FALSE; return FALSE;
result = FALSE; result = FALSE;
if (DEBUGGING && if (DEBUGGING && !state->disable_output &&
state->level <= stack -> maxdepth && state->level <= stack -> maxdepth &&
InList (stack -> functions, state->func) && InList (stack -> functions, state->func) &&
InList (stack -> keywords, keyword) && InList (stack -> keywords, keyword) &&
......
...@@ -38,6 +38,7 @@ extern void _db_pargs_(uint _line_,const char *keyword); ...@@ -38,6 +38,7 @@ extern void _db_pargs_(uint _line_,const char *keyword);
extern void _db_doprnt_ _VARARGS((const char *format,...)); extern void _db_doprnt_ _VARARGS((const char *format,...));
extern void _db_dump_(uint _line_,const char *keyword,const char *memory, extern void _db_dump_(uint _line_,const char *keyword,const char *memory,
uint length); uint length);
extern void _db_output_();
extern void _db_lock_file(); extern void _db_lock_file();
extern void _db_unlock_file(); extern void _db_unlock_file();
...@@ -66,6 +67,7 @@ extern void _db_unlock_file(); ...@@ -66,6 +67,7 @@ extern void _db_unlock_file();
#define DEBUGGER_ON _no_db_=0 #define DEBUGGER_ON _no_db_=0
#define DBUG_LOCK_FILE { _db_lock_file(); } #define DBUG_LOCK_FILE { _db_lock_file(); }
#define DBUG_UNLOCK_FILE { _db_unlock_file(); } #define DBUG_UNLOCK_FILE { _db_unlock_file(); }
#define DBUG_OUTPUT(A) { _db_output_(A); }
#define DBUG_ASSERT(A) assert(A) #define DBUG_ASSERT(A) assert(A)
#else /* No debugger */ #else /* No debugger */
...@@ -86,6 +88,7 @@ extern void _db_unlock_file(); ...@@ -86,6 +88,7 @@ extern void _db_unlock_file();
#define DEBUGGER_ON #define DEBUGGER_ON
#define DBUG_LOCK_FILE #define DBUG_LOCK_FILE
#define DBUG_UNLOCK_FILE #define DBUG_UNLOCK_FILE
#define DBUG_OUTPUT(A)
#define DBUG_ASSERT(A) {} #define DBUG_ASSERT(A) {}
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -370,6 +370,12 @@ int __void__; ...@@ -370,6 +370,12 @@ int __void__;
#define LINT_INIT(var) #define LINT_INIT(var)
#endif #endif
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(HAVE_purify)
#define PURIFY_OR_LINT_INIT(var) var=0
#else
#define PURIFY_OR_LINT_INIT(var)
#endif
/* Define some useful general macros */ /* Define some useful general macros */
#if defined(__cplusplus) && defined(__GNUC__) #if defined(__cplusplus) && defined(__GNUC__)
#define max(a, b) ((a) >? (b)) #define max(a, b) ((a) >? (b))
......
...@@ -221,6 +221,7 @@ extern ulong my_cache_w_requests, my_cache_write, my_cache_r_requests, ...@@ -221,6 +221,7 @@ extern ulong my_cache_w_requests, my_cache_write, my_cache_r_requests,
my_cache_read; my_cache_read;
extern ulong my_blocks_used, my_blocks_changed; extern ulong my_blocks_used, my_blocks_changed;
extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
extern uint mysys_usage_id;
extern my_bool my_init_done; extern my_bool my_init_done;
/* Point to current my_message() */ /* Point to current my_message() */
......
...@@ -490,6 +490,8 @@ MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, ...@@ -490,6 +490,8 @@ MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table,
const char *wild); const char *wild);
unsigned long STDCALL mysql_escape_string(char *to,const char *from, unsigned long STDCALL mysql_escape_string(char *to,const char *from,
unsigned long from_length); unsigned long from_length);
unsigned long STDCALL mysql_hex_string(char *to,const char *from,
unsigned long from_length);
unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql,
char *to,const char *from, char *to,const char *from,
unsigned long length); unsigned long length);
......
...@@ -342,13 +342,16 @@ dict_index_rec_get_sys_col( ...@@ -342,13 +342,16 @@ dict_index_rec_get_sys_col(
ut_ad(len == 7); ut_ad(len == 7);
return(trx_read_roll_ptr(field)); return(trx_read_roll_ptr(field));
} else if ((type == DATA_ROW_ID) || (type == DATA_MIX_ID)) { } else if (type == DATA_TRX_ID) {
return(trx_read_trx_id(field));
} else if (type == DATA_MIX_ID) {
return(mach_dulint_read_compressed(field)); return(mach_dulint_read_compressed(field));
} else { } else {
ut_ad(type == DATA_TRX_ID); ut_a(type == DATA_ROW_ID);
return(trx_read_trx_id(field)); return(mach_read_from_6(field));
} }
} }
......
...@@ -37,7 +37,7 @@ test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem ...@@ -37,7 +37,7 @@ test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem
CLEANFILES = $(test_SCRIPTS) $(test_DATA) CLEANFILES = $(test_SCRIPTS) $(test_DATA)
INCLUDES = -I$(srcdir)/../include -I../include -I.. INCLUDES = -I$(srcdir)/../include -I../include -I..
bin_PROGRAMS = mysql_test_run_new EXTRA_PROGRAMS = mysql_test_run_new
noinst_HEADERS = my_manage.h noinst_HEADERS = my_manage.h
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c
......
This diff is collapsed.
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
#ifndef __WIN__ #ifndef __WIN__
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h> #include <unistd.h>
#include <fnmatch.h> #include <signal.h>
#include <fnmatch.h> /* FIXME HAVE_FNMATCH_H or something */
#else #else
#include <direct.h> #include <direct.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -100,7 +101,7 @@ void init_args(arg_list_t *al) ...@@ -100,7 +101,7 @@ void init_args(arg_list_t *al)
void add_arg(arg_list_t *al, const char *format, ...) void add_arg(arg_list_t *al, const char *format, ...)
{ {
va_list ap; va_list ap;
char temp[PATH_MAX]; char temp[FN_REFLEN];
ASSERT(al != NULL); ASSERT(al != NULL);
...@@ -230,10 +231,10 @@ int wait_for_server_start(char *bin_dir __attribute__((unused)), ...@@ -230,10 +231,10 @@ int wait_for_server_start(char *bin_dir __attribute__((unused)),
{ {
arg_list_t al; arg_list_t al;
int err= 0, i; int err= 0, i;
char trash[PATH_MAX]; char trash[FN_REFLEN];
/* mysqladmin file */ /* mysqladmin file */
snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir); snprintf(trash, FN_REFLEN, "%s/trash.out",tmp_dir);
/* args */ /* args */
init_args(&al); init_args(&al);
...@@ -490,9 +491,9 @@ int stop_server(char *bin_dir __attribute__((unused)), char *mysqladmin_file, ...@@ -490,9 +491,9 @@ int stop_server(char *bin_dir __attribute__((unused)), char *mysqladmin_file,
{ {
arg_list_t al; arg_list_t al;
int err= 0; int err= 0;
char trash[PATH_MAX]; char trash[FN_REFLEN];
snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir); snprintf(trash, FN_REFLEN, "%s/trash.out",tmp_dir);
/* args */ /* args */
init_args(&al); init_args(&al);
...@@ -548,7 +549,7 @@ int stop_server(char *bin_dir __attribute__((unused)), char *mysqladmin_file, ...@@ -548,7 +549,7 @@ int stop_server(char *bin_dir __attribute__((unused)), char *mysqladmin_file,
#ifndef __WIN__ #ifndef __WIN__
pid_t get_server_pid(char *pid_file) pid_t get_server_pid(char *pid_file)
{ {
char buf[PATH_MAX]; char buf[FN_REFLEN];
int fd, err; int fd, err;
char *p; char *p;
pid_t id= 0; pid_t id= 0;
...@@ -556,7 +557,7 @@ pid_t get_server_pid(char *pid_file) ...@@ -556,7 +557,7 @@ pid_t get_server_pid(char *pid_file)
/* discover id */ /* discover id */
fd= open(pid_file, O_RDONLY); fd= open(pid_file, O_RDONLY);
err= read(fd, buf, PATH_MAX); err= read(fd, buf, FN_REFLEN);
close(fd); close(fd);
...@@ -619,7 +620,7 @@ void del_tree(char *dir) ...@@ -619,7 +620,7 @@ void del_tree(char *dir)
#ifndef __WIN__ #ifndef __WIN__
DIR *parent= opendir(dir); DIR *parent= opendir(dir);
struct dirent *entry; struct dirent *entry;
char temp[PATH_MAX]; char temp[FN_REFLEN];
if (parent == NULL) if (parent == NULL)
{ {
...@@ -629,22 +630,36 @@ void del_tree(char *dir) ...@@ -629,22 +630,36 @@ void del_tree(char *dir)
while ((entry= readdir(parent)) != NULL) while ((entry= readdir(parent)) != NULL)
{ {
/* create long name */ /* create long name */
snprintf(temp, PATH_MAX, "%s/%s", dir, entry->d_name); snprintf(temp, FN_REFLEN, "%s/%s", dir, entry->d_name);
if (entry->d_name[0] == '.') if (entry->d_name[0] == '.')
{ {
/* Skip */ /* Skip */
} }
else else
if (S_ISDIR(entry->d_type))
{ {
/* delete subdirectory */ /* FIXME missing test in acinclude.m4 */
del_tree(temp); #ifndef STRUCT_DIRENT_HAS_D_TYPE
} struct stat st;
else
{ if (lstat(entry->d_name, &st) == -1)
/* remove file */ {
remove(temp); /* FIXME error */
return;
}
if (S_ISDIR(st.st_mode))
#else
if (S_ISDIR(entry->d_type))
#endif
{
/* delete subdirectory */
del_tree(temp);
}
else
{
/* remove file */
remove(temp);
}
} }
} }
/* remove directory */ /* remove directory */
...@@ -652,10 +667,10 @@ void del_tree(char *dir) ...@@ -652,10 +667,10 @@ void del_tree(char *dir)
#else #else
struct _finddata_t parent; struct _finddata_t parent;
intptr_t handle; intptr_t handle;
char temp[PATH_MAX]; char temp[FN_REFLEN];
char mask[PATH_MAX]; char mask[FN_REFLEN];
snprintf(mask,MAX_PATH,"%s/*.*",dir); snprintf(mask,FN_REFLEN,"%s/*.*",dir);
if ((handle=_findfirst(mask,&parent)) == -1L) if ((handle=_findfirst(mask,&parent)) == -1L)
{ {
...@@ -665,7 +680,7 @@ void del_tree(char *dir) ...@@ -665,7 +680,7 @@ void del_tree(char *dir)
do do
{ {
/* create long name */ /* create long name */
snprintf(temp, PATH_MAX, "%s/%s", dir, parent.name); snprintf(temp, FN_REFLEN, "%s/%s", dir, parent.name);
if (parent.name[0] == '.') if (parent.name[0] == '.')
{ {
/* Skip */ /* Skip */
...@@ -700,11 +715,11 @@ int removef(const char *format, ...) ...@@ -700,11 +715,11 @@ int removef(const char *format, ...)
{ {
#ifdef __NETWARE__ #ifdef __NETWARE__
va_list ap; va_list ap;
char path[PATH_MAX]; char path[FN_REFLEN];
va_start(ap, format); va_start(ap, format);
vsnprintf(path, PATH_MAX, format, ap); vsnprintf(path, FN_REFLEN, format, ap);
va_end(ap); va_end(ap);
return remove(path); return remove(path);
...@@ -712,15 +727,15 @@ int removef(const char *format, ...) ...@@ -712,15 +727,15 @@ int removef(const char *format, ...)
#eldef __WIN__ #eldef __WIN__
{ {
va_list ap; va_list ap;
char path[PATH_MAX]; char path[FN_REFLEN];
struct _finddata_t parent; struct _finddata_t parent;
intptr_t handle; intptr_t handle;
char temp[PATH_MAX]; char temp[FN_REFLEN];
char *p; char *p;
va_start(ap, format); va_start(ap, format);
vsnprintf(path, PATH_MAX, format, ap); vsnprintf(path, FN_REFLEN, format, ap);
va_end(ap); va_end(ap);
...@@ -739,7 +754,7 @@ int removef(const char *format, ...) ...@@ -739,7 +754,7 @@ int removef(const char *format, ...)
{ {
if (! (parent.attrib & _A_SUBDIR)) if (! (parent.attrib & _A_SUBDIR))
{ {
snprintf(temp, PATH_MAX, "%s/%s", path, parent.name); snprintf(temp, FN_REFLEN, "%s/%s", path, parent.name);
remove(temp); remove(temp);
} }
}while (_findnext(handle,&parent) == 0); }while (_findnext(handle,&parent) == 0);
...@@ -749,14 +764,14 @@ int removef(const char *format, ...) ...@@ -749,14 +764,14 @@ int removef(const char *format, ...)
#else #else
DIR *parent; DIR *parent;
struct dirent *entry; struct dirent *entry;
char temp[PATH_MAX]; char temp[FN_REFLEN];
va_list ap; va_list ap;
char path[PATH_MAX]; char path[FN_REFLEN];
char *p; char *p;
/* Get path with mask */ /* Get path with mask */
va_start(ap, format); va_start(ap, format);
vsnprintf(path, PATH_MAX, format, ap); vsnprintf(path, FN_REFLEN, format, ap);
va_end(ap); va_end(ap);
...@@ -775,10 +790,21 @@ int removef(const char *format, ...) ...@@ -775,10 +790,21 @@ int removef(const char *format, ...)
while ((entry= readdir(parent)) != NULL) while ((entry= readdir(parent)) != NULL)
{ {
/* entry is not directory and entry matches with mask */ /* entry is not directory and entry matches with mask */
#ifndef STRUCT_DIRENT_HAS_D_TYPE
struct stat st;
if (lstat(entry->d_name, &st) == -1)
{
return 1;
}
if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0))
#else
if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0)) if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0))
#endif
{ {
/* create long name */ /* create long name */
snprintf(temp, PATH_MAX, "%s/%s", path, entry->d_name); snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name);
/* Delete only files */ /* Delete only files */
remove(temp); remove(temp);
} }
...@@ -795,7 +821,7 @@ int removef(const char *format, ...) ...@@ -795,7 +821,7 @@ int removef(const char *format, ...)
void get_basedir(char *argv0, char *basedir) void get_basedir(char *argv0, char *basedir)
{ {
char temp[PATH_MAX]; char temp[FN_REFLEN];
char *p; char *p;
int position; int position;
......
...@@ -52,8 +52,6 @@ int my_vsnprintf_(char *to, size_t n, const char* value, ...); ...@@ -52,8 +52,6 @@ int my_vsnprintf_(char *to, size_t n, const char* value, ...);
#define TRY_MAX 5 #define TRY_MAX 5
#ifdef __WIN__ #ifdef __WIN__
#define PATH_MAX _MAX_PATH
#define NAME_MAX _MAX_FNAME
#define kill(A,B) TerminateProcess((HANDLE)A,0) #define kill(A,B) TerminateProcess((HANDLE)A,0)
#define NOT_NEED_PID 0 #define NOT_NEED_PID 0
#define MASTER_PID 1 #define MASTER_PID 1
......
...@@ -227,7 +227,7 @@ DO_CLIENT_GDB="" ...@@ -227,7 +227,7 @@ DO_CLIENT_GDB=""
SLEEP_TIME_AFTER_RESTART=1 SLEEP_TIME_AFTER_RESTART=1
SLEEP_TIME_FOR_DELETE=10 SLEEP_TIME_FOR_DELETE=10
SLEEP_TIME_FOR_FIRST_MASTER=400 # Enough time to create innodb tables SLEEP_TIME_FOR_FIRST_MASTER=400 # Enough time to create innodb tables
SLEEP_TIME_FOR_SECOND_MASTER=30 SLEEP_TIME_FOR_SECOND_MASTER=400
SLEEP_TIME_FOR_FIRST_SLAVE=400 SLEEP_TIME_FOR_FIRST_SLAVE=400
SLEEP_TIME_FOR_SECOND_SLAVE=30 SLEEP_TIME_FOR_SECOND_SLAVE=30
CHARACTER_SET=latin1 CHARACTER_SET=latin1
...@@ -457,6 +457,9 @@ SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M" ...@@ -457,6 +457,9 @@ SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M"
export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1 export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1
NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2`
NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var"
if [ x$SOURCE_DIST = x1 ] ; then if [ x$SOURCE_DIST = x1 ] ; then
MY_BASEDIR=$MYSQL_TEST_DIR MY_BASEDIR=$MYSQL_TEST_DIR
else else
...@@ -941,11 +944,11 @@ start_ndbcluster() ...@@ -941,11 +944,11 @@ start_ndbcluster()
echo "Starting ndbcluster" echo "Starting ndbcluster"
if [ "$DO_BENCH" = 1 ] if [ "$DO_BENCH" = 1 ]
then then
NDBCLUSTER_OPTS="" NDBCLUSTER_EXTRA_OPTS=""
else else
NDBCLUSTER_OPTS="--small" NDBCLUSTER_EXTRA_OPTS="--small"
fi fi
./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT $NDBCLUSTER_OPTS --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 ./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --diskless --initial || exit 1
NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT" NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT"
else else
NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER" NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
...@@ -963,7 +966,7 @@ stop_ndbcluster() ...@@ -963,7 +966,7 @@ stop_ndbcluster()
if [ -z "$USE_RUNNING_NDBCLUSTER" ] if [ -z "$USE_RUNNING_NDBCLUSTER" ]
then then
# Kill any running ndbcluster stuff # Kill any running ndbcluster stuff
./ndb/ndbcluster --data-dir=$MYSQL_TEST_DIR/var --port-base=$NDBCLUSTER_PORT --stop ./ndb/ndbcluster $NDBCLUSTER_OPTS --stop
fi fi
fi fi
} }
......
This diff is collapsed.
...@@ -13,6 +13,8 @@ SUFFIXES = .sh ...@@ -13,6 +13,8 @@ SUFFIXES = .sh
.sh: .sh:
@RM@ -f $@ $@-t @RM@ -f $@ $@-t
@SED@ \ @SED@ \
-e 's!@''ndb_port''@!$(ndb_port)!g' \
-e 's!@''ndb_port_base''@!$(ndb_port_base)!g' \
-e 's!@''ndbbindir''@!$(ndbbindir)!g' \ -e 's!@''ndbbindir''@!$(ndbbindir)!g' \
-e 's!@''ndbtoolsdir''@!$(ndbtoolsdir)!g' \ -e 's!@''ndbtoolsdir''@!$(ndbtoolsdir)!g' \
$< > $@-t $< > $@-t
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
# This scripts starts the table handler ndbcluster # This scripts starts the table handler ndbcluster
# configurable parameters, make sure to change in mysqlcluterd as well # configurable parameters, make sure to change in mysqlcluterd as well
port_base="2200" port=@ndb_port@
port_base=@ndb_port_base@
fsdir=`pwd` fsdir=`pwd`
# end configurable parameters # end configurable parameters
...@@ -22,6 +23,7 @@ if [ -d ../sql ] ; then ...@@ -22,6 +23,7 @@ if [ -d ../sql ] ; then
exec_ndb=$ndbtop/src/kernel/ndbd exec_ndb=$ndbtop/src/kernel/ndbd
exec_mgmtsrvr=$ndbtop/src/mgmsrv/ndb_mgmd exec_mgmtsrvr=$ndbtop/src/mgmsrv/ndb_mgmd
exec_waiter=$ndbtop/tools/ndb_waiter exec_waiter=$ndbtop/tools/ndb_waiter
exec_test=$ndbtop/tools/ndb_test_platform
exec_mgmtclient=$ndbtop/src/mgmclient/ndb_mgm exec_mgmtclient=$ndbtop/src/mgmclient/ndb_mgm
else else
BINARY_DIST=1 BINARY_DIST=1
...@@ -34,9 +36,15 @@ else ...@@ -34,9 +36,15 @@ else
exec_mgmtsrvr=$BASEDIR/bin/ndb_mgmd exec_mgmtsrvr=$BASEDIR/bin/ndb_mgmd
fi fi
exec_waiter=$BASEDIR/bin/ndb_waiter exec_waiter=$BASEDIR/bin/ndb_waiter
exec_test=$BASEDIR/bin/ndb_test_platform
exec_mgmtclient=$BASEDIR/bin/ndb_mgm exec_mgmtclient=$BASEDIR/bin/ndb_mgm
fi fi
if $exec_test ; then :; else
echo "ndb not correctly compiled to support this platform"
exit 1
fi
pidfile=ndbcluster.pid pidfile=ndbcluster.pid
cfgfile=Ndb.cfg cfgfile=Ndb.cfg
stop_ndb= stop_ndb=
...@@ -77,6 +85,9 @@ while test $# -gt 0; do ...@@ -77,6 +85,9 @@ while test $# -gt 0; do
--data-dir=*) --data-dir=*)
fsdir=`echo "$1" | sed -e "s;--data-dir=;;"` fsdir=`echo "$1" | sed -e "s;--data-dir=;;"`
;; ;;
--port=*)
port=`echo "$1" | sed -e "s;--port=;;"`
;;
--port-base=*) --port-base=*)
port_base=`echo "$1" | sed -e "s;--port-base=;;"` port_base=`echo "$1" | sed -e "s;--port-base=;;"`
;; ;;
...@@ -87,7 +98,7 @@ while test $# -gt 0; do ...@@ -87,7 +98,7 @@ while test $# -gt 0; do
shift shift
done done
fs_ndb="$fsdir/ndbcluster-$port_base" fs_ndb="$fsdir/ndbcluster-$port"
NDB_HOME= NDB_HOME=
if [ ! -x "$fsdir" ]; then if [ ! -x "$fsdir" ]; then
...@@ -113,7 +124,7 @@ exec_ndb="$exec_ndb --no-defaults" ...@@ -113,7 +124,7 @@ exec_ndb="$exec_ndb --no-defaults"
exec_waiter="$exec_waiter --no-defaults" exec_waiter="$exec_waiter --no-defaults"
ndb_host="localhost" ndb_host="localhost"
ndb_mgmd_port=$port_base ndb_mgmd_port=$port
NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port" NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port"
export NDB_CONNECTSTRING export NDB_CONNECTSTRING
...@@ -151,10 +162,6 @@ if [ -d "$fs_ndb" ]; then :; else ...@@ -151,10 +162,6 @@ if [ -d "$fs_ndb" ]; then :; else
exit 1 exit 1
fi fi
# set som help variables
port_transporter=`expr $ndb_mgmd_port + 2`
# Start management server as deamon # Start management server as deamon
# Edit file system path and ports in config file # Edit file system path and ports in config file
...@@ -169,7 +176,7 @@ sed \ ...@@ -169,7 +176,7 @@ sed \
-e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \ -e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \
-e s,"CHOOSE_FILESYSTEM","$fs_ndb",g \ -e s,"CHOOSE_FILESYSTEM","$fs_ndb",g \
-e s,"CHOOSE_PORT_MGM","$ndb_mgmd_port",g \ -e s,"CHOOSE_PORT_MGM","$ndb_mgmd_port",g \
-e s,"CHOOSE_PORT_TRANSPORTER","$port_transporter",g \ -e s,"CHOOSE_PORT_TRANSPORTER","$port_base",g \
< ndb/ndb_config_2_node.ini \ < ndb/ndb_config_2_node.ini \
> "$fs_ndb/config.ini" > "$fs_ndb/config.ini"
fi fi
......
...@@ -483,3 +483,13 @@ ERROR 42000: Incorrect table name 't1\\' ...@@ -483,3 +483,13 @@ ERROR 42000: Incorrect table name 't1\\'
rename table t1 to `t1\\`; rename table t1 to `t1\\`;
ERROR 42000: Incorrect table name 't1\\' ERROR 42000: Incorrect table name 't1\\'
drop table t1; drop table t1;
create table t1 (a text) character set koi8r;
insert into t1 values (_koi8r'');
select hex(a) from t1;
hex(a)
D4C5D3D4
alter table t1 convert to character set cp1251;
select hex(a) from t1;
hex(a)
F2E5F1F2
drop table t1;
drop table if exists t1;
create table t1 (a int) engine=innodb;
start transaction with consistent snapshot;
insert into t1 values(1);
select * from t1;
a
commit;
delete from t1;
start transaction;
insert into t1 values(1);
select * from t1;
a
1
commit;
drop table t1;
...@@ -126,3 +126,43 @@ Field Type Null Key Default Extra ...@@ -126,3 +126,43 @@ Field Type Null Key Default Extra
a char(1) a char(1)
b enum('あ','い') YES NULL b enum('あ','い') YES NULL
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1
(
a INTEGER NOT NULL,
b VARCHAR(50) NOT NULL DEFAULT '',
PRIMARY KEY (a),
KEY b (b(10))
) TYPE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
a b
0 aaabbbcccddd
SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
a b
1 eeefffggghhh
SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
a b
2 iiijjjkkkl
DROP TABLE t1;
CREATE TABLE t1
(
a INTEGER NOT NULL,
b VARCHAR(50) NOT NULL DEFAULT '',
PRIMARY KEY (a),
KEY b (b(10))
) TYPE=MyISAM CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
a b
0 aaabbbcccddd
SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
a b
1 eeefffggghhh
SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
a b
2 iiijjjkkkl
DROP TABLE t1;
...@@ -5,7 +5,7 @@ def 1 8 1 1 N 32769 0 8 ...@@ -5,7 +5,7 @@ def 1 8 1 1 N 32769 0 8
def 1.0 5 3 3 N 32769 1 8 def 1.0 5 3 3 N 32769 1 8
def -1 8 1 2 N 32769 0 8 def -1 8 1 2 N 32769 0 8
def hello 254 5 5 N 1 31 8 def hello 254 5 5 N 1 31 8
def NULL 6 0 0 Y 32768 0 8 def NULL 6 0 0 Y 32896 0 63
1 1.0 -1 hello NULL 1 1.0 -1 hello NULL
1 1.0 -1 hello NULL 1 1.0 -1 hello NULL
create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10)); create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
......
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
flush status; flush status;
create table t1( create table t1(
id int not null primary key, id int not null primary key,
...@@ -363,3 +363,8 @@ a int NOT NULL PRIMARY KEY, ...@@ -363,3 +363,8 @@ a int NOT NULL PRIMARY KEY,
b int b int
) engine=ndb; ) engine=ndb;
insert t9 values(1, 2), (2,3), (3, 4), (4, 5); insert t9 values(1, 2), (2,3), (3, 4), (4, 5);
create table t10 (
a int not null primary key,
b blob
) engine=ndb;
insert into t10 values (1, 'kalle');
...@@ -8,3 +8,6 @@ show status like 'handler_discover%'; ...@@ -8,3 +8,6 @@ show status like 'handler_discover%';
Variable_name Value Variable_name Value
Handler_discover 1 Handler_discover 1
drop table t9; drop table t9;
select * from t10;
ERROR HY000: Got error 4263 'Invalid blob attributes or invalid blob parts table' from ndbcluster
drop table t10;
...@@ -400,6 +400,13 @@ b attr1 ...@@ -400,6 +400,13 @@ b attr1
9413 9412 9413 9412
drop table test.t1, t2; drop table test.t1, t2;
drop database mysqltest; drop database mysqltest;
drop database if exists ndbtest1;
create database ndbtest1;
use ndbtest1;
create table t1(id int) engine=ndbcluster;
drop database ndbtest1;
drop database ndbtest1;
ERROR HY000: Can't drop database 'ndbtest1'; database doesn't exist
use test; use test;
create table t1 (a int primary key, b char(0)); create table t1 (a int primary key, b char(0));
insert into t1 values (1,""); insert into t1 values (1,"");
......
drop table if exists t1; drop table if exists t1, test1, test2;
CREATE TABLE t1 ( CREATE TABLE t1 (
a int unsigned NOT NULL PRIMARY KEY, a int unsigned NOT NULL PRIMARY KEY,
b int unsigned not null, b int unsigned not null,
...@@ -275,3 +275,38 @@ a b c ...@@ -275,3 +275,38 @@ a b c
1 1 1 1 1 1
4 4 NULL 4 4 NULL
drop table t1; drop table t1;
CREATE TABLE test1 (
SubscrID int(11) NOT NULL auto_increment,
UsrID int(11) NOT NULL default '0',
PRIMARY KEY (SubscrID),
KEY idx_usrid (UsrID)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO test1 VALUES (2,224),(3,224),(1,224);
CREATE TABLE test2 (
SbclID int(11) NOT NULL auto_increment,
SbcrID int(11) NOT NULL default '0',
PRIMARY KEY (SbclID),
KEY idx_sbcrid (SbcrID)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO test2 VALUES (3,2),(1,1),(2,1),(4,2);
select * from test1 order by 1;
SubscrID UsrID
1 224
2 224
3 224
select * from test2 order by 1;
SbclID SbcrID
1 1
2 1
3 2
4 2
SELECT s.SubscrID,l.SbclID FROM test1 s left JOIN test2 l ON
l.SbcrID=s.SubscrID WHERE s.UsrID=224 order by 1, 2;
SubscrID SbclID
1 1
1 2
2 3
2 4
3 NULL
drop table test1;
drop table test2;
...@@ -184,3 +184,97 @@ select count(*) from t1 where i=2 or i is null; ...@@ -184,3 +184,97 @@ select count(*) from t1 where i=2 or i is null;
count(*) count(*)
9 9
drop table t1; drop table t1;
set names latin2;
create table t1 select
null as c00,
if(1, null, 'string') as c01,
if(0, null, 'string') as c02,
ifnull(null, 'string') as c03,
ifnull('string', null) as c04,
case when 0 then null else 'string' end as c05,
case when 1 then null else 'string' end as c06,
coalesce(null, 'string') as c07,
coalesce('string', null) as c08,
least('string',null) as c09,
least(null, 'string') as c10,
greatest('string',null) as c11,
greatest(null, 'string') as c12,
nullif('string', null) as c13,
nullif(null, 'string') as c14,
trim('string' from null) as c15,
trim(null from 'string') as c16,
substring_index('string', null, 1) as c17,
substring_index(null, 'string', 1) as c18,
elt(1, null, 'string') as c19,
elt(1, 'string', null) as c20,
concat('string', null) as c21,
concat(null, 'string') as c22,
concat_ws('sep', 'string', null) as c23,
concat_ws('sep', null, 'string') as c24,
concat_ws(null, 'string', 'string') as c25,
make_set(3, 'string', null) as c26,
make_set(3, null, 'string') as c27,
export_set(3, null, 'off', 'sep') as c29,
export_set(3, 'on', null, 'sep') as c30,
export_set(3, 'on', 'off', null) as c31,
replace(null, 'from', 'to') as c32,
replace('str', null, 'to') as c33,
replace('str', 'from', null) as c34,
insert('str', 1, 2, null) as c35,
insert(null, 1, 2, 'str') as c36,
lpad('str', 10, null) as c37,
rpad(null, 10, 'str') as c38;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c00` binary(0) default NULL,
`c01` varchar(6) character set latin2 default NULL,
`c02` varchar(6) character set latin2 default NULL,
`c03` varchar(6) character set latin2 NOT NULL default '',
`c04` varchar(6) character set latin2 default NULL,
`c05` varchar(6) character set latin2 default NULL,
`c06` varchar(6) character set latin2 default NULL,
`c07` varchar(6) character set latin2 default NULL,
`c08` varchar(6) character set latin2 default NULL,
`c09` varchar(6) character set latin2 NOT NULL default '',
`c10` varchar(6) character set latin2 NOT NULL default '',
`c11` varchar(6) character set latin2 NOT NULL default '',
`c12` varchar(6) character set latin2 NOT NULL default '',
`c13` varchar(6) character set latin2 default NULL,
`c14` char(0) character set latin2 default NULL,
`c15` char(0) character set latin2 default NULL,
`c16` varchar(6) character set latin2 default NULL,
`c17` varchar(6) character set latin2 default NULL,
`c18` char(0) character set latin2 default NULL,
`c19` varchar(6) character set latin2 default NULL,
`c20` varchar(6) character set latin2 default NULL,
`c21` varchar(6) character set latin2 default NULL,
`c22` varchar(6) character set latin2 default NULL,
`c23` varchar(9) character set latin2 default NULL,
`c24` varchar(9) character set latin2 default NULL,
`c25` varchar(12) character set latin2 default NULL,
`c26` varchar(7) character set latin2 default NULL,
`c27` varchar(7) character set latin2 default NULL,
`c29` longtext character set latin2,
`c30` longtext character set latin2,
`c31` varchar(192) character set latin2 default NULL,
`c32` char(0) character set latin2 default NULL,
`c33` char(3) character set latin2 default NULL,
`c34` char(3) character set latin2 default NULL,
`c35` char(3) character set latin2 default NULL,
`c36` char(3) character set latin2 default NULL,
`c37` varchar(10) character set latin2 default NULL,
`c38` varchar(10) character set latin2 default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
case 'str' when 'STR' then 'str' when null then 'null' end as c01,
case 'str' when null then 'null' when 'STR' then 'str' end as c02,
field(null, 'str1', 'str2') as c03,
field('str1','STR1', null) as c04,
field('str1', null, 'STR1') as c05,
'string' in ('STRING', null) as c08,
'string' in (null, 'STRING') as c09;
c01 c02 c03 c04 c05 c08 c09
str str 0 1 2 1 1
set names latin1;
...@@ -1789,7 +1789,7 @@ t5 CREATE TABLE `t5` ( ...@@ -1789,7 +1789,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL, `param10` bigint(20) default NULL,
`const11` int(4) default NULL, `const11` int(4) default NULL,
`param11` bigint(20) default NULL, `param11` bigint(20) default NULL,
`const12` char(0) default NULL, `const12` binary(0) default NULL,
`param12` bigint(20) default NULL, `param12` bigint(20) default NULL,
`param13` double default NULL, `param13` double default NULL,
`param14` longtext, `param14` longtext,
...@@ -1819,7 +1819,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 ...@@ -1819,7 +1819,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
......
...@@ -1772,7 +1772,7 @@ t5 CREATE TABLE `t5` ( ...@@ -1772,7 +1772,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL, `param10` bigint(20) default NULL,
`const11` int(4) default NULL, `const11` int(4) default NULL,
`param11` bigint(20) default NULL, `param11` bigint(20) default NULL,
`const12` char(0) default NULL, `const12` binary(0) default NULL,
`param12` bigint(20) default NULL, `param12` bigint(20) default NULL,
`param13` double default NULL, `param13` double default NULL,
`param14` longtext, `param14` longtext,
...@@ -1802,7 +1802,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 ...@@ -1802,7 +1802,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
......
...@@ -1773,7 +1773,7 @@ t5 CREATE TABLE `t5` ( ...@@ -1773,7 +1773,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL, `param10` bigint(20) default NULL,
`const11` int(4) default NULL, `const11` int(4) default NULL,
`param11` bigint(20) default NULL, `param11` bigint(20) default NULL,
`const12` char(0) default NULL, `const12` binary(0) default NULL,
`param12` bigint(20) default NULL, `param12` bigint(20) default NULL,
`param13` double default NULL, `param13` double default NULL,
`param14` longtext, `param14` longtext,
...@@ -1803,7 +1803,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 ...@@ -1803,7 +1803,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
......
...@@ -1712,7 +1712,7 @@ t5 CREATE TABLE `t5` ( ...@@ -1712,7 +1712,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL, `param10` bigint(20) default NULL,
`const11` int(4) default NULL, `const11` int(4) default NULL,
`param11` bigint(20) default NULL, `param11` bigint(20) default NULL,
`const12` char(0) default NULL, `const12` binary(0) default NULL,
`param12` bigint(20) default NULL, `param12` bigint(20) default NULL,
`param13` double default NULL, `param13` double default NULL,
`param14` longtext, `param14` longtext,
...@@ -1742,7 +1742,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 ...@@ -1742,7 +1742,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
...@@ -4721,7 +4721,7 @@ t5 CREATE TABLE `t5` ( ...@@ -4721,7 +4721,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL, `param10` bigint(20) default NULL,
`const11` int(4) default NULL, `const11` int(4) default NULL,
`param11` bigint(20) default NULL, `param11` bigint(20) default NULL,
`const12` char(0) default NULL, `const12` binary(0) default NULL,
`param12` bigint(20) default NULL, `param12` bigint(20) default NULL,
`param13` double default NULL, `param13` double default NULL,
`param14` longtext, `param14` longtext,
...@@ -4751,7 +4751,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 ...@@ -4751,7 +4751,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
......
...@@ -1772,7 +1772,7 @@ t5 CREATE TABLE `t5` ( ...@@ -1772,7 +1772,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL, `param10` bigint(20) default NULL,
`const11` int(4) default NULL, `const11` int(4) default NULL,
`param11` bigint(20) default NULL, `param11` bigint(20) default NULL,
`const12` char(0) default NULL, `const12` binary(0) default NULL,
`param12` bigint(20) default NULL, `param12` bigint(20) default NULL,
`param13` double default NULL, `param13` double default NULL,
`param14` longtext, `param14` longtext,
...@@ -1802,7 +1802,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 ...@@ -1802,7 +1802,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
......
...@@ -1749,7 +1749,7 @@ t5 CREATE TABLE `t5` ( ...@@ -1749,7 +1749,7 @@ t5 CREATE TABLE `t5` (
`param10` bigint(20) default NULL, `param10` bigint(20) default NULL,
`const11` int(4) default NULL, `const11` int(4) default NULL,
`param11` bigint(20) default NULL, `param11` bigint(20) default NULL,
`const12` char(0) default NULL, `const12` binary(0) default NULL,
`param12` bigint(20) default NULL, `param12` bigint(20) default NULL,
`param13` double default NULL, `param13` double default NULL,
`param14` longtext, `param14` longtext,
...@@ -1779,7 +1779,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 ...@@ -1779,7 +1779,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63
def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8
......
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
create table t1 (a int);
insert into t1 values(9);
select * from mysqltest1.t1;
a
9
show databases like 'mysqltest1';
Database (mysqltest1)
mysqltest1
select * from test.t1;
a
9
drop table t1;
drop database mysqltest1;
...@@ -324,3 +324,15 @@ alter table t1 rename to `t1\\`; ...@@ -324,3 +324,15 @@ alter table t1 rename to `t1\\`;
rename table t1 to `t1\\`; rename table t1 to `t1\\`;
drop table t1; drop table t1;
#
# Bug #6479 ALTER TABLE ... changing charset fails for TEXT columns
#
# The column's character set was changed but the actual data was not
# modified. In other words, the values were reinterpreted
# as UTF8 instead of being converted.
create table t1 (a text) character set koi8r;
insert into t1 values (_koi8r'');
select hex(a) from t1;
alter table t1 convert to character set cp1251;
select hex(a) from t1;
drop table t1;
-- source include/have_innodb.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
### Test 1:
### - While a consistent snapshot transaction is executed,
### no external inserts should be visible to the transaction.
connection con1;
create table t1 (a int) engine=innodb;
start transaction with consistent snapshot;
connection con2;
insert into t1 values(1);
connection con1;
select * from t1; # if consistent snapshot was set as expected, we
# should see nothing.
commit;
### Test 2:
### - For any non-consistent snapshot transaction, external
### committed inserts should be visible to the transaction.
delete from t1;
start transaction; # Now we omit WITH CONSISTENT SNAPSHOT
connection con2;
insert into t1 values(1);
connection con1;
select * from t1; # if consistent snapshot was not set, as expected, we
# should see 1.
commit;
drop table t1;
...@@ -83,3 +83,39 @@ CREATE TABLE t1 ( ...@@ -83,3 +83,39 @@ CREATE TABLE t1 (
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SHOW COLUMNS FROM t1; SHOW COLUMNS FROM t1;
DROP TABLE t1; DROP TABLE t1;
#
# Bug #6345 Unexpected behaviour with partial indices
#
--disable_warnings
CREATE TABLE t1
(
a INTEGER NOT NULL,
b VARCHAR(50) NOT NULL DEFAULT '',
PRIMARY KEY (a),
KEY b (b(10))
) TYPE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
--enable_warnings
INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
DROP TABLE t1;
--disable_warnings
CREATE TABLE t1
(
a INTEGER NOT NULL,
b VARCHAR(50) NOT NULL DEFAULT '',
PRIMARY KEY (a),
KEY b (b(10))
) TYPE=MyISAM CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci';
--enable_warnings
INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd');
INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh');
INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl');
SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a;
SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a;
SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a;
DROP TABLE t1;
-- source include/have_ndb.inc -- source include/have_ndb.inc
--disable_warnings --disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
--enable_warnings --enable_warnings
################################################ ################################################
...@@ -472,5 +472,11 @@ system rm var/master-data/test/t9.frm ; ...@@ -472,5 +472,11 @@ system rm var/master-data/test/t9.frm ;
# MySQL Server will have been restarted because it has a # MySQL Server will have been restarted because it has a
# ndb_autodiscover2-master.opt file. # ndb_autodiscover2-master.opt file.
create table t10 (
a int not null primary key,
b blob
) engine=ndb;
insert into t10 values (1, 'kalle');
--exec $NDB_TOOLS_DIR/ndb_drop_table -d test `$NDB_TOOLS_DIR/ndb_show_tables | grep BLOB` > /dev/null 2>&1 || true
...@@ -13,4 +13,7 @@ show status like 'handler_discover%'; ...@@ -13,4 +13,7 @@ show status like 'handler_discover%';
drop table t9; drop table t9;
--error 1296
select * from t10;
drop table t10;
...@@ -360,6 +360,21 @@ select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a; ...@@ -360,6 +360,21 @@ select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a;
drop table test.t1, t2; drop table test.t1, t2;
drop database mysqltest; drop database mysqltest;
#
# BUG#6031 - DROP DATABASE doesn't drop database on first try
#
--disable_warnings
drop database if exists ndbtest1;
--enable_warnings
create database ndbtest1;
use ndbtest1;
create table t1(id int) engine=ndbcluster;
drop database ndbtest1;
--error 1008
drop database ndbtest1;
# #
# test support of char(0) # test support of char(0)
# #
......
-- source include/have_ndb.inc -- source include/have_ndb.inc
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1, test1, test2;
--enable_warnings --enable_warnings
# #
...@@ -146,3 +146,29 @@ select * from t1 use index (bc) where b IS NULL and c = 2 order by a; ...@@ -146,3 +146,29 @@ select * from t1 use index (bc) where b IS NULL and c = 2 order by a;
select * from t1 use index (bc) where b < 4 order by a; select * from t1 use index (bc) where b < 4 order by a;
select * from t1 use index (bc) where b IS NOT NULL order by a; select * from t1 use index (bc) where b IS NOT NULL order by a;
drop table t1; drop table t1;
#
# Bug #6435
CREATE TABLE test1 (
SubscrID int(11) NOT NULL auto_increment,
UsrID int(11) NOT NULL default '0',
PRIMARY KEY (SubscrID),
KEY idx_usrid (UsrID)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO test1 VALUES (2,224),(3,224),(1,224);
CREATE TABLE test2 (
SbclID int(11) NOT NULL auto_increment,
SbcrID int(11) NOT NULL default '0',
PRIMARY KEY (SbclID),
KEY idx_sbcrid (SbcrID)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO test2 VALUES (3,2),(1,1),(2,1),(4,2);
select * from test1 order by 1;
select * from test2 order by 1;
SELECT s.SubscrID,l.SbclID FROM test1 s left JOIN test2 l ON
l.SbcrID=s.SubscrID WHERE s.UsrID=224 order by 1, 2;
drop table test1;
drop table test2;
...@@ -122,3 +122,70 @@ explain select * from t1 where i=2 or i is null; ...@@ -122,3 +122,70 @@ explain select * from t1 where i=2 or i is null;
select count(*) from t1 where i=2 or i is null; select count(*) from t1 where i=2 or i is null;
drop table t1; drop table t1;
#
# NULL has its own type BINARY(0) by default.
# But NULL should be weaker than a constant
# when mixing charsets/collations
#
set names latin2;
# Check that result type is taken from a non-null string
create table t1 select
null as c00,
if(1, null, 'string') as c01,
if(0, null, 'string') as c02,
ifnull(null, 'string') as c03,
ifnull('string', null) as c04,
case when 0 then null else 'string' end as c05,
case when 1 then null else 'string' end as c06,
coalesce(null, 'string') as c07,
coalesce('string', null) as c08,
least('string',null) as c09,
least(null, 'string') as c10,
greatest('string',null) as c11,
greatest(null, 'string') as c12,
nullif('string', null) as c13,
nullif(null, 'string') as c14,
trim('string' from null) as c15,
trim(null from 'string') as c16,
substring_index('string', null, 1) as c17,
substring_index(null, 'string', 1) as c18,
elt(1, null, 'string') as c19,
elt(1, 'string', null) as c20,
concat('string', null) as c21,
concat(null, 'string') as c22,
concat_ws('sep', 'string', null) as c23,
concat_ws('sep', null, 'string') as c24,
concat_ws(null, 'string', 'string') as c25,
make_set(3, 'string', null) as c26,
make_set(3, null, 'string') as c27,
export_set(3, null, 'off', 'sep') as c29,
export_set(3, 'on', null, 'sep') as c30,
export_set(3, 'on', 'off', null) as c31,
replace(null, 'from', 'to') as c32,
replace('str', null, 'to') as c33,
replace('str', 'from', null) as c34,
insert('str', 1, 2, null) as c35,
insert(null, 1, 2, 'str') as c36,
lpad('str', 10, null) as c37,
rpad(null, 10, 'str') as c38;
show create table t1;
drop table t1;
#
# Check that comparison is done according to
# non-null string collation, i.e. case insensitively,
# rather than according to NULL's collation, i.e. case sensitively
#
-- in field
select
case 'str' when 'STR' then 'str' when null then 'null' end as c01,
case 'str' when null then 'null' when 'STR' then 'str' end as c02,
field(null, 'str1', 'str2') as c03,
field('str1','STR1', null) as c04,
field('str1', null, 'STR1') as c05,
'string' in ('STRING', null) as c08,
'string' in (null, 'STRING') as c09;
# Restore charset to the default value.
set names latin1;
"--replicate-rewrite-db=mysqltest1->test"
source include/master-slave.inc;
--disable_warnings
drop database if exists mysqltest1;
--enable_warnings
create database mysqltest1;
use mysqltest1;
create table t1 (a int);
insert into t1 values(9);
select * from mysqltest1.t1;
sync_slave_with_master;
show databases like 'mysqltest1'; # should be empty
select * from test.t1;
# cleanup
connection master;
drop table t1;
drop database mysqltest1;
sync_slave_with_master;
...@@ -42,8 +42,8 @@ static void netware_init(); ...@@ -42,8 +42,8 @@ static void netware_init();
#define netware_init() #define netware_init()
#endif #endif
my_bool my_init_done= 0;
my_bool my_init_done=0; uint mysys_usage_id= 0; /* Incremented for each my_init() */
static ulong atoi_octal(const char *str) static ulong atoi_octal(const char *str)
{ {
...@@ -51,7 +51,7 @@ static ulong atoi_octal(const char *str) ...@@ -51,7 +51,7 @@ static ulong atoi_octal(const char *str)
while (*str && my_isspace(&my_charset_latin1, *str)) while (*str && my_isspace(&my_charset_latin1, *str))
str++; str++;
str2int(str, str2int(str,
(*str == '0' ? 8 : 10), /* Octalt or decimalt */ (*str == '0' ? 8 : 10), /* Octalt or decimalt */
0, INT_MAX, &tmp); 0, INT_MAX, &tmp);
return (ulong) tmp; return (ulong) tmp;
} }
...@@ -74,6 +74,7 @@ my_bool my_init(void) ...@@ -74,6 +74,7 @@ my_bool my_init(void)
if (my_init_done) if (my_init_done)
return 0; return 0;
my_init_done=1; my_init_done=1;
mysys_usage_id++;
#if defined(THREAD) && defined(SAFE_MUTEX) #if defined(THREAD) && defined(SAFE_MUTEX)
safe_mutex_global_init(); /* Must be called early */ safe_mutex_global_init(); /* Must be called early */
#endif #endif
......
...@@ -733,6 +733,7 @@ extern "C" { ...@@ -733,6 +733,7 @@ extern "C" {
int param, unsigned long long * value); int param, unsigned long long * value);
int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*, int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*,
int param, const char ** value); int param, const char ** value);
int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
#ifndef NDB_TYPES_H #ifndef NDB_TYPES_H
#define NDB_TYPES_H #define NDB_TYPES_H
typedef char Int8; typedef signed char Int8;
typedef unsigned char Uint8; typedef unsigned char Uint8;
typedef short Int16; typedef signed short Int16;
typedef unsigned short Uint16; typedef unsigned short Uint16;
typedef int Int32; typedef signed int Int32;
typedef unsigned int Uint32; typedef unsigned int Uint32;
typedef unsigned int UintR; typedef unsigned int UintR;
...@@ -45,10 +45,10 @@ typedef uintptr_t UintPtr; ...@@ -45,10 +45,10 @@ typedef uintptr_t UintPtr;
#if defined(WIN32) || defined(NDB_WIN32) #if defined(WIN32) || defined(NDB_WIN32)
typedef unsigned __int64 Uint64; typedef unsigned __int64 Uint64;
typedef __int64 Int64; typedef signed __int64 Int64;
#else #else
typedef unsigned long long Uint64; typedef unsigned long long Uint64;
typedef long long Int64; typedef signed long long Int64;
#endif #endif
#endif #endif
...@@ -369,7 +369,7 @@ public: ...@@ -369,7 +369,7 @@ public:
*/ */
bool getDistributionKey() const; bool getDistributionKey() const;
/** @} *******************************************************************/ /** @} *******************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
void setTupleKey(bool); void setTupleKey(bool);
bool getTupleKey() const; bool getTupleKey() const;
...@@ -486,6 +486,18 @@ public: ...@@ -486,6 +486,18 @@ public:
*/ */
const Column* getColumn(const char * name) const; const Column* getColumn(const char * name) const;
/**
* Get column definition via index in table.
* @return null if none existing name
*/
Column* getColumn(const int attributeId);
/**
* Get column definition via name.
* @return null if none existing name
*/
Column* getColumn(const char * name);
/** /**
* Get column definition via index in table. * Get column definition via index in table.
* @return null if none existing name * @return null if none existing name
......
...@@ -104,6 +104,11 @@ public: ...@@ -104,6 +104,11 @@ public:
*/ */
static void bitXOR(unsigned size, Uint32 data[], const Uint32 data2[]); static void bitXOR(unsigned size, Uint32 data[], const Uint32 data2[]);
/**
* bitXORC - Bitwise (x ^ ~y) into first operand.
*/
static void bitXORC(unsigned size, Uint32 data[], const Uint32 data2[]);
/** /**
* contains - Check if all bits set in data2 are set in data * contains - Check if all bits set in data2 are set in data
*/ */
...@@ -261,6 +266,14 @@ BitmaskImpl::bitXOR(unsigned size, Uint32 data[], const Uint32 data2[]) ...@@ -261,6 +266,14 @@ BitmaskImpl::bitXOR(unsigned size, Uint32 data[], const Uint32 data2[])
} }
} }
inline void
BitmaskImpl::bitXORC(unsigned size, Uint32 data[], const Uint32 data2[])
{
for (unsigned i = 0; i < size; i++) {
data[i] ^= ~data2[i];
}
}
inline bool inline bool
BitmaskImpl::contains(unsigned size, Uint32 data[], const Uint32 data2[]) BitmaskImpl::contains(unsigned size, Uint32 data[], const Uint32 data2[])
{ {
...@@ -451,6 +464,12 @@ public: ...@@ -451,6 +464,12 @@ public:
static void bitXOR(Uint32 data[], const Uint32 data2[]); static void bitXOR(Uint32 data[], const Uint32 data2[]);
BitmaskPOD<size>& bitXOR(const BitmaskPOD<size>& mask2); BitmaskPOD<size>& bitXOR(const BitmaskPOD<size>& mask2);
/**
* bitXORC - Bitwise (x ^ ~y) into first operand.
*/
static void bitXORC(Uint32 data[], const Uint32 data2[]);
BitmaskPOD<size>& bitXORC(const BitmaskPOD<size>& mask2);
/** /**
* contains - Check if all bits set in data2 (that) are also set in data (this) * contains - Check if all bits set in data2 (that) are also set in data (this)
*/ */
...@@ -712,6 +731,21 @@ BitmaskPOD<size>::bitXOR(const BitmaskPOD<size>& mask2) ...@@ -712,6 +731,21 @@ BitmaskPOD<size>::bitXOR(const BitmaskPOD<size>& mask2)
return *this; return *this;
} }
template <unsigned size>
inline void
BitmaskPOD<size>::bitXORC(Uint32 data[], const Uint32 data2[])
{
BitmaskImpl::bitXORC(size,data, data2);
}
template <unsigned size>
inline BitmaskPOD<size>&
BitmaskPOD<size>::bitXORC(const BitmaskPOD<size>& mask2)
{
BitmaskPOD<size>::bitXORC(rep.data, mask2.rep.data);
return *this;
}
template <unsigned size> template <unsigned size>
char * char *
BitmaskPOD<size>::getText(const Uint32 data[], char* buf) BitmaskPOD<size>::getText(const Uint32 data[], char* buf)
......
...@@ -37,7 +37,7 @@ public: ...@@ -37,7 +37,7 @@ public:
public: public:
virtual ~Session() {} virtual ~Session() {}
virtual void runSession(){} virtual void runSession(){}
virtual void stopSession(){} virtual void stopSession(){ m_stop = true; }
protected: protected:
friend class SocketServer; friend class SocketServer;
friend void* sessionThread_C(void*); friend void* sessionThread_C(void*);
...@@ -98,6 +98,8 @@ public: ...@@ -98,6 +98,8 @@ public:
*/ */
void stopSessions(bool wait = false); void stopSessions(bool wait = false);
void foreachSession(void (*f)(SocketServer::Session*, void*), void *data);
private: private:
struct SessionInstance { struct SessionInstance {
Service * m_service; Service * m_service;
......
SUBDIRS = portlib debugger util logger transporter mgmcommon editline SUBDIRS = portlib debugger util logger transporter mgmcommon
noinst_LTLIBRARIES = libcommon.la noinst_LTLIBRARIES = libcommon.la
......
include .defs.mk
LIB_DIRS := \
portlib \
debugger \
util \
logger
ifneq ($(USE_EDITLINE), N)
LIB_DIRS += editline
endif
DIRS := transporter mgmcommon
include $(NDB_TOP)/Epilogue.mk
include .defs.mk
TYPE := kernel
DIRS := signaldata
PIC_ARCHIVE := Y
ARCHIVE_TARGET := trace
SOURCES = SignalLoggerManager.cpp DebuggerNames.cpp BlockNames.cpp LogLevel.cpp EventLogger.cpp GrepError.cpp
include $(NDB_TOP)/Epilogue.mk
include .defs.mk
TYPE := ndbapi
PIC_ARCHIVE := Y
ARCHIVE_TARGET := signaldataprint
SOURCES = TcKeyReq.cpp TcKeyConf.cpp TcKeyRef.cpp \
TcRollbackRep.cpp \
TupKey.cpp TupCommit.cpp LqhKey.cpp \
FsOpenReq.cpp FsCloseReq.cpp FsRef.cpp FsConf.cpp FsReadWriteReq.cpp\
SignalDataPrint.cpp SignalNames.cpp \
ContinueB.cpp DihContinueB.cpp NdbfsContinueB.cpp \
CloseComReqConf.cpp PackedSignal.cpp PrepFailReqRef.cpp \
GCPSave.cpp DictTabInfo.cpp \
AlterTable.cpp AlterTab.cpp \
CreateTrig.cpp AlterTrig.cpp DropTrig.cpp \
FireTrigOrd.cpp TrigAttrInfo.cpp \
CreateIndx.cpp AlterIndx.cpp DropIndx.cpp TcIndx.cpp \
IndxKeyInfo.cpp IndxAttrInfo.cpp \
FsAppendReq.cpp ScanTab.cpp \
BackupImpl.cpp BackupSignalData.cpp \
UtilSequence.cpp UtilPrepare.cpp UtilDelete.cpp UtilExecute.cpp \
LqhFrag.cpp DropTab.cpp PrepDropTab.cpp LCP.cpp MasterLCP.cpp \
CopyGCI.cpp SystemError.cpp StartRec.cpp NFCompleteRep.cpp \
FailRep.cpp DisconnectRep.cpp SignalDroppedRep.cpp \
SumaImpl.cpp NdbSttor.cpp CreateFragmentation.cpp \
CntrStart.cpp ReadNodesConf.cpp \
UtilLock.cpp TuxMaint.cpp TupAccess.cpp AccLock.cpp \
LqhTrans.cpp
include $(NDB_TOP)/Epilogue.mk
...@@ -16,65 +16,9 @@ ...@@ -16,65 +16,9 @@
#include "GlobalSignalNumbers.h" #include <GlobalSignalNumbers.h>
#include "signaldata/SignalDataPrint.hpp" #include <signaldata/SignalData.hpp>
#include "signaldata/TcKeyReq.hpp" #include <signaldata/SignalDataPrint.hpp>
#include "signaldata/TcKeyConf.hpp"
#include "signaldata/TcKeyRef.hpp"
#include "signaldata/LqhKey.hpp"
#include "signaldata/TupKey.hpp"
#include "signaldata/TupCommit.hpp"
#include "signaldata/FsOpenReq.hpp"
#include "signaldata/FsCloseReq.hpp"
#include "signaldata/FsReadWriteReq.hpp"
#include "signaldata/FsRef.hpp"
#include "signaldata/FsConf.hpp"
#include "signaldata/CloseComReqConf.hpp"
#include "signaldata/PackedSignal.hpp"
#include "signaldata/PrepFailReqRef.hpp"
#include "signaldata/DictTabInfo.hpp"
#include "signaldata/AlterTable.hpp"
#include "signaldata/AlterTab.hpp"
#include "signaldata/CreateTrig.hpp"
#include "signaldata/AlterTrig.hpp"
#include "signaldata/DropTrig.hpp"
#include "signaldata/FireTrigOrd.hpp"
#include "signaldata/TrigAttrInfo.hpp"
#include "signaldata/CreateIndx.hpp"
#include "signaldata/AlterIndx.hpp"
#include "signaldata/DropIndx.hpp"
#include "signaldata/TcIndx.hpp"
#include "signaldata/IndxKeyInfo.hpp"
#include "signaldata/IndxAttrInfo.hpp"
#include <signaldata/FsAppendReq.hpp>
#include <signaldata/BackupSignalData.hpp>
#include <signaldata/BackupImpl.hpp>
#include <signaldata/UtilSequence.hpp>
#include <signaldata/UtilPrepare.hpp>
#include <signaldata/UtilExecute.hpp>
#include <signaldata/ScanTab.hpp>
#include <signaldata/ScanFrag.hpp>
#include <signaldata/LqhFrag.hpp>
#include <signaldata/LqhTransConf.hpp>
#include <signaldata/DropTab.hpp>
#include <signaldata/PrepDropTab.hpp>
#include <signaldata/LCP.hpp>
#include <signaldata/MasterLCP.hpp>
#include <signaldata/CopyGCIReq.hpp>
#include <signaldata/SystemError.hpp>
#include <signaldata/StartRec.hpp>
#include <signaldata/NFCompleteRep.hpp>
#include <signaldata/SignalDroppedRep.hpp>
#include <signaldata/FailRep.hpp>
#include <signaldata/DisconnectRep.hpp>
#include <signaldata/SumaImpl.hpp>
#include <signaldata/NdbSttor.hpp>
#include <signaldata/CreateFragmentation.hpp>
#include <signaldata/UtilLock.hpp>
#include <signaldata/CntrStart.hpp>
#include <signaldata/ReadNodesConf.hpp>
#include <signaldata/TuxMaint.hpp>
#include <signaldata/AccLock.hpp>
/** /**
* This is the register * This is the register
...@@ -254,9 +198,11 @@ SignalDataPrintFunctions[] = { ...@@ -254,9 +198,11 @@ SignalDataPrintFunctions[] = {
,{ 0, 0 } ,{ 0, 0 }
}; };
template class Bitmask<1>; #include <Bitmask.hpp>
template class Bitmask<2>;
template class Bitmask<4>;
template struct BitmaskPOD<1>; template struct BitmaskPOD<1>;
template struct BitmaskPOD<2>; template struct BitmaskPOD<2>;
template struct BitmaskPOD<4>; template struct BitmaskPOD<4>;
template class Bitmask<1>;
template class Bitmask<2>;
template class Bitmask<4>;
File Name Description
--------------------------------------------------------
README Release notes and copyright
MANIFEST This shipping list
Make.os9 OS-9 makefile
Makefile Unix makefile
complete.c Filename completion routines
editline.3 Manual page for editline library
editline.c Line-editing routines
editline_internal.h Internal library header file
os9.h OS-9-specific declarations
sysos9.c OS-9-specific routines
sysunix.c Unix-specific routines
testit.c Test driver
unix.h Unix-specific declarations
noinst_LIBRARIES = libeditline.a
libeditline_a_SOURCES = complete.c editline.c sysunix.c
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/ndb/include
DEFS = -DANSI_ARROWS -DHAVE_TCGETATTR -DSYS_UNIX
# Don't update the files from bitkeeper
%::SCCS/s.%
include .defs.mk
TYPE :=
ARCHIVE_TARGET := editline
CFLAGS += -DANSI_ARROWS -DHAVE_TCGETATTR -DSYS_UNIX
ifeq ($(NDB_OS), WIN32)
SOURCES = editline_win32.c
else
SOURCES = complete.c editline.c sysunix.c
endif
DIRS := test
include $(NDB_TOP)/Epilogue.mk
--
NOTE: This version has been modified by Ericsson/Alzato. Please
see the cvs changelog for more details.
--
$Revision: 1.2 $
This is a line-editing library. It can be linked into almost any
program to provide command-line editing and recall.
It is call-compatible with the FSF readline library, but it is a
fraction of the size (and offers fewer features). It does not use
standard I/O. It is distributed under a "C News-like" copyright.
Configuration is done in the Makefile. Type "make testit" to get
a small slow shell for testing.
This contains some changes since the posting to comp.sources.misc:
- Bugfix for completion on absolute pathnames.
- Better handling of M-n versus showing raw 8bit chars.
- Better signal handling.
- Now supports termios/termio/sgttyb ioctl's.
- Add M-m command to toggle how 8bit data is displayed.
The following changes, made since the last public release, come from
J.G. Vons <vons@cesar.crbca1.sinet.slb.com>:
- History-searching no longer redraws the line wrong
- Added ESC-ESC as synonym for ESC-?
- SIGQUIT (normally ^\) now sends a signal, not indicating EOF.
- Fixed some typo's and unclear wording in the manpage.
- Fixed completion when all entries shared a common prefix.
- Fixed some meta-char line-redrawing bugs.
Enjoy,
Rich $alz
<rsalz@osf.org>
Copyright 1992,1993 Simmule Turner and Rich Salz. All rights reserved.
This software is not subject to any license of the American Telephone
and Telegraph Company or of the Regents of the University of California.
Permission is granted to anyone to use this software for any purpose on
any computer system, and to alter it and redistribute it freely, subject
to the following restrictions:
1. The authors are not responsible for the consequences of use of this
software, no matter how awful, even if they arise from flaws in it.
2. The origin of this software must not be misrepresented, either by
explicit claim or by omission. Since few users ever read sources,
credits must appear in the documentation.
3. Altered versions must be plainly marked as such, and must not be
misrepresented as being the original software. Since few users
ever read sources, credits must appear in the documentation.
4. This notice may not be removed or altered.
/* -*- c-basic-offset: 4; -*-
** $Revision: 1.8 $
**
** History and file completion functions for editline library.
*/
#include "editline_internal.h"
/*
** strcmp-like sorting predicate for qsort.
*/
static int
compare(const void *p1, const void *p2)
{
const char **v1;
const char **v2;
v1 = (const char **)p1;
v2 = (const char **)p2;
return strcmp(*v1, *v2);
}
/*
** Fill in *avp with an array of names that match file, up to its length.
** Ignore . and .. .
*/
static int
FindMatches(char *dir, char *file, char ***avp)
{
char **av;
char **new;
char *p;
DIR *dp;
struct dirent *ep;
size_t ac;
size_t len;
if ((dp = opendir(dir)) == NULL)
return 0;
av = NULL;
ac = 0;
len = strlen(file);
while ((ep = readdir(dp)) != NULL) {
p = ep->d_name;
if (p[0] == '.' && (p[1] == '\0' || (p[1] == '.' && p[2] == '\0')))
continue;
if (len && strncmp(p, file, len) != 0)
continue;
if ((ac % MEM_INC) == 0) {
if ((new = malloc(sizeof(char*) * (ac + MEM_INC))) == NULL)
break;
if (ac) {
memcpy(new, av, ac * sizeof (char **));
free(av);
}
*avp = av = new;
}
if ((av[ac] = strdup(p)) == NULL) {
if (ac == 0)
free(av);
break;
}
ac++;
}
/* Clean up and return. */
(void)closedir(dp);
if (ac)
qsort(av, ac, sizeof (char **), compare);
return ac;
}
/*
** Split a pathname into allocated directory and trailing filename parts.
*/
static int
SplitPath(char *path, char **dirpart, char ** filepart)
{
static char DOT[] = ".";
char *dpart;
char *fpart;
if ((fpart = strrchr(path, '/')) == NULL) {
if ((dpart = strdup(DOT)) == NULL)
return -1;
if ((fpart = strdup(path)) == NULL) {
free(dpart);
return -1;
}
}
else {
if ((dpart = strdup(path)) == NULL)
return -1;
dpart[fpart - path + 1] = '\0';
if ((fpart = strdup(++fpart)) == NULL) {
free(dpart);
return -1;
}
}
*dirpart = dpart;
*filepart = fpart;
return 0;
}
/*
** Attempt to complete the pathname, returning an allocated copy.
** Fill in *unique if we completed it, or set it to 0 if ambiguous.
*/
char *
rl_complete(char *pathname,int *unique)
{
char **av;
char *dir;
char *file;
char *new;
char *p;
size_t ac;
size_t end;
size_t i;
size_t j;
size_t len;
size_t new_len;
size_t p_len;
if (SplitPath(pathname, &dir, &file) < 0)
return NULL;
if ((ac = FindMatches(dir, file, &av)) == 0) {
free(dir);
free(file);
return NULL;
}
p = NULL;
len = strlen(file);
if (ac == 1) {
/* Exactly one match -- finish it off. */
*unique = 1;
j = strlen(av[0]) - len + 2;
p_len = sizeof(char) * (j + 1);
if ((p = malloc(p_len)) != NULL) {
memcpy(p, av[0] + len, j);
new_len = sizeof(char) * (strlen(dir) + strlen(av[0]) + 2);
new = malloc(new_len);
if(new != NULL) {
snprintf(new, new_len, "%s/%s", dir, av[0]);
rl_add_slash(new, p, p_len);
free(new);
}
}
}
else {
/* Find largest matching substring. */
for (*unique = 0, i = len, end = strlen(av[0]); i < end; i++)
for (j = 1; j < ac; j++)
if (av[0][i] != av[j][i])
goto breakout;
breakout:
if (i > len) {
j = i - len + 1;
if ((p = malloc(sizeof(char) * j)) != NULL) {
memcpy(p, av[0] + len, j);
p[j - 1] = '\0';
}
}
}
/* Clean up and return. */
free(dir);
free(file);
for (i = 0; i < ac; i++)
free(av[i]);
free(av);
return p;
}
/*
** Return all possible completions.
*/
int
rl_list_possib(char *pathname, char ***avp)
{
char *dir;
char *file;
int ac;
if (SplitPath(pathname, &dir, &file) < 0)
return 0;
ac = FindMatches(dir, file, avp);
free(dir);
free(file);
return ac;
}
.\" $Revision: 1.1 $
.TH EDITLINE 3
.SH NAME
editline \- command-line editing library with history
.SH SYNOPSIS
.nf
.B "char *"
.B "readline(prompt)"
.B " char *prompt;"
.B "void"
.B "add_history(line)"
.B " char *line;"
.fi
.SH DESCRIPTION
.I Editline
is a library that provides an line-editing interface with text recall.
It is intended to be compatible with the
.I readline
library provided by the Free Software Foundation, but much smaller.
The bulk of this manual page describes the user interface.
.PP
The
.I readline
routine returns a line of text with the trailing newline removed.
The data is returned in a buffer allocated with
.IR malloc (3),
so the space should be released with
.IR free (3)
when the calling program is done with it.
Before accepting input from the user, the specified
.I prompt
is displayed on the terminal.
.PP
The
.I add_history
routine makes a copy of the specified
.I line
and adds it to the internal history list.
.SS "User Interface"
A program that uses this library provides a simple emacs-like editing
interface to its users.
A line may be edited before it is sent to the calling program by typing either
control characters or escape sequences.
A control character, shown as a caret followed by a letter, is typed by
holding down the ``control'' key while the letter is typed.
For example, ``^A'' is a control-A.
An escape sequence is entered by typing the ``escape'' key followed by one or
more characters.
The escape key is abbreviated as ``ESC''.
Note that unlike control keys, case matters in escape sequences; ``ESC\ F''
is not the same as ``ESC\ f''.
.PP
An editing command may be typed anywhere on the line, not just at the
beginning.
In addition, a return may also be typed anywhere on the line, not just at
the end.
.PP
Most editing commands may be given a repeat count,
.IR n ,
where
.I n
is a number.
To enter a repeat count, type the escape key, the number, and then
the command to execute.
For example, ``ESC\ 4\ ^f'' moves forward four characters.
If a command may be given a repeat count then the text ``[n]'' is given at the
end of its description.
.PP
The following control characters are accepted:
.RS
.nf
.ta \w'ESC DEL 'u
^A Move to the beginning of the line
^B Move left (backwards) [n]
^D Delete character [n]
^E Move to end of line
^F Move right (forwards) [n]
^G Ring the bell
^H Delete character before cursor (backspace key) [n]
^I Complete filename (tab key); see below
^J Done with line (return key)
^K Kill to end of line (or column [n])
^L Redisplay line
^M Done with line (alternate return key)
^N Get next line from history [n]
^P Get previous line from history [n]
^R Search backward (forward if [n]) through history for text;
\& prefixing the string with a caret (^) forces it to
\& match only at the beginning of a history line
^T Transpose characters
^V Insert next character, even if it is an edit command
^W Wipe to the mark
^X^X Exchange current location and mark
^Y Yank back last killed text
^[ Start an escape sequence (escape key)
^]c Move forward to next character ``c''
^? Delete character before cursor (delete key) [n]
.fi
.RE
.PP
The following escape sequences are provided.
.RS
.nf
.ta \w'ESC DEL 'u
ESC\ ^H Delete previous word (backspace key) [n]
ESC\ DEL Delete previous word (delete key) [n]
ESC\ ESC Show possible completions; see below
ESC\ SP Set the mark (space key); see ^X^X and ^Y above
ESC\ . Get the last (or [n]'th) word from previous line
ESC\ ? Show possible completions; see below
ESC\ < Move to start of history
ESC\ > Move to end of history
ESC\ b Move backward a word [n]
ESC\ d Delete word under cursor [n]
ESC\ f Move forward a word [n]
ESC\ l Make word lowercase [n]
ESC\ m Toggle if 8bit chars display as themselves or with
\& an ``M\-'' prefix
ESC\ u Make word uppercase [n]
ESC\ y Yank back last killed text
ESC\ w Make area up to mark yankable
ESC\ nn Set repeat count to the number nn
ESC\ C Read from environment variable ``_C_'', where C is
\& an uppercase letter
.fi
.RE
.PP
The
.I editline
library has a small macro facility.
If you type the escape key followed by an uppercase letter,
.IR C ,
then the contents of the environment variable
.I _C_
are read in as if you had typed them at the keyboard.
For example, if the variable
.I _L_
contains the following:
.RS
^A^Kecho '^V^[[H^V^[[2J'^M
.RE
Then typing ``ESC L'' will move to the beginning of the line, kill the
entire line, enter the echo command needed to clear the terminal (if your
terminal is like a VT-100), and send the line back to the shell.
.PP
The
.I editline
library also does filename completion.
Suppose the root directory has the following files in it:
.RS
.nf
.ta \w'core 'u
bin vmunix
core vmunix.old
.fi
.RE
If you type ``rm\ /v'' and then the tab key.
.I Editline
will then finish off as much of the name as possible by adding ``munix''.
Because the name is not unique, it will then beep.
If you type the escape key followed by either a question mark or another
escape, it will display the two choices.
If you then type a period and a tab, the library will finish off the filename
for you:
.RS
.nf
.RI "rm /v[TAB]" munix ".[TAB]" old
.fi
.RE
The tab key is shown by ``[TAB]'' and the automatically-entered text
is shown in italics.
.SH "BUGS AND LIMITATIONS"
Cannot handle lines more than 80 columns.
.SH AUTHORS
Simmule R. Turner <uunet.uu.net!capitol!sysgo!simmy>
and Rich $alz <rsalz@osf.org>.
Original manual page by DaviD W. Sanderson <dws@ssec.wisc.edu>.
This diff is collapsed.
/* $Revision: 1.2 $
**
** Internal header file for editline library.
*/
#include <ndb_global.h>
#if defined(SYS_UNIX)
#include "unix.h"
#endif /* defined(SYS_UNIX) */
#define MEM_INC 64
#define SCREEN_INC 256
/*
** Variables and routines internal to this package.
*/
extern int rl_eof;
extern int rl_erase;
extern int rl_intr;
extern int rl_kill;
extern int rl_quit;
#if defined(DO_SIGTSTP)
extern int rl_susp;
#endif /* defined(DO_SIGTSTP) */
extern char *rl_complete();
extern int rl_list_possib();
extern void rl_ttyset();
extern void rl_add_slash();
This diff is collapsed.
include .defs.mk
TYPE := util
BIN_TARGET := editline_test
BIN_TARGET_ARCHIVES := editline
SOURCES = testit.c
include $(NDB_TOP)/Epilogue.mk
/* $Revision: 1.3 $
**
** Editline system header file for Unix.
*/
#define CRLF "\r\n"
#include <ndb_global.h>
#include <dirent.h>
include .defs.mk
TYPE := ndbapi
PIC_ARCHIVE := Y
ARCHIVE_TARGET := logger
DIRS := loggertest
SOURCES := Logger.cpp LogHandlerList.cpp LogHandler.cpp \
ConsoleLogHandler.cpp FileLogHandler.cpp
ifeq ($(NDB_OS), OSE)
NO_SYSLOG := Y
endif
ifeq ($(NDB_OS), WIN32)
NO_SYSLOG := Y
endif
ifneq ($(NO_SYSLOG), Y)
SOURCES += SysLogHandler.cpp
endif
include $(NDB_TOP)/Epilogue.mk
...@@ -90,7 +90,7 @@ LocalConfig::init(const char *connectString, ...@@ -90,7 +90,7 @@ LocalConfig::init(const char *connectString,
//7. Check //7. Check
{ {
char buf[256]; char buf[256];
BaseString::snprintf(buf, sizeof(buf), "host=localhost:%s", NDB_BASE_PORT); BaseString::snprintf(buf, sizeof(buf), "host=localhost:%s", NDB_PORT);
if(readConnectString(buf, "default connect string")) if(readConnectString(buf, "default connect string"))
return true; return true;
} }
...@@ -124,12 +124,12 @@ void LocalConfig::printUsage() const { ...@@ -124,12 +124,12 @@ void LocalConfig::printUsage() const {
ndbout << "1. Put a Ndb.cfg file in the directory where you start"<<endl ndbout << "1. Put a Ndb.cfg file in the directory where you start"<<endl
<< " the node. "<< endl << " the node. "<< endl
<< " Ex: Ndb.cfg" << endl << " Ex: Ndb.cfg" << endl
<< " | host=localhost:"<<NDB_BASE_PORT<<endl; << " | host=localhost:"<<NDB_PORT<<endl;
ndbout << "2. Use the environment variable NDB_CONNECTSTRING to "<<endl ndbout << "2. Use the environment variable NDB_CONNECTSTRING to "<<endl
<< " provide this information." <<endl << " provide this information." <<endl
<< " Ex: " << endl << " Ex: " << endl
<< " >export NDB_CONNECTSTRING=\"host=localhost:"<<NDB_BASE_PORT<<"\"" << " >export NDB_CONNECTSTRING=\"host=localhost:"<<NDB_PORT<<"\""
<<endl<<endl; <<endl<<endl;
} }
......
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