Commit bee9933a authored by unknown's avatar unknown

Small bug fixes


support-files/mysql.server-sys5.sh:
  Change mode to -rw-rw-r--
Docs/manual.texi:
  Added information about BeOS, Access 2000, AIX and user links
client/mysql.cc:
  Fixed SOURCE to work on windows
client/mysqldump.c:
  Strip of white space
configure.in:
  Fix for AIX
include/dbug.h:
  Assert handling
include/my_pthread.h:
  Ia64 needs more thread stack than other processors
include/my_sys.h:
  More comments
myisam/mi_key.c:
  Fixed wrong key length checks
mysql.proj:
  update
mysys/charset.c:
  Cleanup
mysys/mf_keycache.c:
  Moved SEC_LINK to file that used it
mysys/my_static.h:
  Moved SEC_LINK to file that used it
scripts/Makefile.am:
  Fix for debian
scripts/mysql_install_db.sh:
  Cleanup
sql/gen_lex_hash.cc:
  Better values
sql/ha_berkeley.cc:
  Fix of reading of unique key
sql/handler.cc:
  Fix memory allocation bug
sql/mysqld.cc:
  Fix for Ia64
sql/share/charsets/latin1.conf:
  Fixed sortorder back to scandinavian.
sql/sql_yacc.yy:
  FULL shouldn't be a keyword
support-files/Makefile.am:
  Fix for debian
support-files/mysql.server.sh:
  Cleanups
parent aaca0e3c
This diff is collapsed.
......@@ -300,7 +300,7 @@ int main(int argc,char *argv[])
}
}
#endif
sprintf(buff, "Type 'help;' or '\\h' for help.\n");
sprintf(buff, "Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer\n");
put_info(buff,INFO_INFO);
status.exit_status=read_lines(1); // read lines and execute them
mysql_end(0);
......@@ -1680,8 +1680,9 @@ static int com_source(String *buffer, char *line)
while (end > source_name && (isspace(end[-1]) || iscntrl(end[-1])))
end--;
end[0]=0;
unpack_filename(source_name,source_name);
/* open file name */
if (!(sql_file = my_fopen(source_name, O_RDONLY,MYF(0))))
if (!(sql_file = my_fopen(source_name, O_RDONLY | O_BINARY,MYF(0))))
{
char buff[FN_REFLEN+60];
sprintf(buff,"Failed to open file '%s', error: %d", source_name,errno);
......
......@@ -1046,7 +1046,7 @@ static char *getTableName(int reset)
}
if ((row = mysql_fetch_row(res)))
return((char*) row[0]);
if (reset)
mysql_data_seek(res,0); /* We want to read again */
else
......@@ -1134,14 +1134,14 @@ static int dump_all_tables_in_db(char *database)
dynstr_append(&query, " READ /*!32311 LOCAL */,");
}
if (numrows && mysql_real_query(sock, query.str, query.length-1))
DBerror(sock, "when using LOCK TABLES");
DBerror(sock, "when using LOCK TABLES");
/* We shall continue here, if --force was given */
dynstr_free(&query);
}
if (flush_logs)
{
if (mysql_refresh(sock, REFRESH_LOG))
DBerror(sock, "when doing refresh");
DBerror(sock, "when doing refresh");
/* We shall continue here, if --force was given */
}
while ((table = getTableName(0)))
......@@ -1175,14 +1175,14 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
dynstr_append(&query, " READ /*!32311 LOCAL */,");
}
if (mysql_real_query(sock, query.str, query.length-1))
DBerror(sock, "when doing LOCK TABLES");
DBerror(sock, "when doing LOCK TABLES");
/* We shall countinue here, if --force was given */
dynstr_free(&query);
}
if (flush_logs)
{
if (mysql_refresh(sock, REFRESH_LOG))
DBerror(sock, "when doing refresh");
DBerror(sock, "when doing refresh");
/* We shall countinue here, if --force was given */
}
for (; tables > 0 ; tables-- , table_names++)
......@@ -1258,7 +1258,7 @@ int main(int argc, char **argv)
else if (argc > 1 && !opt_databases)
dump_selected_tables(*argv, (argv + 1), (argc - 1));
/* One or more databases, all tables */
else
else
dump_databases(argv);
if (opt_first_slave)
......
......@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE(mysql, 3.23.23-beta)
AM_INIT_AUTOMAKE(mysql, 3.23.24-beta)
AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10
......@@ -685,8 +685,8 @@ case $SYSTEM_TYPE in
;;
*aix4.3*)
echo "Adding defines for AIX"
CFLAGS="$CFLAGS -DUNDEF_HAVE_INITGROUPS"
CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_INITGROUPS"
CFLAGS="$CFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS"
CXXFLAGS="$CXXFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS"
;;
esac
......@@ -789,6 +789,7 @@ then
#
elif test "$with_named_thread" = "no"
then
AC_MSG_RESULT("no")
AC_MSG_CHECKING("SCO UnixWare 7.1 native threads")
if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null
then
......@@ -807,6 +808,7 @@ then
else
AC_DEFINE(HAVE_UNIXWARE7_POSIX)
fi
AC_MSG_RESULT("yes")
# We must have cc
AC_MSG_CHECKING("for gcc")
if expr "$CC" : ".*gcc.*"
......@@ -817,7 +819,6 @@ then
CC="$CC -Kthread -DUNIXWARE_7";
CXX="$CXX -Kthread -DUNIXWARE_7";
fi
AC_MSG_RESULT("yes")
else
{ echo "configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual." 1>&2; exit 1; };
fi
......
......@@ -66,6 +66,7 @@ extern void _db_unlock_file();
#define DEBUGGER_ON _no_db_=0
#define DBUG_LOCK_FILE { _db_lock_file(); }
#define DBUG_UNLOCK_FILE { _db_unlock_file(); }
#define DBUG_ASSERT(A) A
#else /* No debugger */
#define DBUG_ENTER(a1)
......@@ -85,6 +86,7 @@ extern void _db_unlock_file();
#define DEBUGGER_ON
#define DBUG_LOCK_FILE
#define DBUG_UNLOCK_FILE
#define DBUG_ASSERT(A) {}
#endif
#ifdef __cplusplus
}
......
......@@ -490,6 +490,11 @@ extern int pthread_dummy(int);
/* All thread specific variables are in the following struct */
#define THREAD_NAME_SIZE 10
#if defined(__ia64__)
#define DEFAULT_THREAD_STACK (128*1024)
#else
#define DEFAULT_THREAD_STACK (64*1024)
#endif
struct st_my_thread_var
{
......
......@@ -313,9 +313,13 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
((info)->rc_pos - (info)->rc_request_pos))
typedef struct st_changeable_var {
const char *name;
long *varptr;
long def_value,min_value,max_value,sub_size,block_size;
const char *name; /* Name of variable */
long *varptr; /* Pointer to variable */
long def_value, /* Default value */
min_value, /* Min allowed value */
max_value, /* Max allowed value */
sub_size, /* Subtract this from given value */
block_size; /* Value should be a mult. of this */
} CHANGEABLE_VAR;
......@@ -527,6 +531,7 @@ extern void my_free_lock(byte *ptr,myf flags);
#define my_malloc_lock(A,B) my_malloc((A),(B))
#define my_free_lock(A,B) my_free((A),(B))
#endif
#define alloc_root_inited(A) ((A)->min_malloc != 0)
void init_alloc_root(MEM_ROOT *mem_root,uint block_size);
gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size);
void free_root(MEM_ROOT *root);
......
......@@ -283,7 +283,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
uint length;
get_key_length(length,key);
#ifdef CHECK_KEYS
if (length >= keyseg->length || key+length > key_end)
if (length > keyseg->length || key+length > key_end)
goto err;
#endif
memcpy(record+keyseg->start,(byte*) key, length);
......@@ -294,7 +294,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
uint length;
get_key_length(length,key);
#ifdef CHECK_KEYS
if (length >= keyseg->length || key+length > key_end)
if (length > keyseg->length || key+length > key_end)
goto err;
#endif
memcpy(record+keyseg->start+keyseg->bit_start,
......
No preview for this file type
......@@ -380,7 +380,7 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags)
(void) init_available_charsets(MYF(0)); /* If it isn't initialized */
cs=get_internal_charset(cs_number);
if (!cs && flags & MY_WME)
if (!cs && (flags & MY_WME))
{
char index_file[FN_REFLEN], cs_string[23];
strmov(get_charsets_dir(index_file), "Index");
......
......@@ -42,6 +42,17 @@
#define CHANGED_BLOCKS_MASK (CHANGED_BLOCKS_HASH-1)
#define FLUSH_CACHE 2000 /* Sort this many blocks at once */
typedef struct sec_link {
struct sec_link *next_hash,**prev_hash;/* Blocks linked acc. to hash-value */
struct sec_link *next_used,*prev_used;
struct sec_link *next_changed,**prev_changed;
File file;
my_off_t diskpos;
byte *buffer;
my_bool changed;
} SEC_LINK;
static uint find_next_bigger_power(uint value);
static SEC_LINK *find_key_block(int file,my_off_t filepos,int *error);
......@@ -287,7 +298,6 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length,
} while ((length-= read_length));
pthread_mutex_unlock(&THR_LOCK_keycache);
return(start);
pthread_mutex_unlock(&THR_LOCK_keycache);
}
_my_cache_r_requests++;
_my_cache_read++;
......@@ -457,6 +467,7 @@ static SEC_LINK *find_key_block(int file, my_off_t filepos, int *error)
static void free_block(SEC_LINK *used)
{
used->file= -1;
used->changed=0;
if (used != _my_used_first) /* Relink used-chain */
{
if (used == _my_used_last)
......@@ -568,7 +579,6 @@ int flush_key_blocks(File file, enum flush_type type)
if (type != FLUSH_KEEP && type != FLUSH_FORCE_WRITE)
{
/* This will not destroy position or data */
used->changed=0;
_my_blocks_changed--;
free_block(used);
}
......
......@@ -33,16 +33,6 @@ struct st_remember {
sig_handler (*func)(int number);
};
typedef struct sec_link {
struct sec_link *next_hash,**prev_hash;/* Blocks linked acc. to hash-value */
struct sec_link *next_used,*prev_used;
struct sec_link *next_changed,**prev_changed;
File file;
my_off_t diskpos;
byte *buffer;
my_bool changed;
} SEC_LINK;
struct irem {
struct remember *_pNext; /* Linked list of structures */
struct remember *_pPrev; /* Other link */
......
......@@ -71,6 +71,7 @@ SUFFIXES = .sh
@RM@ -f $@ $@-t
@SED@ \
-e 's!@''bindir''@!$(bindir)!g' \
-e 's!@''sbindir''@!$(sbindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''datadir''@!$(datadir)!g' \
......
......@@ -11,56 +11,82 @@
ldata=@localstatedir@
execdir=@libexecdir@
bindir=@bindir@
sbindir=@sbindir@
force=0
IN_RPM=0
defaults=
# Are we doing an rpm install?
if test "$1" = "-IN-RPM"; then IN_RPM=1; shift; fi
if test "$1" = "--force"; then force=1; shift; fi
# Get mysqld/safe_mysqld options from /etc/my.cnf or ~/.my.cnf
case "$1" in
--no-defaults) defaults="$1"; conf=/nonexistent; shift ;;
--defaults-file=*) defaults="$1"; conf=`echo "$1"|sed 's;^--defaults-file=;;'`; shift ;;
*)
if test -w /
then
conf=/etc/my.cnf
else
conf=$HOME/.my.cnf
fi
;;
esac
while [ "x$1" != x ]
do
case "$1" in
-*) eqvalue="`echo $1 |sed 's/[-_a-zA-Z0-9]*=//'`"
case "$1" in
-IN-RPM) IN_RPM=1
;;
--force) force=1
;;
--no-defaults=*) CONFIG_FILES=/nonexistent
;;
--defaults-file=*) CONFIG_FILES="$eqvalue"
;;
--basedir=*) SETVARS="$SETVARS basedir=\"$eqvalue\"; bindir=\"$eqvalue/bon\"; execdir=\"$eqvalue/libexec\"; sbindir=\"$eqvalue/sbin\"; "
;;
--ldata=*|--datadir=*) SETVARS="$SETVARS ldata=\"$eqvalue\";"
;;
--user=*) SETVARS="$SETVARS user=\"$eqvalue\";"
;;
esac
;;
esac
shift
done
GetCNF () {
if test -f "$conf"
then
if grep "^datadir" $conf >/dev/null
then
ldata=`grep "^datadir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
if grep "^execdir" $conf >/dev/null
then
execdir=`grep "^execdir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
if grep "^bindir" $conf >/dev/null
then
bindir=`grep "^bindir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
if grep "^user" $conf >/dev/null
then
user=`grep "^user" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
fi
VARIABLES="basedir bindir datadir sbindir user pid-file log port socket"
# set it not already set
CONFIG_FILES=${CONFIG_FILES:-"/etc/my.cnf ./my.cnf $HOME/.my.cnf"}
for arg
for c in $CONFIG_FILES
do
case "$arg" in
--basedir=*) basedir=`echo "$arg"|sed 's;^--basedir=;;'`; bindir="$basedir/bin"; execdir="$basedir/libexec" ;;
--datadir=*) ldata=`echo "$arg"|sed 's;^--datadir=;;'` ;;
--user=*) user=`echo "$arg"|sed 's;^--user=;;'` ;;
esac
if [ -f $c ]
then
#echo "Processing $c..."
for v in $VARIABLES
do
# This method assumes last of duplicate $variable entries will be the
# value set ([mysqld])
# This could easily be rewritten to gather [xxxxx]-specific entries,
# but for now it looks like only the mysqld ones are needed for
# server startup scripts
eval `sed -n -e '/^$/d' -e '/^#/d' -e 's,[ ],,g' -e '/=/p' $c |\
awk -F= -v v=$v '{if ($1 == v) printf ("thevar=\"%s\"\n", $2)}'`
# it would be easier if the my.cnf and variable values were
# all matched, but since they aren't we need to map them here.
case $v in
pid-file) v=pid_file ;;
log) v=log_file ;;
datadir) v=ldata ;;
esac
# As long as $thevar isn't blank, use it to set or override current
# value
[ "$thevar" != "" ] && eval $v=$thevar
done
#else
# echo "No $c config file."
fi
done
}
# run function to get config values
GetCNF
# Override/set with command-line values
eval $SETVARS
mdata=$ldata/mysql
......
......@@ -472,7 +472,7 @@ int main(int argc,char **argv)
int error;
MY_INIT(argv[0]);
start_value=7223692L; best_t1=2365832L; best_t2=1560117L; best_type=0; /* mode=4519 add=5 func_type: 0 */
start_value=2610463L; best_t1=8358376L; best_t2=860646L; best_type=2; /* mode=4111 add=8 func_type: 0 */
if (get_options(argc,(char **) argv))
exit(1);
......
......@@ -972,7 +972,7 @@ int ha_berkeley::index_read_idx(byte * buf, uint keynr, const byte * key,
statistic_increment(ha_read_key_count,&LOCK_status);
DBUG_ENTER("index_read_idx");
current_row.flags=DB_DBT_REALLOC;
DBUG_RETURN(read_row(file->get(file, transaction,
DBUG_RETURN(read_row(file->get(key_file[keynr], transaction,
pack_key(&last_key, keynr, key_buff, key,
key_len),
&current_row,0),
......
......@@ -317,8 +317,11 @@ int handler::ha_open(const char *name, int mode, int test_if_locked)
}
if (!error)
{
if (!(ref=(byte*) alloc_root(&table->mem_root,
ALIGN_SIZE(ref_length)*2)))
if (!alloc_root_inited(&table->mem_root)) // If temporary table
ref=sql_alloc(ALIGN_SIZE(ref_length)*2);
else
ref=(byte*) alloc_root(&table->mem_root, ALIGN_SIZE(ref_length)*2);
if (!ref)
{
close();
error=HA_ERR_OUT_OF_MEM;
......
......@@ -2302,7 +2302,8 @@ CHANGEABLE_VAR changeable_vars[] = {
{ "thread_cache_size", (long*) &thread_cache_size, 0,1,16384,0,1},
{ "tmp_table_size", (long*) &tmp_table_size,1024*1024L,1024,~0L,
MALLOC_OVERHEAD,1},
{ "thread_stack", (long*) &thread_stack,1024*64,1024*32,~0L,0,1024},
{ "thread_stack", (long*) &thread_stack,DEFAULT_THREAD_STACK,1024*32,
~0L,0,1024},
{ "wait_timeout", (long*) &net_wait_timeout,NET_WAIT_TIMEOUT,1,~0L,0,1},
{ NullS,(long*) 0,0,0,0,0,0,} };
......
......@@ -68,7 +68,7 @@
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
41 41 41 41 41 41 C6 43 45 45 45 45 49 49 49 49
D0 4E 4F 4F 4F 4F 4F D7 4F 55 55 55 55 59 DE 53
41 41 41 41 41 41 C6 43 45 45 45 45 49 49 49 49
D0 4E 4F 4F 4F 4F 4F F7 4F 55 55 55 55 59 DE 59
41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
44 4E 4F 4F 4F 4F 5D D7 D8 55 55 55 59 59 DE DF
41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
44 4E 4F 4F 4F 4F 5D F7 D8 55 55 55 59 59 DE FF
......@@ -2368,6 +2368,7 @@ keyword:
| ESCAPE_SYM {}
| EXTENDED_SYM {}
| FAST_SYM {}
| FULL {}
| FILE_SYM {}
| FIRST_SYM {}
| FIXED_SYM {}
......
......@@ -53,6 +53,7 @@ SUFFIXES = .sh
@RM@ -f $@ $@-t
@SED@ \
-e 's!@''bindir''@!$(bindir)!g' \
-e 's!@''sbindir''@!$(sbindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''datadir''@!$(datadir)!g' \
......
#!/bin/sh
# search & check GNU patch
PATCH="gpatch"
$PATCH --version || PATCH="patch"
$PATCH --version || exit
if /usr/bin/test ! -e PKG/stamp-pre ; then
grep VERSION configure | head -1 | sed 's/VERSION=//' > ./PKG/version
touch PKG/stamp-pre
fi
if /usr/bin/test ! -e PKG/stamp-patch ; then
${PATCH} -p0 < ./PKG/patch
touch PKG/stamp-patch
fi
if /usr/bin/test ! -e PKG/stamp-compile ; then
sh ./PKG/compile.sh ujis
touch PKG/stamp-compile
sh ./PKG/doc.sh ujis
fi
cd PKG
sh mkpkg.sh ujis
#!/bin/sh
# GNU ncurses
# search & check GNU make
GMAKE="gmake"
$GMAKE --version || GMAKE="make"
$GMAKE --version || exit
MAKE=$GMAKE
export MAKE
CC=gcc
CFLAGS="-O6 -fomit-frame-pointer"
CXX=gcc
CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti"
# LDFLAGS="-static"
LD=gcc
export CC
export CXX
export LD
export CFLAGS
export CXXFLAGS
# export LDFLAGS
# Solaris don't have libpthread.a.
if [ "x$1" = "x" ]; then
echo " please set character set"
exit
fi
CHAR="$1"
case "$1" in
[uU]*)
CHAR=ujis
;;
[sS]*)
CHAR=sjis
;;
esac
#---------------
P=`pwd`
if [ -f Makefile ] ; then
${GMAKE} distclean
fi
for i in bin sbin include man share/doc/mysql mysql-data
do
/usr/bin/mkdir -p PKG/tmp-${CHAR}/usr/local/${i}
done
/usr/bin/mkdir -p PKG/tmp-${CHAR}/etc/init.d
#----------------------------
./configure \
--prefix=/usr/local \
--libexecdir=/usr/local/sbin \
--sbindir=/usr/local/sbin \
--localstatedir=/usr/local/mysql-data \
--with-charset=${CHAR} \
--with-extra-charsets=all \
--with-raid \
--without-docs \
--without-bench \
--without-perl \
--with-gcc \
--with-mysqld-ldflags="-static" \
--with-client-ldflags="-static" \
--with-named-curses-libs=/usr/local/lib/libncurses.a \
--with-mysqld-user=mysql
# --with-berkeley-db-includes=/usr/local/include/db3 \
# --with-berkeley-db-libs=/usr/local/lib/libdb3.a \
# --with-low-memory
${GMAKE}
${GMAKE} install DESTDIR=${P}/PKG/tmp-${CHAR}
v=`grep '^SHARED_LIB_VERSION' configure.in | sed 's@SHARED_LIB_VERSION@@' | sed -e 's@=@@' -e 's@:@ @g' | awk '{print $1}'`
km="libmysqlclient.so.$v"
export km
(cd ${P}/PKG/tmp-${CHAR}/usr/local/lib/mysql/ ; \
for i in libmysqlclient* ; do \
if /usr/bin/test ! -L $i ; then \
mv $i ../ ; ln -sf ../$i ; \
fi ; \
done ; \
k=`ls libmysqlclient.so.*.*.*` ; \
cd .. ; \
if /usr/bin/test ! -z libmysqlclient.so ; then \
ln -sf $k libmysqlclient.so ;
fi ; \
if /usr/bin/test ! -z $km ; then \
ln -sf $k $km ;
fi ; \
)
#
(cd ${P}/PKG/tmp-${CHAR}/usr/local/bin ; strip * )
(cd ${P}/PKG/tmp-${CHAR}/usr/local/sbin ; strip * )
#!/bin/sh
CHAR="$1"
case "$1" in
[uU]*)
CHAR=ujis
;;
[sS]*)
CHAR=sjis
;;
esac
cp -r Docs/* PKG/tmp-${CHAR}/usr/local/share/doc/mysql/
cp INSTALL-SOURCE* COPYING* MIRRORS README* PKG/tmp-${CHAR}/usr/local/share/doc/mysql/
cd PKG/tmp-${CHAR}/usr/local/share/doc/mysql/
gzip *.txt *.texi *.info *.pdf
#!/bin/sh
if [ "x$1" = "x" ]; then
echo " please set charset"
exit
fi
CHAR="$1"
case "$1" in
[uU]*)
CHAR=ujis ; CH=uj
;;
[sS]*)
CHAR=sjis ; CH=sj
;;
esac
#-------------------
DIR=`pwd`
VERSION=`cat version`
T=`uname -p`
sed -e "s/@CHAR1@/${CH}/" \
-e "s/@CHAR2@/${CHAR}/" \
-e "s/@VERSION@/${VERSION}/" \
-e "s/@TYPE@/${T}/" \
pkginfo.ini > pkginfo.${CHAR}
sed -e "s,@DIR@,${DIR},g" \
-e "s,@PKGINFO@,${DIR}/pkginfo.${CHAR}," \
prototype.ini > prototype.${CHAR}
INIT="tmp-${CHAR}/etc/init.d/mysql"
cp ../support-files/mysql.server $INIT
chmod 755 $INIT
(cd tmp-${CHAR}; \
chown root etc usr ; \
chgrp sys etc usr ;\
chmod 755 usr etc; \
chgrp sys etc/init.d ; \
chmod 755 etc/init.d ; \
find . -print|pkgproto >> ../prototype.${CHAR})
pkgmk -o -f prototype.${CHAR} -r ${DIR}/tmp-${CHAR}
--- scripts/safe_mysqld.sh.orig Sat Sep 2 17:28:26 2000
+++ scripts/safe_mysqld.sh Sat Sep 2 17:31:19 2000
@@ -89,10 +89,10 @@
NOHUP_NICENESS=`nohup nice`
-if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice --1 echo foo > /dev/null 2>&1; then
+if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice -1 echo foo > /dev/null 2>&1; then
NOHUP_NICENESS="nohup"
else
- NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup"
+ NOHUP_NICENESS="nice -$NOHUP_NICENESS nohup"
fi
export MYSQL_UNIX_PORT
@@ -163,7 +163,8 @@
# The only thing is ps x => redhat 5 gives warnings when using ps -x.
# kill -9 is used or the process won't react on the kill.
numofproces=`ps xa | grep -v "grep" | grep -c $ledir/mysqld`
- echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log
+ echo | tee -a $err_log
+ echo "Number of processes running now: $numofproces" | tee -a $err_log
I=1
while test "$I" -le "$numofproces"
do
@@ -185,4 +186,6 @@
echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log
done
-echo -e "`date +'%y%m%d %H:%M:%S mysqld ended\n'`" | tee -a $err_log
+echo | tee -a $err_log
+echo "`date +'%y%m%d %H:%M:%S mysqld ended'`" | tee -a $err_log
+echo | tee -a $err_log
--- support-files/mysql.server.sh.orig Sat Sep 2 17:35:56 2000
+++ support-files/mysql.server.sh Sat Sep 2 17:36:35 2000
@@ -23,6 +23,9 @@
mysql_daemon_user=@MYSQLD_USER@
export PATH
+## your options...
+OPT=""
+
mode=$1
if test -w / # determine if we should look at the root config file
@@ -82,8 +85,9 @@
then
# Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade.
- $bindir/safe_mysqld \
- --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file --log=$log_file &
+ $bindir/safe_mysqld $OPT \
+ --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file &
+# --log=$log_file &
else
echo "Can't execute $bindir/safe_mysqld"
fi
--- configure.orig Sat Sep 2 17:54:03 2000
+++ configure Sat Sep 2 17:54:18 2000
@@ -202,7 +202,7 @@
--with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
+ latin1 latin2 swe7 usa7 win1250 win1251ukr
ujis sjis tis620; default is latin1)"
ac_help="$ac_help
--with-extra-charsets=cs1,cs2
@@ -8843,7 +8843,7 @@
# Choose a character set
-CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
DEFAULT_CHARSET=latin1
# Check whether --with-charset or --without-charset was given.
--- configure.in.orig Sat Sep 2 17:53:57 2000
+++ configure.in Sat Sep 2 17:54:36 2000
@@ -1517,14 +1517,14 @@
dnl or other special handling, you must also create
dnl strings/ctype-$charset_name.c
-CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
DEFAULT_CHARSET=latin1
AC_ARG_WITH(charset,
[ --with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
+ latin1 latin2 swe7 usa7 win1250 win1251ukr
ujis sjis tis620; default is latin1)],
[default_charset="$withval"],
[default_charset="$DEFAULT_CHARSET"])
PKG=MySQL
NAME=MySQL
ARCH=@TYPE@
VERSION=@VERSION@
CATEGORY=utility
VENDOR=TcX DataKonsult AB, Detron HB and MySQL AB
BASEDIR=/
CLASSES=none
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
export PATH
export LD_LIBRARY_PATH
D0="/usr/local/mysql-data"
D="${D0}/mysql"
DOFIX=0
if /usr/bin/test ! -f ${D}/tables_priv.frm -a -d ${D} ; then
DOFIX=1
fi
if [ ! -d ${D} ]; then
DOFIX=2
/usr/local/bin/mysql_install_db
fi
chown -R mysql $D0
chgrp -R mysql $D0
if /usr/bin/test $DOFIX -eq 1 ; then
/etc/init.d/mysql start
/usr/local/bin/mysql_fix_privilege_tables
else
/etc/init.d/mysql start || true
fi
#!/bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
export PATH
export LD_LIBRARY_PATH
if /usr/bin/test -x /etc/init.d/mysql ; then
/etc/init.d/mysql stop || true
fi
#----- user check
P=`grep mysql /etc/passwd`
G=`grep mysql /etc/group`
if /usr/bin/test "x$G" = "x" ; then
/usr/sbin/groupadd mysql
fi
if /usr/bin/test "x$P" = "x" ; then
/usr/sbin/useradd -g mysql -d /usr/local/mysql-data -s /bin/false mysql
fi
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
export PATH
export LD_LIBRARY_PATH
pid=`/usr/bin/ps -e | /usr/bin/grep mysqld | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
[ "$pid" != "" ] && /usr/local/bin/mysqladmin shutdown
#---
#/usr/ucb/echo -n "Remove DATA Directory (All data expire) [Y/N]? "
#read I
I=No
case "$I" in
Y*|y*)
/usr/ucb/echo -n "Removing MySQL DATA ALL..."
rm -rf /usr/local/mysql-data
echo "done."
;;
*)
echo "not purge DATA directory"
;;
esac;
i pkginfo=@PKGINFO@
i postinstall=@DIR@/postinstall
i preinstall=@DIR@/preinstall
i preremove=@DIR@/preremove
mysql for DEBIAN
----------------------
Comments regarding the Package
* about patch files
if you want to make new patch,
write patch file and put it into debian/patches/.
debian/rules do patch debian/patches/* automatically.
* about server packages
I use Debian alternative system, to switch next 3 type MySQL server.
mysql-server :
this is static linked MySQL server(/usr/sbin/mysqld-static) and share/mysql/ files.
mysql-server-shared:
this is dynamic linked MySQL server only. (/usr/sbin/mysqld-shared)
mysql-server-debug:
--with-debug flag. mysqld only. (/usr/sbin/mysqld-debug)
* about charset
I build MySQL server --with-extra-charsets=all
* about location
server programs ...... /usr/sbin/
share files .......... /usr/share/mysql/
client programs ...... /usr/bin/
MySQL data directory . /var/mysql/data/
benchmark directory .. /var/mysql/sql-bench/
socket file ......... /tmp/mysql.sock
include files ........ /usr/include/mysql/
libraries ........... /usr/lib/ , /usr/lib/mysql/
put libmysqlclient* into /usr/lib/ ,
others, put /usr/lib/mysql/ .
takeshi@SoftAgency.co.jp
This diff is collapsed.
Source: mysql
Section: devel
Priority: extra
Maintainer: takeshi <takeshi@softagency.co.jp>
Standards-Version: 2.1.2.2
Package: mysql
Architecture: all
Description: mysql
Missing
Package: mysql-doc
Architecture: all
Description: mysql Documentation (html)
MySQL Doc.
Package: libmysqlclient9
Architecture: any
Provides: libmysqlclient9
Description: libmysqlclient.so.9
libmysqlclient.so.9
Package: mysql-client
Architecture: any
Depends: ${shlibs:Depends}
Section: devel
Priority: extra
Conflicts: mysql-client-ujis, mysql-client-sjis
Replaces: mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-client-ujis, mysql-client-sjis
Provides: mysql-client
Description: mysql clients.
MySQL clients programs.
Package: mysql-server
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Provides: mysql-server
Description: MySQL server (static linked)
MySQL server. static linked.
Package: mysql-server-shared
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Description: MySQL server (dynamic linked)
MySQL server. dynamic linked.
Package: mysql-server-debug
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Description: MySQL server debug
MySQL server. debug
Package: mysql-dev
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: mysql-dev-sjis, mysql-dev-ujis
Replaces: mysql-dev-sjis, mysql-dev-ujis, libmysqlclient6-ujis, libmysqlclient6-sjis
Provides: mysql-dev
Description: MySQL develop suite
MySQL develop.
Package: mysql-bench
Architecture: all
Description: mysql benchmark suite.
MySQL sql-bench files.
This package was debianized by takeshi@softagency.co.jp on
Sat, 2 May 1998 03:42:24 +0900.
It was downloaded from
http://www.mysql.com/
Copyright:
GPL
Docs/Makefile
strings/Makefile
dbug/Makefile
mysys/Makefile
extra/Makefile
regex/Makefile
isam/Makefile
heap/Makefile
merge/Makefile
sql/Makefile
sql/share/Makefile
support-files/binary-configure
support-files/my-example.cnf
support-files/mysql-log-rotate
scripts/add_func_table
scripts/mysql_setpermisson
scripts/mysqlbug
scripts/mysqlhotcopy
client/my_static.h
client/mysys_priv.h
include/my_config.h
sql/lex_hash.h
sql-bench/Makefile
scripts/mysql_config
libmysql_r/Makefile
#!/bin/sh
STAMPFILE="debian/stamp-move"
if [ -e $STAMPFILE ]; then
exit
fi
#----------
CLIENT1="msql2mysql mysql mysql_convert_table_format mysql_find_rows mysql_fix_privilege_tables mysql_setpermission mysql_zap mysqlaccess mysqladmin mysqlbug mysqldump mysqlhotcopy mysqlimport mysqlshow"
# CLIENT2="add_file_priv add_func_table add_long_password make_binary_distribution"
P=`pwd`
#----------
for CHAR in build
do
#-----
cp -Rpd debian/${CHAR}/usr debian/mysql-server/
cp -Rpd debian/${CHAR}-shared/usr/lib/mysql/libmysqlclient.so.* debian/libmysqlclient9/usr/lib/
#----- mysql-server-shared ---
cp -Rpd debian/${CHAR}-shared/usr/sbin/mysqld debian/mysql-server-shared/usr/sbin/mysqld-shared
#----- mysql-server-debug ---
cp -Rpd debian/${CHAR}-debug/usr/sbin/mysqld debian/mysql-server-debug/usr/sbin/mysqld-debug
#----- mysql-server ---
mv debian/mysql-server/usr/sbin/mysqld debian/mysql-server/usr/sbin/mysqld-static
#----- mysql-client ----
cd ${P}/debian/mysql-server/usr/bin/ && mv $CLIENT1 ../../../mysql-client/usr/bin/
cd ${P}
mv -f debian/mysql-server/usr/{man,info} debian/mysql-client/usr/share/
mv debian/mysql-server/usr/share/mysql/my-example.cnf debian/mysql-client/usr/share/mysql/
mv -f debian/mysql-server/usr/bin/replace debian/mysql-client/usr/bin/mysql_replace
#----- mysql-server ---
mv debian/mysql-server/usr/bin/* debian/mysql-server/usr/sbin/
mv debian/mysql-server/usr/sbin/my_print_defaults debian/mysql-server/usr/bin/
mv debian/mysql-server/usr/sbin/comp_err debian/mysql-server/usr/bin/
mv debian/mysql-server/usr/sbin/perror debian/mysql-server/usr/bin/mysql_perror
mv debian/mysql-server/usr/sbin/resolveip debian/mysql-server/usr/bin/mysql_resolveip
#----- mysql-dev ----
cp -Rpd debian/${CHAR}-shared/usr/lib/mysql/libmysqlclient.so debian/mysql-dev/usr/lib/
mv debian/mysql-server/usr/include debian/mysql-dev/usr/
mv debian/mysql-server/usr/lib/mysql debian/mysql-dev/usr/lib/
mv debian/mysql-dev/usr/lib/mysql/libmysqlclient.a debian/mysql-dev/usr/lib/
(cd debian/mysql-dev/usr/lib/mysql ; ln -sf "../libmysqlclient.a" )
#-----
cp debian/README.debian debian/copyright debian/changelog \
debian/mysql-client/usr/share/doc/mysql/
done
####################
### doc
cp -r COPYING* MIRRORS README* Docs/* debian/mysql-doc/usr/share/doc/mysql/
#### sql-bench
mv debian/mysql-server/usr/sql-bench \
debian/mysql-bench/var/mysql/
touch $STAMPFILE
# Example mysql config file.
# You can copy this to one of:
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is @localstatedir@) or
# ~/.my.cnf to set user-specific options.
#
# One can use all long options that the program supports.
# Run the program with --help to get a list of available options
# This will be passed to all mysql clients
[client]
#password = my_password
#port = 3306
#socket = /tmp/mysql.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# The MySQL server
[mysqld]
default-character-set = ujis
#port = 3306
#socket = /tmp/mysql.sock
#skip-locking
#set-variable = key_buffer=16M
#set-variable = max_allowed_packet=1M
#set-variable = thread_stack=128K
## Start logging
#log
[mysqldump]
default-character-set = ujis
#quick
#set-variable = max_allowed_packet=16M
[mysql]
default-character-set = ujis
#no-auto-rehash
[isamchk]
#set-variable = key_buffer=16M
usr/bin
usr/share/mysql
usr/share/doc/mysql
#!/bin/sh
update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-debug 20
#!/bin/sh
update-alternatives --auto mysqld
#!/bin/sh
update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-shared 15
#!/bin/sh
update-alternatives --auto mysqld
#!/bin/sh
update-rc.d mysql defaults 50 >/dev/null
#--------
update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-static 10
#--------
DOFIX=0
if [ ! -e /var/mysql/data/mysql/tables_priv.frm -a -d /var/mysql/data/mysql ]; then
DOFIX=1
fi
#--------
i=`grep '^mysql:' /etc/group`
if [ "x${i}" == "x" ]; then
groupadd mysql || true
fi
i=`grep '^mysql:' /etc/passwd`
if [ "x${i}" == "x" ]; then
useradd -g mysql -d /var/mysql/data -s /noexists mysql || true
fi
#--------
if [ ! -d /var/mysql/data/mysql ]; then
install -d /var/mysql/data || true
/usr/sbin/mysql_install_db || true
chown -R mysql.mysql /var/mysql
fi
#--------
/etc/init.d/mysql start || true
if [ $DOFIX -eq 1 ]; then
echo "***************************************"
echo " Now, fix tables for MySQL 3.22.11...."
echo " if you set root passwd, please in..."
echo -n " ? MySQL root passwd ? : "
read pass dumy
/usr/sbin/mysql_fix_privilege_tables $pass
fi
#!/bin/sh
update-alternatives --auto mysqld
if [ "$1" = "purge" ]
then
update-rc.d mysql remove >/dev/null
echo -n " Shall I also remove all of the databases (y/N)?"; read ans
if [ "$ans" = "y" -o "$ans" = "Y" ]; then
rm -rf /var/mysql
fi
fi
#!/bin/sh
/etc/init.d/mysql stop || true
--- mysql-3.23.23.orig/sql/Makefile.in
+++ mysql-3.23.23/sql/Makefile.in
@@ -366,7 +366,7 @@
mysqlbinlog: $(mysqlbinlog_OBJECTS) $(mysqlbinlog_DEPENDENCIES)
@rm -f mysqlbinlog
- $(CXXLINK) $(mysqlbinlog_LDFLAGS) $(mysqlbinlog_OBJECTS) $(mysqlbinlog_LDADD) $(LIBS)
+ $(CXXLINK) $(mysqld_LDFLAGS) $(mysqlbinlog_OBJECTS) $(mysqld_LDADD) $(LIBS)
mysqld: $(mysqld_OBJECTS) $(mysqld_DEPENDENCIES)
@rm -f mysqld
--- mysql-3.23.23.orig/scripts/Makefile.in
+++ mysql-3.23.23/scripts/Makefile.in
@@ -337,6 +337,7 @@
@RM@ -f $@ $@-t
@SED@ \
-e 's!@''bindir''@!$(bindir)!g' \
+ -e 's!@''sbindir''@!$(sbindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''datadir''@!$(datadir)!g' \
--- mysql-3.23.23.orig/support-files/Makefile.in
+++ mysql-3.23.23/support-files/Makefile.in
@@ -308,6 +308,7 @@
@RM@ -f $@ $@-t
@SED@ \
-e 's!@''bindir''@!$(bindir)!g' \
+ -e 's!@''sbindir''@!$(sbindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''datadir''@!$(datadir)!g' \
--- mysql-3.23.23.orig/scripts/msql2mysql.sh
+++ mysql-3.23.23/scripts/msql2mysql.sh
@@ -13,4 +13,4 @@
# described in the License. Among other things, the License requires that
# the copyright notice and this notice be preserved on all copies.
-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $*
+@bindir@/mysql_replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $*
--- mysql-3.23.23.orig/scripts/mysql_install_db.sh
+++ mysql-3.23.23/scripts/mysql_install_db.sh
@@ -11,6 +11,7 @@
ldata=@localstatedir@
execdir=@libexecdir@
bindir=@bindir@
+sbindir=@sbindir@
force=0
IN_RPM=0
defaults=
@@ -47,6 +48,10 @@
then
bindir=`grep "^bindir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
+ if grep "^sbindir" $conf >/dev/null
+ then
+ sbindir=`grep "^sbindir" $conf | sed '.*=[ \t]*//`
+ fi
if grep "^user" $conf >/dev/null
then
user=`grep "^user" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
@@ -56,7 +61,7 @@
for arg
do
case "$arg" in
- --basedir=*) basedir=`echo "$arg"|sed 's;^--basedir=;;'`; bindir="$basedir/bin"; execdir="$basedir/libexec" ;;
+ --basedir=*) basedir=`echo "$arg"|sed 's;^--basedir=;;'`; bindir="$basedir/bin"; sbindir="$basedir/sbin"; execdir="$basedir/libexec" ;;
--datadir=*) ldata=`echo "$arg"|sed 's;^--datadir=;;'` ;;
--user=*) user=`echo "$arg"|sed 's;^--user=;;'` ;;
esac
@@ -82,10 +87,10 @@
# Check if hostname is valid
if test "$IN_RPM" -eq 0 -a $force -eq 0
then
- resolved=`$bindir/resolveip $hostname 2>&1`
+ resolved=`$bindir/mysql_resolveip $hostname 2>&1`
if [ $? -ne 0 ]
then
- resolved=`$bindir/resolveip localhost 2>&1`
+ resolved=`$bindir/mysql_resolveip localhost 2>&1`
if [ $? -eq 0 ]
then
echo "Sorry, the host '$hostname' could not be looked up."
@@ -300,7 +305,7 @@
if test -z "$IN_RPM"
then
echo "You can start the MySQL demon with:"
- echo "cd @prefix@ ; $bindir/safe_mysqld &"
+ echo "cd @prefix@ ; $sbindir/safe_mysqld &"
echo
echo "You can test the MySQL demon with the benchmarks in the 'sql-bench' directory:"
echo "cd sql-bench ; run-all-tests"
--- mysql-3.23.23.orig/support-files/mysql.server.sh Tue Sep 5 19:13:35 2000
+++ mysql-3.23.23/support-files/mysql.server.sh Tue Sep 5 19:19:40 2000
@@ -16,6 +16,7 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
basedir=@prefix@
bindir=@bindir@
+sbindir=@sbindir@
datadir=@localstatedir@
pid_file=@localstatedir@/mysqld.pid
log_file=@localstatedir@/mysqld.log
@@ -64,6 +65,10 @@
then
bindir=`grep "^bindir" $conf | cut -f 2 -d= | tr -d ' '`
fi
+ if grep "^sbindir" $conf >/dev/null
+ then
+ sbindir=`grep "^sbindir" $conf | cut -f 2 -d= | tr -d ' '`
+ fi
if grep "^log[ \t]*=" $conf >/dev/null
then
log_file=`grep "log[ \t]*=" $conf | cut -f 2 -d= | tr -d ' '`
@@ -78,14 +83,15 @@
'start')
# Start daemon
- if test -x $bindir/safe_mysqld
+ if test -x $sbindir/safe_mysqld
then
# Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade.
- $bindir/safe_mysqld \
- --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file --log=$log_file &
+ $sbindir/safe_mysqld \
+ --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file &
+# --log=$log_file &
else
- echo "Can't execute $bindir/safe_mysqld"
+ echo "Can't execute $sbindir/safe_mysqld"
fi
;;
--- mysql-3.23.23.orig/configure
+++ mysql-3.23.23/configure
@@ -202,7 +202,7 @@
--with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
+ latin1 latin2 swe7 usa7 win1250 win1251ukr
ujis sjis tis620; default is latin1)"
ac_help="$ac_help
--with-extra-charsets=cs1,cs2
@@ -8843,7 +8843,7 @@
# Choose a character set
-CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
DEFAULT_CHARSET=latin1
# Check whether --with-charset or --without-charset was given.
--- mysql-3.23.23.orig/configure.in
+++ mysql-3.23.23/configure.in
@@ -1517,14 +1517,14 @@
dnl or other special handling, you must also create
dnl strings/ctype-$charset_name.c
-CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
DEFAULT_CHARSET=latin1
AC_ARG_WITH(charset,
[ --with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
+ latin1 latin2 swe7 usa7 win1250 win1251ukr
ujis sjis tis620; default is latin1)],
[default_charset="$withval"],
[default_charset="$DEFAULT_CHARSET"])
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
package=mysql
CHARSET=ujis
TEMPINST=build
#CFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static
CC=gcc
CFLAGS=-O6 -fomit-frame-pointer
CXX=gcc
CXXFLAGS=-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti
# CXXFLAGS=-O6 -fomit-frame-pointer -felide-constructors -fno-rtti
SYSNAME=
COMMONCONF= --prefix=/usr --libexecdir=/usr/sbin \
--localstatedir=/var/mysql/data \
--enable-shared \
--without-perl --without-readline \
--without-docs --without-bench \
--with-mysqld-user=mysql \
--with-extra-charsets=all
SERVERCONF=$(COMMONCONF) --enable-assembler \
--with-raid
# --with-berkeley-db-includes=/usr/include/db3 \
# --with-berkeley-db-libs=/usr/lib/libdb3.a
STATICCONF=--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
CLIENTCONF=$(COMMONCONF) --without-server
##################################################
patches debian/stamp-patches:
-test -e debian/stamp-patches || \
for i in `find debian/patches -type f -print` ; do \
patch -p1 < $$i ; \
done
touch debian/stamp-patches
##################################################
premkdir debian/stamp-premkdir:
$(checkdir)
-rm -rf debian/tmp debian/$(TEMPINST)*
dh_installdirs
-install -d debian/$(TEMPINST)/usr/{bin,sbin,share,man,include,info}
-install -d debian/$(TEMPINST)-shared/usr/{bin,sbin,share,man,include,info}
-install -d debian/$(TEMPINST)-debug/usr/{bin,sbin,share,man,include,info}
touch debian/stamp-premkdir
##################################################
config debian/stamp-config: debian/stamp-premkdir debian/stamp-patches
CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
LDFLAGS="-static" \
./configure $(SERVERCONF) $(STATICCONF) \
--with-charset=$(CHARSET) \
--with-bench \
$(SYSNAME)
# sed 's/-fno-implicit-templates//g' sql/Makefile > .m
# mv .m sql/Makefile
touch debian/stamp-config
##################################################
build: debian/stamp-config
make LDFLAGS="-static"
make install DESTDIR=`pwd`/debian/$(TEMPINST)
cp include/m_ctype.h `pwd`/debian/$(TEMPINST)/usr/include/mysql/
touch build
##################################################
build-shared debian/stamp-build-shared: debian/stamp-patches
-make distclean
CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
./configure $(SERVERCONF) \
--with-charset=$(CHARSET) \
$(SYSNAME)
# ./configure $(CLIENTCONF)
make
make install DESTDIR=`pwd`/debian/$(TEMPINST)-shared
touch debian/stamp-build-shared
##################################################
build-debug debian/stamp-build-debug: debian/stamp-patches
-make distclean
CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
./configure $(SERVERCONF) \
--with-charset=$(CHARSET) \
--with-debug \
$(SYSNAME)
# ./configure $(CLIENTCONF)
make
make install DESTDIR=`pwd`/debian/$(TEMPINST)-debug
touch debian/stamp-build-debug
##################################################
clean:
$(checkdir)
-make distclean
-test -e debian/stamp-patches && \
for i in `find debian/patches -type f -print` ; do \
patch -R -p1 < $$i ; \
done
-rm -rf build debian/stamp-* debian/$(TEMPINST)*
-dh_clean
-rm -f `find . -name "*~"`
-rm -rf debian/tmp debian/files* core
-rm -f debian/*substvars
-rm -f `cat debian/gomi`
##################################################
binary-indep: checkroot build
$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
binary-arch: checkroot build debian/stamp-build-shared debian/stamp-build-debug
sh debian/move
### init, post*
dh_installdeb
cp debian/shlibs debian/libmysqlclient9/DEBIAN/
cp debian/my.cnf debian/mysql-server/etc/
cp support-files/mysql.server debian/mysql-server/etc/init.d/mysql ; chmod +x debian/mysql-server/etc/init.d/mysql
### dpkg-xxx
dh_compress
dh_fixperms
dh_strip
dh_shlibdeps
dh_gencontrol
dpkg --build debian/libmysqlclient9 ..
dpkg --build debian/mysql-client ..
dpkg --build debian/mysql-server ..
dpkg --build debian/mysql-server-shared ..
dpkg --build debian/mysql-server-debug ..
dpkg --build debian/mysql-dev ..
dpkg --build debian/mysql-bench ..
dpkg --build debian/mysql-doc ..
define checkdir
test -f debian/rules
endef
# Below here is fairly generic really
binary: binary-indep binary-arch
##################################################
checkroot:
$(checkdir)
test root = "`whoami`"
##################################################
.PHONY: binary binary-arch binary-indep clean checkroot
libmysqlclient 9 libmysqlclient9
File mode changed from 100755 to 100644
......@@ -13,63 +13,61 @@
# chkconfig: 2345 90 90
# description: A very fast and reliable SQL database engine.
# The following variables are only set for letting mysql.server find things
# if you want to affect other MySQL variables, you should make your changes
# in the /etc/my.cnf or other configuration files
PATH=/sbin:/usr/sbin:/bin:/usr/bin
basedir=@prefix@
bindir=@bindir@
sbindir=@sbindir@
datadir=@localstatedir@
pid_file=@localstatedir@/mysqld.pid
log_file=@localstatedir@/mysqld.log
# Run mysqld as this user.
mysql_daemon_user=@MYSQLD_USER@
export PATH
mode=$1
if test -w / # determine if we should look at the root config file
then # or user config file
conf=/etc/my.cnf
else
conf=$HOME/.my.cnf # Using the users config file
fi
# The following code tries to get the variables safe_mysqld needs from the
# config file. This isn't perfect as this ignores groups, but it should
# work as the options doesn't conflict with anything else.
if test -f "$conf" # Extract those fields we need from config file.
then
if grep "^datadir" $conf >/dev/null
then
datadir=`grep "^datadir" $conf | cut -f 2 -d= | tr -d ' '`
fi
if grep "^user" $conf >/dev/null
then
mysql_daemon_user=`grep "^user" $conf | cut -f 2 -d= | tr -d ' ' | head -1`
fi
if grep "^pid-file" $conf >/dev/null
then
pid_file=`grep "^pid-file" $conf | cut -f 2 -d= | tr -d ' '`
else
if test -d "$datadir"
then
pid_file=$datadir/`hostname`.pid
fi
fi
if grep "^basedir" $conf >/dev/null
then
basedir=`grep "^basedir" $conf | cut -f 2 -d= | tr -d ' '`
bindir=$basedir/bin
fi
if grep "^bindir" $conf >/dev/null
then
bindir=`grep "^bindir" $conf | cut -f 2 -d= | tr -d ' '`
fi
if grep "^log[ \t]*=" $conf >/dev/null
then
log_file=`grep "log[ \t]*=" $conf | cut -f 2 -d= | tr -d ' '`
fi
fi
GetCNF () {
VARIABLES="basedir bindir sbindir datadir pid-file"
CONFIG_FILES="/etc/my.cnf $basedir/my.cnf $HOME/.my.cnf"
for c in $CONFIG_FILES
do
if [ -f $c ]
then
#echo "Processing $c..."
for v in $VARIABLES
do
# This method assumes last of duplicate $variable entries will be the
# value set ([mysqld])
# This could easily be rewritten to gather [xxxxx]-specific entries,
# but for now it looks like only the mysqld ones are needed for
# server startup scripts
eval `sed -n -e '/^$/d' -e '/^#/d' -e 's,[ ],,g' -e '/=/p' $c |\
awk -F= -v v=$v '{if ($1 == v) printf ("thevar=\"%s\"\n", $2)}'`
# it would be easier if the my.cnf and variable values were
# all matched, but since they aren't we need to map them here.
case $v in
pid-file) v=pid_file ;;
log) v=log_file ;;
esac
# As long as $thevar isn't blank, use it to set or override current
# value
[ "$thevar" != "" ] && eval $v=$thevar
done
#else
# echo "No $c config file."
fi
done
}
# run function to get config values
GetCNF
# Safeguard (relative paths, core dumps..)
cd $basedir
......@@ -83,7 +81,7 @@ case "$mode" in
# Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade.
$bindir/safe_mysqld \
--user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file --log=$log_file &
--datadir=$datadir --pid-file=$pid_file &
else
echo "Can't execute $bindir/safe_mysqld"
fi
......
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