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

Merge

parents af3c968b be5e4e72
...@@ -4,8 +4,8 @@ use Getopt::Long; ...@@ -4,8 +4,8 @@ use Getopt::Long;
$opt_distribution=$opt_user=$opt_result=$opt_config_options=$opt_config_env=""; $opt_distribution=$opt_user=$opt_result=$opt_config_options=$opt_config_env="";
$opt_dbd_options=$opt_perl_options=""; $opt_dbd_options=$opt_perl_options="";
$opt_tmp=""; $opt_tmp="";
$opt_help=$opt_Information=$opt_no_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=0; $opt_help=$opt_Information=$opt_no_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=0;
GetOptions("Information","help","distribution=s","user=s","result=s","no-delete","no-test","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s") || usage(); GetOptions("Information","help","distribution=s","user=s","result=s","no-delete","no-test","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip") || usage();
usage() if ($opt_help || $opt_Information); usage() if ($opt_help || $opt_Information);
usage() if (!$opt_distribution); usage() if (!$opt_distribution);
...@@ -20,6 +20,7 @@ $log="$pwd/Logs/$host.log"; ...@@ -20,6 +20,7 @@ $log="$pwd/Logs/$host.log";
$opt_distribution =~ /(mysql-[^\/]*)\.tar/; $opt_distribution =~ /(mysql-[^\/]*)\.tar/;
$ver=$1; $ver=$1;
$gcc_version=which("gcc"); $gcc_version=which("gcc");
$connect_option= ($opt_tcpip ? "--host=$host" : "");
if (defined($gcc_version) && ! $opt_config_env) if (defined($gcc_version) && ! $opt_config_env)
{ {
$tmp=`$gcc_version -v 2>&1`; $tmp=`$gcc_version -v 2>&1`;
...@@ -186,7 +187,7 @@ if ($opt_stage <= 7 && !$opt_no_test) ...@@ -186,7 +187,7 @@ if ($opt_stage <= 7 && !$opt_no_test)
{ {
safe_cd("$test_dir/sql-bench"); safe_cd("$test_dir/sql-bench");
log_system("rm -f limits/mysql.cfg"); log_system("rm -f limits/mysql.cfg");
safe_system("perl ./crash-me --force --batch-mode"); safe_system("perl ./crash-me --force --batch-mode $connect_option");
} }
if ($opt_stage <= 8 && !$opt_no_test) if ($opt_stage <= 8 && !$opt_no_test)
...@@ -194,7 +195,7 @@ if ($opt_stage <= 8 && !$opt_no_test) ...@@ -194,7 +195,7 @@ if ($opt_stage <= 8 && !$opt_no_test)
safe_cd("$test_dir/sql-bench"); safe_cd("$test_dir/sql-bench");
log_system("rm -f output/*"); log_system("rm -f output/*");
$tmp= $opt_fast_benchmark ? "--fast --user root --small-test" : ""; $tmp= $opt_fast_benchmark ? "--fast --user root --small-test" : "";
check_system("perl ./run-all-tests --log --die-on-errors $tmp","RUN-mysql"); check_system("perl ./run-all-tests --log --die-on-errors $connect_option $tmp","RUN-mysql");
} }
if ($opt_stage <= 9 && $opt_result) if ($opt_stage <= 9 && $opt_result)
......
This diff is collapsed.
...@@ -300,7 +300,7 @@ int main(int argc,char *argv[]) ...@@ -300,7 +300,7 @@ int main(int argc,char *argv[])
} }
} }
#endif #endif
sprintf(buff, "Type 'help;' or '\\h' for help.\n"); sprintf(buff, "Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer\n");
put_info(buff,INFO_INFO); put_info(buff,INFO_INFO);
status.exit_status=read_lines(1); // read lines and execute them status.exit_status=read_lines(1); // read lines and execute them
mysql_end(0); mysql_end(0);
...@@ -1680,8 +1680,9 @@ static int com_source(String *buffer, char *line) ...@@ -1680,8 +1680,9 @@ static int com_source(String *buffer, char *line)
while (end > source_name && (isspace(end[-1]) || iscntrl(end[-1]))) while (end > source_name && (isspace(end[-1]) || iscntrl(end[-1])))
end--; end--;
end[0]=0; end[0]=0;
unpack_filename(source_name,source_name);
/* open file name */ /* open file name */
if (!(sql_file = my_fopen(source_name, O_RDONLY,MYF(0)))) if (!(sql_file = my_fopen(source_name, O_RDONLY | O_BINARY,MYF(0))))
{ {
char buff[FN_REFLEN+60]; char buff[FN_REFLEN+60];
sprintf(buff,"Failed to open file '%s', error: %d", source_name,errno); sprintf(buff,"Failed to open file '%s', error: %d", source_name,errno);
......
...@@ -604,6 +604,28 @@ static uint getTableStructure(char *table, char* db) ...@@ -604,6 +604,28 @@ static uint getTableStructure(char *table, char* db)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
/* Make an sql-file, if path was given iow. option -T was given */
if (!tFlag)
{
if (path)
{
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
strmov(tmp_path,path);
convert_dirname(tmp_path);
sql_file= my_fopen(fn_format(filename, table, tmp_path, ".sql", 4),
O_WRONLY, MYF(MY_WME));
if (!sql_file) /* If file couldn't be opened */
{
safe_exit(EX_MYSQLERR);
DBUG_RETURN(0);
}
write_heder(sql_file, db);
}
fprintf(sql_file, "\n#\n# Table structure for table '%s'\n#\n\n", table);
if (opt_drop)
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name);
fprintf(sql_file, "CREATE TABLE %s (\n", table_name);
}
if (cFlag) if (cFlag)
sprintf(insert_pat, "INSERT %sINTO %s (", delayed, table_name); sprintf(insert_pat, "INSERT %sINTO %s (", delayed, table_name);
else else
...@@ -619,18 +641,32 @@ static uint getTableStructure(char *table, char* db) ...@@ -619,18 +641,32 @@ static uint getTableStructure(char *table, char* db)
ulong *lengths=mysql_fetch_lengths(tableRes); ulong *lengths=mysql_fetch_lengths(tableRes);
if (init) if (init)
{ {
if (!tFlag)
fputs(",\n",sql_file);
if (cFlag) if (cFlag)
strpos=strmov(strpos,", "); strpos=strmov(strpos,", ");
} }
init=1; init=1;
if (cFlag) if (cFlag)
strpos=strmov(strpos,quote_name(row[SHOW_FIELDNAME],name_buff)); strpos=strmov(strpos,quote_name(row[SHOW_FIELDNAME],name_buff));
} if (!tFlag)
if (cFlag) {
{ if (opt_keywords)
strpos=strmov(strpos,") VALUES "); fprintf(sql_file, " %s.%s %s", table_name,
if (!extended_insert) quote_name(row[SHOW_FIELDNAME],name_buff), row[SHOW_TYPE]);
strpos=strmov(strpos,"("); else
fprintf(sql_file, " %s %s", quote_name(row[SHOW_FIELDNAME],name_buff),
row[SHOW_TYPE]);
if (row[SHOW_DEFAULT])
{
fputs(" DEFAULT ", sql_file);
unescape(sql_file,row[SHOW_DEFAULT],lengths[SHOW_DEFAULT]);
}
if (!row[SHOW_NULL][0])
fputs(" NOT NULL", sql_file);
if (row[SHOW_EXTRA][0])
fprintf(sql_file, " %s",row[SHOW_EXTRA]);
}
} }
numFields = (uint) mysql_num_rows(tableRes); numFields = (uint) mysql_num_rows(tableRes);
mysql_free_result(tableRes); mysql_free_result(tableRes);
...@@ -638,37 +674,102 @@ static uint getTableStructure(char *table, char* db) ...@@ -638,37 +674,102 @@ static uint getTableStructure(char *table, char* db)
{ {
/* Make an sql-file, if path was given iow. option -T was given */ /* Make an sql-file, if path was given iow. option -T was given */
char buff[20+FN_REFLEN]; char buff[20+FN_REFLEN];
uint keynr,primary_key;
sprintf(buff,"show create table %s",table_name); sprintf(buff,"show keys from %s",table_name);
if (mysql_query(sock, buff)) if (mysql_query(sock, buff))
{ {
fprintf(stderr, "%s: Can't get CREATE TABLE for table '%s' (%s)\n", fprintf(stderr, "%s: Can't get keys for table '%s' (%s)\n",
my_progname, table, mysql_error(sock)); my_progname, table, mysql_error(sock));
if (sql_file != stdout)
my_fclose(sql_file, MYF(MY_WME));
safe_exit(EX_MYSQLERR); safe_exit(EX_MYSQLERR);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
if (path) tableRes=mysql_store_result(sock);
/* Find first which key is primary key */
keynr=0;
primary_key=INT_MAX;
while ((row=mysql_fetch_row(tableRes)))
{ {
char filename[FN_REFLEN], tmp_path[FN_REFLEN]; if (atoi(row[3]) == 1)
strmov(tmp_path,path);
convert_dirname(tmp_path);
sql_file= my_fopen(fn_format(filename, table, tmp_path, ".sql", 4),
O_WRONLY, MYF(MY_WME));
if (!sql_file) /* If file couldn't be opened */
{ {
safe_exit(EX_MYSQLERR); keynr++;
DBUG_RETURN(0); #ifdef FORCE_PRIMARY_KEY
if (atoi(row[1]) == 0 && primary_key == INT_MAX)
primary_key=keynr;
#endif
if (!strcmp(row[2],"PRIMARY"))
{
primary_key=keynr;
break;
}
} }
write_heder(sql_file, db);
} }
fprintf(sql_file, "\n#\n# Table structure for table '%s'\n#\n\n", table); mysql_data_seek(tableRes,0);
if (opt_drop) keynr=0;
fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name); while ((row=mysql_fetch_row(tableRes)))
{
if (atoi(row[3]) == 1)
{
if (keynr++)
putc(')', sql_file);
if (atoi(row[1])) /* Test if duplicate key */
/* Duplicate allowed */
fprintf(sql_file, ",\n KEY %s (",quote_name(row[2],name_buff));
else if (keynr == primary_key)
fputs(",\n PRIMARY KEY (",sql_file); /* First UNIQUE is primary */
else
fprintf(sql_file, ",\n UNIQUE %s (",quote_name(row[2],name_buff));
}
else
putc(',', sql_file);
fputs(quote_name(row[4],name_buff), sql_file);
if (row[7])
fprintf(sql_file, "(%s)",row[7]); /* Sub key */
}
if (keynr)
putc(')', sql_file);
fputs("\n)",sql_file);
tableRes=mysql_store_result(sock); /* Get MySQL specific create options */
row=mysql_fetch_row(tableRes); if (create_options)
fprintf(sql_file, "%s;\n", row[1]); {
sprintf(buff,"show table status like '%s'",table);
if (mysql_query(sock, buff))
{
if (mysql_errno(sock) != ER_PARSE_ERROR)
{ /* If old MySQL version */
if (verbose)
fprintf(stderr,
"# Warning: Couldn't get status information for table '%s' (%s)\n",
table,mysql_error(sock));
}
}
else if (!(tableRes=mysql_store_result(sock)) ||
!(row=mysql_fetch_row(tableRes)))
{
fprintf(stderr,
"Error: Couldn't read status information for table '%s' (%s)\n",
table,mysql_error(sock));
}
else
{
fputs("/*!",sql_file);
print_value(sql_file,tableRes,row,"type=","Type",0);
print_value(sql_file,tableRes,row,"","Create_options",0);
print_value(sql_file,tableRes,row,"comment=","Comment",1);
fputs(" */",sql_file);
}
mysql_free_result(tableRes); /* Is always safe to free */
}
fputs(";\n", sql_file);
}
if (cFlag)
{
strpos=strmov(strpos,") VALUES ");
if (!extended_insert)
strpos=strmov(strpos,"(");
} }
DBUG_RETURN(numFields); DBUG_RETURN(numFields);
} /* getTableStructure */ } /* getTableStructure */
...@@ -841,7 +942,7 @@ static void dumpTable(uint numFields, char *table) ...@@ -841,7 +942,7 @@ static void dumpTable(uint numFields, char *table)
{ {
if (length) if (length)
{ {
if (!IS_NUM(field->type)) if (!IS_NUM_FIELD(field))
{ {
if (dynstr_realloc(&extended_row,length * 2+2)) if (dynstr_realloc(&extended_row,length * 2+2))
{ {
...@@ -873,7 +974,7 @@ static void dumpTable(uint numFields, char *table) ...@@ -873,7 +974,7 @@ static void dumpTable(uint numFields, char *table)
putchar(','); putchar(',');
if (row[i]) if (row[i])
{ {
if (!IS_NUM(field->type)) if (!IS_NUM_FIELD(field))
unescape(stdout, row[i], lengths[i]); unescape(stdout, row[i], lengths[i]);
else else
fputs(row[i],stdout); fputs(row[i],stdout);
......
...@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. ...@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(sql/mysqld.cc) AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line! # The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE(mysql, 3.23.23-beta) AM_INIT_AUTOMAKE(mysql, 3.23.24-beta)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10 PROTOCOL_VERSION=10
...@@ -685,8 +685,8 @@ case $SYSTEM_TYPE in ...@@ -685,8 +685,8 @@ case $SYSTEM_TYPE in
;; ;;
*aix4.3*) *aix4.3*)
echo "Adding defines for AIX" echo "Adding defines for AIX"
CFLAGS="$CFLAGS -DUNDEF_HAVE_INITGROUPS" CFLAGS="$CFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS"
CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_INITGROUPS" CXXFLAGS="$CXXFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS"
;; ;;
esac esac
...@@ -789,6 +789,7 @@ then ...@@ -789,6 +789,7 @@ then
# #
elif test "$with_named_thread" = "no" elif test "$with_named_thread" = "no"
then then
AC_MSG_RESULT("no")
AC_MSG_CHECKING("SCO UnixWare 7.1 native threads") AC_MSG_CHECKING("SCO UnixWare 7.1 native threads")
if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null
then then
...@@ -807,6 +808,7 @@ then ...@@ -807,6 +808,7 @@ then
else else
AC_DEFINE(HAVE_UNIXWARE7_POSIX) AC_DEFINE(HAVE_UNIXWARE7_POSIX)
fi fi
AC_MSG_RESULT("yes")
# We must have cc # We must have cc
AC_MSG_CHECKING("for gcc") AC_MSG_CHECKING("for gcc")
if expr "$CC" : ".*gcc.*" if expr "$CC" : ".*gcc.*"
...@@ -817,7 +819,6 @@ then ...@@ -817,7 +819,6 @@ then
CC="$CC -Kthread -DUNIXWARE_7"; CC="$CC -Kthread -DUNIXWARE_7";
CXX="$CXX -Kthread -DUNIXWARE_7"; CXX="$CXX -Kthread -DUNIXWARE_7";
fi fi
AC_MSG_RESULT("yes")
else else
{ echo "configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual." 1>&2; exit 1; }; { echo "configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual." 1>&2; exit 1; };
fi fi
......
...@@ -66,6 +66,7 @@ extern void _db_unlock_file(); ...@@ -66,6 +66,7 @@ extern void _db_unlock_file();
#define DEBUGGER_ON _no_db_=0 #define DEBUGGER_ON _no_db_=0
#define DBUG_LOCK_FILE { _db_lock_file(); } #define DBUG_LOCK_FILE { _db_lock_file(); }
#define DBUG_UNLOCK_FILE { _db_unlock_file(); } #define DBUG_UNLOCK_FILE { _db_unlock_file(); }
#define DBUG_ASSERT(A) A
#else /* No debugger */ #else /* No debugger */
#define DBUG_ENTER(a1) #define DBUG_ENTER(a1)
...@@ -85,6 +86,7 @@ extern void _db_unlock_file(); ...@@ -85,6 +86,7 @@ extern void _db_unlock_file();
#define DEBUGGER_ON #define DEBUGGER_ON
#define DBUG_LOCK_FILE #define DBUG_LOCK_FILE
#define DBUG_UNLOCK_FILE #define DBUG_UNLOCK_FILE
#define DBUG_ASSERT(A) {}
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -490,6 +490,11 @@ extern int pthread_dummy(int); ...@@ -490,6 +490,11 @@ extern int pthread_dummy(int);
/* All thread specific variables are in the following struct */ /* All thread specific variables are in the following struct */
#define THREAD_NAME_SIZE 10 #define THREAD_NAME_SIZE 10
#if defined(__ia64__)
#define DEFAULT_THREAD_STACK (128*1024)
#else
#define DEFAULT_THREAD_STACK (64*1024)
#endif
struct st_my_thread_var struct st_my_thread_var
{ {
......
...@@ -313,9 +313,13 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *); ...@@ -313,9 +313,13 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
((info)->rc_pos - (info)->rc_request_pos)) ((info)->rc_pos - (info)->rc_request_pos))
typedef struct st_changeable_var { typedef struct st_changeable_var {
const char *name; const char *name; /* Name of variable */
long *varptr; long *varptr; /* Pointer to variable */
long def_value,min_value,max_value,sub_size,block_size; long def_value, /* Default value */
min_value, /* Min allowed value */
max_value, /* Max allowed value */
sub_size, /* Subtract this from given value */
block_size; /* Value should be a mult. of this */
} CHANGEABLE_VAR; } CHANGEABLE_VAR;
...@@ -527,6 +531,7 @@ extern void my_free_lock(byte *ptr,myf flags); ...@@ -527,6 +531,7 @@ extern void my_free_lock(byte *ptr,myf flags);
#define my_malloc_lock(A,B) my_malloc((A),(B)) #define my_malloc_lock(A,B) my_malloc((A),(B))
#define my_free_lock(A,B) my_free((A),(B)) #define my_free_lock(A,B) my_free((A),(B))
#endif #endif
#define alloc_root_inited(A) ((A)->min_malloc != 0)
void init_alloc_root(MEM_ROOT *mem_root,uint block_size); void init_alloc_root(MEM_ROOT *mem_root,uint block_size);
gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size); gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size);
void free_root(MEM_ROOT *root); void free_root(MEM_ROOT *root);
......
...@@ -73,6 +73,8 @@ extern char *mysql_unix_port; ...@@ -73,6 +73,8 @@ extern char *mysql_unix_port;
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) #define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG) #define IS_BLOB(n) ((n) & BLOB_FLAG)
#define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR) #define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR)
#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG)
#define INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && (f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8) || (f)->type == FIELD_TYPE_YEAR)
typedef struct st_mysql_field { typedef struct st_mysql_field {
char *name; /* Name of column */ char *name; /* Name of column */
......
...@@ -61,6 +61,7 @@ enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY, ...@@ -61,6 +61,7 @@ enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */ #define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */
#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */ #define TIMESTAMP_FLAG 1024 /* Field is a timestamp */
#define SET_FLAG 2048 /* field is a set */ #define SET_FLAG 2048 /* field is a set */
#define NUM_FLAG 32768 /* Field is num (for clients) */
#define PART_KEY_FLAG 16384 /* Intern; Part of some key */ #define PART_KEY_FLAG 16384 /* Intern; Part of some key */
#define GROUP_FLAG 32768 /* Intern: Group field */ #define GROUP_FLAG 32768 /* Intern: Group field */
#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */ #define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */
......
...@@ -852,6 +852,8 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, ...@@ -852,6 +852,8 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
field->flags= (uint) (uchar) row->data[4][0]; field->flags= (uint) (uchar) row->data[4][0];
field->decimals=(uint) (uchar) row->data[4][1]; field->decimals=(uint) (uchar) row->data[4][1];
} }
if (INTERNAL_NUM_FIELD(field))
field->flags|= NUM_FLAG;
if (default_value && row->data[5]) if (default_value && row->data[5])
field->def=strdup_root(alloc,(char*) row->data[5]); field->def=strdup_root(alloc,(char*) row->data[5]);
else else
......
...@@ -283,7 +283,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, ...@@ -283,7 +283,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
uint length; uint length;
get_key_length(length,key); get_key_length(length,key);
#ifdef CHECK_KEYS #ifdef CHECK_KEYS
if (length >= keyseg->length || key+length > key_end) if (length > keyseg->length || key+length > key_end)
goto err; goto err;
#endif #endif
memcpy(record+keyseg->start,(byte*) key, length); memcpy(record+keyseg->start,(byte*) key, length);
...@@ -294,7 +294,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, ...@@ -294,7 +294,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
uint length; uint length;
get_key_length(length,key); get_key_length(length,key);
#ifdef CHECK_KEYS #ifdef CHECK_KEYS
if (length >= keyseg->length || key+length > key_end) if (length > keyseg->length || key+length > key_end)
goto err; goto err;
#endif #endif
memcpy(record+keyseg->start+keyseg->bit_start, memcpy(record+keyseg->start+keyseg->bit_start,
......
No preview for this file type
...@@ -380,7 +380,7 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags) ...@@ -380,7 +380,7 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags)
(void) init_available_charsets(MYF(0)); /* If it isn't initialized */ (void) init_available_charsets(MYF(0)); /* If it isn't initialized */
cs=get_internal_charset(cs_number); cs=get_internal_charset(cs_number);
if (!cs && flags & MY_WME) if (!cs && (flags & MY_WME))
{ {
char index_file[FN_REFLEN], cs_string[23]; char index_file[FN_REFLEN], cs_string[23];
strmov(get_charsets_dir(index_file), "Index"); strmov(get_charsets_dir(index_file), "Index");
......
...@@ -42,6 +42,17 @@ ...@@ -42,6 +42,17 @@
#define CHANGED_BLOCKS_MASK (CHANGED_BLOCKS_HASH-1) #define CHANGED_BLOCKS_MASK (CHANGED_BLOCKS_HASH-1)
#define FLUSH_CACHE 2000 /* Sort this many blocks at once */ #define FLUSH_CACHE 2000 /* Sort this many blocks at once */
typedef struct sec_link {
struct sec_link *next_hash,**prev_hash;/* Blocks linked acc. to hash-value */
struct sec_link *next_used,*prev_used;
struct sec_link *next_changed,**prev_changed;
File file;
my_off_t diskpos;
byte *buffer;
my_bool changed;
} SEC_LINK;
static uint find_next_bigger_power(uint value); static uint find_next_bigger_power(uint value);
static SEC_LINK *find_key_block(int file,my_off_t filepos,int *error); static SEC_LINK *find_key_block(int file,my_off_t filepos,int *error);
...@@ -287,7 +298,6 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length, ...@@ -287,7 +298,6 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length,
} while ((length-= read_length)); } while ((length-= read_length));
pthread_mutex_unlock(&THR_LOCK_keycache); pthread_mutex_unlock(&THR_LOCK_keycache);
return(start); return(start);
pthread_mutex_unlock(&THR_LOCK_keycache);
} }
_my_cache_r_requests++; _my_cache_r_requests++;
_my_cache_read++; _my_cache_read++;
...@@ -457,6 +467,7 @@ static SEC_LINK *find_key_block(int file, my_off_t filepos, int *error) ...@@ -457,6 +467,7 @@ static SEC_LINK *find_key_block(int file, my_off_t filepos, int *error)
static void free_block(SEC_LINK *used) static void free_block(SEC_LINK *used)
{ {
used->file= -1; used->file= -1;
used->changed=0;
if (used != _my_used_first) /* Relink used-chain */ if (used != _my_used_first) /* Relink used-chain */
{ {
if (used == _my_used_last) if (used == _my_used_last)
...@@ -568,7 +579,6 @@ int flush_key_blocks(File file, enum flush_type type) ...@@ -568,7 +579,6 @@ int flush_key_blocks(File file, enum flush_type type)
if (type != FLUSH_KEEP && type != FLUSH_FORCE_WRITE) if (type != FLUSH_KEEP && type != FLUSH_FORCE_WRITE)
{ {
/* This will not destroy position or data */ /* This will not destroy position or data */
used->changed=0;
_my_blocks_changed--; _my_blocks_changed--;
free_block(used); free_block(used);
} }
......
...@@ -33,16 +33,6 @@ struct st_remember { ...@@ -33,16 +33,6 @@ struct st_remember {
sig_handler (*func)(int number); sig_handler (*func)(int number);
}; };
typedef struct sec_link {
struct sec_link *next_hash,**prev_hash;/* Blocks linked acc. to hash-value */
struct sec_link *next_used,*prev_used;
struct sec_link *next_changed,**prev_changed;
File file;
my_off_t diskpos;
byte *buffer;
my_bool changed;
} SEC_LINK;
struct irem { struct irem {
struct remember *_pNext; /* Linked list of structures */ struct remember *_pNext; /* Linked list of structures */
struct remember *_pPrev; /* Other link */ struct remember *_pPrev; /* Other link */
......
...@@ -71,6 +71,7 @@ SUFFIXES = .sh ...@@ -71,6 +71,7 @@ SUFFIXES = .sh
@RM@ -f $@ $@-t @RM@ -f $@ $@-t
@SED@ \ @SED@ \
-e 's!@''bindir''@!$(bindir)!g' \ -e 's!@''bindir''@!$(bindir)!g' \
-e 's!@''sbindir''@!$(sbindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \ -e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \ -e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''datadir''@!$(datadir)!g' \ -e 's!@''datadir''@!$(datadir)!g' \
......
...@@ -11,56 +11,82 @@ ...@@ -11,56 +11,82 @@
ldata=@localstatedir@ ldata=@localstatedir@
execdir=@libexecdir@ execdir=@libexecdir@
bindir=@bindir@ bindir=@bindir@
sbindir=@sbindir@
force=0 force=0
IN_RPM=0 IN_RPM=0
defaults= defaults=
# Are we doing an rpm install? while [ "x$1" != x ]
if test "$1" = "-IN-RPM"; then IN_RPM=1; shift; fi do
if test "$1" = "--force"; then force=1; shift; fi case "$1" in
-*) eqvalue="`echo $1 |sed 's/[-_a-zA-Z0-9]*=//'`"
# Get mysqld/safe_mysqld options from /etc/my.cnf or ~/.my.cnf case "$1" in
case "$1" in -IN-RPM) IN_RPM=1
--no-defaults) defaults="$1"; conf=/nonexistent; shift ;; ;;
--defaults-file=*) defaults="$1"; conf=`echo "$1"|sed 's;^--defaults-file=;;'`; shift ;; --force) force=1
*) ;;
if test -w / --no-defaults=*) CONFIG_FILES=/nonexistent
then ;;
conf=/etc/my.cnf --defaults-file=*) CONFIG_FILES="$eqvalue"
else ;;
conf=$HOME/.my.cnf --basedir=*) SETVARS="$SETVARS basedir=\"$eqvalue\"; bindir=\"$eqvalue/bon\"; execdir=\"$eqvalue/libexec\"; sbindir=\"$eqvalue/sbin\"; "
fi ;;
;; --ldata=*|--datadir=*) SETVARS="$SETVARS ldata=\"$eqvalue\";"
esac ;;
--user=*) SETVARS="$SETVARS user=\"$eqvalue\";"
;;
esac
;;
esac
shift
done
GetCNF () {
if test -f "$conf" VARIABLES="basedir bindir datadir sbindir user pid-file log port socket"
then # set it not already set
if grep "^datadir" $conf >/dev/null CONFIG_FILES=${CONFIG_FILES:-"/etc/my.cnf ./my.cnf $HOME/.my.cnf"}
then
ldata=`grep "^datadir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
if grep "^execdir" $conf >/dev/null
then
execdir=`grep "^execdir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
if grep "^bindir" $conf >/dev/null
then
bindir=`grep "^bindir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
if grep "^user" $conf >/dev/null
then
user=`grep "^user" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
fi
for arg for c in $CONFIG_FILES
do do
case "$arg" in if [ -f $c ]
--basedir=*) basedir=`echo "$arg"|sed 's;^--basedir=;;'`; bindir="$basedir/bin"; execdir="$basedir/libexec" ;; then
--datadir=*) ldata=`echo "$arg"|sed 's;^--datadir=;;'` ;; #echo "Processing $c..."
--user=*) user=`echo "$arg"|sed 's;^--user=;;'` ;; for v in $VARIABLES
esac do
# This method assumes last of duplicate $variable entries will be the
# value set ([mysqld])
# This could easily be rewritten to gather [xxxxx]-specific entries,
# but for now it looks like only the mysqld ones are needed for
# server startup scripts
eval `sed -n -e '/^$/d' -e '/^#/d' -e 's,[ ],,g' -e '/=/p' $c |\
awk -F= -v v=$v '{if ($1 == v) printf ("thevar=\"%s\"\n", $2)}'`
# it would be easier if the my.cnf and variable values were
# all matched, but since they aren't we need to map them here.
case $v in
pid-file) v=pid_file ;;
log) v=log_file ;;
datadir) v=ldata ;;
esac
# As long as $thevar isn't blank, use it to set or override current
# value
[ "$thevar" != "" ] && eval $v=$thevar
done
#else
# echo "No $c config file."
fi
done done
}
# run function to get config values
GetCNF
# Override/set with command-line values
eval $SETVARS
mdata=$ldata/mysql mdata=$ldata/mysql
...@@ -310,7 +336,7 @@ then ...@@ -310,7 +336,7 @@ then
echo echo
echo "The latest information about MySQL is available on the web at" echo "The latest information about MySQL is available on the web at"
echo "http://www.mysql.com" echo "http://www.mysql.com"
echo "Support MySQL by buying support/licenses at http://www.mysql.com/license.htmy." echo "Support MySQL by buying support/licenses at https://order.mysql.com"
echo echo
exit 0 exit 0
else else
......
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 17:36:42 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:23:52
ATIS table test ATIS table test
Creating tables Creating tables
Time for create_table (28): 1 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for create_table (28): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Inserting data Inserting data
Time to insert (9768): 5 wallclock secs ( 0.88 usr 1.38 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to insert (9768): 5 wallclock secs ( 0.69 usr 1.47 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Retrieving data Retrieving data
Time for select_simple_join (500): 3 wallclock secs ( 1.58 usr 0.66 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_simple_join (500): 4 wallclock secs ( 1.47 usr 0.69 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_join (200): 22 wallclock secs (12.86 usr 5.22 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_join (200): 22 wallclock secs (13.20 usr 5.34 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_distinct (800): 17 wallclock secs ( 4.78 usr 1.80 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_distinct (800): 17 wallclock secs ( 4.75 usr 1.70 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_group (2800): 20 wallclock secs ( 3.55 usr 1.13 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_group (2800): 19 wallclock secs ( 3.31 usr 0.98 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Removing tables Removing tables
Time to drop_table (28): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to drop_table (28): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 68 wallclock secs (23.67 usr 10.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 67 wallclock secs (23.42 usr 10.20 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
This diff is collapsed.
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 16:59:02 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 0:45:18
Testing of ALTER TABLE Testing of ALTER TABLE
Testing with 1000 columns and 1000 rows in 20 steps Testing with 1000 columns and 1000 rows in 20 steps
Insert data into the table Insert data into the table
Time for insert (1000) 0 wallclock secs ( 0.13 usr 0.13 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for insert (1000) 0 wallclock secs ( 0.13 usr 0.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_add (992): 1201 wallclock secs ( 0.53 usr 0.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for alter_table_add (992): 1228 wallclock secs ( 0.55 usr 0.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_index (8): 25 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for create_index (8): 25 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for drop_index (8): 25 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for drop_index (8): 27 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for alter_table_drop (496): 1009 wallclock secs ( 0.23 usr 0.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for alter_table_drop (496): 1033 wallclock secs ( 0.17 usr 0.08 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 2260 wallclock secs ( 0.89 usr 0.42 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 2313 wallclock secs ( 0.84 usr 0.34 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 17:37:50 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:25:00
Testing of some unusual tables Testing of some unusual tables
All tests are done 1000 times with 1000 fields All tests are done 1000 times with 1000 fields
Testing table with 1000 fields Testing table with 1000 fields
Testing select * from table with 1 record Testing select * from table with 1 record
Time to select_many_fields(1000): 20 wallclock secs ( 8.56 usr 9.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to select_many_fields(1000): 20 wallclock secs ( 8.72 usr 9.24 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select all_fields from table with 1 record Testing select all_fields from table with 1 record
Time to select_many_fields(1000): 35 wallclock secs ( 8.77 usr 9.11 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to select_many_fields(1000): 36 wallclock secs ( 8.88 usr 9.50 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert VALUES() Testing insert VALUES()
Time to insert_many_fields(1000): 3 wallclock secs ( 0.39 usr 0.30 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to insert_many_fields(1000): 3 wallclock secs ( 0.66 usr 0.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert (all_fields) VALUES() Testing insert (all_fields) VALUES()
Time to insert_many_fields(1000): 19 wallclock secs ( 0.19 usr 0.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to insert_many_fields(1000): 18 wallclock secs ( 0.16 usr 0.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 80 wallclock secs (17.91 usr 18.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 79 wallclock secs (18.42 usr 19.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 22:55:01 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:26:20
Testing the speed of connecting to the server and sending of data Testing the speed of connecting to the server and sending of data
All tests are done 10000 times All tests are done 10000 times
Testing connection/disconnect Testing connection/disconnect
Time to connect (10000): 34 wallclock secs (11.53 usr 10.31 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to connect (10000): 33 wallclock secs (11.69 usr 10.25 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test connect/simple select/disconnect Test connect/simple select/disconnect
Time for connect+select_simple (10000): 37 wallclock secs (12.56 usr 11.92 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for connect+select_simple (10000): 36 wallclock secs (12.89 usr 11.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test simple select Test simple select
Time for select_simple (10000): 4 wallclock secs ( 0.94 usr 1.67 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_simple (10000): 4 wallclock secs ( 1.03 usr 1.67 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing connect/select 1 row from table/disconnect Testing connect/select 1 row from table/disconnect
Time to connect+select_1_row (10000): 39 wallclock secs (12.75 usr 13.53 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to connect+select_1_row (10000): 39 wallclock secs (11.72 usr 12.45 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select 1 row from table Testing select 1 row from table
Time to select_1_row (10000): 5 wallclock secs ( 1.11 usr 1.91 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to select_1_row (10000): 5 wallclock secs ( 0.95 usr 2.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing select 2 rows from table Testing select 2 rows from table
Time to select_2_rows (10000): 7 wallclock secs ( 1.23 usr 1.58 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to select_2_rows (10000): 5 wallclock secs ( 1.30 usr 1.92 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test select with aritmetic (+) Test select with aritmetic (+)
Time for select_column+column (10000): 6 wallclock secs ( 1.05 usr 1.86 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_column+column (10000): 6 wallclock secs ( 1.11 usr 1.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing retrieval of big records (65000 bytes) Testing retrieval of big records (65000 bytes)
Time to select_big (10000): 54 wallclock secs (15.66 usr 8.23 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to select_big (10000): 57 wallclock secs (18.77 usr 10.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 186 wallclock secs (56.84 usr 51.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 185 wallclock secs (59.45 usr 51.06 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 17:41:14 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:29:26
Testing the speed of creating and droping tables Testing the speed of creating and droping tables
Testing with 10000 tables and 10000 loop count Testing with 10000 tables and 10000 loop count
Testing create of tables Testing create of tables
Time for create_MANY_tables (10000): 232 wallclock secs ( 2.97 usr 1.23 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for create_MANY_tables (10000): 219 wallclock secs ( 2.70 usr 1.36 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Accessing tables Accessing tables
Time to select_group_when_MANY_tables (10000): 306 wallclock secs ( 1.09 usr 1.50 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to select_group_when_MANY_tables (10000): 191 wallclock secs ( 1.67 usr 1.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing drop Testing drop
Time for drop_table_when_MANY_tables (10000): 223 wallclock secs ( 0.80 usr 1.34 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for drop_table_when_MANY_tables (10000): 153 wallclock secs ( 1.09 usr 1.41 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing create+drop Testing create+drop
Time for create+drop (10000): 123 wallclock secs ( 3.36 usr 2.61 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for create+drop (10000): 128 wallclock secs ( 3.75 usr 2.59 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for create_key+drop (10000): 156 wallclock secs ( 5.13 usr 2.78 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for create_key+drop (10000): 161 wallclock secs ( 5.14 usr 2.31 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 1040 wallclock secs (13.34 usr 9.47 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 852 wallclock secs (14.36 usr 9.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 17:58:36 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 1:43:39
Testing the speed of inserting data into 1 table and do some selects on it. Testing the speed of inserting data into 1 table and do some selects on it.
The tests are done with a table that has 100000 rows. The tests are done with a table that has 100000 rows.
Generating random keys Generating random keys
Creating tables Creating tables
Inserting 100000 rows in order Inserting 100000 rows in order
Inserting 100000 rows in reverse order Inserting 100000 rows in reverse order
Inserting 100000 rows in random order Inserting 100000 rows in random order
Time for insert (300000): 204 wallclock secs (29.41 usr 41.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for insert (300000): 206 wallclock secs (30.56 usr 39.33 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing insert of duplicates Testing insert of duplicates
Time for insert_duplicates (300000): 38 wallclock secs ( 8.48 usr 12.98 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for insert_duplicates (300000): 59 wallclock secs ( 8.80 usr 11.75 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Retrieving data from the table Retrieving data from the table
Time for select_big (10:3000000): 87 wallclock secs (62.05 usr 25.47 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_big (10:3000000): 87 wallclock secs (61.98 usr 25.58 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for order_by_key (10:3000000): 88 wallclock secs (62.23 usr 25.44 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for order_by_key (10:3000000): 88 wallclock secs (63.17 usr 24.64 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for order_by (10:3000000): 98 wallclock secs (62.59 usr 25.67 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for order_by (10:3000000): 98 wallclock secs (62.34 usr 25.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_diff_key (500:1000): 138 wallclock secs ( 0.52 usr 0.16 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_diff_key (500:1000): 124 wallclock secs ( 0.48 usr 0.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_range_prefix (5010:42084): 15 wallclock secs ( 4.33 usr 1.58 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_range_prefix (5010:42084): 14 wallclock secs ( 4.63 usr 1.80 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_range (5010:42084): 15 wallclock secs ( 4.53 usr 1.78 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_range (5010:42084): 16 wallclock secs ( 4.67 usr 1.58 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_key_prefix (200000): 198 wallclock secs (93.94 usr 37.94 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_key_prefix (200000): 200 wallclock secs (92.94 usr 38.81 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_key (200000): 201 wallclock secs (92.41 usr 38.77 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_key (200000): 201 wallclock secs (92.67 usr 41.23 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Test of compares with simple ranges Test of compares with simple ranges
Time for select_range_prefix (20000:43500): 13 wallclock secs ( 5.61 usr 2.42 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_range_prefix (20000:43500): 13 wallclock secs ( 5.33 usr 2.36 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_range (20000:43500): 13 wallclock secs ( 5.55 usr 2.27 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_range (20000:43500): 14 wallclock secs ( 5.75 usr 2.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_group (111): 31 wallclock secs ( 0.09 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_group (111): 33 wallclock secs ( 0.14 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for min_max_on_key (15000): 14 wallclock secs ( 6.27 usr 2.73 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for min_max_on_key (15000): 14 wallclock secs ( 6.51 usr 2.45 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for min_max (60): 18 wallclock secs ( 0.05 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for min_max (60): 18 wallclock secs ( 0.03 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_on_key (100): 26 wallclock secs ( 0.06 usr 0.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_on_key (100): 25 wallclock secs ( 0.01 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count (100): 40 wallclock secs ( 0.11 usr 0.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count (100): 39 wallclock secs ( 0.14 usr 0.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_big (20): 95 wallclock secs ( 0.05 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_distinct_big (20): 98 wallclock secs ( 0.03 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing update of keys with functions Testing update of keys with functions
Time for update_of_key (500): 62 wallclock secs ( 4.58 usr 6.73 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for update_of_key (500): 63 wallclock secs ( 4.78 usr 6.47 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for update_of_key_big (501): 33 wallclock secs ( 0.05 usr 0.05 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for update_of_key_big (501): 34 wallclock secs ( 0.05 usr 0.06 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing update with key Testing update with key
Time for update_with_key (100000): 185 wallclock secs (25.34 usr 40.66 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for update_with_key (100000): 188 wallclock secs (26.88 usr 40.59 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing update of all rows Testing update of all rows
Time for update_big (500): 64 wallclock secs ( 0.00 usr 0.01 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for update_big (500): 68 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing left outer join Testing left outer join
Time for outer_join_on_key (10:10): 37 wallclock secs ( 0.05 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for outer_join_on_key (10:10): 40 wallclock secs ( 0.00 usr 0.01 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for outer_join (10:10): 115 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for outer_join (10:10): 118 wallclock secs ( 0.01 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for outer_join_found (10:10): 102 wallclock secs ( 0.01 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for outer_join_found (10:10): 104 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for outer_join_not_found (500:10): 54 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for outer_join_not_found (500:10): 59 wallclock secs ( 0.02 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing delete Testing delete
Time for delete_key (10000): 6 wallclock secs ( 0.84 usr 1.30 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for delete_key (10000): 7 wallclock secs ( 0.73 usr 1.13 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for delete_big (12): 21 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for delete_big (12): 21 wallclock secs ( 0.00 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Insert into table with 16 keys and with a primary key with 16 parts Insert into table with 16 keys and with a primary key with 16 parts
Time for insert_key (100000): 1418 wallclock secs (13.78 usr 12.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for insert_key (100000): 1434 wallclock secs (14.73 usr 12.73 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing update of keys Testing update of keys
Time for update_of_key (256): 406 wallclock secs ( 0.03 usr 0.02 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for update_of_key (256): 427 wallclock secs ( 0.02 usr 0.08 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Deleting everything from table Deleting everything from table
Time for delete_big_many_keys (2): 438 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for delete_big_many_keys (2): 412 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Inserting 100000 rows with multiple values Inserting 100000 rows with multiple values
Time for multiple_value_insert (100000): 10 wallclock secs ( 2.59 usr 0.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for multiple_value_insert (100000): 9 wallclock secs ( 2.48 usr 0.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for drop table(1): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for drop table(1): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 4284 wallclock secs (485.59 usr 280.22 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 4332 wallclock secs (490.00 usr 278.16 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 19:10:01 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 2:55:53
Testing the speed of selecting on keys that consist of many parts Testing the speed of selecting on keys that consist of many parts
The test-table has 10000 rows and the test is done with 500 ranges. The test-table has 10000 rows and the test is done with 500 ranges.
Creating table Creating table
Inserting 10000 rows Inserting 10000 rows
Time to insert (10000): 7 wallclock secs ( 1.27 usr 1.42 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to insert (10000): 7 wallclock secs ( 1.23 usr 1.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing big selects on the table Testing big selects on the table
Time for select_big (70:17207): 1 wallclock secs ( 0.39 usr 0.11 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_big (70:17207): 1 wallclock secs ( 0.34 usr 0.20 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for select_range (410:1057904): 185 wallclock secs (27.20 usr 8.77 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for select_range (410:1057904): 189 wallclock secs (27.13 usr 9.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for min_max_on_key (70000): 161 wallclock secs (31.55 usr 12.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for min_max_on_key (70000): 166 wallclock secs (30.02 usr 11.73 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_on_key (50000): 321 wallclock secs (21.41 usr 8.33 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_on_key (50000): 320 wallclock secs (22.06 usr 8.56 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_group_on_key_parts (1000:0): 34 wallclock secs ( 2.64 usr 1.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_group_on_key_parts (1000:0): 40 wallclock secs ( 2.53 usr 0.92 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing count(distinct) on the table Testing count(distinct) on the table
Time for count_distinct (1000:2000): 69 wallclock secs ( 1.17 usr 0.41 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_distinct (1000:2000): 75 wallclock secs ( 1.13 usr 0.31 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group_on_key (1000:6000): 38 wallclock secs ( 0.70 usr 0.17 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_distinct_group_on_key (1000:6000): 40 wallclock secs ( 0.81 usr 0.23 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group_on_key_parts (1000:100000): 153 wallclock secs ( 2.61 usr 1.03 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_distinct_group_on_key_parts (1000:100000): 158 wallclock secs ( 2.78 usr 1.14 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_group (1000:100000): 152 wallclock secs ( 2.81 usr 0.92 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_distinct_group (1000:100000): 157 wallclock secs ( 2.50 usr 1.09 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time for count_distinct_big (1000:10000000): 1134 wallclock secs (224.20 usr 81.19 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for count_distinct_big (1000:10000000): 1125 wallclock secs (223.27 usr 83.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 2255 wallclock secs (315.95 usr 115.52 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 2278 wallclock secs (313.80 usr 117.34 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Testing server 'MySQL 3.23.17a alpha' at 2000-06-02 19:47:36 Testing server 'MySQL 3.23.23 beta' at 2000-09-01 3:33:51
Wisconsin benchmark test Wisconsin benchmark test
Time for create_table (3): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for create_table (3): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Inserting data Inserting data
Time to insert (31000): 19 wallclock secs ( 2.52 usr 3.91 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to insert (31000): 18 wallclock secs ( 2.22 usr 3.97 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Time to delete_big (1): 0 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time to delete_big (1): 1 wallclock secs ( 0.00 usr 0.00 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Running actual benchmark Running actual benchmark
Time for wisc_benchmark (114): 9 wallclock secs ( 5.66 usr 1.53 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Time for wisc_benchmark (114): 9 wallclock secs ( 5.69 usr 1.53 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
Total time: 29 wallclock secs ( 8.19 usr 5.44 sys + 0.00 cusr 0.00 csys = 0.00 CPU) Total time: 28 wallclock secs ( 7.91 usr 5.50 sys + 0.00 cusr 0.00 csys = 0.00 CPU)
2000-09-01 Michael Widenius <monty@mysql.com>
* Avoid allocation of "localhost" string.
* Changed that TIMESTAMP(X) is sometimes as string
* Release of 3.23.23
2000-08-21 Michael Widenius <monty@mysql.com> 2000-08-21 Michael Widenius <monty@mysql.com>
* Added RENAME TABLE. * Added RENAME TABLE.
......
...@@ -514,7 +514,7 @@ public: ...@@ -514,7 +514,7 @@ public:
Field_timestamp(char *ptr_arg, uint32 len_arg, Field_timestamp(char *ptr_arg, uint32 len_arg,
enum utype unireg_check_arg, const char *field_name_arg, enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg); struct st_table *table_arg);
enum Item_result result_type () const { return INT_RESULT; } enum Item_result result_type () const { return field_length == 8 || field_length == 14 ? INT_RESULT : STRING_RESULT; }
enum_field_types type() const { return FIELD_TYPE_TIMESTAMP;} enum_field_types type() const { return FIELD_TYPE_TIMESTAMP;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; } enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
void store(const char *to,uint length); void store(const char *to,uint length);
......
...@@ -472,7 +472,7 @@ int main(int argc,char **argv) ...@@ -472,7 +472,7 @@ int main(int argc,char **argv)
int error; int error;
MY_INIT(argv[0]); MY_INIT(argv[0]);
start_value=7223692L; best_t1=2365832L; best_t2=1560117L; best_type=0; /* mode=4519 add=5 func_type: 0 */ start_value=2610463L; best_t1=8358376L; best_t2=860646L; best_type=2; /* mode=4111 add=8 func_type: 0 */
if (get_options(argc,(char **) argv)) if (get_options(argc,(char **) argv))
exit(1); exit(1);
......
...@@ -972,7 +972,7 @@ int ha_berkeley::index_read_idx(byte * buf, uint keynr, const byte * key, ...@@ -972,7 +972,7 @@ int ha_berkeley::index_read_idx(byte * buf, uint keynr, const byte * key,
statistic_increment(ha_read_key_count,&LOCK_status); statistic_increment(ha_read_key_count,&LOCK_status);
DBUG_ENTER("index_read_idx"); DBUG_ENTER("index_read_idx");
current_row.flags=DB_DBT_REALLOC; current_row.flags=DB_DBT_REALLOC;
DBUG_RETURN(read_row(file->get(file, transaction, DBUG_RETURN(read_row(file->get(key_file[keynr], transaction,
pack_key(&last_key, keynr, key_buff, key, pack_key(&last_key, keynr, key_buff, key,
key_len), key_len),
&current_row,0), &current_row,0),
......
...@@ -317,8 +317,11 @@ int handler::ha_open(const char *name, int mode, int test_if_locked) ...@@ -317,8 +317,11 @@ int handler::ha_open(const char *name, int mode, int test_if_locked)
} }
if (!error) if (!error)
{ {
if (!(ref=(byte*) alloc_root(&table->mem_root, if (!alloc_root_inited(&table->mem_root)) // If temporary table
ALIGN_SIZE(ref_length)*2))) ref=sql_alloc(ALIGN_SIZE(ref_length)*2);
else
ref=(byte*) alloc_root(&table->mem_root, ALIGN_SIZE(ref_length)*2);
if (!ref)
{ {
close(); close();
error=HA_ERR_OUT_OF_MEM; error=HA_ERR_OUT_OF_MEM;
......
...@@ -426,7 +426,7 @@ void sql_print_error(const char *format,...) ...@@ -426,7 +426,7 @@ void sql_print_error(const char *format,...)
extern char mysql_data_home[2],server_version[50],max_sort_char, extern char mysql_data_home[2],server_version[50],max_sort_char,
mysql_real_data_home[]; mysql_real_data_home[];
extern my_string mysql_unix_port,mysql_tmpdir; extern my_string mysql_unix_port,mysql_tmpdir;
extern const char *first_keyword; extern const char *first_keyword, *localhost;
extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables, extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables,
created_tmp_tables, aborted_threads,aborted_connects, created_tmp_tables, aborted_threads,aborted_connects,
delayed_insert_timeout, delayed_insert_timeout,
......
...@@ -191,6 +191,7 @@ volatile ulong cached_thread_count=0; ...@@ -191,6 +191,7 @@ volatile ulong cached_thread_count=0;
// replication parameters, if master_host is not NULL, we are slaving off the master // replication parameters, if master_host is not NULL, we are slaving off the master
my_string master_user = (char*) "test", master_password = 0, master_host=0, my_string master_user = (char*) "test", master_password = 0, master_host=0,
master_info_file = (char*) "master.info"; master_info_file = (char*) "master.info";
const char *localhost=LOCAL_HOST;
uint master_port = MYSQL_PORT, master_connect_retry = 60; uint master_port = MYSQL_PORT, master_connect_retry = 60;
ulong max_tmp_tables,max_heap_table_size; ulong max_tmp_tables,max_heap_table_size;
...@@ -1981,9 +1982,9 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) ...@@ -1981,9 +1982,9 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused)))
continue; continue;
} }
if (!(vio_tmp=vio_new(new_sock, if (!(vio_tmp=vio_new(new_sock,
new_sock == unix_sock ? VIO_TYPE_SOCKET : sock == unix_sock ? VIO_TYPE_SOCKET :
VIO_TYPE_TCPIP, VIO_TYPE_TCPIP,
new_sock == unix_sock)) || sock == unix_sock)) ||
my_net_init(&thd->net,vio_tmp)) my_net_init(&thd->net,vio_tmp))
{ {
if (vio_tmp) if (vio_tmp)
...@@ -1997,14 +1998,7 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) ...@@ -1997,14 +1998,7 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused)))
continue; continue;
} }
if (sock == unix_sock) if (sock == unix_sock)
{ thd->host=(char*) localhost;
if (!(thd->host=my_strdup(LOCAL_HOST,MYF(0))))
{
close_connection(&thd->net,ER_OUT_OF_RESOURCES);
delete thd;
continue;
}
}
create_new_thread(thd); create_new_thread(thd);
} }
...@@ -2332,7 +2326,7 @@ CHANGEABLE_VAR changeable_vars[] = { ...@@ -2332,7 +2326,7 @@ CHANGEABLE_VAR changeable_vars[] = {
{ "tmp_table_size", (long*) &tmp_table_size, { "tmp_table_size", (long*) &tmp_table_size,
1024*1024L, 1024, ~0L, MALLOC_OVERHEAD, 1 }, 1024*1024L, 1024, ~0L, MALLOC_OVERHEAD, 1 },
{ "thread_stack", (long*) &thread_stack, { "thread_stack", (long*) &thread_stack,
1024*64, 1024*32, ~0L, 0, 1024 }, DEFAULT_THREAD_STACK, 1024*32, ~0L, 0, 1024 },
{ "wait_timeout", (long*) &net_wait_timeout, { "wait_timeout", (long*) &net_wait_timeout,
NET_WAIT_TIMEOUT, 1, ~0L, 0, 1 }, NET_WAIT_TIMEOUT, 1, ~0L, 0, 1 },
{ NullS, (long*) 0, 0, 0, 0, 0, 0} { NullS, (long*) 0, 0, 0, 0, 0, 0}
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
41 41 41 41 41 41 C6 43 45 45 45 45 49 49 49 49 41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
D0 4E 4F 4F 4F 4F 4F D7 4F 55 55 55 55 59 DE 53 44 4E 4F 4F 4F 4F 5D D7 D8 55 55 55 59 59 DE DF
41 41 41 41 41 41 C6 43 45 45 45 45 49 49 49 49 41 41 41 41 5C 5B 5C 43 45 45 45 45 49 49 49 49
D0 4E 4F 4F 4F 4F 4F F7 4F 55 55 55 55 59 DE 59 44 4E 4F 4F 4F 4F 5D F7 D8 55 55 55 59 59 DE FF
...@@ -150,7 +150,8 @@ THD::~THD() ...@@ -150,7 +150,8 @@ THD::~THD()
DBUG_PRINT("info", ("freeing host")); DBUG_PRINT("info", ("freeing host"));
safeFree(host); if (host != localhost) // If not pointer to constant
safeFree(host);
safeFree(user); safeFree(user);
safeFree(db); safeFree(db);
safeFree(ip); safeFree(ip);
......
...@@ -180,10 +180,7 @@ check_connections(THD *thd) ...@@ -180,10 +180,7 @@ check_connections(THD *thd)
#if !defined(HAVE_SYS_UN_H) || defined(HAVE_mit_thread) #if !defined(HAVE_SYS_UN_H) || defined(HAVE_mit_thread)
/* Fast local hostname resolve for Win32 */ /* Fast local hostname resolve for Win32 */
if (!strcmp(thd->ip,"127.0.0.1")) if (!strcmp(thd->ip,"127.0.0.1"))
{ thd->host=(char*) localhost;
if (!(thd->host=my_strdup("localhost",MYF(0))))
return (ER_OUT_OF_RESOURCES);
}
else else
#endif #endif
if (!(specialflag & SPECIAL_NO_RESOLVE)) if (!(specialflag & SPECIAL_NO_RESOLVE))
...@@ -199,9 +196,9 @@ check_connections(THD *thd) ...@@ -199,9 +196,9 @@ check_connections(THD *thd)
if (acl_check_host(thd->host,thd->ip)) if (acl_check_host(thd->host,thd->ip))
return(ER_HOST_NOT_PRIVILEGED); return(ER_HOST_NOT_PRIVILEGED);
} }
else /* No hostname means that the connection was on a socket */ else /* Hostname given means that the connection was on a socket */
{ {
DBUG_PRINT("general",("Host: localhost")); DBUG_PRINT("general",("Host: %s",thd->host));
thd->ip=0; thd->ip=0;
bzero((char*) &thd->remote,sizeof(struct sockaddr)); bzero((char*) &thd->remote,sizeof(struct sockaddr));
} }
...@@ -561,7 +558,7 @@ bool do_command(THD *thd) ...@@ -561,7 +558,7 @@ bool do_command(THD *thd)
{ {
packet=(char*) net->read_pos; packet=(char*) net->read_pos;
command = (enum enum_server_command) (uchar) packet[0]; command = (enum enum_server_command) (uchar) packet[0];
DBUG_PRINT("general",("Command on socket %s = %d (%s)", DBUG_PRINT("general",("Command on %s = %d (%s)",
vio_description(net->vio), command, vio_description(net->vio), command,
command_name[command])); command_name[command]));
} }
......
...@@ -2368,6 +2368,7 @@ keyword: ...@@ -2368,6 +2368,7 @@ keyword:
| ESCAPE_SYM {} | ESCAPE_SYM {}
| EXTENDED_SYM {} | EXTENDED_SYM {}
| FAST_SYM {} | FAST_SYM {}
| FULL {}
| FILE_SYM {} | FILE_SYM {}
| FIRST_SYM {} | FIRST_SYM {}
| FIXED_SYM {} | FIXED_SYM {}
......
...@@ -97,7 +97,9 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost) ...@@ -97,7 +97,9 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost)
if ((vio = (Vio*) my_malloc(sizeof(*vio),MYF(MY_WME)))) if ((vio = (Vio*) my_malloc(sizeof(*vio),MYF(MY_WME))))
{ {
vio_reset(vio, type, sd, 0, localhost); vio_reset(vio, type, sd, 0, localhost);
sprintf(vio->desc, "socket (%d)", vio->sd); sprintf(vio->desc,
(vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"),
vio->sd);
#if !defined(___WIN__) && !defined(__EMX__) #if !defined(___WIN__) && !defined(__EMX__)
#if !defined(NO_FCNTL_NONBLOCK) #if !defined(NO_FCNTL_NONBLOCK)
vio->fcntl_mode = fcntl(sd, F_GETFL); vio->fcntl_mode = fcntl(sd, F_GETFL);
......
...@@ -53,6 +53,7 @@ SUFFIXES = .sh ...@@ -53,6 +53,7 @@ SUFFIXES = .sh
@RM@ -f $@ $@-t @RM@ -f $@ $@-t
@SED@ \ @SED@ \
-e 's!@''bindir''@!$(bindir)!g' \ -e 's!@''bindir''@!$(bindir)!g' \
-e 's!@''sbindir''@!$(sbindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \ -e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \ -e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''datadir''@!$(datadir)!g' \ -e 's!@''datadir''@!$(datadir)!g' \
......
#!/bin/sh
# search & check GNU patch
PATCH="gpatch"
$PATCH --version || PATCH="patch"
$PATCH --version || exit
if /usr/bin/test ! -e PKG/stamp-pre ; then
grep VERSION configure | head -1 | sed 's/VERSION=//' > ./PKG/version
touch PKG/stamp-pre
fi
if /usr/bin/test ! -e PKG/stamp-patch ; then
${PATCH} -p0 < ./PKG/patch
touch PKG/stamp-patch
fi
if /usr/bin/test ! -e PKG/stamp-compile ; then
sh ./PKG/compile.sh ujis
touch PKG/stamp-compile
sh ./PKG/doc.sh ujis
fi
cd PKG
sh mkpkg.sh ujis
#!/bin/sh
# GNU ncurses
# search & check GNU make
GMAKE="gmake"
$GMAKE --version || GMAKE="make"
$GMAKE --version || exit
MAKE=$GMAKE
export MAKE
CC=gcc
CFLAGS="-O6 -fomit-frame-pointer"
CXX=gcc
CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti"
# LDFLAGS="-static"
LD=gcc
export CC
export CXX
export LD
export CFLAGS
export CXXFLAGS
# export LDFLAGS
# Solaris don't have libpthread.a.
if [ "x$1" = "x" ]; then
echo " please set character set"
exit
fi
CHAR="$1"
case "$1" in
[uU]*)
CHAR=ujis
;;
[sS]*)
CHAR=sjis
;;
esac
#---------------
P=`pwd`
if [ -f Makefile ] ; then
${GMAKE} distclean
fi
for i in bin sbin include man share/doc/mysql mysql-data
do
/usr/bin/mkdir -p PKG/tmp-${CHAR}/usr/local/${i}
done
/usr/bin/mkdir -p PKG/tmp-${CHAR}/etc/init.d
#----------------------------
./configure \
--prefix=/usr/local \
--libexecdir=/usr/local/sbin \
--sbindir=/usr/local/sbin \
--localstatedir=/usr/local/mysql-data \
--with-charset=${CHAR} \
--with-extra-charsets=all \
--with-raid \
--without-docs \
--without-bench \
--without-perl \
--with-gcc \
--with-mysqld-ldflags="-static" \
--with-client-ldflags="-static" \
--with-named-curses-libs=/usr/local/lib/libncurses.a \
--with-mysqld-user=mysql
# --with-berkeley-db-includes=/usr/local/include/db3 \
# --with-berkeley-db-libs=/usr/local/lib/libdb3.a \
# --with-low-memory
${GMAKE}
${GMAKE} install DESTDIR=${P}/PKG/tmp-${CHAR}
v=`grep '^SHARED_LIB_VERSION' configure.in | sed 's@SHARED_LIB_VERSION@@' | sed -e 's@=@@' -e 's@:@ @g' | awk '{print $1}'`
km="libmysqlclient.so.$v"
export km
(cd ${P}/PKG/tmp-${CHAR}/usr/local/lib/mysql/ ; \
for i in libmysqlclient* ; do \
if /usr/bin/test ! -L $i ; then \
mv $i ../ ; ln -sf ../$i ; \
fi ; \
done ; \
k=`ls libmysqlclient.so.*.*.*` ; \
cd .. ; \
if /usr/bin/test ! -z libmysqlclient.so ; then \
ln -sf $k libmysqlclient.so ;
fi ; \
if /usr/bin/test ! -z $km ; then \
ln -sf $k $km ;
fi ; \
)
#
(cd ${P}/PKG/tmp-${CHAR}/usr/local/bin ; strip * )
(cd ${P}/PKG/tmp-${CHAR}/usr/local/sbin ; strip * )
#!/bin/sh
CHAR="$1"
case "$1" in
[uU]*)
CHAR=ujis
;;
[sS]*)
CHAR=sjis
;;
esac
cp -r Docs/* PKG/tmp-${CHAR}/usr/local/share/doc/mysql/
cp INSTALL-SOURCE* COPYING* MIRRORS README* PKG/tmp-${CHAR}/usr/local/share/doc/mysql/
cd PKG/tmp-${CHAR}/usr/local/share/doc/mysql/
gzip *.txt *.texi *.info *.pdf
#!/bin/sh
if [ "x$1" = "x" ]; then
echo " please set charset"
exit
fi
CHAR="$1"
case "$1" in
[uU]*)
CHAR=ujis ; CH=uj
;;
[sS]*)
CHAR=sjis ; CH=sj
;;
esac
#-------------------
DIR=`pwd`
VERSION=`cat version`
T=`uname -p`
sed -e "s/@CHAR1@/${CH}/" \
-e "s/@CHAR2@/${CHAR}/" \
-e "s/@VERSION@/${VERSION}/" \
-e "s/@TYPE@/${T}/" \
pkginfo.ini > pkginfo.${CHAR}
sed -e "s,@DIR@,${DIR},g" \
-e "s,@PKGINFO@,${DIR}/pkginfo.${CHAR}," \
prototype.ini > prototype.${CHAR}
INIT="tmp-${CHAR}/etc/init.d/mysql"
cp ../support-files/mysql.server $INIT
chmod 755 $INIT
(cd tmp-${CHAR}; \
chown root etc usr ; \
chgrp sys etc usr ;\
chmod 755 usr etc; \
chgrp sys etc/init.d ; \
chmod 755 etc/init.d ; \
find . -print|pkgproto >> ../prototype.${CHAR})
pkgmk -o -f prototype.${CHAR} -r ${DIR}/tmp-${CHAR}
--- scripts/safe_mysqld.sh.orig Sat Sep 2 17:28:26 2000
+++ scripts/safe_mysqld.sh Sat Sep 2 17:31:19 2000
@@ -89,10 +89,10 @@
NOHUP_NICENESS=`nohup nice`
-if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice --1 echo foo > /dev/null 2>&1; then
+if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice -1 echo foo > /dev/null 2>&1; then
NOHUP_NICENESS="nohup"
else
- NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup"
+ NOHUP_NICENESS="nice -$NOHUP_NICENESS nohup"
fi
export MYSQL_UNIX_PORT
@@ -163,7 +163,8 @@
# The only thing is ps x => redhat 5 gives warnings when using ps -x.
# kill -9 is used or the process won't react on the kill.
numofproces=`ps xa | grep -v "grep" | grep -c $ledir/mysqld`
- echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log
+ echo | tee -a $err_log
+ echo "Number of processes running now: $numofproces" | tee -a $err_log
I=1
while test "$I" -le "$numofproces"
do
@@ -185,4 +186,6 @@
echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log
done
-echo -e "`date +'%y%m%d %H:%M:%S mysqld ended\n'`" | tee -a $err_log
+echo | tee -a $err_log
+echo "`date +'%y%m%d %H:%M:%S mysqld ended'`" | tee -a $err_log
+echo | tee -a $err_log
--- support-files/mysql.server.sh.orig Sat Sep 2 17:35:56 2000
+++ support-files/mysql.server.sh Sat Sep 2 17:36:35 2000
@@ -23,6 +23,9 @@
mysql_daemon_user=@MYSQLD_USER@
export PATH
+## your options...
+OPT=""
+
mode=$1
if test -w / # determine if we should look at the root config file
@@ -82,8 +85,9 @@
then
# Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade.
- $bindir/safe_mysqld \
- --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file --log=$log_file &
+ $bindir/safe_mysqld $OPT \
+ --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file &
+# --log=$log_file &
else
echo "Can't execute $bindir/safe_mysqld"
fi
--- configure.orig Sat Sep 2 17:54:03 2000
+++ configure Sat Sep 2 17:54:18 2000
@@ -202,7 +202,7 @@
--with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
+ latin1 latin2 swe7 usa7 win1250 win1251ukr
ujis sjis tis620; default is latin1)"
ac_help="$ac_help
--with-extra-charsets=cs1,cs2
@@ -8843,7 +8843,7 @@
# Choose a character set
-CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
DEFAULT_CHARSET=latin1
# Check whether --with-charset or --without-charset was given.
--- configure.in.orig Sat Sep 2 17:53:57 2000
+++ configure.in Sat Sep 2 17:54:36 2000
@@ -1517,14 +1517,14 @@
dnl or other special handling, you must also create
dnl strings/ctype-$charset_name.c
-CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
DEFAULT_CHARSET=latin1
AC_ARG_WITH(charset,
[ --with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
+ latin1 latin2 swe7 usa7 win1250 win1251ukr
ujis sjis tis620; default is latin1)],
[default_charset="$withval"],
[default_charset="$DEFAULT_CHARSET"])
PKG=MySQL
NAME=MySQL
ARCH=@TYPE@
VERSION=@VERSION@
CATEGORY=utility
VENDOR=TcX DataKonsult AB, Detron HB and MySQL AB
BASEDIR=/
CLASSES=none
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
export PATH
export LD_LIBRARY_PATH
D0="/usr/local/mysql-data"
D="${D0}/mysql"
DOFIX=0
if /usr/bin/test ! -f ${D}/tables_priv.frm -a -d ${D} ; then
DOFIX=1
fi
if [ ! -d ${D} ]; then
DOFIX=2
/usr/local/bin/mysql_install_db
fi
chown -R mysql $D0
chgrp -R mysql $D0
if /usr/bin/test $DOFIX -eq 1 ; then
/etc/init.d/mysql start
/usr/local/bin/mysql_fix_privilege_tables
else
/etc/init.d/mysql start || true
fi
#!/bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
export PATH
export LD_LIBRARY_PATH
if /usr/bin/test -x /etc/init.d/mysql ; then
/etc/init.d/mysql stop || true
fi
#----- user check
P=`grep mysql /etc/passwd`
G=`grep mysql /etc/group`
if /usr/bin/test "x$G" = "x" ; then
/usr/sbin/groupadd mysql
fi
if /usr/bin/test "x$P" = "x" ; then
/usr/sbin/useradd -g mysql -d /usr/local/mysql-data -s /bin/false mysql
fi
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
export PATH
export LD_LIBRARY_PATH
pid=`/usr/bin/ps -e | /usr/bin/grep mysqld | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
[ "$pid" != "" ] && /usr/local/bin/mysqladmin shutdown
#---
#/usr/ucb/echo -n "Remove DATA Directory (All data expire) [Y/N]? "
#read I
I=No
case "$I" in
Y*|y*)
/usr/ucb/echo -n "Removing MySQL DATA ALL..."
rm -rf /usr/local/mysql-data
echo "done."
;;
*)
echo "not purge DATA directory"
;;
esac;
i pkginfo=@PKGINFO@
i postinstall=@DIR@/postinstall
i preinstall=@DIR@/preinstall
i preremove=@DIR@/preremove
mysql for DEBIAN
----------------------
Comments regarding the Package
* about patch files
if you want to make new patch,
write patch file and put it into debian/patches/.
debian/rules do patch debian/patches/* automatically.
* about server packages
I use Debian alternative system, to switch next 3 type MySQL server.
mysql-server :
this is static linked MySQL server(/usr/sbin/mysqld-static) and share/mysql/ files.
mysql-server-shared:
this is dynamic linked MySQL server only. (/usr/sbin/mysqld-shared)
mysql-server-debug:
--with-debug flag. mysqld only. (/usr/sbin/mysqld-debug)
* about charset
I build MySQL server --with-extra-charsets=all
* about location
server programs ...... /usr/sbin/
share files .......... /usr/share/mysql/
client programs ...... /usr/bin/
MySQL data directory . /var/mysql/data/
benchmark directory .. /var/mysql/sql-bench/
socket file ......... /tmp/mysql.sock
include files ........ /usr/include/mysql/
libraries ........... /usr/lib/ , /usr/lib/mysql/
put libmysqlclient* into /usr/lib/ ,
others, put /usr/lib/mysql/ .
takeshi@SoftAgency.co.jp
This diff is collapsed.
Source: mysql
Section: devel
Priority: extra
Maintainer: takeshi <takeshi@softagency.co.jp>
Standards-Version: 2.1.2.2
Package: mysql
Architecture: all
Description: mysql
Missing
Package: mysql-doc
Architecture: all
Description: mysql Documentation (html)
MySQL Doc.
Package: libmysqlclient9
Architecture: any
Provides: libmysqlclient9
Description: libmysqlclient.so.9
libmysqlclient.so.9
Package: mysql-client
Architecture: any
Depends: ${shlibs:Depends}
Section: devel
Priority: extra
Conflicts: mysql-client-ujis, mysql-client-sjis
Replaces: mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-client-ujis, mysql-client-sjis
Provides: mysql-client
Description: mysql clients.
MySQL clients programs.
Package: mysql-server
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Provides: mysql-server
Description: MySQL server (static linked)
MySQL server. static linked.
Package: mysql-server-shared
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Description: MySQL server (dynamic linked)
MySQL server. dynamic linked.
Package: mysql-server-debug
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Replaces: mysql-server-sjis, mysql-base (<< 3.22.11), mysql-base-ujis (<< 3.22.11), mysql-base-sjis (<< 3.22.11), mysql-server-sjis, mysql-server-ujis, mysql-server (<< 3.23.0)
Description: MySQL server debug
MySQL server. debug
Package: mysql-dev
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: mysql-dev-sjis, mysql-dev-ujis
Replaces: mysql-dev-sjis, mysql-dev-ujis, libmysqlclient6-ujis, libmysqlclient6-sjis
Provides: mysql-dev
Description: MySQL develop suite
MySQL develop.
Package: mysql-bench
Architecture: all
Description: mysql benchmark suite.
MySQL sql-bench files.
This package was debianized by takeshi@softagency.co.jp on
Sat, 2 May 1998 03:42:24 +0900.
It was downloaded from
http://www.mysql.com/
Copyright:
GPL
Docs/Makefile
strings/Makefile
dbug/Makefile
mysys/Makefile
extra/Makefile
regex/Makefile
isam/Makefile
heap/Makefile
merge/Makefile
sql/Makefile
sql/share/Makefile
support-files/binary-configure
support-files/my-example.cnf
support-files/mysql-log-rotate
scripts/add_func_table
scripts/mysql_setpermisson
scripts/mysqlbug
scripts/mysqlhotcopy
client/my_static.h
client/mysys_priv.h
include/my_config.h
sql/lex_hash.h
sql-bench/Makefile
scripts/mysql_config
libmysql_r/Makefile
#!/bin/sh
STAMPFILE="debian/stamp-move"
if [ -e $STAMPFILE ]; then
exit
fi
#----------
CLIENT1="msql2mysql mysql mysql_convert_table_format mysql_find_rows mysql_fix_privilege_tables mysql_setpermission mysql_zap mysqlaccess mysqladmin mysqlbug mysqldump mysqlhotcopy mysqlimport mysqlshow"
# CLIENT2="add_file_priv add_func_table add_long_password make_binary_distribution"
P=`pwd`
#----------
for CHAR in build
do
#-----
cp -Rpd debian/${CHAR}/usr debian/mysql-server/
cp -Rpd debian/${CHAR}-shared/usr/lib/mysql/libmysqlclient.so.* debian/libmysqlclient9/usr/lib/
#----- mysql-server-shared ---
cp -Rpd debian/${CHAR}-shared/usr/sbin/mysqld debian/mysql-server-shared/usr/sbin/mysqld-shared
#----- mysql-server-debug ---
cp -Rpd debian/${CHAR}-debug/usr/sbin/mysqld debian/mysql-server-debug/usr/sbin/mysqld-debug
#----- mysql-server ---
mv debian/mysql-server/usr/sbin/mysqld debian/mysql-server/usr/sbin/mysqld-static
#----- mysql-client ----
cd ${P}/debian/mysql-server/usr/bin/ && mv $CLIENT1 ../../../mysql-client/usr/bin/
cd ${P}
mv -f debian/mysql-server/usr/{man,info} debian/mysql-client/usr/share/
mv debian/mysql-server/usr/share/mysql/my-example.cnf debian/mysql-client/usr/share/mysql/
mv -f debian/mysql-server/usr/bin/replace debian/mysql-client/usr/bin/mysql_replace
#----- mysql-server ---
mv debian/mysql-server/usr/bin/* debian/mysql-server/usr/sbin/
mv debian/mysql-server/usr/sbin/my_print_defaults debian/mysql-server/usr/bin/
mv debian/mysql-server/usr/sbin/comp_err debian/mysql-server/usr/bin/
mv debian/mysql-server/usr/sbin/perror debian/mysql-server/usr/bin/mysql_perror
mv debian/mysql-server/usr/sbin/resolveip debian/mysql-server/usr/bin/mysql_resolveip
#----- mysql-dev ----
cp -Rpd debian/${CHAR}-shared/usr/lib/mysql/libmysqlclient.so debian/mysql-dev/usr/lib/
mv debian/mysql-server/usr/include debian/mysql-dev/usr/
mv debian/mysql-server/usr/lib/mysql debian/mysql-dev/usr/lib/
mv debian/mysql-dev/usr/lib/mysql/libmysqlclient.a debian/mysql-dev/usr/lib/
(cd debian/mysql-dev/usr/lib/mysql ; ln -sf "../libmysqlclient.a" )
#-----
cp debian/README.debian debian/copyright debian/changelog \
debian/mysql-client/usr/share/doc/mysql/
done
####################
### doc
cp -r COPYING* MIRRORS README* Docs/* debian/mysql-doc/usr/share/doc/mysql/
#### sql-bench
mv debian/mysql-server/usr/sql-bench \
debian/mysql-bench/var/mysql/
touch $STAMPFILE
# Example mysql config file.
# You can copy this to one of:
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is @localstatedir@) or
# ~/.my.cnf to set user-specific options.
#
# One can use all long options that the program supports.
# Run the program with --help to get a list of available options
# This will be passed to all mysql clients
[client]
#password = my_password
#port = 3306
#socket = /tmp/mysql.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# The MySQL server
[mysqld]
default-character-set = ujis
#port = 3306
#socket = /tmp/mysql.sock
#skip-locking
#set-variable = key_buffer=16M
#set-variable = max_allowed_packet=1M
#set-variable = thread_stack=128K
## Start logging
#log
[mysqldump]
default-character-set = ujis
#quick
#set-variable = max_allowed_packet=16M
[mysql]
default-character-set = ujis
#no-auto-rehash
[isamchk]
#set-variable = key_buffer=16M
usr/bin
usr/share/mysql
usr/share/doc/mysql
#!/bin/sh
update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-debug 20
#!/bin/sh
update-alternatives --auto mysqld
#!/bin/sh
update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-shared 15
#!/bin/sh
update-alternatives --auto mysqld
#!/bin/sh
update-rc.d mysql defaults 50 >/dev/null
#--------
update-alternatives --install /usr/sbin/mysqld mysqld /usr/sbin/mysqld-static 10
#--------
DOFIX=0
if [ ! -e /var/mysql/data/mysql/tables_priv.frm -a -d /var/mysql/data/mysql ]; then
DOFIX=1
fi
#--------
i=`grep '^mysql:' /etc/group`
if [ "x${i}" == "x" ]; then
groupadd mysql || true
fi
i=`grep '^mysql:' /etc/passwd`
if [ "x${i}" == "x" ]; then
useradd -g mysql -d /var/mysql/data -s /noexists mysql || true
fi
#--------
if [ ! -d /var/mysql/data/mysql ]; then
install -d /var/mysql/data || true
/usr/sbin/mysql_install_db || true
chown -R mysql.mysql /var/mysql
fi
#--------
/etc/init.d/mysql start || true
if [ $DOFIX -eq 1 ]; then
echo "***************************************"
echo " Now, fix tables for MySQL 3.22.11...."
echo " if you set root passwd, please in..."
echo -n " ? MySQL root passwd ? : "
read pass dumy
/usr/sbin/mysql_fix_privilege_tables $pass
fi
#!/bin/sh
update-alternatives --auto mysqld
if [ "$1" = "purge" ]
then
update-rc.d mysql remove >/dev/null
echo -n " Shall I also remove all of the databases (y/N)?"; read ans
if [ "$ans" = "y" -o "$ans" = "Y" ]; then
rm -rf /var/mysql
fi
fi
#!/bin/sh
/etc/init.d/mysql stop || true
--- mysql-3.23.23.orig/sql/Makefile.in
+++ mysql-3.23.23/sql/Makefile.in
@@ -366,7 +366,7 @@
mysqlbinlog: $(mysqlbinlog_OBJECTS) $(mysqlbinlog_DEPENDENCIES)
@rm -f mysqlbinlog
- $(CXXLINK) $(mysqlbinlog_LDFLAGS) $(mysqlbinlog_OBJECTS) $(mysqlbinlog_LDADD) $(LIBS)
+ $(CXXLINK) $(mysqld_LDFLAGS) $(mysqlbinlog_OBJECTS) $(mysqld_LDADD) $(LIBS)
mysqld: $(mysqld_OBJECTS) $(mysqld_DEPENDENCIES)
@rm -f mysqld
--- mysql-3.23.23.orig/scripts/Makefile.in
+++ mysql-3.23.23/scripts/Makefile.in
@@ -337,6 +337,7 @@
@RM@ -f $@ $@-t
@SED@ \
-e 's!@''bindir''@!$(bindir)!g' \
+ -e 's!@''sbindir''@!$(sbindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''datadir''@!$(datadir)!g' \
--- mysql-3.23.23.orig/support-files/Makefile.in
+++ mysql-3.23.23/support-files/Makefile.in
@@ -308,6 +308,7 @@
@RM@ -f $@ $@-t
@SED@ \
-e 's!@''bindir''@!$(bindir)!g' \
+ -e 's!@''sbindir''@!$(sbindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \
-e 's!@''datadir''@!$(datadir)!g' \
--- mysql-3.23.23.orig/scripts/msql2mysql.sh
+++ mysql-3.23.23/scripts/msql2mysql.sh
@@ -13,4 +13,4 @@
# described in the License. Among other things, the License requires that
# the copyright notice and this notice be preserved on all copies.
-@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $*
+@bindir@/mysql_replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $*
--- mysql-3.23.23.orig/scripts/mysql_install_db.sh
+++ mysql-3.23.23/scripts/mysql_install_db.sh
@@ -11,6 +11,7 @@
ldata=@localstatedir@
execdir=@libexecdir@
bindir=@bindir@
+sbindir=@sbindir@
force=0
IN_RPM=0
defaults=
@@ -47,6 +48,10 @@
then
bindir=`grep "^bindir" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
fi
+ if grep "^sbindir" $conf >/dev/null
+ then
+ sbindir=`grep "^sbindir" $conf | sed '.*=[ \t]*//`
+ fi
if grep "^user" $conf >/dev/null
then
user=`grep "^user" $conf | sed 's;^[^=]*=[ \t]*;;' | sed 's;[ \t]$;;'`
@@ -56,7 +61,7 @@
for arg
do
case "$arg" in
- --basedir=*) basedir=`echo "$arg"|sed 's;^--basedir=;;'`; bindir="$basedir/bin"; execdir="$basedir/libexec" ;;
+ --basedir=*) basedir=`echo "$arg"|sed 's;^--basedir=;;'`; bindir="$basedir/bin"; sbindir="$basedir/sbin"; execdir="$basedir/libexec" ;;
--datadir=*) ldata=`echo "$arg"|sed 's;^--datadir=;;'` ;;
--user=*) user=`echo "$arg"|sed 's;^--user=;;'` ;;
esac
@@ -82,10 +87,10 @@
# Check if hostname is valid
if test "$IN_RPM" -eq 0 -a $force -eq 0
then
- resolved=`$bindir/resolveip $hostname 2>&1`
+ resolved=`$bindir/mysql_resolveip $hostname 2>&1`
if [ $? -ne 0 ]
then
- resolved=`$bindir/resolveip localhost 2>&1`
+ resolved=`$bindir/mysql_resolveip localhost 2>&1`
if [ $? -eq 0 ]
then
echo "Sorry, the host '$hostname' could not be looked up."
@@ -300,7 +305,7 @@
if test -z "$IN_RPM"
then
echo "You can start the MySQL demon with:"
- echo "cd @prefix@ ; $bindir/safe_mysqld &"
+ echo "cd @prefix@ ; $sbindir/safe_mysqld &"
echo
echo "You can test the MySQL demon with the benchmarks in the 'sql-bench' directory:"
echo "cd sql-bench ; run-all-tests"
--- mysql-3.23.23.orig/support-files/mysql.server.sh Tue Sep 5 19:13:35 2000
+++ mysql-3.23.23/support-files/mysql.server.sh Tue Sep 5 19:19:40 2000
@@ -16,6 +16,7 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
basedir=@prefix@
bindir=@bindir@
+sbindir=@sbindir@
datadir=@localstatedir@
pid_file=@localstatedir@/mysqld.pid
log_file=@localstatedir@/mysqld.log
@@ -64,6 +65,10 @@
then
bindir=`grep "^bindir" $conf | cut -f 2 -d= | tr -d ' '`
fi
+ if grep "^sbindir" $conf >/dev/null
+ then
+ sbindir=`grep "^sbindir" $conf | cut -f 2 -d= | tr -d ' '`
+ fi
if grep "^log[ \t]*=" $conf >/dev/null
then
log_file=`grep "log[ \t]*=" $conf | cut -f 2 -d= | tr -d ' '`
@@ -78,14 +83,15 @@
'start')
# Start daemon
- if test -x $bindir/safe_mysqld
+ if test -x $sbindir/safe_mysqld
then
# Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade.
- $bindir/safe_mysqld \
- --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file --log=$log_file &
+ $sbindir/safe_mysqld \
+ --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file &
+# --log=$log_file &
else
- echo "Can't execute $bindir/safe_mysqld"
+ echo "Can't execute $sbindir/safe_mysqld"
fi
;;
--- mysql-3.23.23.orig/configure
+++ mysql-3.23.23/configure
@@ -202,7 +202,7 @@
--with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
+ latin1 latin2 swe7 usa7 win1250 win1251ukr
ujis sjis tis620; default is latin1)"
ac_help="$ac_help
--with-extra-charsets=cs1,cs2
@@ -8843,7 +8843,7 @@
# Choose a character set
-CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
DEFAULT_CHARSET=latin1
# Check whether --with-charset or --without-charset was given.
--- mysql-3.23.23.orig/configure.in
+++ mysql-3.23.23/configure.in
@@ -1517,14 +1517,14 @@
dnl or other special handling, you must also create
dnl strings/ctype-$charset_name.c
-CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
DEFAULT_CHARSET=latin1
AC_ARG_WITH(charset,
[ --with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
croat czech danish dec8 dos estonia euc_kr gb2312 gbk
german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
+ latin1 latin2 swe7 usa7 win1250 win1251ukr
ujis sjis tis620; default is latin1)],
[default_charset="$withval"],
[default_charset="$DEFAULT_CHARSET"])
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
package=mysql
CHARSET=ujis
TEMPINST=build
#CFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static
CC=gcc
CFLAGS=-O6 -fomit-frame-pointer
CXX=gcc
CXXFLAGS=-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti
# CXXFLAGS=-O6 -fomit-frame-pointer -felide-constructors -fno-rtti
SYSNAME=
COMMONCONF= --prefix=/usr --libexecdir=/usr/sbin \
--localstatedir=/var/mysql/data \
--enable-shared \
--without-perl --without-readline \
--without-docs --without-bench \
--with-mysqld-user=mysql \
--with-extra-charsets=all
SERVERCONF=$(COMMONCONF) --enable-assembler \
--with-raid
# --with-berkeley-db-includes=/usr/include/db3 \
# --with-berkeley-db-libs=/usr/lib/libdb3.a
STATICCONF=--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
CLIENTCONF=$(COMMONCONF) --without-server
##################################################
patches debian/stamp-patches:
-test -e debian/stamp-patches || \
for i in `find debian/patches -type f -print` ; do \
patch -p1 < $$i ; \
done
touch debian/stamp-patches
##################################################
premkdir debian/stamp-premkdir:
$(checkdir)
-rm -rf debian/tmp debian/$(TEMPINST)*
dh_installdirs
-install -d debian/$(TEMPINST)/usr/{bin,sbin,share,man,include,info}
-install -d debian/$(TEMPINST)-shared/usr/{bin,sbin,share,man,include,info}
-install -d debian/$(TEMPINST)-debug/usr/{bin,sbin,share,man,include,info}
touch debian/stamp-premkdir
##################################################
config debian/stamp-config: debian/stamp-premkdir debian/stamp-patches
CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
LDFLAGS="-static" \
./configure $(SERVERCONF) $(STATICCONF) \
--with-charset=$(CHARSET) \
--with-bench \
$(SYSNAME)
# sed 's/-fno-implicit-templates//g' sql/Makefile > .m
# mv .m sql/Makefile
touch debian/stamp-config
##################################################
build: debian/stamp-config
make LDFLAGS="-static"
make install DESTDIR=`pwd`/debian/$(TEMPINST)
cp include/m_ctype.h `pwd`/debian/$(TEMPINST)/usr/include/mysql/
touch build
##################################################
build-shared debian/stamp-build-shared: debian/stamp-patches
-make distclean
CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
./configure $(SERVERCONF) \
--with-charset=$(CHARSET) \
$(SYSNAME)
# ./configure $(CLIENTCONF)
make
make install DESTDIR=`pwd`/debian/$(TEMPINST)-shared
touch debian/stamp-build-shared
##################################################
build-debug debian/stamp-build-debug: debian/stamp-patches
-make distclean
CC=$(CC) CFLAGS="$(CFLAGS)" CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" \
./configure $(SERVERCONF) \
--with-charset=$(CHARSET) \
--with-debug \
$(SYSNAME)
# ./configure $(CLIENTCONF)
make
make install DESTDIR=`pwd`/debian/$(TEMPINST)-debug
touch debian/stamp-build-debug
##################################################
clean:
$(checkdir)
-make distclean
-test -e debian/stamp-patches && \
for i in `find debian/patches -type f -print` ; do \
patch -R -p1 < $$i ; \
done
-rm -rf build debian/stamp-* debian/$(TEMPINST)*
-dh_clean
-rm -f `find . -name "*~"`
-rm -rf debian/tmp debian/files* core
-rm -f debian/*substvars
-rm -f `cat debian/gomi`
##################################################
binary-indep: checkroot build
$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
binary-arch: checkroot build debian/stamp-build-shared debian/stamp-build-debug
sh debian/move
### init, post*
dh_installdeb
cp debian/shlibs debian/libmysqlclient9/DEBIAN/
cp debian/my.cnf debian/mysql-server/etc/
cp support-files/mysql.server debian/mysql-server/etc/init.d/mysql ; chmod +x debian/mysql-server/etc/init.d/mysql
### dpkg-xxx
dh_compress
dh_fixperms
dh_strip
dh_shlibdeps
dh_gencontrol
dpkg --build debian/libmysqlclient9 ..
dpkg --build debian/mysql-client ..
dpkg --build debian/mysql-server ..
dpkg --build debian/mysql-server-shared ..
dpkg --build debian/mysql-server-debug ..
dpkg --build debian/mysql-dev ..
dpkg --build debian/mysql-bench ..
dpkg --build debian/mysql-doc ..
define checkdir
test -f debian/rules
endef
# Below here is fairly generic really
binary: binary-indep binary-arch
##################################################
checkroot:
$(checkdir)
test root = "`whoami`"
##################################################
.PHONY: binary binary-arch binary-indep clean checkroot
libmysqlclient 9 libmysqlclient9
File mode changed from 100755 to 100644
...@@ -13,63 +13,61 @@ ...@@ -13,63 +13,61 @@
# chkconfig: 2345 90 90 # chkconfig: 2345 90 90
# description: A very fast and reliable SQL database engine. # description: A very fast and reliable SQL database engine.
# The following variables are only set for letting mysql.server find things
# if you want to affect other MySQL variables, you should make your changes
# in the /etc/my.cnf or other configuration files
PATH=/sbin:/usr/sbin:/bin:/usr/bin PATH=/sbin:/usr/sbin:/bin:/usr/bin
basedir=@prefix@ basedir=@prefix@
bindir=@bindir@ bindir=@bindir@
sbindir=@sbindir@
datadir=@localstatedir@ datadir=@localstatedir@
pid_file=@localstatedir@/mysqld.pid pid_file=@localstatedir@/mysqld.pid
log_file=@localstatedir@/mysqld.log
# Run mysqld as this user.
mysql_daemon_user=@MYSQLD_USER@
export PATH export PATH
mode=$1 mode=$1
if test -w / # determine if we should look at the root config file GetCNF () {
then # or user config file
conf=/etc/my.cnf VARIABLES="basedir bindir sbindir datadir pid-file"
else CONFIG_FILES="/etc/my.cnf $basedir/my.cnf $HOME/.my.cnf"
conf=$HOME/.my.cnf # Using the users config file
fi for c in $CONFIG_FILES
do
# The following code tries to get the variables safe_mysqld needs from the if [ -f $c ]
# config file. This isn't perfect as this ignores groups, but it should then
# work as the options doesn't conflict with anything else. #echo "Processing $c..."
for v in $VARIABLES
if test -f "$conf" # Extract those fields we need from config file. do
then # This method assumes last of duplicate $variable entries will be the
if grep "^datadir" $conf >/dev/null # value set ([mysqld])
then # This could easily be rewritten to gather [xxxxx]-specific entries,
datadir=`grep "^datadir" $conf | cut -f 2 -d= | tr -d ' '` # but for now it looks like only the mysqld ones are needed for
fi # server startup scripts
if grep "^user" $conf >/dev/null eval `sed -n -e '/^$/d' -e '/^#/d' -e 's,[ ],,g' -e '/=/p' $c |\
then awk -F= -v v=$v '{if ($1 == v) printf ("thevar=\"%s\"\n", $2)}'`
mysql_daemon_user=`grep "^user" $conf | cut -f 2 -d= | tr -d ' ' | head -1`
fi # it would be easier if the my.cnf and variable values were
if grep "^pid-file" $conf >/dev/null # all matched, but since they aren't we need to map them here.
then case $v in
pid_file=`grep "^pid-file" $conf | cut -f 2 -d= | tr -d ' '` pid-file) v=pid_file ;;
else log) v=log_file ;;
if test -d "$datadir" esac
then
pid_file=$datadir/`hostname`.pid # As long as $thevar isn't blank, use it to set or override current
fi # value
fi [ "$thevar" != "" ] && eval $v=$thevar
if grep "^basedir" $conf >/dev/null
then done
basedir=`grep "^basedir" $conf | cut -f 2 -d= | tr -d ' '` #else
bindir=$basedir/bin # echo "No $c config file."
fi fi
if grep "^bindir" $conf >/dev/null done
then }
bindir=`grep "^bindir" $conf | cut -f 2 -d= | tr -d ' '`
fi
if grep "^log[ \t]*=" $conf >/dev/null
then
log_file=`grep "log[ \t]*=" $conf | cut -f 2 -d= | tr -d ' '`
fi
fi
# run function to get config values
GetCNF
# Safeguard (relative paths, core dumps..) # Safeguard (relative paths, core dumps..)
cd $basedir cd $basedir
...@@ -83,7 +81,7 @@ case "$mode" in ...@@ -83,7 +81,7 @@ case "$mode" in
# Give extra arguments to mysqld with the my.cnf file. This script may # Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade. # be overwritten at next upgrade.
$bindir/safe_mysqld \ $bindir/safe_mysqld \
--user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file --log=$log_file & --datadir=$datadir --pid-file=$pid_file &
else else
echo "Can't execute $bindir/safe_mysqld" echo "Can't execute $bindir/safe_mysqld"
fi fi
......
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