summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-08-27 22:13:26 +0300
committerunknown <monty@narttu.mysql.fi>2003-08-27 22:13:26 +0300
commitad4fdb79cd4c6f06a1a09e0ded07cb7e8c76f07c (patch)
treec9fde96b759a6ffda7cc40b971132c4a94f66f7b
parentc637296ceaf315d66011d0eeeae4765294fff060 (diff)
parent9d64b924c992ba06209350d4837ff3b7c2bc136e (diff)
downloadmariadb-git-ad4fdb79cd4c6f06a1a09e0ded07cb7e8c76f07c.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into narttu.mysql.fi:/my/mysql-4.0
-rw-r--r--extra/my_print_defaults.c29
-rw-r--r--include/my_sys.h4
-rw-r--r--include/mysql_com.h4
-rw-r--r--mysys/default.c59
-rw-r--r--scripts/mysqld_safe.sh2
-rw-r--r--sql/share/portuguese/errmsg.txt40
-rw-r--r--sql/share/spanish/errmsg.txt34
-rw-r--r--vio/Makefile.am2
8 files changed, 102 insertions, 72 deletions
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index c0f8a54f432..549b2124b55 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -26,6 +26,7 @@
#include <my_getopt.h>
const char *config_file="my"; /* Default config file */
+uint verbose= 0, opt_defaults_file_used= 0;
static struct my_option my_long_options[] =
{
@@ -47,6 +48,8 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help message and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"verbose", 'v', "Increase the output level",
+ 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
@@ -55,7 +58,7 @@ static struct my_option my_long_options[] =
static void usage(my_bool version)
{
- printf("%s Ver 1.5 for %s at %s\n",my_progname,SYSTEM_TYPE,
+ printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE,
MACHINE_TYPE);
if (version)
return;
@@ -73,12 +76,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument __attribute__((unused)))
{
switch (optid) {
+ case 'c':
+ opt_defaults_file_used= 1;
+ break;
case 'n':
exit(0);
case 'I':
case '?':
usage(0);
exit(0);
+ case 'v':
+ verbose++;
+ break;
case 'V':
usage(1);
exit(0);
@@ -104,7 +113,7 @@ static int get_options(int *argc,char ***argv)
int main(int argc, char **argv)
{
- int count;
+ int count, error;
char **load_default_groups, *tmp_arguments[2],
**argument, **arguments;
MY_INIT(argv[0]);
@@ -126,8 +135,20 @@ int main(int argc, char **argv)
arguments=tmp_arguments;
arguments[0]=my_progname;
arguments[1]=0;
- load_defaults(config_file, (const char **) load_default_groups,
- &count, &arguments);
+ if ((error= load_defaults(config_file, (const char **) load_default_groups,
+ &count, &arguments)) > 1)
+ {
+ if (verbose && opt_defaults_file_used)
+ {
+ if (error == 2)
+ fprintf(stderr, "WARNING: Defaults file (%s) not found!\n",
+ config_file);
+ if (error == 3)
+ fprintf(stderr, "WARNING: Defaults file (%s) is not a regular file!\n",
+ config_file);
+ }
+ exit(2); // Non-fatal error
+ }
for (argument= arguments+1 ; *argument ; argument++)
puts(*argument);
diff --git a/include/my_sys.h b/include/my_sys.h
index 9f4b91c8bf6..7a3d22f3304 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -742,8 +742,8 @@ extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
extern char *strdup_root(MEM_ROOT *root,const char *str);
extern char *strmake_root(MEM_ROOT *root,const char *str,uint len);
extern char *memdup_root(MEM_ROOT *root,const char *str,uint len);
-extern void load_defaults(const char *conf_file, const char **groups,
- int *argc, char ***argv);
+extern int load_defaults(const char *conf_file, const char **groups,
+ int *argc, char ***argv);
extern void free_defaults(char **argv);
extern void print_defaults(const char *conf_file, const char **groups);
extern my_bool my_compress(byte *, ulong *, ulong *);
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 945372563b0..6daf26bc2ac 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -242,8 +242,8 @@ void hash_password(unsigned long *result, const char *password);
/* Some other useful functions */
void my_init(void);
-void load_defaults(const char *conf_file, const char **groups,
- int *argc, char ***argv);
+int load_defaults(const char *conf_file, const char **groups,
+ int *argc, char ***argv);
my_bool my_thread_init(void);
void my_thread_end(void);
diff --git a/mysys/default.c b/mysys/default.c
index cdacc8bee2b..716be6fc2bb 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -66,13 +66,13 @@ NullS,
#define windows_ext ".ini"
#endif
-static my_bool search_default_file(DYNAMIC_ARRAY *args,MEM_ROOT *alloc,
- const char *dir, const char *config_file,
- const char *ext, TYPELIB *group);
+static int search_default_file(DYNAMIC_ARRAY *args,MEM_ROOT *alloc,
+ const char *dir, const char *config_file,
+ const char *ext, TYPELIB *group);
static char *remove_end_comment(char *ptr);
-void load_defaults(const char *conf_file, const char **groups,
+int load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv)
{
DYNAMIC_ARRAY args;
@@ -80,6 +80,7 @@ void load_defaults(const char *conf_file, const char **groups,
TYPELIB group;
my_bool found_print_defaults=0;
uint args_used=0;
+ int error= 0;
MEM_ROOT alloc;
char *ptr,**res;
DBUG_ENTER("load_defaults");
@@ -100,7 +101,7 @@ void load_defaults(const char *conf_file, const char **groups,
(*argc)--;
*argv=res;
*(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */
- DBUG_VOID_RETURN;
+ return 0;
}
/* Check if we want to force the use a specific default file */
@@ -129,14 +130,14 @@ void load_defaults(const char *conf_file, const char **groups,
goto err;
if (forced_default_file)
{
- if (search_default_file(&args, &alloc, "", forced_default_file, "",
- &group))
+ if ((error= search_default_file(&args, &alloc, "",
+ forced_default_file, "", &group)) == 1)
goto err;
}
else if (dirname_length(conf_file))
{
- if (search_default_file(&args, &alloc, NullS, conf_file, default_ext,
- &group))
+ if ((error= search_default_file(&args, &alloc, NullS, conf_file,
+ default_ext, &group)) == 1)
goto err;
}
else
@@ -144,26 +145,25 @@ void load_defaults(const char *conf_file, const char **groups,
#ifdef __WIN__
char system_dir[FN_REFLEN];
GetWindowsDirectory(system_dir,sizeof(system_dir));
- if (search_default_file(&args, &alloc, system_dir, conf_file, windows_ext,
- &group))
+ if ((error= search_default_file(&args, &alloc, system_dir, conf_file,
+ windows_ext, &group)) == 1)
goto err;
#endif
#if defined(__EMX__) || defined(OS2)
if (getenv("ETC") &&
- search_default_file(&args, &alloc, getenv("ETC"), conf_file,
- default_ext, &group))
+ (error= search_default_file(&args, &alloc, getenv("ETC"), conf_file,
+ default_ext, &group)) == 1)
goto err;
#endif
for (dirs=default_directories ; *dirs; dirs++)
{
- int error=0;
if (**dirs)
- error=search_default_file(&args, &alloc, *dirs, conf_file,
- default_ext, &group);
+ error= search_default_file(&args, &alloc, *dirs, conf_file,
+ default_ext, &group);
else if (defaults_extra_file)
- error=search_default_file(&args, &alloc, NullS, defaults_extra_file,
- default_ext, &group);
- if (error)
+ error= search_default_file(&args, &alloc, NullS, defaults_extra_file,
+ default_ext, &group);
+ if (error == 1)
goto err;
}
}
@@ -204,11 +204,11 @@ void load_defaults(const char *conf_file, const char **groups,
puts("");
exit(1);
}
- DBUG_VOID_RETURN;
+ return error;
err:
fprintf(stderr,"Program aborted\n");
- exit(1);
+ return(error);
}
@@ -220,9 +220,16 @@ void free_defaults(char **argv)
}
-static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
- const char *dir, const char *config_file,
- const char *ext, TYPELIB *group)
+/*
+ Return values: 0 Success
+ 1 Fatal error, abort
+ 2 File not found, continue
+ 3 File is not a regular file, continue
+*/
+
+static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
+ const char *dir, const char *config_file,
+ const char *ext, TYPELIB *group)
{
char name[FN_REFLEN+10],buff[4096],*ptr,*end,*value,*tmp;
FILE *fp;
@@ -247,7 +254,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
{
MY_STAT stat_info;
if (!my_stat(name,&stat_info,MYF(0)))
- return 0;
+ return 2;
/*
Ignore world-writable regular files.
This is mainly done to protect us to not read a file created by
@@ -260,6 +267,8 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
name);
return 0;
}
+ else if ((stat_info.st_mode & S_IFMT) != S_IFREG)
+ return 3;
}
#endif
if (!(fp = my_fopen(fn_format(name,name,"","",4),O_RDONLY,MYF(0))))
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index d7e3eedb84e..1c056e963cb 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -148,7 +148,7 @@ else
fi
args=
-parse_arguments `$print_defaults $defaults mysqld server mysqld_safe safe_mysqld`
+parse_arguments `$print_defaults --loose-verbose $defaults mysqld server mysqld_safe safe_mysqld`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
if test ! -x $ledir/$MYSQLD
diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt
index f9f37bfd924..89af701f21a 100644
--- a/sql/share/portuguese/errmsg.txt
+++ b/sql/share/portuguese/errmsg.txt
@@ -219,23 +219,23 @@
"Não pode acrescentar uma restrição de chave estrangeira",
"Não pode acrescentar uma linha filha: uma restrição de chave estrangeira falhou",
"Não pode apagar uma linha pai: uma restrição de chave estrangeira falhou",
-"Error connecting to master: %-.128s",
-"Error running query on master: %-.128s",
-"Error when executing command %s: %-.128s",
-"Wrong usage of %s and %s",
-"The used SELECT statements have a different number of columns",
-"Can't execute the query because you have a conflicting read lock",
-"Mixing of transactional and non-transactional tables is disabled",
-"Option '%s' used twice in statement",
-"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
-"Access denied. You need the %-.128s privilege for this operation",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
-"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
-"Variable '%-.64s' doesn't have a default value",
-"Variable '%-.64s' can't be set to the value of '%-.64s'",
-"Wrong argument type to variable '%-.64s'",
-"Variable '%-.64s' can only be set, not read",
-"Wrong usage/placement of '%s'",
-"This version of MySQL doesn't yet support '%s'",
-"Got fatal error %d: '%-.128s' from master when reading data from binary log",
-"Slave SQL thread ignored the query because of replicate-*-table rules"
+"Erro conectando com o master: %-.128s",
+"Erro rodando consulta no master: %-.128s",
+"Erro quando executando comando %s: %-.128s",
+"Uso errado de %s e %s",
+"Os comandos SELECT usados têm diferente número de colunas",
+"Não posso executar a consulta porque você tem um conflito de travamento de leitura",
+"Mistura de tabelas transacional e não-transacional está desabilitada",
+"Opção '%s' usada duas vezes no comando",
+"Usuário '%-.64s' tem excedido o '%s' recurso (atual valor: %ld)",
+"Acesso negado. Você precisa o privilégio %-.128s para essa operação",
+"Variável '%-.64s' é uma LOCAL variável e não pode ser usada com SET GLOBAL",
+"Variável '%-.64s' é uma GLOBAL variável e deve ser configurada com SET GLOBAL",
+"Variável '%-.64s' não tem um valor padrão",
+"Variável '%-.64s' não pode ser configurada para o valor de '%-.64s'",
+"Tipo errado de argumento para variável '%-.64s'",
+"Variável '%-.64s' somente pode ser configurada, não lida",
+"Errado uso/colocação de '%s'",
+"Esta versão de MySQL não suporta ainda '%s'",
+"Obteve fatal erro %d: '%-.128s' do master quando lendo dados do binary log",
+"Slave SQL thread ignorado a consulta devido às normas de replicação-*-tabela"
diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt
index 78b7e5ac907..acb0b9fd2ab 100644
--- a/sql/share/spanish/errmsg.txt
+++ b/sql/share/spanish/errmsg.txt
@@ -223,20 +223,20 @@
"Error de coneccion a master: %-128s",
"Error executando el query en master: %-128%",
"Error de %s: %-128%",
-"Wrong usage of %s and %s",
-"The used SELECT statements have a different number of columns",
-"Can't execute the query because you have a conflicting read lock",
-"Mixing of transactional and non-transactional tables is disabled",
-"Option '%s' used twice in statement",
-"User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
-"Access denied. You need the %-.128s privilege for this operation",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
-"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
-"Variable '%-.64s' doesn't have a default value",
-"Variable '%-.64s' can't be set to the value of '%-.64s'",
-"Wrong argument type to variable '%-.64s'",
-"Variable '%-.64s' can only be set, not read",
-"Wrong usage/placement of '%s'",
-"This version of MySQL doesn't yet support '%s'",
-"Got fatal error %d: '%-.128s' from master when reading data from binary log",
-"Slave SQL thread ignored the query because of replicate-*-table rules"
+"Equivocado uso de %s y %s",
+"El comando SELECT usado tiene diferente número de columnas",
+"No puedo ejecutar el query porque usted tiene conflicto de traba de lectura",
+"Mezla de transancional y no-transancional tablas está deshabilitada",
+"Opción '%s' usada dos veces en el comando",
+"Usuario '%-.64s' ha excedido el recurso '%s' (actual valor: %ld)",
+"Acceso negado. Usted necesita el privilegio %-.128s para esta operación",
+"Variable '%-.64s' es una LOCAL variable y no puede ser usada con SET GLOBAL",
+"Variable '%-.64s' es una GLOBAL variable y no puede ser configurada con SET GLOBAL",
+"Variable '%-.64s' no tiene un valor patrón",
+"Variable '%-.64s' no puede ser configurada para el valor de '%-.64s'",
+"Tipo de argumento equivocado para variable '%-.64s'",
+"Variable '%-.64s' solamente puede ser configurada, no leída",
+"Equivocado uso/colocación de '%s'",
+"Esta versión de MySQL no soporta todavia '%s'",
+"Recibió fatal error %d: '%-.128s' del master cuando leyendo datos del binary log",
+"Slave SQL thread ignorado el query debido a las reglas de replicación-*-tabla"
diff --git a/vio/Makefile.am b/vio/Makefile.am
index ab8fac51ee7..56ab21e8922 100644
--- a/vio/Makefile.am
+++ b/vio/Makefile.am
@@ -18,7 +18,7 @@ INCLUDES= -I$(srcdir)/../include -I../include $(openssl_includes)
LDADD= @CLIENT_EXTRA_LDFLAGS@ $(openssl_libs)
pkglib_LIBRARIES= libvio.a
noinst_PROGRAMS = test-ssl test-sslserver test-sslclient
-noinst_HEADERS=
+noinst_HEADERS= vio_priv.h
test_ssl_SOURCES= test-ssl.c
test_ssl_LDADD= @CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a \
../mysys/libmysys.a ../strings/libmystrings.a \