Commit e090f2d0 authored by monty@narttu.mysql.fi's avatar monty@narttu.mysql.fi

Fixes for make_win_src_distributions

Removed compiler warnings
parent d33cb08e
......@@ -12,6 +12,7 @@ CP="cp -p"
DEBUG=0
SILENT=0
SUFFIX=""
DIRNAME=""
OUTTAR=0
#
......@@ -75,6 +76,7 @@ parse_arguments() {
--debug) DEBUG=1;;
--tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;;
--suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
--dirname=*) DIRNAME=`echo "$arg" | sed -e "s;--dirname=;;"` ;;
--silent) SILENT=1 ;;
--tar) OUTTAR=1 ;;
--help) show_usage ;;
......@@ -155,11 +157,15 @@ mkdir $BASE/Docs $BASE/extra $BASE/include
# Copy directory files
#
copy_dir_files() {
copy_dir_files()
{
for arg do
print_debug "Copying files from directory '$arg'"
cd $SOURCE/$arg/
cd $SOURCE/$arg
if [ ! -d $BASE/$arg ]; then
print_debug "Creating directory '$arg'"
mkdir $BASE/$arg
fi
for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \
README INSTALL* LICENSE
do
......@@ -199,9 +205,6 @@ copy_dir_dirs() {
for i in *
do
if [ -d $SOURCE/$basedir/$i ] && [ "$i" != "SCCS" ]; then
if [ ! -d $BASE/$basedir/$i ]; then
mkdir $BASE/$basedir/$i
fi
copy_dir_files $basedir/$i
fi
done
......@@ -214,7 +217,7 @@ copy_dir_dirs() {
for i in client dbug extra heap include isam \
libmysql libmysqld merge myisam \
myisammrg mysys regex sql strings \
myisammrg mysys regex sql strings sql-common \
vio zlib
do
copy_dir_files $i
......@@ -270,15 +273,19 @@ done
if [ -f scripts/mysql_install_db ]; then
print_debug "Initializing the 'data' directory"
scripts/mysql_install_db --windows --datadir=$BASE/data
scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data
fi
#
# Specify the distribution package name and copy it
#
NEW_DIR_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version$SUFFIX
if test -z $DIRNAME
then
NEW_DIR_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version$SUFFIX
else
NEW_DIR_NAME=$DIRNAME
fi
NEW_NAME=$NEW_DIR_NAME-win-src
BASE2=$TMP/$NEW_DIR_NAME
......@@ -345,7 +352,7 @@ set_tarzip_options()
EXT=".zip"
NEED_COMPRESS=0
if [ "$SILENT" = "1" ] ; then
OPT="-r"
OPT="$OPT -q"
fi
fi
done
......@@ -386,9 +393,7 @@ fi
print_debug "Removing temporary directory"
rm -r -f $BASE
echo "$NEW_NAME$EXT created successfully !!"
if [ "$SILENT" = "0" ] ; then
echo "$NEW_NAME$EXT created successfully !!"
fi
# End of script
......
#!/bin/sh
# Copyright (C) 1997-2002 MySQL AB
# Copyright (C) 1997-2003 MySQL AB
# For a more info consult the file COPYRIGHT distributed with this file
# This script writes on stdout SQL commands to generate all not
......@@ -12,7 +11,7 @@
# $3 - hostname
# $4 - windows option
if test x$1 = x"" ;
if test "$1" = ""
then
echo "
This script writes on stdout SQL commands to generate all not
......@@ -20,9 +19,9 @@ existing MySQL system tables. It also replaces the help tables with
new context from the manual (from fill_help_tables.sql).
Usage:
mysql_create_system_tables {help|real|verbose} <path to mysql-database directory> <hostname> <windows option>
";
exit;
mysql_create_system_tables [test|verbose|real] <path to mysql-database directory> <hostname> <windows option>
"
exit
fi
mdata=$2
......@@ -44,7 +43,7 @@ i_ht=""
# Check for old tables
if test ! -f $mdata/db.frm
then
if test x$1 = x"verbose" ; then
if test "$1" = "verbose" ; then
echo "Preparing db table" 1>&2;
fi
......@@ -76,7 +75,7 @@ fi
if test ! -f $mdata/host.frm
then
if test x$1 = x"verbose" ; then
if test "$1" = "verbose" ; then
echo "Preparing host table" 1>&2;
fi
......@@ -102,7 +101,7 @@ fi
if test ! -f $mdata/user.frm
then
if test x$1 = x"verbose" ; then
if test "$1" = "verbose" ; then
echo "Preparing user table" 1>&2;
fi
......@@ -142,7 +141,7 @@ then
c_u="$c_u )"
c_u="$c_u comment='Users and global privileges';"
if test x$1 = x"test"
if test "$1" = "test"
then
i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
......@@ -165,7 +164,7 @@ fi
if test ! -f $mdata/func.frm
then
if test x$1 = x"verbose" ; then
if test "$1" = "verbose" ; then
echo "Preparing func table" 1>&2;
fi
......@@ -181,7 +180,7 @@ fi
if test ! -f $mdata/tables_priv.frm
then
if test x$1 = x"verbose" ; then
if test "$1" = "verbose" ; then
echo "Preparing tables_priv table" 1>&2;
fi
......@@ -202,7 +201,7 @@ fi
if test ! -f $mdata/columns_priv.frm
then
if test x$1 = x"verbose" ; then
if test "$1" = "verbose" ; then
echo "Preparing columns_priv table" 1>&2;
fi
......@@ -221,7 +220,7 @@ fi
if test ! -f $mdata/help_topic.frm
then
if test x$1 = x"verbose" ; then
if test "$1" = "verbose" ; then
echo "Preparing help_topic table" 1>&2;
fi
......@@ -242,7 +241,7 @@ old_categories="yes"
if test ! -f $mdata/help_category.frm
then
if test x$1 = x"verbose" ; then
if test "$1" = "verbose" ; then
echo "Preparing help_category table" 1>&2;
fi
......@@ -259,7 +258,7 @@ fi
if test ! -f $mdata/help_keyword.frm
then
if test x$1 = x"verbose" ; then
if test "$1" = "verbose" ; then
echo "Preparing help_keyword table" 1>&2;
fi
......@@ -274,7 +273,7 @@ fi
if test ! -f $mdata/help_relation.frm
then
if test x$1 = x"verbose" ; then
if test "$1" = "verbose" ; then
echo "Preparing help_relation table" 1>&2;
fi
......
......@@ -8,18 +8,8 @@
# All unrecognized arguments to this script are passed to mysqld.
in_rpm=0
case "$1" in
--rpm)
in_rpm="1"; shift
;;
esac
windows=0
case "$1" in
--windows)
windows="1"; shift
;;
esac
defaults=
defaults=""
case "$1" in
--no-defaults|--defaults-file=*|--defaults-extra-file=*)
defaults="$1"; shift
......@@ -44,6 +34,8 @@ parse_arguments() {
--ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--verbose) verbose=1 ;;
--rpm) in_rpm=1 ;;
--windows) windows=1 ;;
*)
if test -n "$pick_args"
then
......@@ -61,6 +53,9 @@ parse_arguments() {
if test -x ./bin/my_print_defaults
then
print_defaults="./bin/my_print_defaults"
elif test -x ./extra/my_print_defaults
then
print_defaults="./extra/my_print_defaults"
elif test -x @bindir@/my_print_defaults
then
print_defaults="@bindir@/my_print_defaults"
......@@ -79,6 +74,7 @@ basedir=
force=0
verbose=0
fill_help_tables=""
parse_arguments `$print_defaults $defaults mysqld mysql_install_db`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
......@@ -103,7 +99,7 @@ else
fi
# find fill_help_tables.sh
for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` @pkgdatadir@
for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@
do
if test -f $i/fill_help_tables.sql
then
......@@ -115,22 +111,28 @@ if test -f $pkgdatadir/fill_help_tables.sql
then
fill_help_tables=$pkgdatadir/fill_help_tables.sql
else
if test $verbose -eq 1
then
echo "Could not find help file 'fill_help_tables.sql' ;$pkgdatadir; ;$basedir;".
fi
echo "Could not find help file 'fill_help_tables.sql' in @pkgdatadir@ or inside $basedir".
exit 1;
fi
mdata=$ldata/mysql
mysqld=$execdir/mysqld
mysqld_opt=""
if test "$windows" -eq 0 -a ! -x $execdir/mysqld
if test "$windows" = 1
then
mysqld="./sql/mysqld"
mysqld_opt="--language=./sql/share/english"
fi
if test ! -x $mysqld
then
if test "$in_rpm" -eq 1
then
echo "FATAL ERROR $execdir/mysqld not found!"
echo "FATAL ERROR $mysqld not found!"
exit 1
else
echo "Didn't find $execdir/mysqld"
echo "Didn't find $mysqld"
echo "You should do a 'make install' before executing this script"
exit 1
fi
......@@ -184,23 +186,28 @@ else
create_option="real"
fi
echo "Installing all prepared tables"
if test "$in_rpm" -eq 0 -a "$windows" -eq 0
then
echo "Installing all prepared tables"
fi
if (
mysql_create_system_tables $create_option $mdata $hostname $windows
$pkgdatadir/mysql_create_system_tables $create_option $mdata $hostname $windows
if test -n "$fill_help_tables"
then
cat $fill_help_tables
fi
) | eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \
) | eval "$mysqld $defaults $mysqld_opt --bootstrap --skip-grant-tables \
--basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args"
then
echo ""
if test "$in_rpm" -eq 0 || "$windows" -eq 0
if test "$in_rpm" -eq 0 -a "$windows" -eq 0
then
echo ""
echo "To start mysqld at boot time you have to copy support-files/mysql.server"
echo "to the right place for your system"
echo
fi
if test "$windows" -eq 0
then
echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !"
echo "This is done with:"
echo "$bindir/mysqladmin -u root password 'new-password'"
......@@ -216,7 +223,7 @@ then
echo "able to use the new GRANT command!"
fi
echo
if test "$in_rpm" -eq 0 -a "$windows" -eq 0
if test "$in_rpm" -eq 0
then
echo "You can start the MySQL daemon with:"
echo "cd @prefix@ ; $bindir/mysqld_safe &"
......@@ -230,13 +237,14 @@ then
echo "The latest information about MySQL is available on the web at"
echo "http://www.mysql.com"
echo "Support MySQL by buying support/licenses at https://order.mysql.com"
fi
exit 0
else
echo "Installation of grant tables failed!"
echo
echo "Examine the logs in $ldata for more information."
echo "You can also try to start the mysqld daemon with:"
echo "$execdir/mysqld --skip-grant &"
echo "$mysqld --skip-grant &"
echo "You can use the command line tool"
echo "$bindir/mysql to connect to the mysql"
echo "database and look at the grant tables:"
......
......@@ -107,7 +107,7 @@ const char *unknown_sqlstate= "HY000";
const char *not_error_sqlstate= "00000";
#ifdef HAVE_SMEM
char *shared_memory_base_name= 0;
const char def_shared_memory_base_name= default_shared_memory_base_name;
const char *def_shared_memory_base_name= default_shared_memory_base_name;
#endif
static void mysql_close_free_options(MYSQL *mysql);
......
......@@ -1652,7 +1652,9 @@ Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
List_iterator<Item> li(list);
Item *item;
#ifndef EMBEDDED_LIBRARY
char buff[sizeof(char*)]; // Max local vars in function
#endif
used_tables_cache=0;
const_item_cache=0;
......
......@@ -3337,15 +3337,19 @@ int mysql_drop_user(THD *thd, List <LEX_USER> &list)
}
tables[0].table->field[0]->store(user_name->host.str,(uint)
user_name->host.length, system_charset_info);
user_name->host.length,
system_charset_info);
tables[0].table->field[1]->store(user_name->user.str,(uint)
user_name->user.length, system_charset_info);
user_name->user.length,
system_charset_info);
if (!tables[0].table->file->index_read_idx(tables[0].table->record[0],0,
(byte*) tables[0].table->field[0]->ptr,0,
(byte*) tables[0].table->
field[0]->ptr,0,
HA_READ_KEY_EXACT))
{
int error;
if ((error = tables[0].table->file->delete_row(tables[0].table->record[0])))
if ((error = tables[0].table->file->delete_row(tables[0].table->
record[0])))
{
tables[0].table->file->print_error(error, MYF(0));
tables[0].table->file->index_end();
......@@ -3355,7 +3359,7 @@ int mysql_drop_user(THD *thd, List <LEX_USER> &list)
}
tables[0].table->file->index_end();
}
err:
VOID(pthread_mutex_unlock(&acl_cache->lock));
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
......
......@@ -2308,7 +2308,6 @@ mysql_execute_command(THD *thd)
break;
}
case SQLCOM_UPDATE:
TABLE_LIST *table;
if (check_db_used(thd,tables))
goto error;
......
......@@ -8061,7 +8061,6 @@ void free_underlaid_joins(THD *thd, SELECT_LEX *select)
bool JOIN::rollup_init()
{
uint i,j;
ORDER *group;
Item **ref_array;
tmp_table_param.quick_group= 0; // Can't create groups in tmp table
......@@ -8145,7 +8144,7 @@ bool JOIN::rollup_make_fields(List<Item> &all_fields, List<Item> &fields,
...
*/
for (level=0 ; level < send_group_parts > 0 ; level++)
for (level=0 ; level < send_group_parts ; level++)
{
uint i;
uint pos= send_group_parts - level -1;
......
......@@ -3850,7 +3850,7 @@ purge_option:
}
Item *tmp= new Item_func_unix_timestamp($2);
Lex->sql_command = SQLCOM_PURGE_BEFORE;
Lex->purge_time= tmp->val_int();
Lex->purge_time= (ulong) tmp->val_int();
}
;
......
......@@ -1723,13 +1723,13 @@ static int my_uni_utf8 (CHARSET_INFO *cs __attribute__((unused)) ,
switch (count) {
/* Fall through all cases!!! */
#ifdef UNICODE_32BIT
case 6: r[5] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x4000000;
case 5: r[4] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x200000;
case 4: r[3] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x10000;
case 6: r[5] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x4000000;
case 5: r[4] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x200000;
case 4: r[3] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x10000;
#endif
case 3: r[2] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x800;
case 2: r[1] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0xc0;
case 1: r[0] = wc;
case 3: r[2] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x800;
case 2: r[1] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0xc0;
case 1: r[0] = (uchar) wc;
}
return count;
}
......
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