Commit c216222b authored by unknown's avatar unknown

Removed wrong mutex lock (hangup in kill on HPUX)

all free_defaults() on exit in mysql.cc;  Should fix problem with SSL


Docs/manual.texi:
  Added information about --skip-innodb
client/mysql.cc:
  Call free_defaults() on exit
client/mysqladmin.c:
  Call free_defaults() on exit
client/mysqlimport.c:
  Call free_defaults() on exit
mysql-test/r/rpl000016.result:
  Added testing of temporary tables with binary log rotation
mysql-test/t/rpl000016.test:
  Added testing of temporary tables with binary log rotation
sql/log.cc:
  Remove not used variable
sql/sql_class.h:
  Removed wrong mutex lock (hangup in kill on HPUX)
parent a0c16f90
...@@ -14373,6 +14373,10 @@ If this is enabled, a user can't create new users with the GRANT ...@@ -14373,6 +14373,10 @@ If this is enabled, a user can't create new users with the GRANT
command, if the user doesn't have @code{INSERT} privilege to the command, if the user doesn't have @code{INSERT} privilege to the
@code{mysql.user} table or any column in this table. @code{mysql.user} table or any column in this table.
@item --skip-bdb
Disable usage of BDB tables. This will save memory and may speed up some
things.
@item --skip-concurrent-insert @item --skip-concurrent-insert
Turn off the ability to select and insert at the same time on @code{MyISAM} Turn off the ability to select and insert at the same time on @code{MyISAM}
tables. (This is only to be used if you think you have found a bug in this tables. (This is only to be used if you think you have found a bug in this
...@@ -14392,6 +14396,10 @@ flush-privileges} or @code{mysqladmin reload}.) ...@@ -14392,6 +14396,10 @@ flush-privileges} or @code{mysqladmin reload}.)
Never use host name cache for faster name-ip resolution, but query DNS server Never use host name cache for faster name-ip resolution, but query DNS server
on every connect instead. @xref{DNS}. on every connect instead. @xref{DNS}.
@item --skip-innodb
Disable usage of Innodb tables. This will save memory and disk space and
speed up some things.
@item --skip-external-locking (was --skip-locking) @item --skip-external-locking (was --skip-locking)
Don't use system locking. To use @code{isamchk} or @code{myisamchk} you must Don't use system locking. To use @code{isamchk} or @code{myisamchk} you must
shut down the server. @xref{Stability}. Note that in MySQL Version shut down the server. @xref{Stability}. Note that in MySQL Version
...@@ -38620,6 +38628,9 @@ an auto-extending 10 MB file @file{ibdata1} to the @code{datadir} ...@@ -38620,6 +38628,9 @@ an auto-extending 10 MB file @file{ibdata1} to the @code{datadir}
of MySQL. (In MySQL-4.0.0 and 4.0.1 the datafile is 64 MB and not of MySQL. (In MySQL-4.0.0 and 4.0.1 the datafile is 64 MB and not
auto-extending.) auto-extending.)
If you don't want to use @code{InnoDB} tables, you can add the
@code{skip-innodb} option to your MySQL option file.
But to get good performance you MUST explicitly set the InnoDB parameters But to get good performance you MUST explicitly set the InnoDB parameters
listed in the following examples. listed in the following examples.
...@@ -40571,13 +40582,14 @@ BDB tables: ...@@ -40571,13 +40582,14 @@ BDB tables:
@item @code{--bdb-no-recover} @tab Don't start Berkeley DB in recover mode. @item @code{--bdb-no-recover} @tab Don't start Berkeley DB in recover mode.
@item @code{--bdb-shared-data} @tab Start Berkeley DB in multi-process mode (Don't use @code{DB_PRIVATE} when initialising Berkeley DB) @item @code{--bdb-shared-data} @tab Start Berkeley DB in multi-process mode (Don't use @code{DB_PRIVATE} when initialising Berkeley DB)
@item @code{--bdb-tmpdir=directory} @tab Berkeley DB tempfile name. @item @code{--bdb-tmpdir=directory} @tab Berkeley DB tempfile name.
@item @code{--skip-bdb} @tab Don't use berkeley db. @item @code{--skip-bdb} @tab Disable usage of BDB tables.
@item @code{-O bdb_max_lock=1000} @tab Set the maximum number of locks possible. @xref{SHOW VARIABLES}. @item @code{-O bdb_max_lock=1000} @tab Set the maximum number of locks possible. @xref{SHOW VARIABLES}.
@end multitable @end multitable
If you use @code{--skip-bdb}, MySQL will not initialise the If you use @code{--skip-bdb}, MySQL will not initialise the
Berkeley DB library and this will save a lot of memory. Of course, Berkeley DB library and this will save a lot of memory. Of course,
you cannot use @code{BDB} tables if you are using this option. you cannot use @code{BDB} tables if you are using this option. If you try
to create an BDB table, MySQL will instead create a MyISAM table.
Normally you should start @code{mysqld} without @code{--bdb-no-recover} if you Normally you should start @code{mysqld} without @code{--bdb-no-recover} if you
intend to use BDB tables. This may, however, give you problems when you intend to use BDB tables. This may, however, give you problems when you
...@@ -112,6 +112,7 @@ typedef struct st_status ...@@ -112,6 +112,7 @@ typedef struct st_status
static HashTable ht; static HashTable ht;
static char **defaults_argv;
enum enum_info_type { INFO_INFO,INFO_ERROR,INFO_RESULT}; enum enum_info_type { INFO_INFO,INFO_ERROR,INFO_RESULT};
typedef enum enum_info_type INFO_TYPE; typedef enum enum_info_type INFO_TYPE;
...@@ -317,15 +318,19 @@ int main(int argc,char *argv[]) ...@@ -317,15 +318,19 @@ int main(int argc,char *argv[])
status.add_to_history=1; status.add_to_history=1;
status.exit_status=1; status.exit_status=1;
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
defaults_argv=argv;
if (get_options(argc, (char **) argv)) if (get_options(argc, (char **) argv))
{ {
free_defaults(defaults_argv);
my_end(0); my_end(0);
exit(1); exit(1);
} }
free_defaults(argv);
if (status.batch && !status.line_buff && if (status.batch && !status.line_buff &&
!(status.line_buff=batch_readline_init(max_allowed_packet+512,stdin))) !(status.line_buff=batch_readline_init(max_allowed_packet+512,stdin)))
{
free_defaults(defaults_argv);
exit(1); exit(1);
}
glob_buffer.realloc(512); glob_buffer.realloc(512);
mysql_server_init(0, NULL, (char**) server_default_groups); mysql_server_init(0, NULL, (char**) server_default_groups);
completion_hash_init(&ht, 128); completion_hash_init(&ht, 128);
...@@ -420,6 +425,7 @@ sig_handler mysql_end(int sig) ...@@ -420,6 +425,7 @@ sig_handler mysql_end(int sig)
my_free(default_prompt,MYF(MY_ALLOW_ZERO_PTR)); my_free(default_prompt,MYF(MY_ALLOW_ZERO_PTR));
my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR)); my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR));
mysql_server_end(); mysql_server_end();
free_defaults(defaults_argv);
my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
exit(status.exit_status); exit(status.exit_status);
} }
......
...@@ -254,7 +254,10 @@ int main(int argc,char *argv[]) ...@@ -254,7 +254,10 @@ int main(int argc,char *argv[])
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
save_argv = argv; /* Save for free_defaults */ save_argv = argv; /* Save for free_defaults */
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
{
free_defaults(save_argv);
exit(ho_error); exit(ho_error);
}
if (argc == 0) if (argc == 0)
{ {
......
...@@ -471,9 +471,15 @@ int main(int argc, char **argv) ...@@ -471,9 +471,15 @@ int main(int argc, char **argv)
/* argv is changed in the program */ /* argv is changed in the program */
argv_to_free= argv; argv_to_free= argv;
if (get_options(&argc, &argv)) if (get_options(&argc, &argv))
{
free_defaults(argv_to_free);
return(1); return(1);
}
if (!(sock= db_connect(current_host,current_db,current_user,opt_password))) if (!(sock= db_connect(current_host,current_db,current_user,opt_password)))
{
free_defaults(argv_to_free);
return(1); /* purecov: deadcode */ return(1); /* purecov: deadcode */
}
if (lock_tables) if (lock_tables)
lock_table(sock, argc, argv); lock_table(sock, argc, argv);
for (; *argv != NULL; argv++) for (; *argv != NULL; argv++)
......
...@@ -10,12 +10,14 @@ change master to master_host='127.0.0.1',master_port=MASTER_PORT, ...@@ -10,12 +10,14 @@ change master to master_host='127.0.0.1',master_port=MASTER_PORT,
master_user='root'; master_user='root';
reset master; reset master;
slave start; slave start;
drop table if exists t1; drop table if exists t1, t2, t3, t4;
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables");
create table t1 (s text); create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard'); insert into t1 values('Could not break slave'),('Tried hard');
show slave status; 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 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 MASTER_PORT 60 master-bin.001 234 slave-relay-bin.001 275 master-bin.001 Yes Yes 0 0 234 275 127.0.0.1 root MASTER_PORT 60 master-bin.001 417 slave-relay-bin.001 458 master-bin.001 Yes Yes 0 0 417 458
select * from t1; select * from t1;
s s
Could not break slave Could not break slave
...@@ -30,6 +32,11 @@ Log_name ...@@ -30,6 +32,11 @@ Log_name
master-bin.001 master-bin.001
master-bin.002 master-bin.002
master-bin.003 master-bin.003
create table t3 select * from temp_table;
select * from t3;
a
testing temporary tables
drop table temp_table, t3;
insert into t2 values(1234); insert into t2 values(1234);
set insert_id=1234; set insert_id=1234;
insert into t2 values(NULL); insert into t2 values(NULL);
...@@ -42,7 +49,7 @@ master-bin.003 ...@@ -42,7 +49,7 @@ master-bin.003
insert into t2 values (65); insert into t2 values (65);
show slave status; 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 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 MASTER_PORT 60 master-bin.003 155 slave-relay-bin.001 755 master-bin.003 Yes Yes 0 0 155 755 127.0.0.1 root MASTER_PORT 60 master-bin.003 290 slave-relay-bin.001 1073 master-bin.003 Yes Yes 0 0 290 1073
select * from t2; select * from t2;
m m
34 34
...@@ -50,8 +57,11 @@ m ...@@ -50,8 +57,11 @@ m
67 67
123 123
1234 1234
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables part 2");
drop table if exists t3; drop table if exists t3;
create table t3 (n int); create table t3 (n int);
create table t4 select * from temp_table;
show master logs; show master logs;
Log_name Log_name
master-bin.003 master-bin.003
...@@ -60,12 +70,13 @@ master-bin.005 ...@@ -60,12 +70,13 @@ master-bin.005
master-bin.006 master-bin.006
show master status; show master status;
File Position Binlog_do_db Binlog_ignore_db File Position Binlog_do_db Binlog_ignore_db
master-bin.006 445 master-bin.006 838
slave stop; select * from t4;
slave start; a
testing temporary tables part 2
show slave status; 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 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 MASTER_PORT 60 master-bin.006 445 slave-relay-bin.004 1229 master-bin.006 Yes Yes 0 0 445 1229 127.0.0.1 root MASTER_PORT 60 master-bin.006 838 slave-relay-bin.004 1816 master-bin.006 Yes Yes 0 0 838 1816
lock tables t3 read; lock tables t3 read;
select count(*) from t3 where n >= 4; select count(*) from t3 where n >= 4;
count(*) count(*)
......
#
# Test are run with max_binlog_size=2048 to force automatic rotation of the
# binary log
# Tests done:
# - Check that slaves reports correct failures if master.info has strange
# modes/information
# - Automatic binary log rotation
# - Ensure that temporary tables works over flush logs and binary log
# changes
# - Test creating a duplicate key error and recover from it
#
connect (master,localhost,root,,test,0,master.sock); connect (master,localhost,root,,test,0,master.sock);
connect (slave,localhost,root,,test,0,slave.sock); connect (slave,localhost,root,,test,0,slave.sock);
system cat /dev/null > var/slave-data/master.info; system cat /dev/null > var/slave-data/master.info;
...@@ -18,7 +29,14 @@ reset master; ...@@ -18,7 +29,14 @@ reset master;
connection slave; connection slave;
slave start; slave start;
connection master; connection master;
drop table if exists t1;
drop table if exists t1, t2, t3, t4;
#
# Test FLUSH LOGS
#
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables");
create table t1 (s text); create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard'); insert into t1 values('Could not break slave'),('Tried hard');
save_master_pos; save_master_pos;
...@@ -32,15 +50,24 @@ flush logs; ...@@ -32,15 +50,24 @@ flush logs;
drop table if exists t2; drop table if exists t2;
create table t2(m int not null auto_increment primary key); create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123); insert into t2 values (34),(67),(123);
save_master_pos;
flush logs; flush logs;
show master logs; show master logs;
create table t3 select * from temp_table;
#now lets make some duplicate key mess and see if we can recover from it save_master_pos;
#first insert a value on the slave
connection slave; connection slave;
sync_with_master; sync_with_master;
select * from t3;
connection master;
drop table temp_table, t3;
#
# Now lets make some duplicate key mess and see if we can recover from it
#
# First insert a value on the slave
connection slave;
insert into t2 values(1234); insert into t2 values(1234);
#same value on the master #same value on the master
...@@ -73,7 +100,14 @@ sync_with_master; ...@@ -73,7 +100,14 @@ sync_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status; show slave status;
select * from t2; select * from t2;
#
# Test forcing the replication log to rotate
#
connection master; connection master;
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables part 2");
let $1=100; let $1=100;
drop table if exists t3; drop table if exists t3;
create table t3 (n int); create table t3 (n int);
...@@ -85,13 +119,16 @@ while ($1) ...@@ -85,13 +119,16 @@ while ($1)
dec $1; dec $1;
} }
enable_query_log; enable_query_log;
create table t4 select * from temp_table;
show master logs; show master logs;
show master status; show master status;
save_master_pos; save_master_pos;
connection slave; connection slave;
slave stop; #slave stop;
slave start; #slave start;
sync_with_master; sync_with_master;
select * from t4;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status; show slave status;
# because of concurrent insert, the table may not be up to date # because of concurrent insert, the table may not be up to date
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log; MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log;
extern I_List<i_string> binlog_do_db, binlog_ignore_db; extern I_List<i_string> binlog_do_db, binlog_ignore_db;
extern ulong max_binlog_size;
static bool test_if_number(const char *str, static bool test_if_number(const char *str,
long *res, bool allow_wildcards); long *res, bool allow_wildcards);
......
...@@ -477,13 +477,12 @@ class THD :public ilink { ...@@ -477,13 +477,12 @@ class THD :public ilink {
} }
inline void close_active_vio() inline void close_active_vio()
{ {
pthread_mutex_lock(&LOCK_delete); safe_mutex_assert_owner(&LOCK_delete);
if (active_vio) if (active_vio)
{ {
vio_close(active_vio); vio_close(active_vio);
active_vio = 0; active_vio = 0;
} }
pthread_mutex_unlock(&LOCK_delete);
} }
#endif #endif
void awake(bool prepare_to_die); void awake(bool prepare_to_die);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment