summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-08-09 00:13:49 +0300
committermonty@mysql.com <>2005-08-09 00:13:49 +0300
commit99cb083549fb13a5f9e6d13617e75f1fadf65236 (patch)
treef29a98a0f6052dc852c1bf2c088567e6a0bb7f6d /sql
parent30a51b53231d655af747d1506575d4878f4f2342 (diff)
downloadmariadb-git-99cb083549fb13a5f9e6d13617e75f1fadf65236.tar.gz
Review of new pushed code
- Fixed some error condtion when handling dates with 'T' - Added extra test for bug #11867 (Wrong result with "... WHERE ROW( a, b ) IN ( SELECT DISTINCT a, b WHERE ...)" to show it's not yet fixed - Safety fixes and cleanups
Diffstat (limited to 'sql')
-rw-r--r--sql/slave.cc4
-rw-r--r--sql/sql_parse.cc12
-rw-r--r--sql/sql_select.cc6
-rw-r--r--sql/sql_union.cc6
4 files changed, 16 insertions, 12 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index a0cc773d44f..9ff7a432b89 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2186,8 +2186,8 @@ int show_master_info(THD* thd, MASTER_INFO* mi)
&my_charset_bin);
protocol->store((ulonglong) mi->rli.group_relay_log_pos);
protocol->store(mi->rli.group_master_log_name, &my_charset_bin);
- protocol->store(mi->slave_running == MYSQL_SLAVE_RUN_CONNECT
- ? "Yes":"No", &my_charset_bin);
+ protocol->store(mi->slave_running == MYSQL_SLAVE_RUN_CONNECT ?
+ "Yes" : "No", &my_charset_bin);
protocol->store(mi->rli.slave_running ? "Yes":"No", &my_charset_bin);
protocol->store(&replicate_do_db);
protocol->store(&replicate_ignore_db);
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 135cef43e90..869e8e5063f 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -4211,10 +4211,12 @@ void create_select_for_variable(const char *var_name)
We set the name of Item to @@session.var_name because that then is used
as the column name in the output.
*/
- var= get_system_var(thd, OPT_SESSION, tmp, null_lex_string);
- end= strxmov(buff, "@@session.", var_name, NullS);
- var->set_name(buff, end-buff, system_charset_info);
- add_item_to_list(thd, var);
+ if ((var= get_system_var(thd, OPT_SESSION, tmp, null_lex_string)))
+ {
+ end= strxmov(buff, "@@session.", var_name, NullS);
+ var->set_name(buff, end-buff, system_charset_info);
+ add_item_to_list(thd, var);
+ }
DBUG_VOID_RETURN;
}
@@ -5038,11 +5040,13 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
THR_LOCK_DATA **end_p= lock_p + thd->locked_tables->lock_count;
for (; lock_p < end_p; lock_p++)
+ {
if ((*lock_p)->type == TL_WRITE)
{
my_error(ER_LOCK_OR_ACTIVE_TRANSACTION, MYF(0));
return 1;
}
+ }
}
/*
Writing to the binlog could cause deadlocks, as we don't log
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 54afe5bb7a6..353ccf79ab8 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2260,11 +2260,9 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond,
We use null_rejecting in add_not_null_conds() to add
'othertbl.field IS NOT NULL' to tab->select_cond.
*/
- (*key_fields)->null_rejecting= (cond->functype() == Item_func::EQ_FUNC) &&
+ (*key_fields)->null_rejecting= ((cond->functype() == Item_func::EQ_FUNC) &&
((*value)->type() == Item::FIELD_ITEM) &&
-
- (((Item_field*)*value)->field->maybe_null() ||
- ((Item_field *)*value)->field->table->maybe_null);
+ ((Item_field*)*value)->field->maybe_null());
(*key_fields)++;
}
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index c33444fd73e..8bb53f7b573 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -285,6 +285,8 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
List_iterator_fast<Item> tp(types);
Item_arena *arena= thd->current_arena;
Item *type;
+ ulong create_options;
+
while ((type= tp++))
{
if (type->result_type() == STRING_RESULT &&
@@ -295,8 +297,8 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
}
}
- ulong create_options= first_select_in_union()->options | thd_arg->options |
- TMP_TABLE_ALL_COLUMNS;
+ create_options= (first_select_in_union()->options | thd_arg->options |
+ TMP_TABLE_ALL_COLUMNS);
/*
Force the temporary table to be a MyISAM table if we're going to use
fullext functions (MATCH ... AGAINST .. IN BOOLEAN MODE) when reading