summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-10-08 21:50:05 +0300
committerunknown <monty@narttu.mysql.fi>2003-10-08 21:50:05 +0300
commitd1d07c99d7dc1f443776a48e66aa471b3b4535e4 (patch)
treecaac541df5c696ac2dd3b9e21880442e8961b4dc /sql
parent44e3cbcfeb14dd45b2eea154a8a602a5851cfac9 (diff)
downloadmariadb-git-d1d07c99d7dc1f443776a48e66aa471b3b4535e4.tar.gz
Indentation cleanups
Remove wait_if_global_read_lock on commit as this can cause deadlocks BUILD/FINISH.sh: Cleanup BUILD/SETUP.sh: Cleanup BUILD/compile-pentium-valgrind-max: Don't write message twice mysql-test/r/innodb.result: Removed failure as this can cause deadlocks mysql-test/r/rpl_max_relay_size.result: Make test repeatable mysql-test/t/innodb.test: Removed failure as this can cause deadlocks mysql-test/t/rpl_max_relay_size.test: Removed failure as this can cause deadlocks sql/handler.cc: Remove wait_if_global_read_lock as this can cause deadlocks sql/opt_range.cc: Indentation cleanup sql/sql_db.cc: Comment cleanup sql/sql_parse.cc: Comment cleanup sql/sql_repl.cc: Indentation cleanup sql/sql_select.cc: Indentation cleanup
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.cc3
-rw-r--r--sql/opt_range.cc10
-rw-r--r--sql/sql_db.cc14
-rw-r--r--sql/sql_parse.cc5
-rw-r--r--sql/sql_repl.cc4
-rw-r--r--sql/sql_select.cc2
6 files changed, 19 insertions, 19 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index e14e326792d..a8e9f9cf50a 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -359,10 +359,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
if (trans == &thd->transaction.all && mysql_bin_log.is_open() &&
my_b_tell(&thd->transaction.trans_log))
{
- if (wait_if_global_read_lock(thd, 0))
- DBUG_RETURN(1);
mysql_bin_log.write(thd, &thd->transaction.trans_log, 1);
- start_waiting_global_read_lock(thd);
reinit_io_cache(&thd->transaction.trans_log,
WRITE_CACHE, (my_off_t) 0, 0, 1);
thd->transaction.trans_log.end_of_file= max_binlog_cache_size;
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 5b1e2c98001..24768537e3d 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -456,7 +456,7 @@ SEL_ARG *SEL_ARG::clone(SEL_ARG *new_parent,SEL_ARG **next_arg)
SEL_ARG *tmp;
if (type != KEY_RANGE)
{
- if(!(tmp=new SEL_ARG(type)))
+ if (!(tmp=new SEL_ARG(type)))
return 0; // out of memory
tmp->prev= *next_arg; // Link into next/prev chain
(*next_arg)->next=tmp;
@@ -464,7 +464,7 @@ SEL_ARG *SEL_ARG::clone(SEL_ARG *new_parent,SEL_ARG **next_arg)
}
else
{
- if(!(tmp=new SEL_ARG(field,part, min_value,max_value,
+ if (!(tmp=new SEL_ARG(field,part, min_value,max_value,
min_flag, max_flag, maybe_flag)))
return 0; // out of memory
tmp->parent=new_parent;
@@ -920,7 +920,7 @@ get_mm_parts(PARAM *param, Field *field, Item_func::Functype type,
}
else {
// This key may be used later
- if(!(sel_arg=new SEL_ARG(SEL_ARG::MAYBE_KEY)))
+ if (!(sel_arg=new SEL_ARG(SEL_ARG::MAYBE_KEY)))
DBUG_RETURN(0); // out of memory
}
sel_arg->part=(uchar) key_part->part;
@@ -1488,7 +1488,7 @@ key_or(SEL_ARG *key1,SEL_ARG *key2)
SEL_ARG *key2_next=key2->next;
if (key2_shared)
{
- if(!(key2=new SEL_ARG(*key2)))
+ if (!(key2=new SEL_ARG(*key2)))
return 0; // out of memory
key2->increment_use_count(key1->use_count+1);
key2->next=key2_next; // New copy of key2
@@ -2333,7 +2333,7 @@ get_quick_keys(PARAM *param,QUICK_SELECT *quick,KEY_PART *key,
}
/* Get range for retrieving rows in QUICK_SELECT::get_next */
- if(!(range= new QUICK_RANGE(param->min_key,
+ if (!(range= new QUICK_RANGE(param->min_key,
(uint) (tmp_min_key - param->min_key),
param->max_key,
(uint) (tmp_max_key - param->max_key),
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index d48022f5829..cd0445b42e2 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -393,16 +393,16 @@ exit:
start_waiting_global_read_lock(thd);
/*
If this database was the client's selected database, we silently change the
- client's selected database to nothing (to have an empty SELECT DATABASE() in
- the future). For this we free() thd->db and set it to 0. But we don't do
+ client's selected database to nothing (to have an empty SELECT DATABASE()
+ in the future). For this we free() thd->db and set it to 0. But we don't do
free() for the slave thread. Indeed, doing a x_free() on it leads to nasty
problems (i.e. long painful debugging) because in this thread, thd->db is
the same as data_buf and db of the Query_log_event which is dropping the
- database. So if you free() thd->db, you're freeing data_buf. You set thd->db
- to 0 but not data_buf (thd->db and data_buf are two distinct pointers which
- point to the same place). Then in ~Query_log_event(), we have
- 'if (data_buf) free(data_buf)'
- data_buf is !=0 so this makes a DOUBLE free().
+ database. So if you free() thd->db, you're freeing data_buf. You set
+ thd->db to 0 but not data_buf (thd->db and data_buf are two distinct
+ pointers which point to the same place). Then in ~Query_log_event(), we
+ have 'if (data_buf) free(data_buf)' data_buf is !=0 so this makes a
+ DOUBLE free().
Side effects of this double free() are, randomly (depends on the machine),
when the slave is replicating a DROP DATABASE:
- garbage characters in the error message:
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index b36d4041950..e30fd0acfae 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -4449,7 +4449,10 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
{
if ((options & REFRESH_READ_LOCK) && thd)
{
- // writing to the binlog could cause deadlocks, as we don't log UNLOCK TABLES
+ /*
+ Writing to the binlog could cause deadlocks, as we don't log
+ UNLOCK TABLES
+ */
tmp_write_to_binlog= 0;
if (lock_global_read_lock(thd))
return 1;
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 7bb51989cc3..2345355922c 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -730,7 +730,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
to p, no digits were found, error. If it contains '\0' it
means conversion went ok.
*/
- if(p_end==p || *p_end)
+ if (p_end==p || *p_end)
slave_errno=ER_BAD_SLAVE_UNTIL_COND;
}
else
@@ -753,7 +753,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
ER(ER_UNTIL_COND_IGNORED));
- if(!slave_errno)
+ if (!slave_errno)
slave_errno = start_slave_threads(0 /*no mutex */,
1 /* wait for start */,
mi,
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index f142db044ce..4bab97d4a46 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -5333,7 +5333,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
HAVING will be chcked after processing aggregate functions,
But WHERE should checkd here (we alredy have read tables)
*/
- if(!join->conds || join->conds->val_int())
+ if (!join->conds || join->conds->val_int())
{
if (!(error=(*end_select)(join,join_tab,0)) || error == -3)
error=(*end_select)(join,join_tab,1);