Commit 67891255 authored by unknown's avatar unknown

Added MYSQL_SERVER_SUFFIX to mysqld

Fixed bug in TRIM
changed strnmov -> strmake


BUILD/SETUP.sh:
  Removed --disable-shared
Docs/manual.texi:
  Changelog
  Installing many servers
acinclude.m4:
  Force use of db-3.2.3h
client/mysql.cc:
  cleanup
mysql-test/r/func_str.result:
  Added new TRIM test
mysql-test/t/func_str.test:
  Added new TRIM test
mysys/charset.c:
  change to use strmake instead of strnmov
mysys/mf_format.c:
  change to use strmake instead of strnmov
mysys/mf_tempfile.c:
  change to use strmake instead of strnmov
scripts/make_binary_distribution.sh:
  Removed error messages for missing files
sql/handler.cc:
  More debug
sql/item_strfunc.cc:
  Fixed bug in TRIM()
sql/mysqld.cc:
  Added MYSQL_SERVER_SUFFIX to mysqld
parent e6b40860
...@@ -26,7 +26,7 @@ debug_cflags="-DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DSAFE_MUTEX -O2" ...@@ -26,7 +26,7 @@ debug_cflags="-DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DSAFE_MUTEX -O2"
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti" base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
base_configs="--prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --disable-shared" base_configs="--prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static"
alpha_configs="" # not used yet alpha_configs="" # not used yet
pentium_configs="" pentium_configs=""
sparc_configs="" sparc_configs=""
......
This diff is collapsed.
...@@ -823,7 +823,7 @@ AC_DEFUN([MYSQL_CHECK_BDB_VERSION], [ ...@@ -823,7 +823,7 @@ AC_DEFUN([MYSQL_CHECK_BDB_VERSION], [
bdb_version_ok=yes bdb_version_ok=yes
# This is ugly, but about as good as it can get # This is ugly, but about as good as it can get
elif test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 3 &&\ elif test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 3 &&\
grep 'DB_VERSION_STRING.*g: ' [$1] > /dev/null grep 'DB_VERSION_STRING.*h: ' [$1] > /dev/null
then then
bdb_version_ok=yes bdb_version_ok=yes
else else
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "my_readline.h" #include "my_readline.h"
#include <signal.h> #include <signal.h>
const char *VER="11.11"; const char *VER="11.12";
gptr sql_alloc(unsigned size); // Don't use mysqld alloc for these gptr sql_alloc(unsigned size); // Don't use mysqld alloc for these
void sql_element_free(void *ptr); void sql_element_free(void *ptr);
...@@ -520,7 +520,7 @@ static void usage(int version) ...@@ -520,7 +520,7 @@ static void usage(int version)
puts(" -W, --pipe Use named pipes to connect to server"); puts(" -W, --pipe Use named pipes to connect to server");
#endif #endif
printf("\n\ printf("\n\
-P --port=... Port number to use for connection.\n\ -P, --port=... Port number to use for connection.\n\
-q, --quick Don't cache result, print it row by row. This may\n\ -q, --quick Don't cache result, print it row by row. This may\n\
slow down the server if the output is suspended.\n\ slow down the server if the output is suspended.\n\
Doesn't use history file.\n\ Doesn't use history file.\n\
...@@ -529,7 +529,7 @@ static void usage(int version) ...@@ -529,7 +529,7 @@ static void usage(int version)
-S --socket=... Socket file to use for connection.\n"); -S --socket=... Socket file to use for connection.\n");
#include "sslopt-usage.h" #include "sslopt-usage.h"
printf("\ printf("\
-t --table Output in table format.\n\ -t, --table Output in table format.\n\
-T, --debug-info Print some debug info at exit.\n\ -T, --debug-info Print some debug info at exit.\n\
--tee=... Append everything into outfile. See interactive help\n\ --tee=... Append everything into outfile. See interactive help\n\
(\\h) also. Does not work in batch mode.\n"); (\\h) also. Does not work in batch mode.\n");
......
...@@ -32,6 +32,8 @@ concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),': ...@@ -32,6 +32,8 @@ concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':
:my:sql: :my:sql:
concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':') concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':')
:my:sql: :my:sql:
TRIM("foo" FROM "foo") TRIM("foo" FROM "foook") TRIM("foo" FROM "okfoo")
ok ok
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test this is a test
replace('aaaa','a','b') replace('aaaa','aa','b') replace('aaaa','a','bb') replace('aaaa','','b') replace('bbbb','a','c') replace('aaaa','a','b') replace('aaaa','aa','b') replace('aaaa','a','bb') replace('aaaa','','b') replace('bbbb','a','c')
......
...@@ -22,6 +22,7 @@ select concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),' ...@@ -22,6 +22,7 @@ select concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),'
select concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':'); select concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':');
select concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':'); select concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':');
select concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':'); select concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':');
select TRIM("foo" FROM "foo"), TRIM("foo" FROM "foook"), TRIM("foo" FROM "okfoo");
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c'); select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c');
......
...@@ -100,7 +100,7 @@ char *get_charsets_dir(char *buf) ...@@ -100,7 +100,7 @@ char *get_charsets_dir(char *buf)
DBUG_ENTER("get_charsets_dir"); DBUG_ENTER("get_charsets_dir");
if (charsets_dir != NULL) if (charsets_dir != NULL)
strnmov(buf, charsets_dir, FN_REFLEN); strmake(buf, charsets_dir, FN_REFLEN-1);
else else
{ {
if (test_if_hard_path(sharedir) || if (test_if_hard_path(sharedir) ||
......
...@@ -57,7 +57,7 @@ my_string fn_format(my_string to, const char *name, const char *dsk, ...@@ -57,7 +57,7 @@ my_string fn_format(my_string to, const char *name, const char *dsk,
name+=(length=dirname_part(dev,(startpos=(my_string) name))); name+=(length=dirname_part(dev,(startpos=(my_string) name)));
if (length == 0 || flag & 1) if (length == 0 || flag & 1)
{ {
(void) strnmov(dev,dsk, sizeof(dev) - 2); (void) strmake(dev,dsk, sizeof(dev) - 2);
/* Use given directory */ /* Use given directory */
convert_dirname(dev); /* Fix to this OS */ convert_dirname(dev); /* Fix to this OS */
} }
...@@ -100,7 +100,7 @@ my_string fn_format(my_string to, const char *name, const char *dsk, ...@@ -100,7 +100,7 @@ my_string fn_format(my_string to, const char *name, const char *dsk,
bmove(buff,(char*) name,length); /* Save name for last copy */ bmove(buff,(char*) name,length); /* Save name for last copy */
name=buff; name=buff;
} }
pos=strnmov(strmov(to,dev),name,length); pos=strmake(strmov(to,dev),name,length);
#ifdef FN_UPPER_CASE #ifdef FN_UPPER_CASE
caseup_str(to); caseup_str(to);
#endif #endif
...@@ -117,7 +117,7 @@ my_string fn_format(my_string to, const char *name, const char *dsk, ...@@ -117,7 +117,7 @@ my_string fn_format(my_string to, const char *name, const char *dsk,
if (flag & 32 || (!lstat(to,&stat_buff) && S_ISLNK(stat_buff.st_mode))) if (flag & 32 || (!lstat(to,&stat_buff) && S_ISLNK(stat_buff.st_mode)))
{ {
if (realpath(to,buff)) if (realpath(to,buff))
strnmov(to,buff,FN_REFLEN-1); strmake(to,buff,FN_REFLEN-1);
} }
} }
#endif #endif
......
...@@ -69,7 +69,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, ...@@ -69,7 +69,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
} }
if ((res=tempnam((char*) dir,(char *) prefix))) if ((res=tempnam((char*) dir,(char *) prefix)))
{ {
strnmov(to,res,FN_REFLEN); strmake(to,res,FN_REFLEN-1);
(*free)(res); (*free)(res);
file=my_create(to,0, mode, MyFlags); file=my_create(to,0, mode, MyFlags);
} }
...@@ -80,7 +80,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, ...@@ -80,7 +80,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
dir=getenv("TMPDIR"); dir=getenv("TMPDIR");
if ((res=tempnam((char*) dir,(char *) prefix))) if ((res=tempnam((char*) dir,(char *) prefix)))
{ {
strnmov(to,res,FN_REFLEN); strmake(to,res,FN_REFLEN-1);
(*free)(res); (*free)(res);
file=my_create(to, 0, mode, MyFlags); file=my_create(to, 0, mode, MyFlags);
} }
...@@ -130,7 +130,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, ...@@ -130,7 +130,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
} }
if ((res=tempnam((char*) dir, (char*) prefix))) if ((res=tempnam((char*) dir, (char*) prefix)))
{ {
strnmov(to,res,FN_REFLEN); strmake(to,res,FN_REFLEN-1);
(*free)(res); (*free)(res);
file=my_create(to,0, file=my_create(to,0,
(int) (O_RDWR | O_BINARY | O_TRUNC | (int) (O_RDWR | O_BINARY | O_TRUNC |
......
...@@ -38,7 +38,7 @@ fi ...@@ -38,7 +38,7 @@ fi
# This should really be integrated with automake and not duplicate the # This should really be integrated with automake and not duplicate the
# installation list. # installation list.
BASE=$TMP/my_dist BASE=$TMP/my_dist$SUFFIX
if [ -d $BASE ] ; then if [ -d $BASE ] ; then
rm -r -f $BASE rm -r -f $BASE
...@@ -59,10 +59,28 @@ do ...@@ -59,10 +59,28 @@ do
done done
for i in extra/comp_err extra/replace extra/perror extra/resolveip \ for i in extra/comp_err extra/replace extra/perror extra/resolveip \
extra/my_print_defaults isam/isamchk isam/pack_isam myisam/myisamchk myisam/myisampack sql/mysqld sql/mysqlbinlog \ extra/my_print_defaults isam/isamchk isam/pack_isam myisam/myisamchk \
client/mysql sql/mysqld sql/mysqld.sym.gz client/mysqlshow \ myisam/myisampack sql/mysqld sql/mysqlbinlog \
client/mysql sql/mysqld client/mysqlshow \
client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \ client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \
client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \
client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest
do
if [ -f $i ]
then
cp -p $i $BASE/bin
strip $BASE/bin
fi
done
for i in sql/mysqld.sym.gz
if [ -f $i ]
then
cp -p $i $BASE/bin
fi
done
for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib
do do
if [ -f $i ] if [ -f $i ]
then then
...@@ -75,7 +93,7 @@ rm $BASE/include/Makefile*; rm $BASE/include/*.in ...@@ -75,7 +93,7 @@ rm $BASE/include/Makefile*; rm $BASE/include/*.in
cp -p tests/*.res tests/*.tst tests/*.pl $BASE/tests cp -p tests/*.res tests/*.tst tests/*.pl $BASE/tests
cp -p support-files/* $BASE/support-files cp -p support-files/* $BASE/support-files
cp -p libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib
cp -r -p sql/share/* $BASE/share/mysql cp -r -p sql/share/* $BASE/share/mysql
rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD
...@@ -106,7 +124,7 @@ if [ -d $BASE/sql-bench/SCCS ] ; then ...@@ -106,7 +124,7 @@ if [ -d $BASE/sql-bench/SCCS ] ; then
fi fi
# Change the distribution to a long descriptive name # Change the distribution to a long descriptive name
NEW_NAME=mysql-$version-$system-$machine$SUFFIX NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$system-$machine$SUFFIX
BASE2=$TMP/$NEW_NAME BASE2=$TMP/$NEW_NAME
rm -r -f $BASE2 rm -r -f $BASE2
mv $BASE $BASE2 mv $BASE $BASE2
......
...@@ -375,8 +375,8 @@ int handler::ha_open(const char *name, int mode, int test_if_locked) ...@@ -375,8 +375,8 @@ int handler::ha_open(const char *name, int mode, int test_if_locked)
{ {
int error; int error;
DBUG_ENTER("handler::open"); DBUG_ENTER("handler::open");
DBUG_PRINT("enter",("db_type: %d db_stat: %d mode: %d lock_test: %d", DBUG_PRINT("enter",("name: %s db_type: %d db_stat: %d mode: %d lock_test: %d",
table->db_type, table->db_stat, mode, test_if_locked)); name, table->db_type, table->db_stat, mode, test_if_locked));
if ((error=open(name,mode,test_if_locked))) if ((error=open(name,mode,test_if_locked)))
{ {
......
...@@ -930,7 +930,7 @@ String *Item_func_trim::val_str(String *str) ...@@ -930,7 +930,7 @@ String *Item_func_trim::val_str(String *str)
char *ptr=(char*) res->ptr(); char *ptr=(char*) res->ptr();
char *end=ptr+res->length(); char *end=ptr+res->length();
const char *r_ptr=remove_str->ptr(); const char *r_ptr=remove_str->ptr();
while (ptr+remove_length < end && !memcmp(ptr,r_ptr,remove_length)) while (ptr+remove_length <= end && !memcmp(ptr,r_ptr,remove_length))
ptr+=remove_length; ptr+=remove_length;
#ifdef USE_MB #ifdef USE_MB
if (use_mb(default_charset_info) && !binary) if (use_mb(default_charset_info) && !binary)
...@@ -954,7 +954,7 @@ String *Item_func_trim::val_str(String *str) ...@@ -954,7 +954,7 @@ String *Item_func_trim::val_str(String *str)
else else
#endif /* USE_MB */ #endif /* USE_MB */
{ {
while (ptr + remove_length < end && while (ptr + remove_length <= end &&
!memcmp(end-remove_length,r_ptr,remove_length)) !memcmp(end-remove_length,r_ptr,remove_length))
end-=remove_length; end-=remove_length;
} }
......
...@@ -275,7 +275,7 @@ char mysql_real_data_home[FN_REFLEN], ...@@ -275,7 +275,7 @@ char mysql_real_data_home[FN_REFLEN],
blob_newline,f_fyllchar,max_sort_char,*mysqld_user,*mysqld_chroot, blob_newline,f_fyllchar,max_sort_char,*mysqld_user,*mysqld_chroot,
*opt_init_file; *opt_init_file;
char *opt_bin_logname = 0; // this one needs to be seen in sql_parse.cc char *opt_bin_logname = 0; // this one needs to be seen in sql_parse.cc
char server_version[50]=MYSQL_SERVER_VERSION; char server_version[60]=MYSQL_SERVER_VERSION;
const char *first_keyword="first"; const char *first_keyword="first";
const char **errmesg; /* Error messages */ const char **errmesg; /* Error messages */
const char *myisam_recover_options_str="OFF"; const char *myisam_recover_options_str="OFF";
...@@ -1471,14 +1471,10 @@ int main(int argc, char **argv) ...@@ -1471,14 +1471,10 @@ int main(int argc, char **argv)
strmov(glob_hostname,"mysql"); strmov(glob_hostname,"mysql");
strmov(pidfile_name,glob_hostname); strmov(pidfile_name,glob_hostname);
strmov(strcend(pidfile_name,'.'),".pid"); // Add extension strmov(strcend(pidfile_name,'.'),".pid"); // Add extension
#ifdef DEMO_VERSION
strcat(server_version,"-demo");
#endif
#ifdef SHAREWARE_VERSION
strcat(server_version,"-shareware");
#endif
#ifndef DBUG_OFF #ifndef DBUG_OFF
strcat(server_version,"-debug"); strxmov(strend(server_version),MYSQL_SERVER_SUFFIX,"-debug",NullS);
#else
strmov(strend(server_version),MYSQL_SERVER_SUFFIX);
#endif #endif
#ifdef _CUSTOMSTARTUPCONFIG_ #ifdef _CUSTOMSTARTUPCONFIG_
if (_cust_check_startup()) if (_cust_check_startup())
......
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