Commit 724d8e1d authored by unknown's avatar unknown

Merge jcole@work.mysql.com:/home/bk/mysql

into tetra.spaceapes.com:/home/jcole/bk/mysql


Docs/manual.texi:
  Auto merged
parents 52391439 857b5d4f
......@@ -6590,13 +6590,12 @@ Please report bad or out-of-date mirrors to @email{webmaster@@mysql.com}.
@c @image{Flags/spain} Spain [MasterD]
@c @uref{http://mysql.masterd.es, WWW}
@c @item
@c Not ok 20000919; Old site (Matt)
@item
@c EMAIL: Patrik.Karen@sdi.slu.se (Patrik Karen)
@c ftp -> remove old files
@c @image{Flags/sweden} Sweden [Sunet] @
@c @uref{http://ftp.sunet.se/pub/unix/databases/relational/mysql/, WWW}
@c @uref{ftp://ftp.sunet.se/pub/unix/databases/relational/mysql/, FTP}
@image{Flags/sweden} Sweden [Sunet] @
@uref{http://ftp.sunet.se/pub/unix/databases/relational/mysql/, WWW}
@uref{ftp://ftp.sunet.se/pub/unix/databases/relational/mysql/, FTP}
@item
@c EMAIL: archive@sunsite.cnlab-switch.ch (Thomas Lenggenhager)
......@@ -6610,12 +6609,6 @@ Please report bad or out-of-date mirrors to @email{webmaster@@mysql.com}.
@c @image{Flags/great-britain} UK [Oyster/UK] @
@c @uref{ftp://ftp.oyster.co.uk/pub/mysql, FTP}
@item
@c EMAIL: gareth@omnipotent.net (Gareth Watts)
@image{Flags/great-britain} UK [Omnipotent/UK] @
@uref{http://mysql.omnipotent.net/, WWW}
@uref{ftp://mysql.omnipotent.net/, FTP}
@item
@c EMAIL: keet@mordor.plig.net (Christiaan Keet)
@image{Flags/great-britain} UK [PLiG/UK] @
......@@ -36076,7 +36069,9 @@ set-variable = innodb_lock_wait_timeout=50
@end example
Note that data files must be < 4G, and < 2G on
some file systems! InnoDB does not create directories:
some file systems! The total size of data files has
to be >= 10 MB.
InnoDB does not create directories:
you have to create them yourself.
Suppose you have a Linux machine with 512 MB RAM and
......@@ -6,8 +6,8 @@ now()-now() weekday(curdate())-weekday(now()) unix_timestamp()-unix_timestamp(no
0 0 0
from_unixtime(unix_timestamp("1994-03-02 10:11:12")) from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s") from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0
1994-03-02 10:11:12 1994-03-02 10:11:12 19940302101112
sec_to_time(9001) sec_to_time(9001)+0 time_to_sec("15:12:22")
02:30:01 23001 54742
sec_to_time(9001) sec_to_time(9001)+0 time_to_sec("15:12:22") sec_to_time(time_to_sec("0:30:47")/6.21)
02:30:01 23001 54742 00:04:57
now()-curdate()*1000000-curtime()
0
strcmp(current_timestamp(),concat(current_date()," ",current_time()))
......
......@@ -7,7 +7,8 @@ select from_days(to_days("960101")),to_days(960201)-to_days("19960101"),to_days(
select period_add("9602",-12),period_diff(199505,"9404") ;
select now()-now(),weekday(curdate())-weekday(now()),unix_timestamp()-unix_timestamp(now());
select from_unixtime(unix_timestamp("1994-03-02 10:11:12")),from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s"),from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0;
select sec_to_time(9001),sec_to_time(9001)+0,time_to_sec("15:12:22");
select sec_to_time(9001),sec_to_time(9001)+0,time_to_sec("15:12:22"),
sec_to_time(time_to_sec("0:30:47")/6.21);
select now()-curdate()*1000000-curtime();
select strcmp(current_timestamp(),concat(current_date()," ",current_time()));
select date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w");
......
......@@ -821,10 +821,6 @@ ha_innobase::open(
DBUG_RETURN(1);
}
/* MySQL allocates the buffer for ref */
ref_length = buff_len;
/* Get pointer to a table object in InnoDB dictionary cache */
if (NULL == (ib_table = dict_table_get(norm_name, NULL))) {
......@@ -861,10 +857,20 @@ ha_innobase::open(
primary_key = 0;
key_used_on_scan = 0;
/* MySQL allocates the buffer for ref */
ref_length = table->key_info->key_length
+ table->key_info->key_parts + 10;
/* One byte per key field is consumed to the SQL NULL
info of the field; we add also 10 bytes of safety margin */
} else {
((row_prebuilt_t*)innobase_prebuilt)
->clust_index_was_generated = TRUE;
ref_length = DATA_ROW_ID_LEN + 10;
dbug_assert(key_used_on_scan == MAX_KEY);
}
......
......@@ -309,11 +309,14 @@ double Item_func_div::val()
longlong Item_func_div::val_int()
{
longlong value=args[0]->val_int();
longlong val2=args[1]->val_int();
if ((null_value= val2 == 0 || args[0]->null_value || args[1]->null_value))
return 0;
return value/val2;
// the integer result of division of two arguments needs to be computed
// as a type-cast division of val(), not as diviion of val_int() of each
// argument. For example, val_int(41.5/3.4) = val_int(12.206) = 12, but
// if you do val_int(41.5)/val_int(3.4), as in the old code, we get 42/3=
// 14, which is wrong. This would break sec_to_time(a/b),
// from_unixtime(a/b), and
// all functions that do val_int() on their arguments
return (longlong)val();
}
void Item_func_div::fix_length_and_dec()
......
......@@ -39,6 +39,8 @@
#include "errmsg.h"
#include <violite.h>
extern ulong net_read_timeout;
extern "C" { // Because of SCO 3.2V4.2
#include <sys/stat.h>
#include <signal.h>
......@@ -62,6 +64,7 @@ extern "C" { // Because of SCO 3.2V4.2
#endif
#if defined(THREAD) && !defined(__WIN__)
#include <my_pthread.h> /* because of signal() */
#include <thr_alarm.h>
#endif
#ifndef INADDR_NONE
#define INADDR_NONE -1
......@@ -479,18 +482,25 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
struct sockaddr_in sock_addr;
uint pkt_length;
NET *net= &mysql->net;
thr_alarm_t alarmed;
#if !defined(__WIN__)
ALARM alarm_buff;
#endif
#ifdef __WIN__
HANDLE hPipe=INVALID_HANDLE_VALUE;
#endif
#ifdef HAVE_SYS_UN_H
struct sockaddr_un UNIXaddr;
#endif
DBUG_ENTER("mysql_real_connect");
DBUG_ENTER("mc_mysql_connect");
DBUG_PRINT("enter",("host: %s db: %s user: %s",
host ? host : "(Null)",
db ? db : "(Null)",
user ? user : "(Null)"));
thr_alarm_init(&alarmed);
thr_alarm(&alarmed,(uint) net_read_timeout,&alarm_buff);
bzero((char*) &mysql->options,sizeof(mysql->options));
net->vio = 0; /* If something goes wrong */
......@@ -625,8 +635,12 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user,
DBUG_PRINT("error",("Got error %d on connect to '%s'",ERRNO,host));
net->last_errno= CR_CONN_HOST_ERROR;
sprintf(net->last_error ,ER(CR_CONN_HOST_ERROR), host, ERRNO);
if (thr_alarm_in_use(&alarmed))
thr_end_alarm(&alarmed);
goto error;
}
if (thr_alarm_in_use(&alarmed))
thr_end_alarm(&alarmed);
}
if (!net->vio || my_net_init(net, net->vio))
......
......@@ -487,6 +487,7 @@ static void close_connections(void)
}
#endif
end_thr_alarm(); // Don't allow alarms
end_slave();
/* First signal all threads that it's time to die */
......@@ -694,7 +695,6 @@ void clean_up(bool print_message)
x_free(opt_bin_logname);
bitmap_free(&temp_pool);
free_max_user_conn();
end_slave();
#ifndef __WIN__
if (!opt_bootstrap)
(void) my_delete(pidfile_name,MYF(0)); // This may not always exist
......
......@@ -611,7 +611,25 @@ int stop_slave(THD* thd, bool net_report )
// thd->killed for the slave thread
thd->proc_info = "waiting for slave to die";
while(slave_running)
pthread_cond_wait(&COND_slave_stopped, &LOCK_slave);
{
/* there is a small change that slave thread might miss the first
alarm. To protect againts it, resend the signal until it reacts
*/
struct timespec abstime;
#ifdef HAVE_TIMESPEC_TS_SEC
abstime.ts_sec=time(NULL)+2;
abstime.ts_nsec=0;
#else
struct timeval tv;
gettimeofday(&tv,0);
abstime.tv_sec=tv.tv_sec+2;
abstime.tv_nsec=tv.tv_usec*1000;
#endif
pthread_cond_timedwait(&COND_slave_stopped, &LOCK_slave, &abstime);
if (slave_running)
thr_alarm_kill(slave_real_id);
}
}
else
slave_errno = ER_SLAVE_NOT_RUNNING;
......
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