summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/item.h2
-rw-r--r--sql/item_cmpfunc.h2
-rw-r--r--sql/item_func.h7
-rw-r--r--sql/item_geofunc.cc2
-rw-r--r--sql/item_geofunc.h2
-rw-r--r--sql/item_timefunc.h2
-rw-r--r--sql/sql_insert.cc6
7 files changed, 11 insertions, 12 deletions
diff --git a/sql/item.h b/sql/item.h
index e5b71eb1845..d31660e5b16 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1056,7 +1056,7 @@ public:
int save_str_value_in_field(Field *field, String *result);
virtual Field *get_tmp_table_field() { return 0; }
- virtual Field *create_field_for_create_select(THD *thd, TABLE *table);
+ virtual Field *create_field_for_create_select(TABLE *table);
virtual Field *create_field_for_schema(THD *thd, TABLE *table);
virtual const char *full_name() const { return name ? name : "???"; }
const char *field_name_or_null()
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 3285b5c6d50..f899775ce88 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -951,7 +951,7 @@ public:
maybe_null= args[1]->maybe_null;
}
const char *func_name() const { return "ifnull"; }
- Field *create_field_for_create_select(THD *thd, TABLE *table)
+ Field *create_field_for_create_select(TABLE *table)
{ return tmp_table_field_from_field_type(table, false, false); }
table_map not_null_tables() const { return 0; }
diff --git a/sql/item_func.h b/sql/item_func.h
index 8316bb72c7d..a909d93dbaa 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -173,9 +173,8 @@ public:
}
void signal_divide_by_null();
friend class udf_handler;
- Field *create_field_for_create_select(THD *thd, TABLE *table)
+ Field *create_field_for_create_select(TABLE *table)
{
- DBUG_ASSERT(thd == table->in_use);
return result_type() != STRING_RESULT ?
create_tmp_field(false, table, MY_INT32_NUM_DECIMAL_DIGITS) :
tmp_table_field_from_field_type(table, false, false);
@@ -1789,7 +1788,7 @@ public:
bool update();
bool fix_fields(THD *thd, Item **ref);
void fix_length_and_dec();
- Field *create_field_for_create_select(THD *thd, TABLE *table)
+ Field *create_field_for_create_select(TABLE *table)
{
return result_type() != STRING_RESULT ?
create_tmp_field(false, table, MY_INT32_NUM_DECIMAL_DIGITS) :
@@ -2158,7 +2157,7 @@ public:
enum enum_field_types field_type() const;
- Field *create_field_for_create_select(THD *thd, TABLE *table)
+ Field *create_field_for_create_select(TABLE *table)
{
return result_type() != STRING_RESULT ?
sp_result_field :
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index bc4bde575b0..c856aa985b3 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -40,7 +40,7 @@
#include "opt_range.h"
-Field *Item_geometry_func::create_field_for_create_select(THD *thd, TABLE *t_arg)
+Field *Item_geometry_func::create_field_for_create_select(TABLE *t_arg)
{
Field *result;
if ((result= new Field_geom(max_length, maybe_null, name, t_arg->s,
diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h
index 93d52013e89..58e1d0a78fb 100644
--- a/sql/item_geofunc.h
+++ b/sql/item_geofunc.h
@@ -40,7 +40,7 @@ public:
Item_geometry_func(THD *thd, List<Item> &list): Item_str_func(thd, list) {}
void fix_length_and_dec();
enum_field_types field_type() const { return MYSQL_TYPE_GEOMETRY; }
- Field *create_field_for_create_select(THD *thd, TABLE *table);
+ Field *create_field_for_create_select(TABLE *table);
};
class Item_func_geometry_from_text: public Item_geometry_func
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 9f67a1dabe6..80e7c1010d0 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -506,7 +506,7 @@ public:
bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date) { DBUG_ASSERT(0); return 1; }
my_decimal *val_decimal(my_decimal *decimal_value)
{ return val_decimal_from_date(decimal_value); }
- Field *create_field_for_create_select(THD *thd, TABLE *table)
+ Field *create_field_for_create_select(TABLE *table)
{ return tmp_table_field_from_field_type(table, false, false); }
int save_in_field(Field *field, bool no_conversions)
{ return save_date_in_field(field); }
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index d237360190e..80287793175 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -3934,10 +3934,10 @@ void select_insert::abort_result_set() {
CREATE TABLE (SELECT) ...
***************************************************************************/
-Field *Item::create_field_for_create_select(THD *thd, TABLE *table)
+Field *Item::create_field_for_create_select(TABLE *table)
{
Field *def_field, *tmp_field;
- return ::create_tmp_field(thd, table, this, type(),
+ return ::create_tmp_field(table->in_use, table, this, type(),
(Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0);
}
@@ -4012,7 +4012,7 @@ static TABLE *create_table_from_items(THD *thd,
while ((item=it++))
{
- Field *tmp_field= item->create_field_for_create_select(thd, &tmp_table);
+ Field *tmp_field= item->create_field_for_create_select(&tmp_table);
if (!tmp_field)
DBUG_RETURN(NULL);