summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BitKeeper/etc/logging_ok1
-rw-r--r--Docs/Makefile.am2
-rwxr-xr-xDocs/Support/generate-text-files.pl9
-rw-r--r--acinclude.m428
-rw-r--r--client/get_password.c2
-rw-r--r--myisam/mi_check.c22
-rw-r--r--myisam/mi_key.c2
-rw-r--r--myisammrg/myrg_open.c9
-rw-r--r--mysql-test/r/ctype_latin1_de.result3
-rw-r--r--mysql-test/r/func_set.result2
-rw-r--r--mysql-test/r/insert_select.result5
-rw-r--r--mysql-test/r/rpl_flush_log_loop.result2
-rw-r--r--mysql-test/r/rpl_max_relay_size.result12
-rw-r--r--mysql-test/t/ctype_latin1_de.test4
-rw-r--r--mysql-test/t/insert_select.test10
-rw-r--r--mysql-test/t/rpl_flush_log_loop.test1
-rw-r--r--mysql-test/t/rpl_max_relay_size.test6
-rw-r--r--mysys/safemalloc.c6
-rw-r--r--mysys/thr_lock.c21
-rw-r--r--scripts/mysqld_safe.sh12
-rw-r--r--sql/ha_innodb.h1
-rw-r--r--sql/handler.cc7
-rw-r--r--sql/item_cmpfunc.cc7
-rw-r--r--sql/item_func.cc2
-rw-r--r--sql/item_strfunc.cc4
-rw-r--r--sql/log.cc103
-rw-r--r--sql/log_event.cc10
-rw-r--r--sql/mysqld.cc4
-rw-r--r--sql/repl_failsafe.cc2
-rw-r--r--sql/share/english/errmsg.txt2
-rw-r--r--sql/slave.cc6
-rw-r--r--sql/sql_acl.cc6
-rw-r--r--sql/sql_base.cc2
-rw-r--r--sql/sql_class.h26
-rw-r--r--sql/sql_db.cc4
-rw-r--r--sql/sql_delete.cc6
-rw-r--r--sql/sql_insert.cc8
-rw-r--r--sql/sql_load.cc8
-rw-r--r--sql/sql_parse.cc4
-rw-r--r--sql/sql_rename.cc2
-rw-r--r--sql/sql_repl.cc12
-rw-r--r--sql/sql_table.cc10
-rw-r--r--sql/sql_update.cc4
-rw-r--r--strings/ctype-latin1_de.c157
-rw-r--r--support-files/my-innodb-heavy-4G.cnf.sh570
-rw-r--r--vio/viosocket.c2
46 files changed, 591 insertions, 537 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index b70b0a7b381..e6124b4111e 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -56,6 +56,7 @@ monty@bitch.mysql.fi
monty@butch.
monty@donna.mysql.fi
monty@hundin.mysql.fi
+monty@mashka.(none)
monty@mashka.mysql.fi
monty@narttu.
monty@narttu.mysql.fi
diff --git a/Docs/Makefile.am b/Docs/Makefile.am
index f3df055a7dd..0beaa44c7eb 100644
--- a/Docs/Makefile.am
+++ b/Docs/Makefile.am
@@ -208,7 +208,7 @@ INSTALL-BINARY: mysql.info $(GT)
perl -w $(GT) mysql.info "LGPL license" "Function Index" > $@
../support-files/MacOSX/ReadMe.txt: mysql.info $(GT)
- perl -w $(GT) mysql.info "Mac OS X installation" "Netware installation" > $@
+ perl -w $(GT) mysql.info "Mac OS X installation" "NetWare installation" > $@
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/Docs/Support/generate-text-files.pl b/Docs/Support/generate-text-files.pl
index 570e579d926..6470baaa6e9 100755
--- a/Docs/Support/generate-text-files.pl
+++ b/Docs/Support/generate-text-files.pl
@@ -1,11 +1,11 @@
-#!/my/gnu/bin/perl -w -*- perl -*-
+#!/usr/bin/perl -w -*- perl -*-
# Generate text files from top directory from the manual.
$from = shift(@ARGV);
$fnode = shift(@ARGV);
$tnode = shift(@ARGV);
-open(IN, "$from") || die;
+open(IN, "$from") || die "Cannot open $from: $!";
$in = 0;
@@ -19,7 +19,7 @@ while (<IN>)
}
elsif (/^File: mysql.info/ || (/^/))
{
- # Just Skip node begginigs
+ # Just Skip node beginnings
}
else
{
@@ -38,3 +38,6 @@ while (<IN>)
}
close(IN);
+
+die "Could not find node \"$tnode\"" if ($in == 1);
+exit 0;
diff --git a/acinclude.m4 b/acinclude.m4
index abeb2024f4a..3bee4e7a874 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -126,12 +126,19 @@ AC_DEFUN(MYSQL_CHECK_ZLIB_WITH_COMPRESS, [
save_LIBS="$LIBS"
LIBS="-l$1 $LIBS"
AC_CACHE_CHECK([if libz with compress], mysql_cv_compress,
-[AC_TRY_LINK([#include <zlib.h>
+[AC_TRY_RUN([#include <zlib.h>
#ifdef __cplusplus
extern "C"
#endif
-],
-[ return compress(0, (unsigned long*) 0, "", 0);
+int main(int argv, char **argc)
+{
+ return 0;
+}
+
+int link_test()
+{
+ return compress(0, (unsigned long*) 0, "", 0);
+}
], mysql_cv_compress=yes, mysql_cv_compress=no)])
if test "$mysql_cv_compress" = "yes"
then
@@ -706,7 +713,7 @@ AC_DEFUN(MYSQL_FIND_OPENSSL, [
/usr/include/ssl /opt/ssl/include /opt/openssl/include \
/usr/local/ssl/include /usr/local/include ; do
if test -f $d/openssl/ssl.h ; then
- OPENSSL_INCLUDE=$d
+ OPENSSL_INCLUDE=-I$d
fi
done
@@ -717,6 +724,15 @@ AC_DEFUN(MYSQL_FIND_OPENSSL, [
fi
done
+ # On RedHat 9 we need kerberos to compile openssl
+ for d in /usr/kerberos/include
+ do
+ if test -f $d/krb5.h ; then
+ OPENSSL_INCLUDE="$OPENSSL_INCLUDE -I$d"
+ fi
+ done
+
+
if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INCLUDE" ; then
echo "Could not find an installation of OpenSSL"
if test -n "$OPENSSL_LIB" ; then
@@ -749,9 +765,9 @@ AC_MSG_CHECKING(for OpenSSL)
openssl_libs="-L$OPENSSL_LIB -lssl -lcrypto"
# Don't set openssl_includes to /usr/include as this gives us a lot of
# compiler warnings when using gcc 3.x
- if test "$OPENSSL_INCLUDE" != "/usr/include"
+ if test "$OPENSSL_INCLUDE" != "-I/usr/include"
then
- openssl_includes="-I$OPENSSL_INCLUDE"
+ openssl_includes="$OPENSSL_INCLUDE"
fi
AC_DEFINE(HAVE_OPENSSL)
diff --git a/client/get_password.c b/client/get_password.c
index 9928d24de32..5d78656ab0a 100644
--- a/client/get_password.c
+++ b/client/get_password.c
@@ -71,7 +71,7 @@ char *get_tty_password(char *opt_message)
char *pos=to,*end=to+sizeof(to)-1;
int i=0;
DBUG_ENTER("get_tty_password");
- fprintf(stderr,opt_message ? opt_message : "Enter password: ");
+ _cputs(opt_message ? opt_message : "Enter password: ");
for (;;)
{
char tmp;
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index 92641cce13a..6caacd95386 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -896,7 +896,8 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
if (_mi_rec_unpack(info,record,info->rec_buff,block_info.rec_len) ==
MY_FILE_ERROR)
{
- mi_check_print_error(param,"Found wrong record at %s", llstr(start_recpos,llbuff));
+ mi_check_print_error(param,"Found wrong record at %s",
+ llstr(start_recpos,llbuff));
got_error=1;
}
else
@@ -3611,6 +3612,7 @@ err:
void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
my_bool repair_only)
{
+ byte *record;
if (!info->s->base.auto_key ||
!(((ulonglong) 1 << (info->s->base.auto_key-1)
& info->s->state.key_map)))
@@ -3624,13 +3626,24 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
if (!(param->testflag & T_SILENT) &&
!(param->testflag & T_REP))
printf("Updating MyISAM file: %s\n", param->isam_file_name);
- /* We have to use keyread here as a normal read uses info->rec_buff */
+ /*
+ We have to use an allocated buffer instead of info->rec_buff as
+ _mi_put_key_in_record() may use info->rec_buff
+ */
+ if (!(record= (byte*) my_malloc((uint) info->s->base.pack_reclength,
+ MYF(0))))
+ {
+ mi_check_print_error(param,"Not enough memory for extra record");
+ return;
+ }
+
mi_extra(info,HA_EXTRA_KEYREAD,0);
- if (mi_rlast(info,info->rec_buff, info->s->base.auto_key-1))
+ if (mi_rlast(info, record, info->s->base.auto_key-1))
{
if (my_errno != HA_ERR_END_OF_FILE)
{
mi_extra(info,HA_EXTRA_NO_KEYREAD,0);
+ my_free((char*) record, MYF(0));
mi_check_print_error(param,"%d when reading last record",my_errno);
return;
}
@@ -3642,10 +3655,11 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
ulonglong auto_increment= (repair_only ? info->s->state.auto_increment :
param->auto_increment_value);
info->s->state.auto_increment=0;
- update_auto_increment(info,info->rec_buff);
+ update_auto_increment(info, record);
set_if_bigger(info->s->state.auto_increment,auto_increment);
}
mi_extra(info,HA_EXTRA_NO_KEYREAD,0);
+ my_free((char*) record, MYF(0));
update_state_info(param, info, UPDATE_AUTO_INC);
return;
}
diff --git a/myisam/mi_key.c b/myisam/mi_key.c
index 5b167cc9ab0..89f6bc490fa 100644
--- a/myisam/mi_key.c
+++ b/myisam/mi_key.c
@@ -264,7 +264,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
byte *blob_ptr;
DBUG_ENTER("_mi_put_key_in_record");
- if (info->blobs && info->s->keyinfo[keynr].flag & HA_VAR_LENGTH_KEY)
+ if (info->s->base.blobs && info->s->keyinfo[keynr].flag & HA_VAR_LENGTH_KEY)
{
if (!(blob_ptr=
mi_alloc_rec_buff(info, info->s->keyinfo[keynr].keylength,
diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c
index 7ff00270c68..5188669cad1 100644
--- a/myisammrg/myrg_open.c
+++ b/myisammrg/myrg_open.c
@@ -33,7 +33,7 @@
MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
{
int save_errno,i,errpos;
- uint files,dir_length,length,options, key_parts;
+ uint files,dir_length,length,key_parts;
ulonglong file_offset;
char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end;
MYRG_INFO info,*m_info;
@@ -110,13 +110,11 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
}
errpos=2;
- options= (uint) ~0;
for (i=files ; i-- > 0 ; )
{
uint j;
m_info->open_tables[i].table=isam;
m_info->options|=isam->s->options;
- options&=isam->s->options;
m_info->records+=isam->state->records;
m_info->del+=isam->state->del;
m_info->data_file_length+=isam->state->data_file_length;
@@ -125,9 +123,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
if (i)
isam=(MI_INFO*) (isam->open_list.next->data);
}
- /* Don't force readonly if not all tables are readonly */
- if (! (options & (HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA)))
- m_info->options&= ~(HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA);
+ /* Don't mark table readonly, for ALTER TABLE ... UNION=(...) to work */
+ m_info->options&= ~(HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA);
/* Fix fileinfo for easyer debugging (actually set by rrnd) */
file_offset=0;
diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result
index 630fef9b679..28394d9533a 100644
--- a/mysql-test/r/ctype_latin1_de.result
+++ b/mysql-test/r/ctype_latin1_de.result
@@ -196,6 +196,9 @@ strcmp('ßa','ss') strcmp('ssa','ß') strcmp('sssb','sßa') strcmp('ß','s')
select strcmp('u','öa'),strcmp('u','ö');
strcmp('u','öa') strcmp('u','ö')
1 1
+select strcmp('sä', 'ßa'), strcmp('aä', 'äx');
+strcmp('sä', 'ßa') strcmp('aä', 'äx')
+-1 -1
create table t1 (a varchar(10), key(a), fulltext (a));
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
select * from t1 where a like "abc%";
diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result
index dfd7750adaf..eeeb216d142 100644
--- a/mysql-test/r/func_set.result
+++ b/mysql-test/r/func_set.result
@@ -27,4 +27,4 @@ find_in_set("abc","abc") find_in_set("ab","abc") find_in_set("abcd","abc")
1 0 0
select interval(null, 1, 10, 100);
interval(null, 1, 10, 100)
-NULL
+-1
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index c007191b562..0142ef68993 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -587,3 +587,8 @@ a b
3 t2:3
2 t2:2
drop table t1,t2;
+CREATE TABLE t1 ( USID INTEGER UNSIGNED, ServerID TINYINT UNSIGNED, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User CHAR(32) NOT NULL DEFAULT '<UNKNOWN>', NASAddr INTEGER UNSIGNED, NASPort INTEGER UNSIGNED, NASPortType INTEGER UNSIGNED, ConnectSpeed INTEGER UNSIGNED, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER UNSIGNED, SessionTime INTEGER UNSIGNED, PacketsIn INTEGER UNSIGNED, OctetsIn INTEGER UNSIGNED, PacketsOut INTEGER UNSIGNED, OctetsOut INTEGER UNSIGNED, TerminateCause INTEGER UNSIGNED, UnauthTime TINYINT UNSIGNED, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL);
+CREATE TABLE t2 ( USID INTEGER UNSIGNED AUTO_INCREMENT, ServerID TINYINT UNSIGNED, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User TEXT NOT NULL, NASAddr INTEGER UNSIGNED, NASPort INTEGER UNSIGNED, NASPortType INTEGER UNSIGNED, ConnectSpeed INTEGER UNSIGNED, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER UNSIGNED, SessionTime INTEGER UNSIGNED, PacketsIn INTEGER UNSIGNED, OctetsIn INTEGER UNSIGNED, PacketsOut INTEGER UNSIGNED, OctetsOut INTEGER UNSIGNED, TerminateCause INTEGER UNSIGNED, UnauthTime TINYINT UNSIGNED, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL, INDEX(USID,ServerID,NASAddr,SessionID), INDEX(AssignedAddr));
+INSERT INTO t1 VALUES (39,42,'Access-Granted','46','491721000045',2130706433,17690,NULL,NULL,'Localnet','491721000045','49172200000',754974766,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2003-07-18 00:11:21',NULL,NULL,20030718001121);
+INSERT INTO t2 SELECT USID, ServerID, State, SessionID, User, NASAddr, NASPort, NASPortType, ConnectSpeed, CarrierType, CallingStationID, CalledStationID, AssignedAddr, SessionTime, PacketsIn, OctetsIn, PacketsOut, OctetsOut, TerminateCause, UnauthTime, AccessRequestTime, AcctStartTime, AcctLastTime, LastModification from t1 LIMIT 1;
+drop table t1,t2;
diff --git a/mysql-test/r/rpl_flush_log_loop.result b/mysql-test/r/rpl_flush_log_loop.result
index 3273ce43a17..18786b1931b 100644
--- a/mysql-test/r/rpl_flush_log_loop.result
+++ b/mysql-test/r/rpl_flush_log_loop.result
@@ -14,4 +14,4 @@ slave start;
flush logs;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root SLAVE_PORT 60 slave-bin.001 79 relay-log.002 119 slave-bin.001 Yes Yes 0 0 79 119
+127.0.0.1 root SLAVE_PORT 60 slave-bin.001 79 relay-log.002 4 slave-bin.001 Yes Yes 0 0 79 4
diff --git a/mysql-test/r/rpl_max_relay_size.result b/mysql-test/r/rpl_max_relay_size.result
index 5c5a9d622e5..1fa3fcd1adb 100644
--- a/mysql-test/r/rpl_max_relay_size.result
+++ b/mysql-test/r/rpl_max_relay_size.result
@@ -16,7 +16,7 @@ select @@global.max_relay_log_size;
start slave;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root 9306 1 master-bin.001 50477 slave-relay-bin.014 1221 master-bin.001 Yes Yes 0 0 50477 1221
+127.0.0.1 root MASTER_PORT 1 master-bin.001 50477 slave-relay-bin.014 1221 master-bin.001 Yes Yes 0 0 50477 1221
stop slave;
reset slave;
set global max_relay_log_size=(5*4096);
@@ -26,7 +26,7 @@ select @@global.max_relay_log_size;
start slave;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root 9306 1 master-bin.001 50477 slave-relay-bin.004 9457 master-bin.001 Yes Yes 0 0 50477 9457
+127.0.0.1 root MASTER_PORT 1 master-bin.001 50477 slave-relay-bin.004 9457 master-bin.001 Yes Yes 0 0 50477 9457
stop slave;
reset slave;
set global max_relay_log_size=0;
@@ -36,25 +36,25 @@ select @@global.max_relay_log_size;
start slave;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root 9306 1 master-bin.001 50477 slave-relay-bin.008 1283 master-bin.001 Yes Yes 0 0 50477 1283
+127.0.0.1 root MASTER_PORT 1 master-bin.001 50477 slave-relay-bin.008 1283 master-bin.001 Yes Yes 0 0 50477 1283
stop slave;
reset slave;
flush logs;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root 9306 1 4 slave-relay-bin.001 4 No No 0 0 0 4
+127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.001 4 No No 0 0 0 4
reset slave;
start slave;
flush logs;
create table t1 (a int);
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root 9306 1 master-bin.001 50535 slave-relay-bin.009 62 master-bin.001 Yes Yes 0 0 50535 62
+127.0.0.1 root MASTER_PORT 1 master-bin.001 50535 slave-relay-bin.009 62 master-bin.001 Yes Yes 0 0 50535 62
flush logs;
drop table t1;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root 9306 1 master-bin.001 50583 slave-relay-bin.010 52 master-bin.001 Yes Yes 0 0 50583 52
+127.0.0.1 root MASTER_PORT 1 master-bin.001 50583 slave-relay-bin.010 52 master-bin.001 Yes Yes 0 0 50583 52
flush logs;
show master status;
File Position Binlog_do_db Binlog_ignore_db
diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test
index 6353650f420..3a0f2658969 100644
--- a/mysql-test/t/ctype_latin1_de.test
+++ b/mysql-test/t/ctype_latin1_de.test
@@ -35,6 +35,10 @@ select strcmp('ßa','ss'),strcmp('ssa','ß'),strcmp('sssb','sßa'),strcmp('ß','s');
select strcmp('u','öa'),strcmp('u','ö');
#
+# overlapping combo's
+#
+select strcmp('sä', 'ßa'), strcmp('aä', 'äx');
+#
# Some other simple tests with the current character set
#
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index d115e9c1af6..5c63f3b3bb7 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -122,3 +122,13 @@ select * from t1;
replace into t1 select * from t2;
select * from t1;
drop table t1,t2;
+
+#
+# Test that caused uninitialized memory access in auto_increment_key update
+#
+
+CREATE TABLE t1 ( USID INTEGER UNSIGNED, ServerID TINYINT UNSIGNED, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User CHAR(32) NOT NULL DEFAULT '<UNKNOWN>', NASAddr INTEGER UNSIGNED, NASPort INTEGER UNSIGNED, NASPortType INTEGER UNSIGNED, ConnectSpeed INTEGER UNSIGNED, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER UNSIGNED, SessionTime INTEGER UNSIGNED, PacketsIn INTEGER UNSIGNED, OctetsIn INTEGER UNSIGNED, PacketsOut INTEGER UNSIGNED, OctetsOut INTEGER UNSIGNED, TerminateCause INTEGER UNSIGNED, UnauthTime TINYINT UNSIGNED, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL);
+CREATE TABLE t2 ( USID INTEGER UNSIGNED AUTO_INCREMENT, ServerID TINYINT UNSIGNED, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User TEXT NOT NULL, NASAddr INTEGER UNSIGNED, NASPort INTEGER UNSIGNED, NASPortType INTEGER UNSIGNED, ConnectSpeed INTEGER UNSIGNED, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER UNSIGNED, SessionTime INTEGER UNSIGNED, PacketsIn INTEGER UNSIGNED, OctetsIn INTEGER UNSIGNED, PacketsOut INTEGER UNSIGNED, OctetsOut INTEGER UNSIGNED, TerminateCause INTEGER UNSIGNED, UnauthTime TINYINT UNSIGNED, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL, INDEX(USID,ServerID,NASAddr,SessionID), INDEX(AssignedAddr));
+INSERT INTO t1 VALUES (39,42,'Access-Granted','46','491721000045',2130706433,17690,NULL,NULL,'Localnet','491721000045','49172200000',754974766,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2003-07-18 00:11:21',NULL,NULL,20030718001121);
+INSERT INTO t2 SELECT USID, ServerID, State, SessionID, User, NASAddr, NASPort, NASPortType, ConnectSpeed, CarrierType, CallingStationID, CalledStationID, AssignedAddr, SessionTime, PacketsIn, OctetsIn, PacketsOut, OctetsOut, TerminateCause, UnauthTime, AccessRequestTime, AcctStartTime, AcctLastTime, LastModification from t1 LIMIT 1;
+drop table t1,t2;
diff --git a/mysql-test/t/rpl_flush_log_loop.test b/mysql-test/t/rpl_flush_log_loop.test
index c68fbb7111a..8a3da1a2b02 100644
--- a/mysql-test/t/rpl_flush_log_loop.test
+++ b/mysql-test/t/rpl_flush_log_loop.test
@@ -14,6 +14,7 @@ slave stop;
eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$SLAVE_MYPORT;
slave start;
+sleep 5;
flush logs;
sleep 5;
--replace_result $SLAVE_MYPORT SLAVE_PORT
diff --git a/mysql-test/t/rpl_max_relay_size.test b/mysql-test/t/rpl_max_relay_size.test
index 4befe4024fc..a2167b1ef36 100644
--- a/mysql-test/t/rpl_max_relay_size.test
+++ b/mysql-test/t/rpl_max_relay_size.test
@@ -28,6 +28,7 @@ set global max_relay_log_size=8192-1; # mapped to 4096
select @@global.max_relay_log_size;
start slave;
sync_with_master;
+--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
show slave status;
stop slave;
reset slave;
@@ -35,6 +36,7 @@ set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
start slave;
sync_with_master;
+--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
show slave status;
stop slave;
reset slave;
@@ -42,6 +44,7 @@ set global max_relay_log_size=0;
select @@global.max_relay_log_size;
start slave;
sync_with_master;
+--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
show slave status;
# Tests below are mainly to ensure that we have not coded with wrong assumptions
@@ -51,6 +54,7 @@ reset slave;
# test of relay log rotation when the slave is stopped
# (to make sure it does not crash).
flush logs;
+--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
show slave status;
reset slave;
@@ -65,6 +69,7 @@ create table t1 (a int);
save_master_pos;
connection slave;
sync_with_master;
+--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
show slave status;
# one more rotation, to be sure Relay_log_space is correctly updated
flush logs;
@@ -73,6 +78,7 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
+--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT 3334 MASTER_PORT
show slave status;
connection master;
diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c
index bd77b4821ff..07c40fd91b6 100644
--- a/mysys/safemalloc.c
+++ b/mysys/safemalloc.c
@@ -374,11 +374,11 @@ void TERMINATE(FILE *file)
{
if (file)
{
- fprintf(file, "Warning: Not freed memory segments: %d\n",
+ fprintf(file, "Warning: Not freed memory segments: %u\n",
sf_malloc_count);
(void) fflush(file);
}
- DBUG_PRINT("safe",("sf_malloc_count: %d", sf_malloc_count));
+ DBUG_PRINT("safe",("sf_malloc_count: %u", sf_malloc_count));
}
/*
@@ -482,7 +482,7 @@ int _sanity(const char *filename, uint lineno)
pthread_mutex_lock(&THR_LOCK_malloc);
#ifndef PEDANTIC_SAFEMALLOC
- if (sf_malloc_tampered && sf_malloc_count < 0)
+ if (sf_malloc_tampered && (int) sf_malloc_count < 0)
sf_malloc_count=0;
#endif
count=sf_malloc_count;
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 61616a4cf2b..d5236cb1ef9 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -172,10 +172,13 @@ static int check_lock(struct st_lock_list *list, const char* lock_type,
return 0;
}
+
static void check_locks(THR_LOCK *lock, const char *where,
my_bool allow_no_locks)
{
uint old_found_errors=found_errors;
+ DBUG_ENTER("check_locks");
+
if (found_errors < MAX_FOUND_ERRORS)
{
if (check_lock(&lock->write,"write",where,1,1) |
@@ -252,18 +255,21 @@ static void check_locks(THR_LOCK *lock, const char *where,
}
if (lock->read.data)
{
- if ((!pthread_equal(lock->write.data->thread,
- lock->read.data->thread) &&
- lock->write.data->type > TL_WRITE_DELAYED &&
- lock->write.data->type != TL_WRITE_ONLY) ||
- ((lock->write.data->type == TL_WRITE_CONCURRENT_INSERT ||
- lock->write.data->type == TL_WRITE_ALLOW_WRITE) &&
- lock->read_no_write_count))
+ if (!pthread_equal(lock->write.data->thread,
+ lock->read.data->thread) &&
+ ((lock->write.data->type > TL_WRITE_DELAYED &&
+ lock->write.data->type != TL_WRITE_ONLY) ||
+ ((lock->write.data->type == TL_WRITE_CONCURRENT_INSERT ||
+ lock->write.data->type == TL_WRITE_ALLOW_WRITE) &&
+ lock->read_no_write_count)))
{
found_errors++;
fprintf(stderr,
"Warning at '%s': Found lock of type %d that is write and read locked\n",
where, lock->write.data->type);
+ DBUG_PRINT("warning",("At '%s': Found lock of type %d that is write and read locked\n",
+ where, lock->write.data->type));
+
}
}
if (lock->read_wait.data)
@@ -286,6 +292,7 @@ static void check_locks(THR_LOCK *lock, const char *where,
DBUG_PRINT("error",("Found wrong lock"));
}
}
+ DBUG_VOID_RETURN;
}
#else /* EXTRA_DEBUG */
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index fcd8e26c901..d7e3eedb84e 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -274,12 +274,16 @@ then
fi
#
-# Uncomment the following lines if you want all tables to be automaticly
-# checked and repaired at start
+# Uncomment the following lines if you want all tables to be automatically
+# checked and repaired during startup. You should add sensible key_buffer
+# and sort_buffer values to my.cnf to improve check performance or require
+# less disk space.
+# Alternatively, you can start mysqld with the "myisam-recover" option. See
+# the manual for details.
#
# echo "Checking tables in $DATADIR"
-# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check -O key_buffer=64M -O sort_buffer=64M $DATADIR/*/*.MYI
-# $MY_BASEDIR_VERSION/bin/isamchk --silent --force -O sort_buffer=64M $DATADIR/*/*.ISM
+# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI
+# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM
echo "Starting $MYSQLD daemon with databases from $DATADIR"
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index 86f409aff67..8a51019b18e 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -32,7 +32,6 @@ typedef struct st_innobase_share {
uint table_name_length,use_count;
} INNOBASE_SHARE;
-
/* The class defining a handle to an Innodb table */
class ha_innobase: public handler
{
diff --git a/sql/handler.cc b/sql/handler.cc
index 0c95dbc4b31..505f64dff43 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -346,7 +346,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
bool transaction_commited= 0;
/* Update the binary log if we have cached some queries */
- if (trans == &thd->transaction.all && mysql_bin_log.is_open(1) &&
+ if (trans == &thd->transaction.all && mysql_bin_log.is_open() &&
my_b_tell(&thd->transaction.trans_log))
{
mysql_bin_log.write(thd, &thd->transaction.trans_log);
@@ -385,7 +385,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
if (transaction_commited && thd->transaction.changed_tables)
query_cache.invalidate(thd->transaction.changed_tables);
#endif /*HAVE_QUERY_CACHE*/
- if (error && trans == &thd->transaction.all && mysql_bin_log.is_open(1))
+ if (error && trans == &thd->transaction.all && mysql_bin_log.is_open())
sql_print_error("Error: Got error during commit; Binlog is not up to date!");
thd->variables.tx_isolation=thd->session_tx_isolation;
if (operation_done)
@@ -801,6 +801,9 @@ void handler::print_error(int error, myf errflag)
int textno=ER_GET_ERRNO;
switch (error) {
+ case EACCES:
+ textno=ER_OPEN_AS_READONLY;
+ break;
case EAGAIN:
textno=ER_FILE_USED;
break;
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 731f9b61438..8c58c58a67d 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -311,7 +311,7 @@ void Item_func_interval::split_sum_func(List<Item> &fields)
}
/*
- return NULL if null value,
+ return -1 if null value,
0 if lower than lowest
1 - arg_count if between args[n] and args[n+1]
arg_count+1 if higher than biggest argument
@@ -321,10 +321,7 @@ longlong Item_func_interval::val_int()
{
double value= item->val();
if (item->null_value)
- {
- null_value= 1;
- return -1;
- }
+ return -1; // -1 if NULL
if (intervals)
{ // Use binary search to find interval
uint start= 0, end= arg_count - 1;
diff --git a/sql/item_func.cc b/sql/item_func.cc
index f7b47736f33..8e9677cc459 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1504,7 +1504,7 @@ void item_user_lock_free(void)
void item_user_lock_release(ULL *ull)
{
ull->locked=0;
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
char buf[256];
String tmp(buf,sizeof(buf));
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 801b77ffcce..8cc3d24f7d9 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1471,6 +1471,10 @@ String *Item_func_format::val_str(String *str)
return 0; /* purecov: inspected */
dec= decimals ? decimals+1 : 0;
str->set(nr,decimals);
+#ifdef HAVE_ISNAN
+ if (isnan(nr))
+ return str;
+#endif
str_length=str->length();
if (nr < 0)
str_length--; // Don't count sign
diff --git a/sql/log.cc b/sql/log.cc
index 96e1f1a2e01..17715620950 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -82,14 +82,14 @@ static int find_uniq_filename(char *name)
MYSQL_LOG::MYSQL_LOG()
:bytes_written(0), last_time(0), query_start(0), name(0),
- file_id(1), open_count(1), log_type(LOG_CLOSED), write_error(0),
+ file_id(1), open_count(1), log_type(LOG_CLOSED), write_error(0), inited(0),
need_start_event(1)
{
/*
We don't want to initialize LOCK_Log here as such initialization depends on
safe_mutex (when using safe_mutex) which depends on MY_INIT(), which is
- called only in main(). Doing initialization here would make it happen before
- main().
+ called only in main(). Doing initialization here would make it happen
+ before main().
*/
index_file_name[0] = 0;
bzero((char*) &log_file,sizeof(log_file));
@@ -102,36 +102,21 @@ MYSQL_LOG::~MYSQL_LOG()
cleanup();
}
-void MYSQL_LOG::cleanup() /* this is called only once */
-{
- close(1);
- (void) pthread_mutex_destroy(&LOCK_log);
- (void) pthread_mutex_destroy(&LOCK_index);
- (void) pthread_cond_destroy(&update_cond);
-}
+/* this is called only once */
-bool MYSQL_LOG::is_open(bool need_mutex)
+void MYSQL_LOG::cleanup()
{
- /*
- Since MySQL 4.0.14, LOCK_log is always inited:
- * for log/update_log/slow_log/bin_log which are global objects, this is done in
- main(), even if the server does not use these logs.
- * for relay_log which belongs to rli which belongs to active_mi, this is
- done in the constructor of rli.
- In older versions, we were never 100% sure that LOCK_log was inited, which
- was a problem.
- */
- if (need_mutex)
+ if (inited)
{
- pthread_mutex_lock(&LOCK_log);
- bool res= (log_type != LOG_CLOSED);
- pthread_mutex_unlock(&LOCK_log);
- return res;
+ inited= 0;
+ close(LOG_CLOSE_INDEX);
+ (void) pthread_mutex_destroy(&LOCK_log);
+ (void) pthread_mutex_destroy(&LOCK_index);
+ (void) pthread_cond_destroy(&update_cond);
}
- else
- return (log_type != LOG_CLOSED);
}
+
int MYSQL_LOG::generate_new_name(char *new_name, const char *log_name)
{
fn_format(new_name,log_name,mysql_data_home,"",4);
@@ -164,13 +149,17 @@ void MYSQL_LOG::init(enum_log_type log_type_arg,
DBUG_VOID_RETURN;
}
+
void MYSQL_LOG::init_pthread_objects()
{
+ DBUG_ASSERT(inited == 0);
+ inited= 1;
(void) pthread_mutex_init(&LOCK_log,MY_MUTEX_INIT_SLOW);
(void) pthread_mutex_init(&LOCK_index, MY_MUTEX_INIT_SLOW);
(void) pthread_cond_init(&update_cond, 0);
}
+
/*
Open a (new) log file.
@@ -326,6 +315,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
break;
}
case LOG_CLOSED: // Impossible
+ case LOG_TO_BE_OPENED:
DBUG_ASSERT(1);
break;
}
@@ -343,7 +333,7 @@ shutdown the MySQL server and restart it.", log_name, errno);
end_io_cache(&log_file);
end_io_cache(&index_file);
safeFree(name);
- log_type=LOG_CLOSED;
+ log_type= LOG_CLOSED;
DBUG_RETURN(1);
}
@@ -576,7 +566,7 @@ bool MYSQL_LOG::reset_logs(THD* thd)
save_name=name;
name=0; // Protect against free
save_log_type=log_type;
- close(0); // Don't close the index file
+ close(LOG_CLOSE_TO_BE_OPENED);
/* First delete all old log files */
@@ -594,7 +584,7 @@ bool MYSQL_LOG::reset_logs(THD* thd)
}
/* Start logging with a new file */
- close(1); // Close index file
+ close(LOG_CLOSE_INDEX);
my_delete(index_file_name, MYF(MY_WME)); // Reset (open will update)
if (!thd->slave_thread)
need_start_event=1;
@@ -647,7 +637,7 @@ int MYSQL_LOG::purge_first_log(struct st_relay_log_info* rli)
Assume that we have previously read the first log and
stored it in rli->relay_log_name
*/
- DBUG_ASSERT(is_open(1));
+ DBUG_ASSERT(is_open());
DBUG_ASSERT(rli->slave_running == 1);
DBUG_ASSERT(!strcmp(rli->linfo.log_file_name,rli->relay_log_name));
DBUG_ASSERT(rli->linfo.index_file_offset ==
@@ -818,7 +808,7 @@ void MYSQL_LOG::new_file(bool need_lock)
enum_log_type save_log_type;
DBUG_ENTER("MYSQL_LOG::new_file");
- if (!is_open(need_lock))
+ if (!is_open())
{
DBUG_PRINT("info",("log is closed"));
DBUG_VOID_RETURN;
@@ -832,7 +822,7 @@ void MYSQL_LOG::new_file(bool need_lock)
safe_mutex_assert_owner(&LOCK_log);
safe_mutex_assert_owner(&LOCK_index);
- // Reuse old name if not binlog and not update log
+ /* Reuse old name if not binlog and not update log */
new_name_ptr= name;
/*
@@ -876,7 +866,7 @@ void MYSQL_LOG::new_file(bool need_lock)
old_name=name;
save_log_type=log_type;
name=0; // Don't free name
- close();
+ close(LOG_CLOSE_TO_BE_OPENED);
/*
Note that at this point, log_type == LOG_CLOSED (important for is_open()).
@@ -971,11 +961,12 @@ err:
bool MYSQL_LOG::write(THD *thd,enum enum_server_command command,
const char *format,...)
{
- if (what_to_log & (1L << (uint) command))
+ if (is_open() && (what_to_log & (1L << (uint) command)))
{
int error=0;
VOID(pthread_mutex_lock(&LOCK_log));
+ /* Test if someone closed between the is_open test and lock */
if (is_open())
{
time_t skr;
@@ -1076,16 +1067,14 @@ bool MYSQL_LOG::write(Log_event* event_info)
#else
IO_CACHE *file = &log_file;
#endif
+ /*
+ In the future we need to add to the following if tests like
+ "do the involved tables match (to be implemented)
+ binlog_[wild_]{do|ignore}_table?" (WL#1049)"
+ */
if ((thd && !(thd->options & OPTION_BIN_LOG) &&
(thd->master_access & SUPER_ACL)) ||
- (local_db && !db_ok(local_db, binlog_do_db, binlog_ignore_db))
- /*
- This is the place for future tests like "do the involved tables match
- (to be implemented) binlog_[wild_]{do|ignore}_table?" (WL#1049):
- we will add a
- && ... to the if().
- */
- )
+ (local_db && !db_ok(local_db, binlog_do_db, binlog_ignore_db)))
{
VOID(pthread_mutex_unlock(&LOCK_log));
DBUG_PRINT("error",("!db_ok"));
@@ -1390,6 +1379,8 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
{
bool error=0;
time_t current_time;
+ if (!is_open())
+ return 0;
VOID(pthread_mutex_lock(&LOCK_log));
if (is_open())
{ // Safety agains reopen
@@ -1503,6 +1494,7 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
return error;
}
+
/*
Wait until we get a signal that the binary log has been updated
@@ -1537,24 +1529,25 @@ void MYSQL_LOG:: wait_for_update(THD* thd)
SYNOPSIS
close()
- exiting Set to 1 if we should also close the index file
- This can be set to 0 if we are going to do call open
- at once after close, in which case we don't want to
- close the index file.
- We only write a 'stop' event to the log if exiting is set
+ exiting Bitmask for one or more of the following bits:
+ LOG_CLOSE_INDEX if we should close the index file
+ LOG_CLOSE_TO_BE_OPENED if we intend to call open
+ at once after close.
+ LOG_CLOSE_STOP_EVENT write a 'stop' event to the log
NOTES
One can do an open on the object at once after doing a close.
The internal structures are not freed until cleanup() is called
*/
-void MYSQL_LOG::close(bool exiting)
+void MYSQL_LOG::close(uint exiting)
{ // One can't set log_type here!
DBUG_ENTER("MYSQL_LOG::close");
DBUG_PRINT("enter",("exiting: %d", (int) exiting));
- if (is_open())
+ if (log_type != LOG_CLOSED && log_type != LOG_TO_BE_OPENED)
{
- if (log_type == LOG_BIN && !no_auto_events && exiting)
+ if (log_type == LOG_BIN && !no_auto_events &&
+ (exiting & LOG_CLOSE_STOP_EVENT))
{
Stop_log_event s;
s.set_log_pos(this);
@@ -1574,7 +1567,7 @@ void MYSQL_LOG::close(bool exiting)
called a not complete close earlier and the index file is still open.
*/
- if (exiting && my_b_inited(&index_file))
+ if ((exiting & LOG_CLOSE_INDEX) && my_b_inited(&index_file))
{
end_io_cache(&index_file);
if (my_close(index_file.file, MYF(0)) < 0 && ! write_error)
@@ -1583,11 +1576,12 @@ void MYSQL_LOG::close(bool exiting)
sql_print_error(ER(ER_ERROR_ON_WRITE), index_file_name, errno);
}
}
- log_type= LOG_CLOSED;
+ log_type= (exiting & LOG_CLOSE_TO_BE_OPENED) ? LOG_TO_BE_OPENED : LOG_CLOSED;
safeFree(name);
DBUG_VOID_RETURN;
}
+
void MYSQL_LOG::set_max_size(ulong max_size_arg)
{
/*
@@ -1605,6 +1599,7 @@ void MYSQL_LOG::set_max_size(ulong max_size_arg)
DBUG_VOID_RETURN;
}
+
/*
Check if a string is a valid number
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 5a0a243c57b..a6d2abbf894 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2167,7 +2167,7 @@ int Rand_log_event::exec_event(struct st_relay_log_info* rli)
int Slave_log_event::exec_event(struct st_relay_log_info* rli)
{
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
mysql_bin_log.write(this);
return Log_event::exec_event(rli);
}
@@ -2217,7 +2217,7 @@ int Create_file_log_event::exec_event(struct st_relay_log_info* rli)
slave_print_error(rli,my_errno, "Write to '%s' failed", fname_buf);
goto err;
}
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
mysql_bin_log.write(this);
error=0; // Everything is ok
@@ -2237,7 +2237,7 @@ int Delete_file_log_event::exec_event(struct st_relay_log_info* rli)
(void) my_delete(fname, MYF(MY_WME));
memcpy(p, ".info", 6);
(void) my_delete(fname, MYF(MY_WME));
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
mysql_bin_log.write(this);
return Log_event::exec_event(rli);
}
@@ -2260,7 +2260,7 @@ int Append_block_log_event::exec_event(struct st_relay_log_info* rli)
slave_print_error(rli,my_errno, "Write to '%s' failed", fname);
goto err;
}
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
mysql_bin_log.write(this);
error=0;
@@ -2319,7 +2319,7 @@ int Execute_load_log_event::exec_event(struct st_relay_log_info* rli)
(void) my_delete(fname, MYF(MY_WME));
memcpy(p, ".data", 6);
(void) my_delete(fname, MYF(MY_WME));
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
mysql_bin_log.write(this);
error = 0;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 88ae612950e..9b8d12e845d 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4210,8 +4210,8 @@ static void usage(void)
puts("\
Copyright (C) 2000 MySQL AB, by Monty and others\n\
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
-and you are welcome to modify and redistribute it under the GPL license\n\
-Starts the MySQL server\n");
+and you are welcome to modify and redistribute it under the GPL license\n\n\
+Starts the MySQL database server\n");
printf("Usage: %s [OPTIONS]\n", my_progname);
#ifdef __WIN__
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 6f404d4b958..1552b3994e9 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -265,7 +265,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg)
LINT_INIT(cmp_res);
DBUG_ENTER("translate_master");
- if (!mysql_bin_log.is_open(1))
+ if (!mysql_bin_log.is_open())
{
strmov(errmsg,"Binary log is not open");
DBUG_RETURN(1);
diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt
index 3d7ca3b28df..0ce90ac0dab 100644
--- a/sql/share/english/errmsg.txt
+++ b/sql/share/english/errmsg.txt
@@ -119,7 +119,7 @@
"Unknown character set: '%-.64s'",
"Too many tables. MySQL can only use %d tables in a join",
"Too many columns",
-"Too big row size. The maximum row size, not counting BLOBs, is %d. You have to change some fields to BLOBs",
+"Too big row size. The maximum row size, not counting BLOBs, is %d (can be lower for some table types). You have to change some fields to BLOBs",
"Thread stack overrun: Used: %ld of a %ld stack. Use 'mysqld -O thread_stack=#' to specify a bigger stack if needed",
"Cross dependency found in OUTER JOIN. Examine your ON conditions",
"Column '%-.64s' is used with UNIQUE or INDEX but is not defined as NOT NULL",
diff --git a/sql/slave.cc b/sql/slave.cc
index 557e288539b..6ace446a341 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1314,7 +1314,7 @@ file '%s')", fname);
if (info_fd >= 0)
my_close(info_fd, MYF(0));
rli->info_fd= -1;
- rli->relay_log.close(1);
+ rli->relay_log.close(LOG_CLOSE_INDEX | LOG_CLOSE_STOP_EVENT);
pthread_mutex_unlock(&rli->data_lock);
DBUG_RETURN(1);
}
@@ -1374,7 +1374,7 @@ err:
if (info_fd >= 0)
my_close(info_fd, MYF(0));
rli->info_fd= -1;
- rli->relay_log.close(1);
+ rli->relay_log.close(LOG_CLOSE_INDEX | LOG_CLOSE_STOP_EVENT);
pthread_mutex_unlock(&rli->data_lock);
DBUG_RETURN(1);
}
@@ -2989,7 +2989,7 @@ void end_relay_log_info(RELAY_LOG_INFO* rli)
rli->cur_log_fd = -1;
}
rli->inited = 0;
- rli->relay_log.close(1);
+ rli->relay_log.close(LOG_CLOSE_INDEX | LOG_CLOSE_STOP_EVENT);
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 697b5d8ffd6..d773aa5bc71 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1136,7 +1136,11 @@ find_acl_user(const char *host, const char *user)
{
ACL_USER *acl_user=dynamic_element(&acl_users,i,ACL_USER*);
DBUG_PRINT("info",("strcmp('%s','%s'), compare_hostname('%s','%s'),",
- user,acl_user->user,(host),(acl_user->host)));
+ user,
+ acl_user->user ? acl_user->user : "",
+ host,
+ acl_user->host.hostname ? acl_user->host.hostname :
+ ""));
if (!acl_user->user && !user[0] ||
acl_user->user && !strcmp(user,acl_user->user))
{
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 217597ccda5..43718e5d93b 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -574,7 +574,7 @@ void close_temporary_tables(THD *thd)
next=table->next;
close_temporary(table);
}
- if (query && found_user_tables && mysql_bin_log.is_open(1))
+ if (query && found_user_tables && mysql_bin_log.is_open())
{
/* The -1 is to remove last ',' */
Query_log_event qinfo(thd, query, (ulong)(end-query)-1, 0);
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 24bbf9a6796..dcc839e13b1 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -30,11 +30,11 @@ class Slave_log_event;
enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE };
enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY };
enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_IGNORE };
-enum enum_log_type { LOG_CLOSED, LOG_NORMAL, LOG_NEW, LOG_BIN };
+enum enum_log_type { LOG_CLOSED, LOG_TO_BE_OPENED, LOG_NORMAL, LOG_NEW, LOG_BIN};
enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
DELAY_KEY_WRITE_ALL };
-// log info errors
+/* log info errors */
#define LOG_INFO_EOF -1
#define LOG_INFO_IO -2
#define LOG_INFO_INVALID -3
@@ -43,6 +43,11 @@ enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
#define LOG_INFO_FATAL -7
#define LOG_INFO_IN_USE -8
+/* bitmap to SQL_LOG::close() */
+#define LOG_CLOSE_INDEX 1
+#define LOG_CLOSE_TO_BE_OPENED 2
+#define LOG_CLOSE_STOP_EVENT 4
+
struct st_relay_log_info;
typedef struct st_log_info
@@ -58,13 +63,10 @@ typedef struct st_log_info
class Log_event;
-class MYSQL_LOG {
+class MYSQL_LOG
+ {
private:
- /*
- LOCK_log is inited by MYSQL_LOG::init(), so one should try to lock it only
- if he is sure MYSQL_LOG::init() has been called (i.e. if 'inited' is true).
- Same for LOCK_index.
- */
+ /* LOCK_log and LOCK_index are inited by init_pthread_objects() */
pthread_mutex_t LOCK_log, LOCK_index;
pthread_cond_t update_cond;
ulonglong bytes_written;
@@ -84,7 +86,7 @@ class MYSQL_LOG {
*/
volatile enum_log_type log_type;
enum cache_type io_cache_type;
- bool write_error;
+ bool write_error, inited;
bool need_start_event;
bool no_auto_events; // for relay binlog
/*
@@ -153,8 +155,7 @@ public:
int purge_logs(THD* thd, const char* to_log);
int purge_first_log(struct st_relay_log_info* rli);
bool reset_logs(THD* thd);
- // if we are exiting, we also want to close the index file
- void close(bool exiting = 0);
+ void close(uint exiting);
// iterating through the log index file
int find_log_pos(LOG_INFO* linfo, const char* log_name,
@@ -162,8 +163,7 @@ public:
int find_next_log(LOG_INFO* linfo, bool need_mutex);
int get_current_log(LOG_INFO* linfo);
uint next_file_id();
- bool is_open(bool need_mutex=0);
-
+ inline bool is_open() { return log_type != LOG_CLOSED; }
inline char* get_index_fname() { return index_file_name;}
inline char* get_log_fname() { return log_file_name; }
inline pthread_mutex_t* get_log_lock() { return &LOCK_log; }
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 6045955334c..6251b1ec624 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -84,7 +84,7 @@ int mysql_create_db(THD *thd, char *db, uint create_options, bool silent)
}
{
mysql_update_log.write(thd,thd->query, thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
mysql_bin_log.write(&qinfo);
@@ -174,7 +174,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
thd->query= path;
}
mysql_update_log.write(thd, thd->query, thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
mysql_bin_log.write(&qinfo);
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 8b81e57d419..45acbaaa7ef 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -172,7 +172,7 @@ cleanup:
if (deleted && (error <= 0 || !transactional_table))
{
mysql_update_log.write(thd,thd->query, thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
log_delayed);
@@ -476,7 +476,7 @@ bool multi_delete::send_eof()
if (deleted && (error <= 0 || normal_tables))
{
mysql_update_log.write(thd,thd->query,thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
log_delayed);
@@ -588,7 +588,7 @@ end:
if (!error)
{
mysql_update_log.write(thd,thd->query,thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
thd->tmp_table);
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index f94963f2570..167ccf974c7 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -308,7 +308,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
if ((info.copied || info.deleted) && (error <= 0 || !transactional_table))
{
mysql_update_log.write(thd, thd->query, thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
log_delayed);
@@ -1143,7 +1143,7 @@ bool delayed_insert::handle_inserts(void)
{
int error;
uint max_rows;
- bool using_ignore=0, using_bin_log=mysql_bin_log.is_open(1);
+ bool using_ignore=0, using_bin_log=mysql_bin_log.is_open();
delayed_row *row;
DBUG_ENTER("handle_inserts");
@@ -1361,7 +1361,7 @@ void select_insert::send_error(uint errcode,const char *err)
if (last_insert_id)
thd->insert_id(last_insert_id); // For binary log
mysql_update_log.write(thd,thd->query,thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
table->file->has_transactions());
@@ -1387,7 +1387,7 @@ bool select_insert::send_eof()
thd->insert_id(last_insert_id); // For binary log
/* Write to binlog before commiting transaction */
mysql_update_log.write(thd,thd->query,thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
table->file->has_transactions());
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 7a20fbfd928..ee573672c35 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -219,7 +219,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
DBUG_RETURN(-1); // Can't allocate buffers
}
- if (!opt_old_rpl_compat && mysql_bin_log.is_open(1))
+ if (!opt_old_rpl_compat && mysql_bin_log.is_open())
{
lf_info.thd = thd;
lf_info.ex = ex;
@@ -281,7 +281,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
{
if (transactional_table)
ha_autocommit_or_rollback(thd,error);
- if (!opt_old_rpl_compat && mysql_bin_log.is_open(1))
+ if (!opt_old_rpl_compat && mysql_bin_log.is_open())
{
if (lf_info.wrote_create_file)
{
@@ -315,7 +315,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
if (!log_delayed)
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
if (opt_old_rpl_compat)
{
@@ -607,7 +607,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, String &field_term,
cache.read_function = _my_b_net_read;
need_end_io_cache = 1;
- if (!opt_old_rpl_compat && mysql_bin_log.is_open(1))
+ if (!opt_old_rpl_compat && mysql_bin_log.is_open())
cache.pre_read = cache.pre_close =
(IO_CACHE_CALLBACK) log_loaded_block;
}
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index a32dce4d704..70c0f772d7d 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2432,7 +2432,7 @@ mysql_execute_command(void)
lex->sql_command == SQLCOM_REVOKE)))
{
mysql_update_log.write(thd, thd->query, thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
mysql_bin_log.write(&qinfo);
@@ -2452,7 +2452,7 @@ mysql_execute_command(void)
if (!res)
{
mysql_update_log.write(thd, thd->query, thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
mysql_bin_log.write(&qinfo);
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index cfc6e5b0721..d7e998264f3 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -80,7 +80,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
if (!error)
{
mysql_update_log.write(thd,thd->query,thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
mysql_bin_log.write(&qinfo);
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 6f0ee69413d..13b22d6a221 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -269,7 +269,7 @@ int purge_master_logs(THD* thd, const char* to_log)
const char* errmsg = 0;
int res;
- if (!mysql_bin_log.is_open(1))
+ if (!mysql_bin_log.is_open())
goto end;
mysql_bin_log.make_log_name(search_file_name, to_log);
@@ -333,7 +333,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
}
#endif
- if (!mysql_bin_log.is_open(1))
+ if (!mysql_bin_log.is_open())
{
errmsg = "Binary log is not open";
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
@@ -970,7 +970,7 @@ int change_master(THD* thd, MASTER_INFO* mi)
int reset_master(THD* thd)
{
- if (!mysql_bin_log.is_open(1))
+ if (!mysql_bin_log.is_open())
{
my_error(ER_FLUSH_MASTER_BINLOG_CLOSED, MYF(ME_BELL+ME_WAITTANG));
return 1;
@@ -1008,7 +1008,7 @@ int show_binlog_events(THD* thd)
if (send_fields(thd, field_list, 1))
DBUG_RETURN(-1);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
LEX_MASTER_INFO *lex_mi = &thd->lex.mi;
ha_rows event_count, limit_start, limit_end;
@@ -1108,7 +1108,7 @@ int show_binlog_info(THD* thd)
String* packet = &thd->packet;
packet->length(0);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
LOG_INFO li;
mysql_bin_log.get_current_log(&li);
@@ -1146,7 +1146,7 @@ int show_binlogs(THD* thd)
String *packet = &thd->packet;
uint length;
- if (!mysql_bin_log.is_open(1))
+ if (!mysql_bin_log.is_open())
{
//TODO: Replace with ER() error message
send_error(net, 0, "You are not using binary logging");
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 2d024ded5db..cf430aec35d 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -235,7 +235,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
if (!dont_log_query)
{
mysql_update_log.write(thd, thd->query,thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
tmp_table_deleted && !some_tables_deleted);
@@ -766,7 +766,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
{
// Must be written before unlock
mysql_update_log.write(thd,thd->query, thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
test(create_info->options &
@@ -1548,7 +1548,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
if (!error)
{
mysql_update_log.write(thd, thd->query, thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
mysql_bin_log.write(&qinfo);
@@ -1918,7 +1918,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
goto err;
}
mysql_update_log.write(thd, thd->query,thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
mysql_bin_log.write(&qinfo);
@@ -2050,7 +2050,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
thd->proc_info="end";
mysql_update_log.write(thd, thd->query,thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
mysql_bin_log.write(&qinfo);
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 42ba00d3ad5..3179c8e0f24 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -317,7 +317,7 @@ int mysql_update(THD *thd,
if (updated && (error <= 0 || !transactional_table))
{
mysql_update_log.write(thd,thd->query,thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
log_delayed);
@@ -933,7 +933,7 @@ bool multi_update::send_eof()
if (updated && (local_error <= 0 || !trans_safe))
{
mysql_update_log.write(thd,thd->query,thd->query_length);
- if (mysql_bin_log.is_open(1))
+ if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length,
log_delayed);
diff --git a/strings/ctype-latin1_de.c b/strings/ctype-latin1_de.c
index 01d377f91c3..5b7a68fb967 100644
--- a/strings/ctype-latin1_de.c
+++ b/strings/ctype-latin1_de.c
@@ -102,6 +102,7 @@ uchar to_upper_latin1_de[] = {
* Ü, ü, Ö, ö, Ä, ä
*/
+/* QQ: why it is necessary ? */
uchar sort_order_latin1_de[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
@@ -121,6 +122,41 @@ uchar sort_order_latin1_de[] = {
68, 78, 79, 79, 79, 79,214,247,216, 85, 85, 85,220, 89,222, 89
};
+
+/* same as sort_order_latin_de, but maps ALL accented chars to unacented ones */
+uchar combo1map[]={
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
+ 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127,
+ 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+ 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
+ 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
+ 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+ 65, 65, 65, 65, 65, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73,
+ 68, 78, 79, 79, 79, 79, 79,215,216, 85, 85, 85, 85, 89,222, 83,
+ 65, 65, 65, 65, 65, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73,
+ 68, 78, 79, 79, 79, 79, 79,247,216, 85, 85, 85, 85, 89,222, 89
+};
+
+uchar combo2map[]={
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,69, 0, 0, 0, 0, 0,69, 0, 0,83, 0, 0, 0, 0,69, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,69, 0, 0, 0, 0, 0,69, 0, 0, 0, 0
+};
+
+/* no longer needed
#define L1_AE 196
#define L1_ae 228
#define L1_OE 214
@@ -128,7 +164,7 @@ uchar sort_order_latin1_de[] = {
#define L1_UE 220
#define L1_ue 252
#define L1_ss 223
-
+*/
/*
Some notes about the following comparison rules:
@@ -143,95 +179,23 @@ uchar sort_order_latin1_de[] = {
sort_order_latin_de[] at all
*/
-
-#define CHECK_S1_COMBO(ch1, ch2, str1, str1_end, res_if_str1_smaller, str2, fst, snd, accent) \
- /* Invariant: ch1 == fst == sort_order_latin1_de[accent] && ch1 != ch2 */ \
- if (ch2 != accent) \
- { \
- ch1= fst; \
- goto normal; \
- } \
- if (str1 == str1_end) \
- return res_if_str1_smaller; \
- { \
- int diff = (int) sort_order_latin1_de[*str1] - snd; \
- if (diff) \
- return diff*(-(res_if_str1_smaller)); \
- /* They are equal (e.g., "Ae" == 'ä') */ \
- str1++; \
- }
-
-
int my_strnncoll_latin1_de(const uchar * s1, int len1,
const uchar * s2, int len2)
{
const uchar *e1 = s1 + len1;
const uchar *e2 = s2 + len2;
+ uchar c1, c12=0, c2, c22=0;
- while (s1 < e1 && s2 < e2)
+ while ((s1 < e1 || c12) && (s2 < e2 || c22))
{
- /*
- Because sort_order_latin1_de doesn't convert 'Ä', Ü or ß we
- can use it here.
- */
- uchar c1 = sort_order_latin1_de[*s1++];
- uchar c2 = sort_order_latin1_de[*s2++];
- if (c1 != c2)
- {
- switch (c1) {
- case 'A':
- CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'A', 'E', L1_AE);
- break;
- case 'O':
- CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'O', 'E', L1_OE);
- break;
- case 'U':
- CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'U', 'E', L1_UE);
- break;
- case 'S':
- CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'S', 'S', L1_ss);
- break;
- case L1_AE:
- CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'A', 'E', 'A');
- break;
- case L1_OE:
- CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'O', 'E', 'O');
- break;
- case L1_UE:
- CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'U', 'E', 'U');
- break;
- case L1_ss:
- CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'S', 'S', 'S');
- break;
- default:
- /*
- Handle the case where 'c2' is a special character
- If this is true, we know that c1 can't match this character.
- */
- normal:
- switch (c2) {
- case L1_AE:
- return (int) c1 - (int) 'A';
- case L1_OE:
- return (int) c1 - (int) 'O';
- case L1_UE:
- return (int) c1 - (int) 'U';
- case L1_ss:
- return (int) c1 - (int) 'S';
- default:
- {
- int diff= (int) c1 - (int) c2;
- if (diff)
- return diff;
- }
- break;
- }
- }
- }
+ if (c12) { c1=c12; c12=0; } else { c12=combo2map[*s1]; c1=combo1map[*s1++]; }
+ if (c22) { c2=c22; c22=0; } else { c22=combo2map[*s2]; c2=combo1map[*s2++]; }
+ if (c1 != c2) return (int)c1 - (int)c2;
}
+
/* A simple test of string lengths won't work -- we test to see
* which string ran out first */
- return s1 < e1 ? 1 : s2 < e2 ? -1 : 0;
+ return (s1 < e1 || c12)? 1 : (s2 < e2 || c22)? -1 : 0;
}
@@ -240,35 +204,12 @@ int my_strnxfrm_latin1_de(uchar * dest, const uchar * src, int len, int srclen)
const uchar *dest_orig = dest;
const uchar *de = dest + len;
const uchar *se = src + srclen;
- while (src < se && dest < de)
+ for ( ; src < se && dest < de ; src++)
{
- uchar chr=sort_order_latin1_de[*src];
- switch (chr) {
- case L1_AE:
- *dest++ = 'A';
- if (dest < de)
- *dest++ = 'E';
- break;
- case L1_OE:
- *dest++ = 'O';
- if (dest < de)
- *dest++ = 'E';
- break;
- case L1_UE:
- *dest++ = 'U';
- if (dest < de)
- *dest++ = 'E';
- break;
- case L1_ss:
- *dest++ = 'S';
- if (dest < de)
- *dest++ = 'S';
- break;
- default:
- *dest++= chr;
- break;
- }
- ++src;
+ uchar chr=combo1map[*src];
+ *dest++=chr;
+ if ((chr=combo2map[*src]) && dest < de)
+ *dest++=chr;
}
return dest - dest_orig;
}
diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh
index b8c49bbf0bc..ed2c2ce9dfd 100644
--- a/support-files/my-innodb-heavy-4G.cnf.sh
+++ b/support-files/my-innodb-heavy-4G.cnf.sh
@@ -1,244 +1,254 @@
#BEGIN CONFIG INFO
-#DESCR: 4G,Innodb only,ACID, Few Connections heavy queries
+#DESCR: 4GB RAM, InnoDB only, ACID, few connections, heavy queries
#TYPE: SYSTEM
#END CONFIG INFO
-# This is example config file for systems with 4G of memory running mostly MySQL
-# using MyISAM only tables and running complex queries with few connections
-#
-
-
-
-
#
-# You can copy this file to
-# /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
+# This is a MySQL example config file for systems with 4GB of memory
+# running mostly MySQL using InnoDB only tables and performing complex
+# queries with few connections.
+#
+# You can copy this file to /etc/my.cnf to set global options,
+# mysql-data-dir/my.cnf to set server-specific options
+# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
-# One can in this file use all long options that the program supports.
-# If you want to know which options a program support, run the program
-# with --help option.
-
-
+# In this file, you can use all long options that the program supports.
+# If you want to know the options a program supports, run the program
+# with the "--help" option.
+#
+# More detailed information about the individual options can also be
+# found in the manual.
+#
-# The following options will be passed to all MySQL clients
-# But note, only client programs shipped by MySQL are guarantied to read it
-# If you wish your software to read this section you would need to specify
-# it as an option during MySQL client library initialization
+#
+# The following options will be read by MySQL client applications.
+# Note that only client applications shipped by MySQL are guaranteed
+# to read this section. If you want your own MySQL client program to
+# honor these values, you need to specify it as an option during the
+# MySQL client library initialization.
+#
[client]
-#password = your_password
+#password = [your_password]
port = @MYSQL_TCP_PORT@
socket = @MYSQL_UNIX_ADDR@
-# ********** Here follows entries for some specific programs
+# *** Application-specific options follow here ***
+#
# The MySQL server
+#
[mysqld]
-# generic configuration options
+# generic configuration options
port = @MYSQL_TCP_PORT@
socket = @MYSQL_UNIX_ADDR@
-
-# Back Log is a number of connection OS can keep in queue, before MySQL
-# connection manager thread has processed them. If you have very intensive
-# connection rate and experience "connection refused" errors you might need
-# to increase this value
+# back_log is the number of connections the operating system can keep in
+# the listen queue, before the MySQL connection manager thread has
+# processed them. If you have a very high connection rate and experience
+# "connection refused" errors, you might need to increase this value.
+# Check your OS documentation for the maximum value of this parameter.
+# Attempting to set back_log higher than your operating system limit
+# will have no effect.
back_log = 50
-
-# Don't listen on a TCP/IP port at all. This can be a security enhancement,
-# if all processes that need to connect to mysqld run on the same host.
-# All interaction with mysqld must be made via Unix sockets or named pipes.
+# Don't listen on a TCP/IP port at all. This can be a security
+# enhancement, if all processes that need to connect to mysqld run
+# on the same host. All interaction with mysqld must be made via Unix
+# sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#skip-networking
-# Maximum amount of concurrent sessions MySQL server will allow
-# One of these connections will be reserved for user with SUPER privelege
-# to allow administrator to login even if server is overloaded.
+# The maximum amount of concurrent sessions the MySQL server will
+# allow. One of these connections will be reserved for a user with
+# SUPER privileges to allow the administrator to login even if the
+# connection limit has been reached.
max_connections = 100
-
-# Maximum amount of errors allowed per host. If this limit is reached
-# host will be blocked from connection MySQL server until "flush hosts"
-# is run or server restart. Invalid passwords as any other errors at
-# connect phase results in increasing this value. See
-# Aborted_Connects status variable for global counter.
+# Maximum amount of errors allowed per host. If this limit is reached,
+# the host will be blocked from connecting to the MySQL server until
+# "FLUSH HOSTS" has been run or the server was restarted. Invalid
+# passwords and other errors during the connect phase result in
+# increasing this value. See the "Aborted_Connects" status variable for
+# global counter.
max_connect_errors = 10
-
-# Amount of tables server can keep open at the time. Each table
-# may require up to 2 file handlers (for MERGE tables even more)
-# so make sure to have amount of open files allowed at least 4096
-# see open-files-limit in [mysqld_safe]
+# The number of open tables for all threads. Increasing this value
+# increases the number of file descriptors that mysqld requires.
+# Therefore you have to make sure to set the amount of open files
+# allowed to at least 4096 in the variable "open-files-limit" in
+# section [mysqld_safe]
table_cache = 2048
-# Do not use file level locking. Enabled file locking give performance
-# hit, so use it only in case you have serveral database instances
-# running on the same files (note some restrictions still apply!)
-# or if you use other software relaying on locking MyISAM tables
-# on file level
-#enable-locking
+# Enable external file level locking. Enabled file locking will have a
+# negative impact on performance, so only use it in case you have
+# multiple database instances running on the same files (note some
+# restrictions still apply!) or if you use other software relying on
+# locking MyISAM tables on file level.
+#external-locking
-# This packets limits maximum size of BLOB server can handle
-# as well as maximum query size server can process
-# enlarged dynamically, for each connection
+# The maximum size of a query packet the server can handle as well as
+# maximum query size server can process (Important when working with
+# large BLOBs). enlarged dynamically, for each connection.
max_allowed_packet = 16M
-# Binary log cache is used for logging transactions to binary log
-# all statements from transactions are buffered in binary log cache
-# and wrote to the binary log at once on commit
-# if transaction is large than this value disk temporary file is used.
-# This buffer is allocated per connection on first update statement
-# in transaction
+# The size of the cache to hold the SQL statements for the binary log
+# during a transaction. If you often use big, multi-statement
+# transactions you can increase this value to get more performance. All
+# statements from transactions are buffered in the binary log cache and
+# are being written to the binary log at once after the COMMIT. If the
+# transaction is larger than this value, temporary file on disk is used
+# instead. This buffer is allocated per connection on first update
+# statement in transaction
binlog_cache_size = 1M
+# Maximum allowed size for a single HEAP (in memory) table. This option
+# is a protection against the accidential creation of a very large HEAP
+# table which could otherwise use up all memory resources.
+max_heap_table_size = 64M
-# Maximum allowed size for single HEAP (in memory) table
-# This option is protection from accidential creation of the HEAP
-# table which would take all the memory resources
-max_heap_table_size=64M
-
-
-# Sort buffer used to perform sorts for some of ORDER BY and
-# GROUP BY queries. If sorted data does not fit into sort buffer
-# Disk based merge sort is used - See sort_merge_passes.
-# Allocated per thread if sort is needed
+# Sort buffer is used to perform sorts for some ORDER BY and GROUP BY
+# queries. If sorted data does not fit into the sort buffer, a disk
+# based merge sort is used instead - See "sort_merge_passes". Allocated
+# per thread if sort is needed.
sort_buffer_size = 8M
-# This buffer is used for optimization of full joins (joins without indexes)
-# Such joins are very bad for performance in most cases anyway, but having
-# this variable large reduces performance impact.
-# see select_full_join status variable for full joins count
-# Allocated per thread if full join is found
-join_buffer_size=8M
-
-
-# Cache threads on disconnect instead of destroying them
-# thread cache allows to greatly reduce amount of thread
-# creations needed if you have a lot of connections
+# This buffer is used for the optimization of full JOINs (JOINs without
+# indexes). Such JOINs are very bad for performance in most cases
+# anyway, but setting this variable to a large value reduces the
+# performance impact. See the "select_full_join" status variable for a
+# count of full JOINs. Allocated per thread if full join is found
+join_buffer_size = 8M
+
+# How many threads we should keep in a cache for reuse. When a client
+# disconnects, the client's threads are put in the cache if there aren't
+# more than thread_cache_size threads from before. This greatly reduces
+# the amount of thread creations needed if you have a lot of new
+# connections. (Normally this doesn't give a notable performance
+# improvement if you have a good thread implementation.)
thread_cache = 8
-
-# Try number of CPU's*(2..4) for thread_concurrency
-# This value makes sense only on few systems (as Solaris)
-# which support thread_concurrency() setting
+# This permits the application to give the threads system a hint for the
+# desired number of threads that should be run at the same time. This
+# value only makes sense on systems that support the thread_concurrency()
+# function call (Sun Solaris, for example).
+# You should try [number of CPUs]*(2..4) for thread_concurrency
thread_concurrency = 8
-
-# Query cache is used to cache SELECT results and later return
-# them without actual query execution for exactly the same query
-# Having query cache enabled may give great benefit if your have
-# typical queries and rarely changed tabled
-# see Qcache_lowmem_prunes status variable to check if current
-# value is enough for your load
-# Note: In case your table change all the time or you never have
-# textually same queries query cache maay bring slowdown
-# instead of performance improvement
+# Query cache is used to cache SELECT results and later return them
+# without actual executing the same query once again. Having the query
+# cache enabled may result in significant speed improvements, if your
+# have a lot of identical queries and rarely changing tables. See the
+# "Qcache_lowmem_prunes" status variable to check if the current value
+# is high enough for your load.
+# Note: In case your tables change very often or if your queries are
+# textually different every time, the query cache may result in a
+# slowdown instead of a performance improvement.
query_cache_size = 64M
-# Cache only result sets which are smaller than this limit
-# This setting is protection of very large result set overwriting
-# all queries in query cache
+# Only cache result sets that are smaller than this limit. This is to
+# protect the query cache of a very large result set overwriting all
+# other query results.
query_cache_limit = 2M
-# Minimum word length to be indexed by full text search index
-# you might wish to decrease it if you need to search on shorter words
+# Minimum word length to be indexed by the full text search index.
+# You might wish to decrease it if you need to search for shorter words.
+# Note that you need to rebuild your FULLTEXT index, after you have
+# modified this value.
ft_min_word_len = 4
-# If your system supports memlock() function you might use this option
-# while running MySQL to keep it locking in memory, avoid potential
-# swapping out in case of high memory pressure. Good for performance.
+# If your system supports the memlock() function call, you might want to
+# enable this option while running MySQL to keep it locked in memory and
+# to avoid potential swapping out in case of high memory pressure. Good
+# for performance.
#memlock
-# Table type which is used by default, if not specified by CREATE TABLE
-# it affects only tables explicitly created by user.
+# Table type which is used by default when creating new tables, if not
+# specified differently during the CREATE TABLE statement.
default_table_type = MYISAM
-# Thread stack size to use. This amount of memory is always reserved at
-# connection time. MySQL itself usually needs no more than 64K of memory,
-# while if you use your own stack hungry UDF functions or OS requires more
-# stack for some operations, you might need to set it higher
+# Thread stack size to use. This amount of memory is always reserved at
+# connection time. MySQL itself usually needs no more than 64K of
+# memory, while if you use your own stack hungry UDF functions or your
+# OS requires more stack for some operations, you might need to set this
+# to a higher value.
thread_stack = 192K
-# Set default transaction isolation level. Levels available are:
+# Set the default transaction isolation level. Levels available are:
# READ-UNCOMMITED, READ-COMMITED, REPEATABLE-READ, SERIALIZABLE
transaction_isolation = REPEATABLE-READ
-# Maximum size for internal in memory temporary table. If table
-# grows larger it is automatically converted to disk based table
-# This limitaion is for single table. There can be many of them.
+# Maximum size for internal (in-memory) temporary tables. If a table
+# grows larger than this value, it is automatically converted to disk
+# based table This limitation is for a single table. There can be many
+# of them.
tmp_table_size = 64M
-# binary logging is required for acting MASTER in replication
-# You also need binary log if you need ability to do point
-# in time recovery from your latest backup
+# Enable binary logging. This is required for acting as a MASTER in a
+# replication configuration. You also need the binary log if you need
+# the ability to do point in time recovery from your latest backup.
log_bin
-# If you're using chaining replication A->B->C you might wish to
-# turn on this option on server B. It makes updates done by
-# slave thread also logged in binary log. Normally they are not
+# If you're using replication with chained slaves (A->B->C), you need to
+# enable this option on server B. It enables logging of updates done by
+# the slave thread into the slave's binary log.
#log_slave_updates
-
-# Full query log. Every query (even with incorrect syntax) server gets goes here.
-# Useful for debugging. Normally is disabled in production
+# Enable the full query log. Every query (even ones with incorrect
+# syntax) that the server receives will be logged. This is useful for
+# debugging, it is usually disabled in production use.
#log
-# If you have any problems with MySQL server you might enable Warnings logging and
-# examine error log for possible explanations.
+# Print warnings to the error log file. If you have any problem with
+# MySQL you should enable logging of warnings and examine the error log
+# for possible explanations.
#log_warnings
-# Log slow queries. Slow queries are queries which take more than defined amount of time
-# or which do not use indexes well, if log_long_format is enabled
-# It is notmally good idea to have this on if you frequently add new queries to the system
+# Log slow queries. Slow queries are queries which take more than the
+# amount of time defined in "long_query_time" or which do not use
+# indexes well, if log_long_format is enabled. It is normally good idea
+# to have this turned on if you frequently add new queries to the
+# system.
log_slow_queries
-
-# All queries taking more than this amount of time will be trated as slow. Do not use value 1
-# here as this will result even in very fast queries logged sometimes, as MySQL measures time with
-# second accuracy only.
+# All queries taking more than this amount of time (in seconds) will be
+# trated as slow. Do not use "1" as a value here, as this will result in
+# even very fast queries being logged from time to time (as MySQL
+# currently measures time with second accuracy only).
long_query_time = 2
-# Log more information in slow query log. Normally it is good to have this on.
-# It results in logging of queries not using indexes additionally to long running queries.
+# Log more information in the slow query log. Normally it is good to
+# have this turned on. This will enable logging of queries that are not
+# using indexes in addition to long running queries.
log_long_format
+# The directory used by MySQL for storing temporary files. For example,
+# it is used to perform disk based large sorts, as well as for internal
+# and explicit temporary tables. It might be good to put it on a
+# swapfs/tmpfs filesystem, if you do not create very large temporary
+# files. Alternatively you can put it on dedicated disk. You can
+# specify multiple paths here by separating them by ";" - they will then
+# be used in a round-robin fashion.
+#tmpdir = /tmp
-# Temporary directory is used by MySQL for storing temporary files, for example
-# used to do disk based large sorts, as well as for internal and explicit
-# temporary tables.
-# It might be good to set it to swapfs/tmpfs filesystem if you do not have very
-# large temporary files created or set it to dedicated disk
-# You can specify several paths here spliting them by ";" they will be used in
-# round-robin fashion
-#tmpdir = /tmp
+# *** Replication related settings
-#*** Replication related settings
-
-
-# This value is required both for master ans slave
-# If you have single master it is typical to use value 1 for it
-# required unique id between 1 and 2^32 - 1
-# defaults to 1 if master-host is not set
-# but will not function as a master if omitted
+# Unique server identification number between 1 and 2^32-1. This value
+# is required for both master and slave hosts. It defaults to 1 if
+# "master-host" is not set, but will MySQL will not function as a master
+# if it is omitted.
server-id = 1
-
-# To configure this server as Replication Slave you will need
-# to set its server_id to some unique value, different from Master
-# and all slaves in the group.
-# You also can disable log-bin as logs are not required (while recomended)
-# for slaves
-#
+# Replication Slave (comment out master section to use this)
+#
+# To configure this host as a replication slave, you can choose between
+# two methods :
#
-# The recomended way to set MASTER settings for the slave are:
-# Use the CHANGE MASTER TO command (fully described in our manual) -
+# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
@@ -252,191 +262,221 @@ server-id = 1
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
-# However if you need to replicate slave configuration over several boxes
-# you can use old approach:
+# OR
#
-# Set the variables below. However, in case you choose this method, then
+# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
-# change in this file to the variables' values below will be ignored and
+# changes in this file to the variable values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
+# required unique id between 2 and 2^32 - 1
+# (and different from the master)
+# defaults to 2 if master-host is set
+# but will not function as a slave if omitted
+#server-id = 2
#
# The replication master for this slave - required
-#master-host = <hostname>
+#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
-#master-user = <username>
+#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
-#master-password = <password>
+#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to 3306
-#master-port = <port>
+#master-port = <port>
-# Make Slave ReadOnly. Only user with SUPER privelege and slave
-# thread will be able to modify it. You might use it to ensure
-# no applications will accidently modify slave instead of master
+# Make the slave read-only. Only users with the SUPER privilege and the
+# replication slave thread will be able to modify data on it. You can
+# use this to ensure that no applications will accidently modify data on
+# the slave instead of the master
#read_only
-
#*** MyISAM Specific options
-# Size of Key Buffer, used to cache index blocks for MyISAM tables
-# Do not set it larger than 30% of available memory, as some memory
-# is required by OS to cache rows.
-# Even if you're not using MyISAM tables still set it to 8-64M
-# as it will be used for internal temporary disk tables.
+# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
+# Do not set it larger than 30% of your available memory, as some memory
+# is also required by the OS to cache rows. Even if you're not using
+# MyISAM tables, you should still set it to 8-64M as it will also be
+# used for internal temporary disk tables.
key_buffer_size = 32M
-# Size of buffer used for doing full table scans for MyISAM tables
-# allocated per thread, as full scan is needed
+# Size of the buffer used for doing full table scans of MyISAM tables.
+# Allocated per thread, if a full scan is needed.
read_buffer_size = 2M
-# Buffer is used for caching the rows while doing Sorts
-# Allocated per thread, then needed
+# When reading rows in sorted order after a sort, the rows are read
+# through this buffer to avoid a disk seeks. You can improve ORDER BY
+# performance a lot, if set this to a high value.
+# Allocated per thread, when needed.
read_rnd_buffer_size = 16M
-# The bulk insert tree is used for optimization of index modification
-# for bulk inserts (hundreds+ values) and LOAD DATA INFILE
-# Do not set larger than key_buffer_size for optimal performance
-# This buffer is allocated than bulk insert is detected
+# MyISAM uses special tree-like cache to make bulk inserts (that is,
+# INSERT ... SELECT, INSERT ... VALUES (...), (...), ..., and LOAD DATA
+# INFILE) faster. This variable limits the size of the cache tree in
+# bytes per thread. Setting it to 0 will disable this optimisation. Do
+# not set it larger than "key_buffer_size" for optimal performance.
+# This buffer is allocated when a bulk insert is detected.
bulk_insert_buffer_size = 64M
-
-# This buffer is allocated than MySQL needs to rebuild the Index,
-# in REPAIR, OPTIMZE, ALTER table statements as well as in
-# LOAD DATA INFILE to empty table
-# it is allocated per thread so be careful with large settings.
+# This buffer is allocated when MySQL needs to rebuild the index in
+# REPAIR, OPTIMZE, ALTER table statements as well as in LOAD DATA INFILE
+# into an empty table. It is allocated per thread so be careful with
+# large settings.
myisam_sort_buffer_size = 128M
-# Maximum size of temporary (sort) file index rebuild can use.
-# If sort is estimated to take larger amount of space, mush slower
-# (keycache) index rebuild method will be used
+# The maximum size of the temporary file MySQL is allowed to use while
+# recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
+# If the file-size would be bigger than this, the index will be created
+# through the key cache (which is slower).
myisam_max_sort_file_size = 10G
-# Use sort method in case the difference between sort file and
-# Table index file is estimated to be less than this value
+# If the temporary file used for fast index creation would be bigger
+# than using the key cache by the amount specified here, then prefer the
+# key cache method. This is mainly used to force long character keys in
+# large tables to use the slower key cache method to create the index.
myisam_max_extra_sort_file_size = 10G
-# If table has more than one index MyISAM can use more than one thread
-# to repair them in parallel. It makes sense if you have multiple of
-# CPUs and planty of memory.
+# If a table has more than one index, MyISAM can use more than one
+# thread to repair them by sorting in parallel. This makes sense if you
+# have multiple CPUs and plenty of memory.
myisam_repair_threads = 1
-# Automatically check and repair not properly closed MyISAM tables
+# Automatically check and repair not properly closed MyISAM tables.
myisam_recover
+# *** BDB Specific options ***
-#*** BDB Specific options
-
-# Use this option if you have BDB tables enabled but you do not plan to use them
+# Use this option if you run a MySQL server with BDB support enabled but
+# you do not plan to use it. This will save memory and may speed up some
+# things.
skip-bdb
-#*** INNODB Specific options
+# *** INNODB Specific options ***
-# Use this option if you have INNODB tables enabled but you do not plan to use them
+# Use this option if you have a MySQL server with InnoDB support enabled
+# but you do not plan to use it. This will save memory and disk space
+# and speed up some things.
#skip-innodb
-# Additional memory pool is used by Innodb to store metadata information.
-# If Innodb needs more memory for this purpose to allocate it from OS
-# As it is fast enough on most recent OS you normally do not need to set it higher
-# SHOW INNODB STATUS will show current amount of it in use
+# Additional memory pool that is used by InnoDB to store metadata
+# information. If InnoDB requires more memory for this purpose it will
+# start to allocate it from the OS. As this is fast enough on most
+# recent operating systems, you normally do not need to change this
+# value. SHOW INNODB STATUS will display the current amount used.
innodb_additional_mem_pool_size = 16M
-# Innodb, unlike MyISAM uses bufferpool to cache both indexes and row data
-# so you would normally wish to have it large up to 50-70% of your memory size
-# Note on 32bit systems you might be limited to 2-3.5G of user level memory
-# per process so do not set it too high.
+# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
+# row data. The bigger you set this the less disk I/O is needed to
+# access data in tables. On a dedicated database server you may set this
+# parameter up to 80% of the machine physical memory size. Do not set it
+# too large, though, because competition of the physical memory may
+# cause paging in the operating system. Note that on 32bit systems you
+# might be limited to 2-3.5G of user level memory per process, so do not
+# set it too high.
innodb_buffer_pool_size = 2G
-# Innodb stores data in one or several files forming tablespace. If you have
-# single logical drive for your data, single autoextending file would be good enough
-# In other case single file per device is often good choice.
-# You may setup Innodb to use Raw disk partitions as well. Refer to the manual.
+# InnoDB stores data in one or more data files forming the tablespace.
+# If you have a single logical drive for your data, a single
+# autoextending file would be good enough. In other cases, a single file
+# per device is often a good choice. You can configure InnoDB to use raw
+# disk partitions as well - please refer to the manual for more info
+# about this.
innodb_data_file_path = ibdata1:10M:autoextend
+# Set this option if you would like the InnoDB tablespace files to be
+# stored in another location. By default this is the MySQL datadir.
+#innodb_data_home_dir = <directory>
-# Set this option if you would like Innodb tablespace files to be stored in other
-# location. Default is MySQL datadir.
-#innodb_data_home_dir
-
-# Number of IO threads to use for async IO operations. This value is hardcoded to
-# 4 on Unix
+# Number of IO threads to use for async IO operations. This value is
+# hardcoded to 4 on Unix, but on Windows disk I/O may benefit from a
+# larger number.
innodb_file_io_threads = 4
-
-# If you run into Innodb tablespace corruption, setting this to nonzero value will
-# likely help you to dump your tables. Start from value 1 and increase it until
-# you're able to dump the table successfully.
+# If you run into InnoDB tablespace corruption, setting this to a nonzero
+# value will likely help you to dump your tables. Start from value 1 and
+# increase it until you're able to dump the table successfully.
#innodb_force_recovery=1
-# Number of threads allowed inside of Innodb kernel. Best setting highly depends
-# on the application, hardware as well as OS scheduler properties
-# Too high value may lead to thread thrashing
+# Number of threads allowed inside the InnoDB kernel. The optimal value
+# depends highly on the application, hardware as well as the OS
+# scheduler properties. A too high value may lead to thread thrashing.
innodb_thread_concurrency = 16
-
-# If set to 1 Innodb will flush(fsync) logs to the disk at each transaction commit
-# which offers full ACID behavior, however if you can afford few last commited transaction
-# lost you can set this value to 2 or 0. Innodb will anyway flush the log file once
-# per second. 0 - do not flush file at all. 2 - flush it to OS buffers but not to the disk.
+# If set to 1, InnoDB will flush (fsync) the transaction logs to the
+# disk at each commit, which offers full ACID behavior. If you are
+# willing to compromise this safety, and you are running small
+# transactions, you may set this to 0 or 2 to reduce disk I/O to the
+# logs. Value 0 means that the log is only written to the log file and
+# the log file flushed to disk approximately once per second. Value 2
+# means the log is written to the log file at each commit, but the log
+# file is only flushed to disk approximately once per second.
innodb_flush_log_at_trx_commit = 1
-
-# Innodb uses fast shutdown by default. However you can disable it to make Innodb to do
-# purge and Insert buffer merge on shutdown. It may increase shutdown time a lot but
-# Innodb will have not need to do it after next startup
+# Speed up InnoDB shutdown. This will disable InnoDB to do a full purge
+# and insert buffer merge on shutdown. It may increase shutdown time a
+# lot, but InnoDB will have to do it on the next startup instead.
#innodb_fast_shutdown
-# Buffer Innodb shall use for buffering log data. As soon as it is full Innodb
-# will have to flush it. As it is flushed once per second anyway even with
-# long transactions it does not make sense to have it very large.
+# The size of the buffer InnoDB uses for buffering log data. As soon as
+# it is full, InnoDB will have to flush it to disk. As it is flushed
+# once per second anyway, it does not make sense to have it very large
+# (even with long transactions).
innodb_log_buffer_size = 8M
-# Size of log file in group. You shall set combined size of log files large 25%-100% of
-# your buffer pool size to avoid not needed buffer pool flush activity on log file
-# overwrite. Note however larger logfile size will increase time needed for recovery
-# process.
+# Size of each log file in a log group. You should set the combined size
+# of log files to about 25%-100% of your buffer pool size to avoid
+# unneeded buffer pool flush activity on log file overwrite. However,
+# note that a larger logfile size will increase the time needed for the
+# recovery process.
innodb_log_file_size = 256M
-# Total number of files in the log group. Value 2-3 is usually good enough.
+# Total number of files in the log group. A value of 2-3 is usually good
+# enough.
innodb_log_files_in_group = 3
-# Location for Innodb log files. Default is MySQL datadir. You may wish to
-# point it to dedicated hard drive or RAID1 volume for improved performance
+# Location of the InnoDB log files. Default is the MySQL datadir. You
+# may wish to point it to a dedicated hard drive or a RAID1 volume for
+# improved performance
#innodb_log_group_home_dir
-# Maximum allowed Percentage of dirty pages in Innodb buffer pool.
-# If it is reached Innodb will start flushing them agressively not to run
-# out of clean pages at all. This is a soft limit, not guarantied to be held.
+# Maximum allowed percentage of dirty pages in the InnoDB buffer pool.
+# If it is reached, InnoDB will start flushing them out agressively to
+# not run out of clean pages at all. This is a soft limit, not
+# guaranteed to be held.
innodb_max_dirty_pages_pct = 90
-
-# Set flush method Innodb will use for Log. Tablespace always uses doublewrite flush logic.
-#innodb_flush_method
-
-# How long Innodb transaction shall wait for lock to be granted before giving up.
-# This value does not correspond to deadlock resolution. Innodb will detect Deadlock
-# as soon as it is formed.
+# The flush method InnoDB will use for Log. The tablespace always uses
+# doublewrite flush logic. The default value is "fdatasync", another
+# option is "O_DSYNC".
+#innodb_flush_method=O_DSYNC
+
+# How long an InnoDB transaction should wait for a lock to be granted
+# before being rolled back. InnoDB automatically detects transaction
+# deadlocks in its own lock table and rolls back the transaction. If you
+# use the LOCK TABLES command, or other transaction-safe storage engines
+# than InnoDB in the same transaction, then a deadlock may arise which
+# InnoDB cannot notice. In cases like this the timeout is useful to
+# resolve the situation.
innodb_lock_wait_timeout = 120
-
[mysqldump]
-# Do not buffer whole result set in memory before writing it to file
-# required for dumping very large tables
+# Do not buffer the whole result set in memory before writing it to
+# file. Required for dumping very large tables
quick
max_allowed_packet = 16M
@@ -444,7 +484,7 @@ max_allowed_packet = 16M
[mysql]
no-auto-rehash
-# Remove the next comment character if you are not familiar with SQL
+# Only allow UPDATEs and DELETEs that use keys.
#safe-updates
[isamchk]
@@ -463,7 +503,7 @@ write_buffer = 8M
interactive-timeout
[mysqld_safe]
-# Increase amount of open files allowed per process
-# Warning: Make sure you have global system limit high enough
-# The high value is required for large number of opened tables
+# Increase the amount of open files allowed per process. Warning: Make
+# sure you have set the global system limit high enough! The high value
+# is required for a large number of opened tables
open-files-limit = 8192
diff --git a/vio/viosocket.c b/vio/viosocket.c
index 898b9a96c11..6f5c4142a45 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -26,8 +26,8 @@
#include <mysql_com.h>
#include <errno.h>
-#include <violite.h>
#include <my_sys.h>
+#include <violite.h>
#include <my_net.h>
#include <m_string.h>