Commit a6ce7b89 authored by msvensson@neptunus.(none)'s avatar msvensson@neptunus.(none)

Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint

into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
parents 1bd6e4f6 d4d675a6
......@@ -87,7 +87,8 @@ mysqltest_SOURCES= mysqltest.c \
$(top_srcdir)/mysys/my_copy.c
mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD)
mysql_upgrade_SOURCES= mysql_upgrade.c
mysql_upgrade_SOURCES= mysql_upgrade.c \
$(top_srcdir)/mysys/my_getpagesize.c
# Fix for mit-threads
DEFS = -DUNDEF_THREADS_HACK \
......
......@@ -375,22 +375,24 @@ static int comp_names(struct fileinfo *a, struct fileinfo *b)
}
static int
find_file(const char *name, const char *root, uint flags, char *result, size_t len, ...)
static int find_file(const char *name, const char *root,
uint flags, char *result, size_t len, ...)
{
int ret;
int ret= 1;
va_list va;
FILEINFO key= { (char*)name, NULL };
const char *subdir;
char *cp;
FILEINFO key;
/* Init key with name of the file to look for */
key.name= (char*)name;
DBUG_ASSERT(root != NULL);
cp= strmake(result, root, len);
if (cp[-1] != FN_LIBCHAR)
*cp++= FN_LIBCHAR;
ret= 1;
va_start(va, len);
subdir= (!(flags & MY_SEARCH_SELF)) ? va_arg(va, char *) : "";
while (subdir)
......@@ -597,7 +599,7 @@ fix_priv_tables:
if (find_file(MYSQL_FIX_PRIV_TABLES_NAME, basedir, MYF(0),
path, sizeof(path),
"support_files", "share/mysql", "scripts",
"support_files", "share", "share/mysql", "scripts",
NullS)
&& find_file(MYSQL_FIX_PRIV_TABLES_NAME, "/usr/local/mysql", MYF(0),
path, sizeof(path),
......
......@@ -856,12 +856,6 @@ extern int my_getncpus();
#else
#define my_mmap(a,b,c,d,e,f) mmap(a,b,c,d,e,f)
#endif
#ifdef HAVE_GETPAGESIZE
#define my_getpagesize() getpagesize()
#else
/* qnx ? */
#define my_getpagesize() 8192
#endif
#define my_munmap(a,b) munmap((a),(b))
#else
......@@ -879,11 +873,17 @@ extern int my_getncpus();
#define HAVE_MMAP
#endif
int my_getpagesize(void);
void *my_mmap(void *, size_t, int, int, int, my_off_t);
int my_munmap(void *, size_t);
#endif
/* my_getpagesize */
#ifdef HAVE_GETPAGESIZE
#define my_getpagesize() getpagesize()
#else
int my_getpagesize(void);
#endif
int my_msync(int, void *, size_t, int);
/* character sets */
......
......@@ -223,9 +223,8 @@ our $opt_ndbcluster_port_slave;
our $opt_ndbconnectstring_slave;
our $opt_record;
our $opt_report_features;
my $opt_report_features;
our $opt_check_testcases;
my $opt_report_features;
our $opt_skip;
our $opt_skip_rpl;
......@@ -241,8 +240,6 @@ our $opt_suite_timeout;
my $default_testcase_timeout= 15; # 15 min max
my $default_suite_timeout= 180; # 3 hours max
our $opt_source_dist;
our $opt_start_and_exit;
our $opt_start_dirty;
our $opt_start_from;
......@@ -302,6 +299,8 @@ our $glob_tot_real_time= 0;
our %mysqld_variables;
my $source_dist= 0;
######################################################################
#
......@@ -635,7 +634,7 @@ sub command_line_setup () {
if ( -d "../sql" )
{
$opt_source_dist= 1;
$source_dist= 1;
}
$glob_hostname= mtr_short_hostname();
......@@ -659,7 +658,7 @@ sub command_line_setup () {
# directory. And we install "/usr/share/mysql-test". Moving up one
# more directory relative to "mysql-test" gives us a usable base
# directory for RPM installs.
if ( ! $opt_source_dist and ! -d "$glob_basedir/bin" )
if ( ! $source_dist and ! -d "$glob_basedir/bin" )
{
$glob_basedir= dirname($glob_basedir);
}
......@@ -671,7 +670,7 @@ sub command_line_setup () {
unless -d $glob_mysql_bench_dir;
$path_my_basedir=
$opt_source_dist ? $glob_mysql_test_dir : $glob_basedir;
$source_dist ? $glob_mysql_test_dir : $glob_basedir;
$glob_timers= mtr_init_timers();
......@@ -934,7 +933,7 @@ sub command_line_setup () {
# --------------------------------------------------------------------------
# Gcov flag
# --------------------------------------------------------------------------
if ( $opt_gcov and ! $opt_source_dist )
if ( $opt_gcov and ! $source_dist )
{
mtr_error("Coverage test needs the source - please use source dist");
}
......@@ -1444,7 +1443,7 @@ sub executable_setup () {
# Look for mysql_fix_privilege_tables.sql script
$file_mysql_fix_privilege_tables=
mtr_file_exists("$glob_basedir/scripts/mysql_fix_privilege_tables.sql",
"$path_share/mysql_fix_privilege_tables.sql");
"$glob_basedir/share/mysql_fix_privilege_tables.sql");
if ( ! $opt_skip_ndbcluster and executable_setup_ndb())
{
......@@ -1599,7 +1598,7 @@ sub environment_setup () {
# Setup LD_LIBRARY_PATH so the libraries from this distro/clone
# are used in favor of the system installed ones
# --------------------------------------------------------------------------
if ( $opt_source_dist )
if ( $source_dist )
{
push(@ld_library_paths, "$glob_basedir/libmysql/.libs/",
"$glob_basedir/libmysql_r/.libs/");
......
......@@ -25,7 +25,7 @@ noinst_HEADERS = mysys_priv.h my_static.h
libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
mf_path.c mf_loadpath.c my_file.c \
my_open.c my_create.c my_dup.c my_seek.c my_read.c \
my_pread.c my_write.c \
my_pread.c my_write.c my_getpagesize.c \
mf_keycache.c mf_keycaches.c my_crc32.c \
mf_iocache.c mf_iocache2.c mf_cache.c mf_tempfile.c \
mf_tempdir.c my_lock.c mf_brkhant.c my_alarm.c \
......
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysys_priv.h"
#ifndef HAVE_GETPAGESIZE
#if defined __WIN__
int my_getpagesize(void)
{
SYSTEM_INFO si;
GetSystemInfo(&si);
return si.dwPageSize;
}
#else
/* Default implementation */
int my_getpagesize(void)
{
return (int)8192;
}
#endif
#endif
......@@ -33,13 +33,6 @@ int my_msync(int fd, void *addr, size_t len, int flags)
static SECURITY_ATTRIBUTES mmap_security_attributes=
{sizeof(SECURITY_ATTRIBUTES), 0, TRUE};
int my_getpagesize(void)
{
SYSTEM_INFO si;
GetSystemInfo(&si);
return si.dwPageSize;
}
void *my_mmap(void *addr, size_t len, int prot,
int flags, int fd, my_off_t offset)
{
......
......@@ -1087,12 +1087,13 @@ my_bool is_const_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
strmov(message, "IS_CONST accepts only one argument");
return 1;
}
initid->ptr= (args->args[0] != NULL) ? 1 : 0;
initid->ptr= (char*)((args->args[0] != NULL) ? 1 : 0);
return 0;
}
char * is_const(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long
*length, char *is_null, char *error)
char * is_const(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
char *result, unsigned long *length,
char *is_null, char *error __attribute__((unused)))
{
if (initid->ptr != 0) {
sprintf(result, "const");
......
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