Commit 7337a193 authored by unknown's avatar unknown

Merge


BitKeeper/etc/logging_ok:
  auto-union
configure.in:
  Auto merged
client/mysql.cc:
  Auto merged
client/mysqltest.c:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
sql/sql_select.cc:
  Auto merged
Docs/manual.texi:
  SCCS merged
sql/Makefile.am:
  SCCS merged
parents c778d337 09518126
......@@ -43,8 +43,8 @@ alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet
pentium_cflags="-mpentiumpro"
sparc_cflags=""
fast_cflags="-O6 -fno-omit-frame-pointer"
reckless_cflags="-O6 -fomit-frame-pointer -ffixed-ebp"
fast_cflags="-O3 -fno-omit-frame-pointer"
reckless_cflags="-O3 -fomit-frame-pointer -ffixed-ebp"
debug_cflags="-DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DSAFE_MUTEX -O2"
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
......
File mode changed from 100644 to 100755
heikki@donna.mysql.fi
jcole@abel.spaceapes.com
monty@donna.mysql.fi
monty@work.mysql.com
paul@central.snake.net
......
......@@ -14,6 +14,7 @@ OLD="mysql-$PVER.tar.gz"
RESULT="mysql-$PVER-$VER.patch.gz"
PATCH_DIR=/my/web/Downloads-live/Patches
RESULT_DIR=/my/web/Downloads-live/MySQL-3.23
RESULT_DIR_MAX=/my/web/Downloads-live/MySQL-Max-3.23
if test ! -f $NEWDIR/$NEW
then
......@@ -39,4 +40,5 @@ chmod a+r,o-w $RESULT binary/*
mv $RESULT $PATCH_DIR
cp binary/mysqlcom-* binary/mysql*win* /net/web/home/production/data/nweb/customer/Downloads
rm binary/mysqlcom-*
mv binary/*Max* $RESULT_DIR_MAX
cp binary/* $RESULT_DIR
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -36,7 +36,11 @@ subdirs = btree build_vxworks build_win32 clib common cxx db db185 \
all:
cd $(bdb_build) && $(MAKE) all
clean:;
clean:
cd $(bdb_build) && $(MAKE) clean
distclean:
cd $(bdb_build) && $(MAKE) distclean
# May want to fix this, and MYSQL/configure, to install things
install dvi check installcheck:
......
......@@ -41,7 +41,7 @@
#include "my_readline.h"
#include <signal.h>
const char *VER="11.14";
const char *VER="11.15";
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
......@@ -280,6 +280,11 @@ int main(int argc,char *argv[])
strmov(outfile, "\0"); // no (default) outfile, unless given at least once
strmov(pager, "stdout"); // the default, if --pager wasn't given
{
char *tmp=getenv("PAGER");
if (tmp)
strmov(default_pager,tmp);
}
if (!isatty(0) || !isatty(1))
{
status.batch=1; opt_silent=1;
......
......@@ -53,6 +53,7 @@
#include <m_ctype.h>
#include <my_config.h>
#include <my_dir.h>
#include <hash.h>
#include <mysqld_error.h>
#include <stdio.h>
#include <stdlib.h>
......@@ -128,6 +129,7 @@ const char* result_file = 0; /* if set, all results are concated and
typedef struct
{
char* name;
int name_len;
char* str_val;
int str_val_len;
int int_val;
......@@ -137,10 +139,31 @@ typedef struct
VAR var_reg[10];
/*Perl/shell-like variable registers */
HASH var_hash;
struct connection cons[MAX_CONS];
struct connection* cur_con, *next_con, *cons_end;
/* Add new commands before Q_UNKNOWN !*/
enum enum_commands {
Q_CONNECTION=1, Q_QUERY,
Q_CONNECT, Q_SLEEP,
Q_INC, Q_DEC,
Q_SOURCE, Q_DISCONNECT,
Q_LET, Q_ECHO,
Q_WHILE, Q_END_BLOCK,
Q_SYSTEM, Q_RESULT,
Q_REQUIRE, Q_SAVE_MASTER_POS,
Q_SYNC_WITH_MASTER, Q_ERROR,
Q_SEND, Q_REAP,
Q_DIRTY_CLOSE, Q_REPLACE,
Q_PING, Q_EVAL,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
Q_COMMENT_WITH_COMMAND
};
/* this should really be called command */
struct st_query
{
......@@ -149,23 +172,7 @@ struct st_query
my_bool abort_on_error, require_file;
uint expected_errno[MAX_EXPECTED_ERRORS];
char record_file[FN_REFLEN];
/* Add new commands before Q_UNKNOWN */
enum { Q_CONNECTION=1, Q_QUERY,
Q_CONNECT, Q_SLEEP,
Q_INC, Q_DEC,
Q_SOURCE, Q_DISCONNECT,
Q_LET, Q_ECHO,
Q_WHILE, Q_END_BLOCK,
Q_SYSTEM, Q_RESULT,
Q_REQUIRE, Q_SAVE_MASTER_POS,
Q_SYNC_WITH_MASTER, Q_ERROR,
Q_SEND, Q_REAP,
Q_DIRTY_CLOSE, Q_REPLACE,
Q_PING, Q_EVAL,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
Q_COMMENT_WITH_COMMAND
} type;
enum enum_commands type;
};
const char *command_names[] = {
......@@ -189,6 +196,13 @@ TYPELIB command_typelib= {array_elements(command_names),"",
DYNAMIC_STRING ds_res;
static void die(const char* fmt, ...);
static void init_var_hash();
static byte* get_var_key(const byte* rec, uint* len,
my_bool __attribute__((unused)) t);
static VAR* var_init(const char* name, int name_len, const char* val,
int val_len);
static void var_free(void* v);
int dyn_string_cmp(DYNAMIC_STRING* ds, const char* fname);
void reject_dump(const char* record_file, char* buf, int size);
......@@ -287,6 +301,8 @@ static void free_used_memory()
DBUG_ENTER("free_used_memory");
close_cons();
close_files();
hash_free(&var_hash);
for (i=0 ; i < q_lines.elements ; i++)
{
struct st_query **q= dynamic_element(&q_lines, i, struct st_query**);
......@@ -428,10 +444,29 @@ VAR* var_get(const char* var_name, const char** var_name_end, int raw)
digit = *var_name - '0';
if (!(digit < 10 && digit >= 0))
{
const char* save_var_name = var_name, *end;
end = (var_name_end) ? *var_name_end : 0;
while(isalnum(*var_name) || *var_name == '_')
{
if(end && var_name == end)
break;
++var_name;
}
if(var_name == save_var_name)
die("Empty variable");
if(!(v = (VAR*)hash_search(&var_hash, save_var_name,
var_name - save_var_name)))
{
if (end)
*(char*)end = 0;
die("Variable '%s' used uninitialized", save_var_name);
}
--var_name;
goto err;
}
else
v = var_reg + digit;
if (!raw && v->int_dirty)
{
sprintf(v->str_val, "%d", v->int_val);
......@@ -448,6 +483,16 @@ err:
return 0;
}
static VAR* var_obtain(char* name, int len)
{
VAR* v;
if((v = (VAR*)hash_search(&var_hash, name, len)))
return v;
v = var_init(name, len, "", 0);
hash_insert(&var_hash, (byte*)v);
return v;
}
int var_set(char* var_name, char* var_name_end, char* var_val,
char* var_val_end)
{
......@@ -463,9 +508,9 @@ int var_set(char* var_name, char* var_name_end, char* var_val,
digit = *var_name - '0';
if (!(digit < 10 && digit >= 0))
{
*var_name_end = 0;
die("Unsupported variable name: %s", var_name);
v = var_obtain(var_name, var_name_end - var_name);
}
else
v = var_reg + digit;
if (v->alloced_len < (val_len = (int)(var_val_end - var_val)+1))
{
......@@ -475,10 +520,12 @@ int var_set(char* var_name, char* var_name_end, char* var_val,
my_malloc(v->alloced_len, MYF(MY_WME))))
die("Out of memory");
}
memcpy(v->str_val, var_val, val_len-1);
v->str_val_len = val_len - 1;
val_len--;
memcpy(v->str_val, var_val, val_len);
v->str_val_len = val_len;
v->str_val[val_len] = 0;
v->int_val = atoi(v->str_val);
v->int_dirty=0;
return 0;
}
......@@ -515,7 +562,7 @@ int eval_expr(VAR* v, const char* p, const char** p_end)
{
if ((vp = var_get(p,p_end,0)))
{
memcpy(v, vp, sizeof(VAR));
memcpy(v, vp, sizeof(*v));
return 0;
}
}
......@@ -523,6 +570,8 @@ int eval_expr(VAR* v, const char* p, const char** p_end)
{
v->str_val = (char*)p;
v->str_val_len = (p_end && *p_end) ? *p_end - p : strlen(p);
v->int_val=atoi(p);
v->int_dirty=0;
return 0;
}
......@@ -557,7 +606,7 @@ int do_system(struct st_query* q)
char* p=q->first_argument;
VAR v;
eval_expr(&v, p, 0); /* NULL terminated */
if (v.str_val_len > 1)
if (v.str_val_len)
{
char expr_buf[512];
if ((uint)v.str_val_len > sizeof(expr_buf) - 1)
......@@ -576,10 +625,10 @@ int do_echo(struct st_query* q)
char* p=q->first_argument;
VAR v;
eval_expr(&v, p, 0); /* NULL terminated */
if (v.str_val_len > 1)
if (v.str_val_len)
{
fflush(stdout);
write(1, v.str_val, v.str_val_len - 1);
write(1, v.str_val, v.str_val_len);
}
write(1, "\n", 1);
return 0;
......@@ -671,15 +720,15 @@ int do_sleep(struct st_query* q)
p++;
if (*p == '.')
{
char c;
int c;
char *p_end;
p++;
p_end = p + 6;
for(;p <= p_end; ++p)
{
c = *p - '0';
if (c < 10 && c >= 0)
c = (int) (*p - '0');
if (c < 10 && (int) c >= 0)
{
t.tv_usec = t.tv_usec * 10 + c;
dec_mul /= 10;
......@@ -1027,7 +1076,6 @@ int do_while(struct st_query* q)
expr_end = strrchr(expr_start, ')');
if (!expr_end)
die("missing ')' in while");
--expr_end;
eval_expr(&v, ++expr_start, &expr_end);
*cur_block++ = parser.current_line++;
if (!v.int_val)
......@@ -1228,7 +1276,7 @@ static char read_query_buf[MAX_QUERY];
int read_query(struct st_query** q_ptr)
{
char *p = read_query_buf, * p1 ;
int c, expected_errno;
int expected_errno;
struct st_query* q;
if (parser.current_line < parser.read_lines)
......@@ -1283,7 +1331,7 @@ int read_query(struct st_query** q_ptr)
{
p++;
p1 = q->record_file;
while(!isspace(c = *p) &&
while (!isspace(*p) &&
p1 < q->record_file + sizeof(q->record_file) - 1)
*p1++ = *p++;
*p1 = 0;
......@@ -1487,7 +1535,6 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
unsigned long* lengths;
char* val;
int len;
int q_error = 0 ;
DYNAMIC_STRING *ds;
DYNAMIC_STRING ds_tmp;
DYNAMIC_STRING eval_query;
......@@ -1516,8 +1563,7 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
else
ds= &ds_res;
if ((flags & QUERY_SEND) &&
(q_error = mysql_send_query(mysql, query, query_len)))
if ((flags & QUERY_SEND) && mysql_send_query(mysql, query, query_len))
die("At line %u: unable to send query '%s'", start_lineno, query);
if(!(flags & QUERY_REAP))
return 0;
......@@ -1652,9 +1698,67 @@ void get_query_type(struct st_query* q)
type=find_type(q->query, &command_typelib, 1+2);
q->query[q->first_word_len]=save;
if (type > 0)
q->type=type; /* Found command */
q->type=(enum enum_commands) type; /* Found command */
}
static byte* get_var_key(const byte* var, uint* len,
my_bool __attribute__((unused)) t)
{
register char* key;
key = ((VAR*)var)->name;
*len = ((VAR*)var)->name_len;
return (byte*)key;
}
static VAR* var_init(const char* name, int name_len, const char* val,
int val_len)
{
int val_alloc_len;
VAR* tmp_var;
if(!name_len)
name_len = strlen(name);
if(!val_len)
val_len = strlen(val) ;
val_alloc_len = val_len + 16; /* room to grow */
if(!(tmp_var = (VAR*)my_malloc(sizeof(*tmp_var) + val_alloc_len
+ name_len, MYF(MY_WME))))
die("Out of memory");
tmp_var->name = (char*)tmp_var + sizeof(*tmp_var);
tmp_var->str_val = tmp_var->name + name_len;
memcpy(tmp_var->name, name, name_len);
memcpy(tmp_var->str_val, val, val_len + 1);
tmp_var->name_len = name_len;
tmp_var->str_val_len = val_len;
tmp_var->alloced_len = val_alloc_len;
tmp_var->int_val = atoi(val);
tmp_var->int_dirty = 0;
return tmp_var;
}
static void var_free(void* v)
{
my_free(v, MYF(MY_WME));
}
static void var_from_env(const char* name, const char* def_val)
{
const char* tmp;
VAR* v;
if(!(tmp = getenv(name)))
tmp = def_val;
v = var_init(name, 0, tmp, 0);
hash_insert(&var_hash, (byte*)v);
}
static void init_var_hash()
{
if(hash_init(&var_hash, 1024, 0, 0, get_var_key, var_free, MYF(0)))
die("Variable hash initialization failed");
var_from_env("MASTER_MYPORT", "9306");
var_from_env("SLAVE_MYPORT", "9307");
}
int main(int argc, char** argv)
{
......@@ -1683,6 +1787,7 @@ int main(int argc, char** argv)
cur_block = block_stack;
init_dynamic_string(&ds_res, "", 0, 65536);
parse_args(argc, argv);
init_var_hash();
if (!*cur_file)
*cur_file = stdin;
*lineno=1;
......@@ -1776,7 +1881,7 @@ int main(int argc, char** argv)
case Q_REPLACE:
get_replace(q);
break;
case Q_SAVE_MASTER_POS: do_save_master_pos(q); break;
case Q_SAVE_MASTER_POS: do_save_master_pos(); break;
case Q_SYNC_WITH_MASTER: do_sync_with_master(q); break;
case Q_COMMENT: /* Ignore row */
case Q_COMMENT_WITH_COMMAND:
......
......@@ -359,6 +359,9 @@ else
*darwin*)
FIND_PROC="$PS -uaxww | grep mysqld | grep \" \$\$PID \" > /dev/null"
;;
*cygwin*)
FIND_PROC="$PS -e | grep mysqld | grep \" \$\$PID \" > /dev/null"
;;
*)
AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
esac
......@@ -724,7 +727,7 @@ int main()
# Some system specific hacks
#
MAX_C_OPTIMIZE="-O6"
MAX_C_OPTIMIZE="-O3"
case $SYSTEM_TYPE in
*solaris2.7*)
......@@ -828,6 +831,15 @@ case $SYSTEM_TYPE in
CFLAGS="$CFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS"
CXXFLAGS="$CXXFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS"
;;
dnl Is this the right match for DEC OSF on alpha?
*dec-osf*)
if test "$ac_cv_prog_gcc" = "yes" && test "$host_cpu" = "alpha"
then
echo "Adding defines for DEC OSF on alpha"
CFLAGS="$CFLAGS -mieee"
CXXFLAGS="$CXXFLAGS -mieee"
fi
;;
esac
......@@ -1135,8 +1147,16 @@ else
fi
#---END:
# for user definable functions (must be checked after threads on AIX)
# Check for dlopen, needed for user definable functions
# This must be checked after threads on AIX
# We only need this for mysqld, not for the clients.
my_save_LIBS="$LIBS"
LIBS=""
AC_CHECK_LIB(dl,dlopen)
LIBDL=$LIBS
LIBS="$my_save_LIBS"
AC_SUBST(LIBDL)
# System characteristics
AC_SYS_RESTARTABLE_SYSCALLS
......@@ -1366,8 +1386,8 @@ AC_CHECK_FUNCS(alarm bmove \
sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \
pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \
pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \
pthread_condattr_create rwlock_init pthread_rwlock_rdlock \
dlopen dlerror fchmod getpass getpassphrase initgroups mlockall)
pthread_condattr_create rwlock_init pthread_rwlock_rdlock pthread_yield\
fchmod getpass getpassphrase initgroups mlockall)
# Sanity check: We chould not have any fseeko symbol unless
# large_file_support=yes
......@@ -1378,6 +1398,11 @@ then
fi]
)
my_save_LIBS="$LIBS"
LIBS="$LIBS $LIBDL"
AC_CHECK_FUNCS(dlopen dlerror)
LIBS="$my_save_LIBS"
# Check definition of gethostbyaddr_r (glibc2 defines this with 8 arguments)
ac_save_CXXFLAGS="$CXXFLAGS"
AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style,
......@@ -1659,10 +1684,11 @@ AC_ARG_WITH(bench,
if test "$with_bench" = "yes"
then
bench_dirs="sql-bench mysql-test"
bench_dirs="sql-bench"
else
bench_dirs=""
fi
bench_dirs="$bench_dirs mysql-test"
AC_SUBST(bench_dirs)
# Don't build readline, i have it already
......
......@@ -28,6 +28,19 @@
#include <os2.h>
#endif /* __EMX__ */
#ifdef __CYGWIN__
/* We use a Unix API, so pretend it's not Windows */
#undef WIN
#undef WIN32
#undef _WIN
#undef _WIN32
#undef _WIN64
#undef __WIN__
#undef __WIN32__
#define HAVE_ERRNO_AS_DEFINE
#endif /* __CYGWIN__ */
#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32)
#include <config-win.h>
#else
......
......@@ -7,8 +7,9 @@ AM_INIT_AUTOMAKE(ib, 0.90)
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_CHECK_HEADERS(aio.h)
AC_CHECK_HEADERS(aio.h sched.h)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_FUNCS(sched_yield)
AC_C_INLINE
AC_C_BIGENDIAN
......
......@@ -39,6 +39,10 @@ subdirectory of 'mysql'. */
/* Include the header file generated by GNU autoconf */
#include "../ib_config.h"
#ifdef HAVE_SCHED_H
#include <sched.h>
#endif
#ifdef HAVE_PREAD
#define HAVE_PWRITE
#endif
......
......@@ -135,10 +135,12 @@ void
os_thread_yield(void)
/*=================*/
{
#ifdef __WIN__
#if defined(__WIN__)
Sleep(0);
#elif (defined(HAVE_SCHED_YIELD) && defined(HAVE_SCHED_H))
sched_yield();
#else
pthread_yield();
os_thread_sleep(0);
#endif
}
......
......@@ -83,9 +83,9 @@ ctype_extra_sources.c: conf_to_src
$(srcdir)/ctype_extra_sources.c
conf_to_src_SOURCES = conf_to_src.c
conf_to_src_LDADD=
#for --with-other-libc to ensure static linking
#note -all-static rather than -static
#this is needed for libtool to work right
conf_to_src_LDFLAGS=-all-static
#force static linking of conf_to_src - essential when linking against
#custom installation of libc
conf_to_src_LDFLAGS=@NOINST_LDFLAGS@
# Don't update the files from bitkeeper
%::SCCS/s.%
......@@ -1657,6 +1657,7 @@ mysql_close(MYSQL *mysql)
{
free_old_query(mysql);
mysql->status=MYSQL_STATUS_READY; /* Force command */
mysql->reconnect=0;
simple_command(mysql,COM_QUIT,NullS,0,1);
end_server(mysql);
}
......
......@@ -24,10 +24,10 @@ PATH=/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin
which ()
{
DIRS=`echo $PATH | tr ":" " "`
IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
for file
do
for dir in $DIRS
for dir in $PATH
do
if test -f $dir/$file
then
......@@ -38,6 +38,7 @@ which ()
echo "which: no $file in ($PATH)"
exit 1
done
IFS="$save_ifs"
}
......@@ -211,6 +212,9 @@ SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/mysqld-slave.err"
SMALL_SERVER="-O key_buffer_size=1M -O sort_buffer=256K -O max_heap_table_size=1M"
export MASTER_MYPORT
export SLAVE_MYPORT
if [ x$SOURCE_DIST = x1 ] ; then
MY_BASEDIR=$MYSQL_TEST_DIR
else
......
......@@ -21,3 +21,7 @@ t2 CREATE TABLE `t2` (
FULLTEXT KEY `tix` (`inhalt`)
) TYPE=MyISAM
ticket inhalt
ticket inhalt
3 foobar
ticket inhalt
3 foobar
......@@ -78,3 +78,10 @@ f1 f2
12 ted
12 ted
12 ted
table type possible_keys key key_len ref rows Extra
t1 ALL btn NULL NULL NULL 14 where used
btn
table type possible_keys key key_len ref rows Extra
t1 ALL btn NULL NULL NULL 14 where used
table type possible_keys key key_len ref rows Extra
t1 ref btn btn 11 const,const 10 where used
......@@ -5,8 +5,6 @@ sum(length(word))
71
(@id := id) - id
0
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
127.0.0.1 root 9306 1 master-bin.001 939 No 1053 Slave: query ' update t1 set n = n + get_lock('crash_lock', 2)' partially completed on the master and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET SQL_SLAVE_SKIP_COUNTER=1; SLAVE START; 0
count(*)
10
n
......
......@@ -42,7 +42,10 @@ ticket2.id = ttxt.ticket
WHERE t1.id = ticket2.ticket and match(ttxt.inhalt) against ('foobar');
INSERT INTO t1 VALUES (3,3);
select t1.id FROM t2 as ttxt,t1 INNER JOIN t1 as ticket2 ON ticket2.id = ttxt.ticket WHERE t1.id = ticket2.ticket and match(ttxt.inhalt) against ('foobar');
select t1.id FROM t2 as ttxt,t1
INNER JOIN t1 as ticket2 ON ticket2.id = ttxt.ticket
WHERE t1.id = ticket2.ticket and
match(ttxt.inhalt) against ('foobar');
# Check that we get 'fulltext' index in SHOW CREATE
......@@ -53,4 +56,9 @@ show create table t2;
select * from t2 where MATCH inhalt AGAINST (NULL);
# MATCH in HAVING (pretty useless, but still it should work)
select * from t2 where MATCH inhalt AGAINST ('foobar');
select * from t2 having MATCH inhalt AGAINST ('foobar');
drop table t1,t2;
......@@ -2,6 +2,7 @@
# Test of heap tables.
#
drop table if exists t1;
create table t1 (a int not null,b int not null, primary key (a)) type=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a=1 or a=0;
......@@ -85,3 +86,17 @@ INSERT into t1 set f1=12,f2="ted";
delete from t1 where f2="bill";
select * from t1;
drop table t1;
#
# Test when using part key searches
#
create table t1 (btn char(10) not null, key(btn)) type=heap;
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
explain select * from t1 where btn like "q%";
select * from t1 where btn like "q%";
alter table t1 add column new_col char(1) not null, add key (btn,new_col), drop key btn;
update t1 set new_col=btn;
explain select * from t1 where btn="a";
explain select * from t1 where btn="a" and new_col="a";
drop table t1;
source include/master-slave.inc;
connection master;
use test;
drop table if exists t1;
drop table if exists t1,t3;
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
drop table if exists foo;
set password = password('foo');
set password = password('');
create table foo(n int);
insert into foo values(1),(2);
create table t3(n int);
insert into t3 values(1),(2);
save_master_pos;
connection slave;
sync_with_master;
use test;
select * from foo;
select * from t3;
select sum(length(word)) from t1;
connection master;
drop table t1;
drop table t1,t3;
save_master_pos;
connection slave;
sync_with_master;
......@@ -59,7 +58,12 @@ connection slave;
sync_with_master ;
#give the slave a chance to exit
sleep 0.5;
show slave status;
# The following test can't be done because the result of Pos will differ
# on different computers
# --replace_result 9306 9999 3334 9999 3335 9999
# show slave status;
set sql_slave_skip_counter=1;
slave start;
select count(*) from t1;
......
......@@ -10,22 +10,22 @@ reset slave;
show slave status;
change master to master_host='127.0.0.1';
show slave status;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=9306;
eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$MASTER_MYPORT;
show slave status;
slave start;
sync_with_master;
show slave status;
connection master;
drop table if exists foo;
create table foo (n int);
insert into foo values (10),(45),(90);
drop table if exists t1;
create table t1 (n int);
insert into t1 values (10),(45),(90);
save_master_pos;
connection slave;
sync_with_master;
select * from foo;
select * from t1;
connection master;
drop table foo;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
......
......@@ -7,9 +7,11 @@ connection slave;
!slave start;
system chmod 600 var/slave-data/master.info;
!slave start;
!change master to master_host='127.0.0.1',master_port=9306,master_user='root';
!eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT,
master_user='root';
reset slave;
!change master to master_host='127.0.0.1',master_port=9306,master_user='root';
eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT,
master_user='root';
connection master;
reset master;
connection slave;
......
......@@ -24,7 +24,7 @@
void init_alloc_root(MEM_ROOT *mem_root, uint block_size, uint pre_alloc_size)
{
mem_root->free=mem_root->used=0;
mem_root->min_malloc=16;
mem_root->min_malloc=32;
mem_root->block_size=block_size-MALLOC_OVERHEAD-sizeof(USED_MEM)-8;
mem_root->error_handler=0;
#if !(defined(HAVE_purify) && defined(EXTRA_DEBUG))
......
......@@ -79,14 +79,18 @@ then
basedir=@prefix@
bindir=@bindir@
execdir=@libexecdir@
elif test -d "$basedir/libexec"
then
else
bindir="$basedir/bin"
if test -x "$basedir/libexec/mysqld"
then
execdir="$basedir/libexec"
elif test -x "@libexecdir@/mysqld"
then
execdir="@libexecdir@"
else
bindir="$basedir/bin"
execdir="$basedir/bin"
fi
fi
mdata=$ldata/mysql
......
......@@ -36,7 +36,7 @@ while ($#ARGV >= $[ && $ARGV[0] =~ /^-/) {
{
$opt_a = 1;
}
elsif ($ARGV[0] eq "-?" || $ARGV[0] eq "-I")
elsif ($ARGV[0] eq "-?" || $ARGV[0] eq "-I" || $ARGV[0] eq "--help")
{
&usage;
}
......@@ -107,7 +107,7 @@ EOF
sub usage {
print <<EOF;
Usage: $0 [-signal] [-?Ift] pattern
Usage: $0 [-signal] [-?Ift] [--help] pattern
Options: -I or -? "info" -f "force" -t "test".
Version 1.0
......
......@@ -52,7 +52,15 @@ parse_arguments() {
--core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;;
--timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;;
--mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;;
--mysqld-version=*) MYSQLD=mysqld-`echo "$arg" | sed -e "s;--mysqld-version=;;"` ;;
--mysqld-version=*)
tmp=`echo "$arg" | sed -e "s;--mysqld-version=;;"`
if test -n "$tmp"
then
MYSQLD="mysqld-$tmp"
else
MYSQLD="mysqld"
fi
;;
*)
if test -n "$pick_args"
then
......@@ -73,7 +81,7 @@ then
MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are
ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is
DATADIR=$MY_BASEDIR_VERSION/data
if test -z "defaults"
if test -z "$defaults"
then
defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf"
fi
......
......@@ -43,7 +43,7 @@ LDADD = ../isam/libnisam.a \
mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \
@bdb_libs@ @innodb_libs@ @pstack_libs@ \
@gemini_libs@ \
$(LDADD) $(CXXLDFLAGS) $(WRAPLIBS)
$(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@
noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
item_strfunc.h item_timefunc.h item_uniq.h \
item_create.h mysql_priv.h \
......
......@@ -1791,7 +1791,8 @@ String *Field_float::val_str(String *val_buffer,
#endif
memcpy_fixed((byte*) &nr,ptr,sizeof(nr));
val_buffer->alloc(max(field_length,70));
uint to_length=max(field_length,70);
val_buffer->alloc(to_length);
char *to=(char*) val_buffer->ptr();
if (dec >= NOT_FIXED_DEC)
......@@ -1841,8 +1842,9 @@ String *Field_float::val_str(String *val_buffer,
while (tmp_dec--)
*to++= *pos++;
#else
#ifdef HAVE_SNPRINTF_
sprintf(to,val_buffer->length(),"%.*f",dec,nr);
#ifdef HAVE_SNPRINTF
to[to_length-1]=0; // Safety
snprintf(to,to_length-1,"%.*f",dec,nr);
#else
sprintf(to,"%.*f",dec,nr);
#endif
......
......@@ -472,7 +472,7 @@ int main(int argc,char **argv)
int error;
MY_INIT(argv[0]);
start_value=4997167L; best_t1=4533271L; best_t2=7512314L; best_type=4;
start_value=2663113L; best_t1=1175350L; best_t2=7404531L; best_type=4; /* mode=4327 add=3 type: 0 */
if (get_options(argc,(char **) argv))
exit(1);
......
......@@ -78,10 +78,3 @@ class ha_heap: public handler
enum thr_lock_type lock_type);
};
......@@ -298,8 +298,8 @@ public:
class Item_ref :public Item_ident
{
Item **ref;
public:
Item **ref;
Item_ref(char *db_par,char *table_name_par,char *field_name_par)
:Item_ident(db_par,table_name_par,field_name_par),ref(0) {}
Item_ref(Item **item, char *table_name_par,char *field_name_par)
......
......@@ -1961,12 +1961,15 @@ bool Item_func_match::fix_fields(THD *thd,struct st_table_list *tlist)
while ((item=li++))
{
if (item->type() != Item::FIELD_ITEM || item->fix_fields(thd,tlist) ||
!item->used_tables())
if (item->fix_fields(thd,tlist))
return 1;
if (item->type() == Item::REF_ITEM)
li.replace(item= *((Item_ref *)item)->ref);
if (item->type() != Item::FIELD_ITEM || !item->used_tables())
return 1;
used_tables_cache|=item->used_tables();
}
/* check that all columns comes from the same table */
/* check that all columns come from the same table */
if (count_bits(used_tables_cache) != 1)
return 1;
const_item_cache=0;
......
......@@ -384,12 +384,16 @@ my_bool STDCALL mc_mysql_reconnect(MYSQL *mysql)
MYSQL tmp_mysql;
DBUG_ENTER("mc_mysql_reconnect");
if (!mysql->reconnect)
DBUG_RETURN(1);
mc_mysql_init(&tmp_mysql);
tmp_mysql.options=mysql->options;
if (!mc_mysql_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd,
mysql->db, mysql->port, mysql->unix_socket,
mysql->client_flag))
{
tmp_mysql.reconnect=0;
mc_mysql_close(&tmp_mysql);
DBUG_RETURN(1);
}
......@@ -793,6 +797,7 @@ mc_mysql_close(MYSQL *mysql)
{
mc_free_old_query(mysql);
mysql->status=MYSQL_STATUS_READY; /* Force command */
mysql->reconnect=0;
mc_simple_command(mysql,COM_QUIT,NullS,0,1);
mc_end_server(mysql);
}
......
......@@ -924,6 +924,8 @@ get_mm_leaf(Field *field,KEY_PART *key_part,
String tmp(buff1,sizeof(buff1)),*res;
uint length,offset,min_length,max_length;
if (!field->optimize_range())
DBUG_RETURN(0); // Can't optimize this
if (!(res= value->val_str(&tmp)))
DBUG_RETURN(&null_element);
......@@ -971,7 +973,8 @@ get_mm_leaf(Field *field,KEY_PART *key_part,
max_str+maybe_null,&min_length,&max_length);
else
#endif
like_error=like_range(res->ptr(),res->length(),wild_prefix,field_length,
like_error=like_range(res->ptr(),res->length(),wild_prefix,
field_length,
min_str+offset,max_str+offset,
max_sort_char,&min_length,&max_length);
}
......
......@@ -178,8 +178,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
setup_fields(thd,tables,fields,1,&all_fields) ||
setup_conds(thd,tables,&conds) ||
setup_order(thd,tables,fields,all_fields,order) ||
setup_group(thd,tables,fields,all_fields,group,&hidden_group_fields) ||
setup_ftfuncs(thd,tables,ftfuncs))
setup_group(thd,tables,fields,all_fields,group,&hidden_group_fields))
DBUG_RETURN(-1); /* purecov: inspected */
if (having)
......@@ -191,6 +190,8 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
if (having->with_sum_func)
having->split_sum_func(all_fields);
}
if (setup_ftfuncs(thd,tables,ftfuncs)) /* should be after having->fix_fields */
DBUG_RETURN(-1);
/*
Check if one one uses a not constant column with group functions
and no GROUP BY.
......
......@@ -66,22 +66,22 @@ uchar NEAR to_lower_ujis[]=
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '{', '|', '}', '~', '\177',
'\200','\201','\202','\203','\204','\205','\206','\207',
'\210','\211','\212','\213','\214','\215','\216','\217',
'\220','\221','\222','\223','\224','\225','\226','\227',
'\230','\231','\232','\233','\234','\235','\236','\237',
'\240','\241','\242','\243','\244','\245','\246','\247',
'\250','\251','\252','\253','\254','\255','\256','\257',
'\260','\261','\262','\263','\264','\265','\266','\267',
'\270','\271','\272','\273','\274','\275','\276','\277',
'\300','\301','\302','\303','\304','\305','\306','\307',
'\310','\311','\312','\313','\314','\315','\316','\317',
'\320','\321','\322','\323','\324','\325','\326','\327',
'\330','\331','\332','\333','\334','\335','\336','\337',
'\340','\341','\342','\343','\344','\345','\346','\347',
'\350','\351','\352','\353','\354','\355','\356','\357',
'\360','\361','\362','\363','\364','\365','\366','\367',
'\370','\371','\372','\373','\374','\375','\376','\377',
(uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207',
(uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217',
(uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227',
(uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237',
(uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247',
(uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257',
(uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267',
(uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277',
(uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307',
(uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317',
(uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327',
(uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337',
(uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347',
(uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357',
(uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367',
(uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377'
};
uchar NEAR to_upper_ujis[]=
......@@ -102,22 +102,22 @@ uchar NEAR to_upper_ujis[]=
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '{', '|', '}', '~', '\177',
'\200','\201','\202','\203','\204','\205','\206','\207',
'\210','\211','\212','\213','\214','\215','\216','\217',
'\220','\221','\222','\223','\224','\225','\226','\227',
'\230','\231','\232','\233','\234','\235','\236','\237',
'\240','\241','\242','\243','\244','\245','\246','\247',
'\250','\251','\252','\253','\254','\255','\256','\257',
'\260','\261','\262','\263','\264','\265','\266','\267',
'\270','\271','\272','\273','\274','\275','\276','\277',
'\300','\301','\302','\303','\304','\305','\306','\307',
'\310','\311','\312','\313','\314','\315','\316','\317',
'\320','\321','\322','\323','\324','\325','\326','\327',
'\330','\331','\332','\333','\334','\335','\336','\337',
'\340','\341','\342','\343','\344','\345','\346','\347',
'\350','\351','\352','\353','\354','\355','\356','\357',
'\360','\361','\362','\363','\364','\365','\366','\367',
'\370','\371','\372','\373','\374','\375','\376','\377',
(uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207',
(uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217',
(uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227',
(uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237',
(uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247',
(uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257',
(uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267',
(uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277',
(uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307',
(uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317',
(uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327',
(uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337',
(uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347',
(uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357',
(uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367',
(uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377'
};
uchar NEAR sort_order_ujis[]=
......@@ -138,22 +138,22 @@ uchar NEAR sort_order_ujis[]=
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '{', '|', '}', '~', '\177',
'\200','\201','\202','\203','\204','\205','\206','\207',
'\210','\211','\212','\213','\214','\215','\216','\217',
'\220','\221','\222','\223','\224','\225','\226','\227',
'\230','\231','\232','\233','\234','\235','\236','\237',
'\240','\241','\242','\243','\244','\245','\246','\247',
'\250','\251','\252','\253','\254','\255','\256','\257',
'\260','\261','\262','\263','\264','\265','\266','\267',
'\270','\271','\272','\273','\274','\275','\276','\277',
'\300','\301','\302','\303','\304','\305','\306','\307',
'\310','\311','\312','\313','\314','\315','\316','\317',
'\320','\321','\322','\323','\324','\325','\326','\327',
'\330','\331','\332','\333','\334','\335','\336','\337',
'\340','\341','\342','\343','\344','\345','\346','\347',
'\350','\351','\352','\353','\354','\355','\356','\357',
'\360','\361','\362','\363','\364','\365','\366','\367',
'\370','\371','\372','\373','\374','\375','\376','\377',
(uchar) '\200',(uchar) '\201',(uchar) '\202',(uchar) '\203',(uchar) '\204',(uchar) '\205',(uchar) '\206',(uchar) '\207',
(uchar) '\210',(uchar) '\211',(uchar) '\212',(uchar) '\213',(uchar) '\214',(uchar) '\215',(uchar) '\216',(uchar) '\217',
(uchar) '\220',(uchar) '\221',(uchar) '\222',(uchar) '\223',(uchar) '\224',(uchar) '\225',(uchar) '\226',(uchar) '\227',
(uchar) '\230',(uchar) '\231',(uchar) '\232',(uchar) '\233',(uchar) '\234',(uchar) '\235',(uchar) '\236',(uchar) '\237',
(uchar) '\240',(uchar) '\241',(uchar) '\242',(uchar) '\243',(uchar) '\244',(uchar) '\245',(uchar) '\246',(uchar) '\247',
(uchar) '\250',(uchar) '\251',(uchar) '\252',(uchar) '\253',(uchar) '\254',(uchar) '\255',(uchar) '\256',(uchar) '\257',
(uchar) '\260',(uchar) '\261',(uchar) '\262',(uchar) '\263',(uchar) '\264',(uchar) '\265',(uchar) '\266',(uchar) '\267',
(uchar) '\270',(uchar) '\271',(uchar) '\272',(uchar) '\273',(uchar) '\274',(uchar) '\275',(uchar) '\276',(uchar) '\277',
(uchar) '\300',(uchar) '\301',(uchar) '\302',(uchar) '\303',(uchar) '\304',(uchar) '\305',(uchar) '\306',(uchar) '\307',
(uchar) '\310',(uchar) '\311',(uchar) '\312',(uchar) '\313',(uchar) '\314',(uchar) '\315',(uchar) '\316',(uchar) '\317',
(uchar) '\320',(uchar) '\321',(uchar) '\322',(uchar) '\323',(uchar) '\324',(uchar) '\325',(uchar) '\326',(uchar) '\327',
(uchar) '\330',(uchar) '\331',(uchar) '\332',(uchar) '\333',(uchar) '\334',(uchar) '\335',(uchar) '\336',(uchar) '\337',
(uchar) '\340',(uchar) '\341',(uchar) '\342',(uchar) '\343',(uchar) '\344',(uchar) '\345',(uchar) '\346',(uchar) '\347',
(uchar) '\350',(uchar) '\351',(uchar) '\352',(uchar) '\353',(uchar) '\354',(uchar) '\355',(uchar) '\356',(uchar) '\357',
(uchar) '\360',(uchar) '\361',(uchar) '\362',(uchar) '\363',(uchar) '\364',(uchar) '\365',(uchar) '\366',(uchar) '\367',
(uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375', (uchar) (uchar) '\376', (uchar) '\377'
};
......
......@@ -17,6 +17,7 @@ Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql
Icon: mysql.gif
URL: http://www.mysql.com/
Packager: David Axmark <david@mysql.com>
Vendor: MySQL AB
Provides: msqlormysql MySQL-server
Obsoletes: mysql
......@@ -134,9 +135,9 @@ Group: Applications/Databases
Obsoletes: mysql-Max
%description Max
Extra MySQL server binary to get support extra features like
transactional tables. To active these features on only have to install
this package after the server package.
Optional MySQL server binary that supports features
like transactional tables. To active this binary, just install this
package after the MySQL package.
%prep
%setup -n mysql-%{mysql_version}
......@@ -151,11 +152,11 @@ BuildMySQL() {
# support assembler speedups.
sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
CC=\"${MYSQL_BUILD_CC:-egcs}\" \
CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O6 -fno-omit-frame-pointer}\" \
CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O3}\" \
CXX=\"${MYSQL_BUILD_CXX:-egcs}\" \
CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O6 \
CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O3 \
-felide-constructors -fno-exceptions -fno-rtti \
-fno-omit-frame-pointer}\" \
}\" \
./configure \
$* \
--enable-assembler \
......@@ -211,6 +212,9 @@ mv Docs/manual.ps Docs/manual.ps.save
make distclean
mv Docs/manual.ps.save Docs/manual.ps
# RPM:s destroys Makefile.in files, so we generate them here
automake
BuildMySQL "--disable-shared" \
"--with-mysqld-ldflags='-all-static'" \
"--with-client-ldflags='-all-static'" \
......@@ -295,14 +299,24 @@ chmod -R og-rw $mysql_datadir/mysql
# Allow safe_mysqld to start mysqld and print a message before we exit
sleep 2
%post Max
# Restart mysqld, to use the new binary.
# There may be a better way to handle this.
/etc/rc.d/init.d/mysql stop > /dev/null 2>&1
echo "Giving mysqld a couple of seconds to restart"
sleep 5
/etc/rc.d/init.d/mysql start
sleep 2
%preun
if test -x /etc/rc.d/init.d/mysql
then
/etc/rc.d/init.d/mysql stop > /dev/null
fi
# Remove autostart of mysql
if test $1 = 0
then
if test -x /etc/rc.d/init.d/mysql
then
/etc/rc.d/init.d/mysql stop > /dev/null
fi
# Remove autostart of mysql
/sbin/chkconfig --del mysql
fi
# We do not remove the mysql user since it may still own a lot of
......
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