Commit 038fe2fc authored by monty@donna.mysql.com's avatar monty@donna.mysql.com

Added MYSQL_SERVER_SUFFIX to mysqld

Fixed bug in TRIM
changed strnmov -> strmake
parent ee3e0a98
......@@ -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_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
pentium_configs=""
sparc_configs=""
......
This diff is collapsed.
......@@ -823,7 +823,7 @@ AC_DEFUN([MYSQL_CHECK_BDB_VERSION], [
bdb_version_ok=yes
# 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 &&\
grep 'DB_VERSION_STRING.*g: ' [$1] > /dev/null
grep 'DB_VERSION_STRING.*h: ' [$1] > /dev/null
then
bdb_version_ok=yes
else
......
......@@ -39,7 +39,7 @@
#include "my_readline.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
void sql_element_free(void *ptr);
......@@ -520,7 +520,7 @@ static void usage(int version)
puts(" -W, --pipe Use named pipes to connect to server");
#endif
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\
slow down the server if the output is suspended.\n\
Doesn't use history file.\n\
......@@ -529,7 +529,7 @@ static void usage(int version)
-S --socket=... Socket file to use for connection.\n");
#include "sslopt-usage.h"
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\
--tee=... Append everything into outfile. See interactive help\n\
(\\h) also. Does not work in batch mode.\n");
......
......@@ -32,6 +32,8 @@ concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':
:my:sql:
concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM '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')
this is a test
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 '),'
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(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 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)
DBUG_ENTER("get_charsets_dir");
if (charsets_dir != NULL)
strnmov(buf, charsets_dir, FN_REFLEN);
strmake(buf, charsets_dir, FN_REFLEN-1);
else
{
if (test_if_hard_path(sharedir) ||
......
......@@ -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)));
if (length == 0 || flag & 1)
{
(void) strnmov(dev,dsk, sizeof(dev) - 2);
(void) strmake(dev,dsk, sizeof(dev) - 2);
/* Use given directory */
convert_dirname(dev); /* Fix to this OS */
}
......@@ -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 */
name=buff;
}
pos=strnmov(strmov(to,dev),name,length);
pos=strmake(strmov(to,dev),name,length);
#ifdef FN_UPPER_CASE
caseup_str(to);
#endif
......@@ -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 (realpath(to,buff))
strnmov(to,buff,FN_REFLEN-1);
strmake(to,buff,FN_REFLEN-1);
}
}
#endif
......
......@@ -69,7 +69,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
}
if ((res=tempnam((char*) dir,(char *) prefix)))
{
strnmov(to,res,FN_REFLEN);
strmake(to,res,FN_REFLEN-1);
(*free)(res);
file=my_create(to,0, mode, MyFlags);
}
......@@ -80,7 +80,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
dir=getenv("TMPDIR");
if ((res=tempnam((char*) dir,(char *) prefix)))
{
strnmov(to,res,FN_REFLEN);
strmake(to,res,FN_REFLEN-1);
(*free)(res);
file=my_create(to, 0, mode, MyFlags);
}
......@@ -130,7 +130,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
}
if ((res=tempnam((char*) dir, (char*) prefix)))
{
strnmov(to,res,FN_REFLEN);
strmake(to,res,FN_REFLEN-1);
(*free)(res);
file=my_create(to,0,
(int) (O_RDWR | O_BINARY | O_TRUNC |
......
......@@ -38,7 +38,7 @@ fi
# This should really be integrated with automake and not duplicate the
# installation list.
BASE=$TMP/my_dist
BASE=$TMP/my_dist$SUFFIX
if [ -d $BASE ] ; then
rm -r -f $BASE
......@@ -59,10 +59,28 @@ do
done
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 \
client/mysql sql/mysqld sql/mysqld.sym.gz client/mysqlshow \
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
extra/my_print_defaults isam/isamchk isam/pack_isam myisam/myisamchk \
myisam/myisampack sql/mysqld sql/mysqlbinlog \
client/mysql sql/mysqld client/mysqlshow \
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
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
if [ -f $i ]
then
......@@ -75,7 +93,7 @@ rm $BASE/include/Makefile*; rm $BASE/include/*.in
cp -p tests/*.res tests/*.tst tests/*.pl $BASE/tests
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
rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD
......@@ -106,7 +124,7 @@ if [ -d $BASE/sql-bench/SCCS ] ; then
fi
# 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
rm -r -f $BASE2
mv $BASE $BASE2
......
......@@ -375,8 +375,8 @@ int handler::ha_open(const char *name, int mode, int test_if_locked)
{
int error;
DBUG_ENTER("handler::open");
DBUG_PRINT("enter",("db_type: %d db_stat: %d mode: %d lock_test: %d",
table->db_type, table->db_stat, mode, test_if_locked));
DBUG_PRINT("enter",("name: %s db_type: %d db_stat: %d mode: %d lock_test: %d",
name, table->db_type, table->db_stat, mode, test_if_locked));
if ((error=open(name,mode,test_if_locked)))
{
......
......@@ -930,7 +930,7 @@ String *Item_func_trim::val_str(String *str)
char *ptr=(char*) res->ptr();
char *end=ptr+res->length();
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;
#ifdef USE_MB
if (use_mb(default_charset_info) && !binary)
......@@ -954,7 +954,7 @@ String *Item_func_trim::val_str(String *str)
else
#endif /* USE_MB */
{
while (ptr + remove_length < end &&
while (ptr + remove_length <= end &&
!memcmp(end-remove_length,r_ptr,remove_length))
end-=remove_length;
}
......
......@@ -275,7 +275,7 @@ char mysql_real_data_home[FN_REFLEN],
blob_newline,f_fyllchar,max_sort_char,*mysqld_user,*mysqld_chroot,
*opt_init_file;
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 **errmesg; /* Error messages */
const char *myisam_recover_options_str="OFF";
......@@ -1471,14 +1471,10 @@ int main(int argc, char **argv)
strmov(glob_hostname,"mysql");
strmov(pidfile_name,glob_hostname);
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
strcat(server_version,"-debug");
strxmov(strend(server_version),MYSQL_SERVER_SUFFIX,"-debug",NullS);
#else
strmov(strend(server_version),MYSQL_SERVER_SUFFIX);
#endif
#ifdef _CUSTOMSTARTUPCONFIG_
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