3788 Dmitry Shulga 2012-05-15
This is a prerequisite patch for WL#6030.
This path implements the rename refactoring pattern.
Rename Field::real_is_nullable ==> Field::is_real_nullable.
Such renaming were implemented in order to provide uniform
naming schema for methods related to nullability check (e.g.
is_null()/is_real_null(), is_nullable()/is_real_nullable).
modified:
sql/field.h
sql/field_conv.cc
sql/item_subselect.cc
sql/opt_range.cc
sql/opt_sum.cc
sql/sql_optimizer.cc
sql/sql_partition.cc
sql/sql_select.cc
sql/sql_show.cc
sql/sql_update.cc
sql/table.cc
storage/csv/ha_tina.cc
storage/federated/ha_federated.cc
storage/heap/ha_heap.cc
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/handler0alter.cc
storage/myisam/ha_myisam.cc
3787 Dmitry Shulga 2012-05-15
This is a prerequisite patch for WL#6030.
This patch rewrites the implementation of method
Field::is_real_null in the simpler way. The patch
removed the redundant comparison and rely on the
fact that standard of C++ allow for a construction
like A(some_value) even for primitive types.
modified:
sql/field.h
3786 Dmitry Shulga 2012-05-15
Prerequisite patch for WL#6030.
This patch removes unnecessary argument named is_nullable from
constructors of Field class hierarchy. This argument was introduced
by previous changes set but currently is considered as supersfluous
since the nullability can be induced by the value of argument
null_ptr_arg that points to the memory where the value of nullability
flag is stored.
All references to Field::is_null_in_record_with_offset were replaced by
method Field::is_real_null since the former had the same functionality
and was removed as result of refactoring.
modified:
sql/field.cc
sql/field.h
sql/ha_ndbcluster.cc
sql/item.cc
sql/sql_select.h
sql/sql_tmp_table.cc
3785 Dmitry Shulga 2012-05-11
This patch is a prerequisite for WL#6030.
This patch changes the way that Field's nullability is checked for.
Instead of use null_ptr directly to check for nullability this patch
takes into account the value of Field::flags attribute and the flag
NOT_NULL_FLAG when makes decision about Field's nullability.
Nullability flag is passed explicitly to every field constructor.
It's also renamed maybe_null to is_nullable and real_maybe_null to
real_is_nullable.
@ sql/field.cc
Field's nullability now is checked using deicated value in flags attribute.
The data member null_ptr is no longer used to check for NOT NULL.
The Field constructors and the constructors of derivated from Field
classes were changed to have nullability as an explicit parameter.
Explicit nullability argument was added to the factory method
new_key_field().
new_key_field implementation is changed - make update of flags
for new created field object according to nullability condition.
At some places tabs were removed.
@ sql/field.h
Filed's nullability now is checked using dedicated value in flags attribute.
The data member null_ptr is no longer used to check for NOT NULL.
The constructors of class Field and the constructors of derivated from Field
classes were changed to have nullability as an explicit parameter.
Explicit nullability flag was added to the factory method new_key_field().
Some methods were renamed:
maybe_null ==> is_nullable,
real_maybe_null ==> real_is_nullable
The method is_null_in_record_with_with_offset was removed
since there is the method is_real_null that has the same functionality.
At some places tabs were removed.
@ sql/field_conv.cc
The data mamber is_nullable was introduced that is used for nullability check.
Since the methods Field::maybe_null(), Field::real_maybe_null() were renamed
the references to these methods were also renamed.
do_outer_field_to_null_str() were modified: checking for nullability is
performed taking into account that is_nullable attribute may be true but
from_null_ptr still may have NULL value. This is possible since currently
we don't garantee that Fiedld::null_ptr is never equal to NULL. Such
assertion will be true after a follow-up patch.
do_copy_not_null() was modified: added check for NULL against value
of Copy_field::from_null_ptr before makes dereference this pointer.
At some places tabs were removed.
@ sql/filesort.cc
Since the method Field::maybe_null was renamed the references to this
method were also renamed.
@ sql/item.cc
Since the method Field::maybe_null was renamed the references to this method
were also renamed. The methods Item::tmp_table_field_from_field_type() and
Item_type_holder::make_field_by_type() were modified: added passing of
an explicit nullability flag to constructor of classes derived from Field.
@ sql/item_subselect.cc
References to Field::real_maybe_null() were replaced by
Field::real_is_nullable() since the "rename" refactoring method
was applied to Field class.
@ sql/key.cc
References to Field::is_null_in_record_with_offset () were replaced by
Field::is_real_null() since the first method was removed as having
a duplicate functionality against Field::is_real_null.
@ sql/log_event.cc
References to Field::maybe_null() were replaced by Field::is_nullable()
since the "rename" refactoring method was applied to Field class.
@ sql/log_event_old.cc
References to Field::maybe_null() were replaced by Field::is_nullable()
since the "rename" refactoring method was applied to Field class.
@ sql/opt_range.cc
References to Field::real_maybe_null() were replaced by
Field::real_is_nullable() since the "rename" refactoring method
was applied to Field class.
@ sql/opt_sum.cc
References to Field::real_maybe_null() were replaced by
Field::real_is_nullable() since the "rename" refactoring method
was applied to Field class.
@ sql/rpl_record.cc
References to Field::maybe_null() were replaced by
Field::is_nullable() since the "rename" refactoring method
was applied to Field class.
@ sql/sql_join_buffer.cc
References to Field::maybe_null() were replaced by
Field::is_nullable() since the "rename" refactoring method
was applied to Field class.
@ sql/sql_load.cc
References to Field::maybe_null() were replaced by
Field::is_nullable() since the "rename" refactoring method
was applied to Field class.
@ sql/sql_optimizer.cc
References to Field::maybe_null() and Field::real_maybe_null()
were replaced by Field::is_nullable() and Field::real_is_nullable()
since the "rename" refactoring method was applied to Field class.
Access to data member Field::null_ptr to check for nullability
was replaced by call to method Field::real_is_nullable.
@ sql/sql_partition.cc
References to Field::maybe_null() and Field::real_maybe_null()
were replaced by Field::is_nullable() and Field::real_is_nullable()
since the "rename" refactoring method was applied to Field class.
@ sql/sql_resolver.cc
The reference to Field::maybe_null() was replaced by
Field::is_nullable() since the "rename" refactoring method
was applied to Field class.
@ sql/sql_select.cc
Reference to Field::real_maybe_null() was replaced by
Field::real_is_nullable() since the "rename" refactoring method
was applied to Field class. Explicit use of constant NOT_NULL_FLAG
was replaced by call of method Field::real_is_nullable().
@ sql/sql_select.h
References to Field::maybe_nullable() were replaced by Field::is_nullable()
since the "rename" refactoring method was applied to Field class.
Added passing of explicit nullability flag when instantiating the
class derived from Field (over call to Field::new_key_field or explicitly
using the constructor of class Field_varstring).
@ sql/sql_show.cc
References to Field::maybe_null() were replaced by
Field::is_nullable() since the "rename" refactoring method
was applied to Field class. Access to the data member Field::flags
to check for nullability were replaced by the call of
Field::real_is_nullable().
@ sql/sql_tmp_table.cc
References to Field::maybe_null() were replaced by
Field::is_nullable() since the "rename" refactoring method
was applied to Field class.
Added passing of explicit nullability flag when instantiating the
class derived from Field (over call to Field::new_key_field or explicitly
using the constructor of class Field_string).
@ sql/sql_update.cc
References to Field::real_maybe_null() were replaced by
Field::real_is_nullable() since the "rename" refactoring method
was applied to Field class.
@ sql/table.cc
References to Field::real_maybe_null() were replaced by
Field::real_is_nullable() since the "rename" refactoring method
was applied to Field class. Access to data member Field::null_ptr
to check for nullability was replaced by call to the method
Field::real_is_nullable.
@ sql/unireg.cc
make_empty_rec() was modified: access to the Field::null_ptr attribute
when set nullability for a field were replaced by the call of
Field::set_null().
@ storage/csv/ha_tina.cc
The reference to Field::real_maybe_null() was replaced by
Field::real_is_nullable() since the "rename" refactoring method
was applied to Field class.
@ storage/federated/ha_federated.cc
Access to data member Field::null_ptr to check for nullability
was replaced by call to method Field::real_is_nullable.
@ storage/heap/ha_heap.cc
Access to data member Field::null_ptr to check for nullability
was replaced by call to method Field::real_is_nullable.
@ storage/innobase/handler/ha_innodb.cc
Access to data member Field::null_ptr to check for nullability
were replaced by call to method Field::real_is_nullable.
@ storage/innobase/handler/handler0alter.cc
Access to data member Field::null_ptr to check for nullability
was replaced by call to method Field::real_is_nullable.
References to Field::real_maybe_null() were replaced by
Field::real_is_nullable() since the "rename" refactoring method
was applied to Field class.
@ storage/myisam/ha_myisam.cc
Access to data member Field::null_ptr to check for nullability
was replaced by call to method Field::real_is_nullable.
modified:
sql/field.cc
sql/field.h
sql/field_conv.cc
sql/filesort.cc
sql/item.cc
sql/item_subselect.cc
sql/key.cc
sql/log_event.cc
sql/log_event_old.cc
sql/opt_range.cc
sql/opt_sum.cc
sql/rpl_record.cc
sql/sql_join_buffer.cc
sql/sql_load.cc
sql/sql_optimizer.cc
sql/sql_partition.cc
sql/sql_resolver.cc
sql/sql_select.cc
sql/sql_select.h
sql/sql_show.cc
sql/sql_tmp_table.cc
sql/sql_update.cc
sql/table.cc
sql/unireg.cc
storage/csv/ha_tina.cc
storage/federated/ha_federated.cc
storage/heap/ha_heap.cc
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/handler0alter.cc
storage/myisam/ha_myisam.cc
=== modified file 'sql/field.cc'
--- a/sql/field.cc 2012-05-11 08:55:35 +0000
+++ b/sql/field.cc 2012-05-15 12:39:41 +0000
@@ -1107,10 +1107,10 @@ bool Field::type_can_have_key_part(enum
Numeric fields base class constructor.
*/
Field_num::Field_num(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- utype unireg_check_arg, const char *field_name_arg,
- uint8 dec_arg, bool zero_arg, bool unsigned_arg)
- :Field(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ uchar null_bit_arg, utype unireg_check_arg,
+ const char *field_name_arg, uint8 dec_arg,
+ bool zero_arg, bool unsigned_arg)
+ :Field(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg),
dec(dec_arg),zerofill(zero_arg),unsigned_flag(unsigned_arg)
{
@@ -1319,8 +1319,8 @@ String *Field::val_int_as_str(String *va
/// This is used as a table name when the table structure is not set up
Field::Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- utype unireg_check_arg, const char *field_name_arg)
+ uchar null_bit_arg, utype unireg_check_arg,
+ const char *field_name_arg)
:ptr(ptr_arg), null_ptr(null_ptr_arg),
table(0), orig_table(0), table_name(0),
field_name(field_name_arg),
@@ -1328,7 +1328,7 @@ Field::Field(uchar *ptr_arg,uint32 lengt
field_length(length_arg), null_bit(null_bit_arg),
is_created_from_null_item(FALSE)
{
- flags= is_nullable ? 0: NOT_NULL_FLAG;
+ flags= null_ptr ? 0: NOT_NULL_FLAG;
comment.str= (char*) "";
comment.length=0;
field_index= 0;
@@ -1694,10 +1694,10 @@ bool Field_num::get_time(MYSQL_TIME *lti
Field_str::Field_str(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- utype unireg_check_arg, const char *field_name_arg,
+ uchar null_bit_arg, utype unireg_check_arg,
+ const char *field_name_arg,
const CHARSET_INFO *charset_arg)
- :Field(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ :Field(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg)
{
field_charset= charset_arg;
@@ -1858,7 +1858,7 @@ Field *Field::new_field(MEM_ROOT *root,
Field *Field::new_key_field(MEM_ROOT *root, TABLE *new_table,
uchar *new_ptr, uchar *new_null_ptr,
- uint new_null_bit, bool is_nullable)
+ uint new_null_bit)
{
Field *tmp;
if ((tmp= new_field(root, new_table, table == new_table)))
@@ -1866,7 +1866,7 @@ Field *Field::new_key_field(MEM_ROOT *ro
tmp->ptr= new_ptr;
tmp->null_ptr= new_null_ptr;
tmp->null_bit= new_null_bit;
- tmp->flags|= is_nullable ? 0: NOT_NULL_FLAG;
+ tmp->flags|= new_null_ptr ? 0: NOT_NULL_FLAG;
}
return tmp;
}
@@ -2508,13 +2508,13 @@ void Field_decimal::sql_type(String &res
Field_new_decimal::Field_new_decimal(uchar *ptr_arg,
uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
+ uchar null_bit_arg,
enum utype unireg_check_arg,
const char *field_name_arg,
uint8 dec_arg,bool zero_arg,
bool unsigned_arg)
- :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
- unireg_check_arg, field_name_arg, dec_arg, zero_arg, unsigned_arg)
+ :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
+ field_name_arg, dec_arg, zero_arg, unsigned_arg)
{
precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg);
set_if_smaller(precision, DECIMAL_MAX_PRECISION);
@@ -2531,7 +2531,7 @@ Field_new_decimal::Field_new_decimal(uin
bool unsigned_arg)
:Field_num((uchar*) 0, len_arg,
is_nullable ? (uchar*) "": 0, 0,
- is_nullable, NONE, name, dec_arg, 0, unsigned_arg)
+ NONE, name, dec_arg, 0, unsigned_arg)
{
precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg);
set_if_smaller(precision, DECIMAL_MAX_PRECISION);
@@ -5248,11 +5248,10 @@ my_decimal *Field_temporal_with_date_and
*/
Field_timestamp::Field_timestamp(uchar *ptr_arg, uint32 len_arg,
uchar *null_ptr_arg, uchar null_bit_arg,
- bool is_nullable, enum utype unireg_check_arg,
+ enum utype unireg_check_arg,
const char *field_name_arg)
:Field_temporal_with_date_and_time(ptr_arg, null_ptr_arg, null_bit_arg,
- is_nullable, unireg_check_arg,
- field_name_arg, 0)
+ unireg_check_arg, field_name_arg, 0)
{
init_timestamp_flags();
/* For 4.0 MYD and 4.0 InnoDB compatibility */
@@ -5264,7 +5263,7 @@ Field_timestamp::Field_timestamp(bool is
const char *field_name_arg)
:Field_temporal_with_date_and_time((uchar *) 0,
is_nullable ? (uchar *) "" : 0, 0,
- is_nullable, NONE, field_name_arg, 0)
+ NONE, field_name_arg, 0)
{
init_timestamp_flags();
/* For 4.0 MYD and 4.0 InnoDB compatibility */
@@ -5427,11 +5426,11 @@ void Field_timestamp::sql_type(String &r
****************************************************************************/
Field_timestampf::Field_timestampf(uchar *ptr_arg,
uchar *null_ptr_arg, uchar null_bit_arg,
- bool is_nullable, enum utype unireg_check_arg,
+ enum utype unireg_check_arg,
const char *field_name_arg,
uint8 dec_arg)
:Field_temporal_with_date_and_timef(ptr_arg, null_ptr_arg, null_bit_arg,
- is_nullable, unireg_check_arg,
+ unireg_check_arg,
field_name_arg, dec_arg)
{
init_timestamp_flags();
@@ -5443,7 +5442,7 @@ Field_timestampf::Field_timestampf(bool
uint8 dec_arg)
:Field_temporal_with_date_and_timef((uchar*) 0,
is_nullable ? (uchar*) "": 0, 0,
- is_nullable, NONE, field_name_arg, dec_arg)
+ NONE, field_name_arg, dec_arg)
{
if (unireg_check != TIMESTAMP_DN_FIELD)
flags|= ON_UPDATE_NOW_FLAG;
@@ -7414,15 +7413,14 @@ Field *Field_varstring::new_field(MEM_RO
Field *Field_varstring::new_key_field(MEM_ROOT *root,
TABLE *new_table,
uchar *new_ptr, uchar *new_null_ptr,
- uint new_null_bit, bool is_nullable)
+ uint new_null_bit)
{
Field_varstring *res;
if ((res= (Field_varstring*) Field::new_key_field(root,
new_table,
new_ptr,
new_null_ptr,
- new_null_bit,
- is_nullable)))
+ new_null_bit)))
{
/* Keys length prefixes are always packed with 2 bytes */
res->length_bytes= 2;
@@ -7469,12 +7467,11 @@ void Field_varstring::hash(ulong *nr, ul
****************************************************************************/
Field_blob::Field_blob(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
- bool is_nullable, enum utype unireg_check_arg,
- const char *field_name_arg,
+ enum utype unireg_check_arg, const char *field_name_arg,
TABLE_SHARE *share, uint blob_pack_length,
const CHARSET_INFO *cs)
:Field_longstr(ptr_arg, BLOB_PACK_LENGTH_TO_MAX_LENGH(blob_pack_length),
- null_ptr_arg, null_bit_arg, is_nullable, unireg_check_arg,
+ null_ptr_arg, null_bit_arg, unireg_check_arg,
field_name_arg, cs),
packlength(blob_pack_length)
{
@@ -8773,10 +8770,10 @@ uint Field_num::is_equal(Create_field *n
*/
Field_bit::Field_bit(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable, uchar *bit_ptr_arg,
+ uchar null_bit_arg, uchar *bit_ptr_arg,
uchar bit_ofs_arg, enum utype unireg_check_arg,
const char *field_name_arg)
- : Field(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ : Field(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg),
bit_ptr(bit_ptr_arg), bit_ofs(bit_ofs_arg), bit_len(len_arg & 7),
bytes_in_rec(len_arg / 8)
@@ -8842,12 +8839,12 @@ Field_bit::do_last_null_byte() const
Field *Field_bit::new_key_field(MEM_ROOT *root,
TABLE *new_table,
uchar *new_ptr, uchar *new_null_ptr,
- uint new_null_bit, bool is_nullable)
+ uint new_null_bit)
{
Field_bit *res;
if ((res= (Field_bit*) Field::new_key_field(root, new_table,
new_ptr, new_null_ptr,
- new_null_bit, is_nullable)))
+ new_null_bit)))
{
/* Move bits normally stored in null_pointer to new_ptr */
res->bit_ptr= new_ptr;
@@ -9293,10 +9290,9 @@ void Field_bit::set_default()
Field_bit_as_char::Field_bit_as_char(uchar *ptr_arg, uint32 len_arg,
uchar *null_ptr_arg, uchar null_bit_arg,
- bool is_nullable,
enum utype unireg_check_arg,
const char *field_name_arg)
- :Field_bit(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable, 0, 0,
+ :Field_bit(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, 0, 0,
unireg_check_arg, field_name_arg)
{
flags|= UNSIGNED_FLAG;
@@ -10021,12 +10017,11 @@ Field *make_field(TABLE_SHARE *share, uc
field_type == MYSQL_TYPE_DECIMAL || // 3.23 or 4.0 string
field_type == MYSQL_TYPE_VAR_STRING)
return new Field_string(ptr, field_length, null_pos, null_bit,
- is_nullable, unireg_check, field_name,
- field_charset);
+ unireg_check, field_name, field_charset);
if (field_type == MYSQL_TYPE_VARCHAR)
return new Field_varstring(ptr,field_length,
HA_VARCHAR_PACKLENGTH(field_length),
- null_pos, null_bit, is_nullable,
+ null_pos, null_bit,
unireg_check, field_name,
share,
field_charset);
@@ -10039,105 +10034,105 @@ Field *make_field(TABLE_SHARE *share, uc
#ifdef HAVE_SPATIAL
if (f_is_geom(pack_flag))
- return new Field_geom(ptr, null_pos, null_bit, is_nullable,
+ return new Field_geom(ptr, null_pos, null_bit,
unireg_check, field_name, share,
pack_length, geom_type);
#endif
if (f_is_blob(pack_flag))
- return new Field_blob(ptr, null_pos, null_bit, is_nullable,
+ return new Field_blob(ptr, null_pos, null_bit,
unireg_check, field_name, share,
pack_length, field_charset);
if (interval)
{
if (f_is_enum(pack_flag))
return new Field_enum(ptr, field_length, null_pos, null_bit,
- is_nullable, unireg_check, field_name,
- pack_length, interval, field_charset);
+ unireg_check, field_name, pack_length,
+ interval, field_charset);
else
return new Field_set(ptr, field_length, null_pos, null_bit,
- is_nullable, unireg_check, field_name,
- pack_length, interval, field_charset);
+ unireg_check, field_name, pack_length,
+ interval, field_charset);
}
}
switch (field_type) {
case MYSQL_TYPE_DECIMAL:
return new Field_decimal(ptr, field_length, null_pos, null_bit,
- is_nullable, unireg_check, field_name,
+ unireg_check, field_name,
f_decimals(pack_flag),
f_is_zerofill(pack_flag) != 0,
f_is_dec(pack_flag) == 0);
case MYSQL_TYPE_NEWDECIMAL:
return new Field_new_decimal(ptr,field_length,null_pos,null_bit,
- is_nullable, unireg_check, field_name,
+ unireg_check, field_name,
f_decimals(pack_flag),
f_is_zerofill(pack_flag) != 0,
f_is_dec(pack_flag) == 0);
case MYSQL_TYPE_FLOAT:
return new Field_float(ptr,field_length,null_pos,null_bit,
- is_nullable, unireg_check, field_name,
+ unireg_check, field_name,
f_decimals(pack_flag),
f_is_zerofill(pack_flag) != 0,
f_is_dec(pack_flag)== 0);
case MYSQL_TYPE_DOUBLE:
return new Field_double(ptr,field_length,null_pos,null_bit,
- is_nullable, unireg_check, field_name,
+ unireg_check, field_name,
f_decimals(pack_flag),
f_is_zerofill(pack_flag) != 0,
f_is_dec(pack_flag)== 0);
case MYSQL_TYPE_TINY:
return new Field_tiny(ptr,field_length,null_pos,null_bit,
- is_nullable, unireg_check, field_name,
+ unireg_check, field_name,
f_is_zerofill(pack_flag) != 0,
f_is_dec(pack_flag) == 0);
case MYSQL_TYPE_SHORT:
return new Field_short(ptr,field_length,null_pos,null_bit,
- is_nullable, unireg_check, field_name,
+ unireg_check, field_name,
f_is_zerofill(pack_flag) != 0,
f_is_dec(pack_flag) == 0);
case MYSQL_TYPE_INT24:
return new Field_medium(ptr,field_length,null_pos,null_bit,
- is_nullable, unireg_check, field_name,
+ unireg_check, field_name,
f_is_zerofill(pack_flag) != 0,
f_is_dec(pack_flag) == 0);
case MYSQL_TYPE_LONG:
return new Field_long(ptr,field_length,null_pos,null_bit,
- is_nullable, unireg_check, field_name,
+ unireg_check, field_name,
f_is_zerofill(pack_flag) != 0,
f_is_dec(pack_flag) == 0);
case MYSQL_TYPE_LONGLONG:
return new Field_longlong(ptr,field_length,null_pos,null_bit,
- is_nullable, unireg_check, field_name,
+ unireg_check, field_name,
f_is_zerofill(pack_flag) != 0,
f_is_dec(pack_flag) == 0);
case MYSQL_TYPE_TIMESTAMP:
return new Field_timestamp(ptr, field_length, null_pos, null_bit,
- is_nullable, unireg_check, field_name);
+ unireg_check, field_name);
case MYSQL_TYPE_TIMESTAMP2:
return new Field_timestampf(ptr, null_pos, null_bit,
- is_nullable, unireg_check, field_name,
+ unireg_check, field_name,
field_length > MAX_DATETIME_WIDTH ?
field_length - 1 - MAX_DATETIME_WIDTH : 0);
case MYSQL_TYPE_YEAR:
return new Field_year(ptr,field_length,null_pos,null_bit,
- is_nullable, unireg_check, field_name);
+ unireg_check, field_name);
case MYSQL_TYPE_NEWDATE:
- return new Field_newdate(ptr, null_pos, null_bit, is_nullable,
+ return new Field_newdate(ptr, null_pos, null_bit,
unireg_check, field_name);
case MYSQL_TYPE_TIME:
- return new Field_time(ptr, null_pos, null_bit, is_nullable,
+ return new Field_time(ptr, null_pos, null_bit,
unireg_check, field_name);
case MYSQL_TYPE_TIME2:
- return new Field_timef(ptr, null_pos, null_bit, is_nullable,
+ return new Field_timef(ptr, null_pos, null_bit,
unireg_check, field_name,
(field_length > MAX_TIME_WIDTH) ?
field_length - 1 - MAX_TIME_WIDTH : 0);
case MYSQL_TYPE_DATETIME:
- return new Field_datetime(ptr, null_pos, null_bit, is_nullable,
+ return new Field_datetime(ptr, null_pos, null_bit,
unireg_check, field_name);
case MYSQL_TYPE_DATETIME2:
- return new Field_datetimef(ptr, null_pos, null_bit, is_nullable,
+ return new Field_datetimef(ptr, null_pos, null_bit,
unireg_check, field_name,
(field_length > MAX_DATETIME_WIDTH) ?
field_length - 1 - MAX_DATETIME_WIDTH : 0);
@@ -10147,8 +10142,8 @@ Field *make_field(TABLE_SHARE *share, uc
case MYSQL_TYPE_BIT:
return f_bit_as_char(pack_flag) ?
new Field_bit_as_char(ptr, field_length, null_pos, null_bit,
- is_nullable, unireg_check, field_name) :
- new Field_bit(ptr, field_length, null_pos, null_bit, is_nullable,
+ unireg_check, field_name) :
+ new Field_bit(ptr, field_length, null_pos, null_bit,
bit_ptr, bit_offset, unireg_check, field_name);
default: // Impossible (Wrong version)
=== modified file 'sql/field.h'
--- a/sql/field.h 2012-05-11 08:55:35 +0000
+++ b/sql/field.h 2012-05-15 15:47:14 +0000
@@ -391,7 +391,7 @@ public:
bool is_created_from_null_item;
Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable, utype unireg_check_arg,
+ uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg);
virtual ~Field() {}
/* Store functions returns 1 on overflow and -1 on fatal error */
@@ -629,7 +629,7 @@ public:
my_ptrdiff_t l_offset= (my_ptrdiff_t) (table->s->default_values -
table->record[0]);
memcpy(ptr, ptr + l_offset, pack_length());
- if (real_is_nullable())
+ if (is_real_nullable())
*null_ptr= ((*null_ptr & (uchar) ~null_bit) |
(null_ptr[l_offset] & null_bit));
}
@@ -731,33 +731,32 @@ public:
if (table->null_row)
return true;
- if (real_is_nullable())
+ if (is_real_nullable())
return (null_ptr[row_offset] & null_bit);
return false;
}
inline bool is_real_null(my_ptrdiff_t row_offset= 0)
{
- return real_is_nullable() ?
- (null_ptr[row_offset] & null_bit ? true : false) :
- false;
+ return is_real_nullable() ? bool(null_ptr[row_offset] & null_bit)
+ : false;
}
inline bool is_null_in_record(const uchar *record)
{
- if (!real_is_nullable())
+ if (!is_real_nullable())
return false;
return test(record[(uint) (null_ptr - table->record[0])] &
null_bit);
}
inline void set_null(my_ptrdiff_t row_offset= 0)
- { if (real_is_nullable()) null_ptr[row_offset]|= null_bit; }
+ { if (is_real_nullable()) null_ptr[row_offset]|= null_bit; }
inline void set_notnull(my_ptrdiff_t row_offset= 0)
{ if (null_ptr) null_ptr[row_offset]&= (uchar) ~null_bit; }
- inline bool is_nullable(void) const { return real_is_nullable() || table->maybe_null; }
+ inline bool is_nullable(void) const { return is_real_nullable() || table->maybe_null; }
/**
Signals that this field is NULL-able.
*/
- inline bool real_is_nullable(void) const
+ inline bool is_real_nullable(void) const
{ return !(flags & NOT_NULL_FLAG); }
enum {
@@ -802,7 +801,7 @@ public:
bool keep_type);
virtual Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
uchar *new_ptr, uchar *new_null_ptr,
- uint new_null_bit, bool is_nullable);
+ uint new_null_bit);
/**
Makes a shallow copy of the Field object.
@@ -1237,7 +1236,7 @@ public:
const uint8 dec;
bool zerofill,unsigned_flag; // Purify cannot handle bit fields
Field_num(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable, utype unireg_check_arg,
+ uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg,
uint8 dec_arg, bool zero_arg, bool unsigned_arg);
Item_result result_type () const { return REAL_RESULT; }
@@ -1276,7 +1275,7 @@ protected:
enum Derivation field_derivation;
public:
Field_str(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable, utype unireg_check_arg,
+ uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg, const CHARSET_INFO *charset);
Item_result result_type () const { return STRING_RESULT; }
Item_result numeric_context_result_type() const
@@ -1316,9 +1315,9 @@ protected:
bool count_spaces);
public:
Field_longstr(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable, utype unireg_check_arg,
+ uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg, const CHARSET_INFO *charset_arg)
- :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, charset_arg)
{}
@@ -1332,10 +1331,10 @@ public:
my_bool not_fixed;
Field_real(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable, utype unireg_check_arg,
+ uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg,
uint8 dec_arg, bool zero_arg, bool unsigned_arg)
- :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, dec_arg, zero_arg,
unsigned_arg),
not_fixed(dec_arg >= NOT_FIXED_DEC)
@@ -1357,11 +1356,11 @@ public:
class Field_decimal :public Field_real {
public:
Field_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg,
- uint8 dec_arg,bool zero_arg,bool unsigned_arg)
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg, uint8 dec_arg,
+ bool zero_arg,bool unsigned_arg)
:Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
- is_nullable, unireg_check_arg, field_name_arg,
+ unireg_check_arg, field_name_arg,
dec_arg, zero_arg, unsigned_arg)
{}
enum_field_types type() const { return MYSQL_TYPE_DECIMAL;}
@@ -1415,9 +1414,9 @@ public:
CREATE TABLE ( DECIMAL(x,y))
*/
Field_new_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg,
- uint8 dec_arg, bool zero_arg, bool unsigned_arg);
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg, uint8 dec_arg,
+ bool zero_arg, bool unsigned_arg);
Field_new_decimal(uint32 len_arg, bool is_nullable,
const char *field_name_arg, uint8 dec_arg,
bool unsigned_arg);
@@ -1466,11 +1465,10 @@ public:
class Field_tiny :public Field_num {
public:
Field_tiny(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg,
- bool zero_arg, bool unsigned_arg)
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg, bool zero_arg, bool unsigned_arg)
:Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
- is_nullable, unireg_check_arg, field_name_arg,
+ unireg_check_arg, field_name_arg,
0, zero_arg,unsigned_arg)
{}
enum Item_result result_type () const { return INT_RESULT; }
@@ -1517,17 +1515,16 @@ public:
class Field_short :public Field_num {
public:
Field_short(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg,
- bool zero_arg, bool unsigned_arg)
- :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg, bool zero_arg, bool unsigned_arg)
+ :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg,
0, zero_arg,unsigned_arg)
{}
Field_short(uint32 len_arg,bool is_nullable, const char *field_name_arg,
bool unsigned_arg)
:Field_num((uchar*) 0, len_arg, is_nullable ? (uchar*) "": 0, 0,
- is_nullable, NONE, field_name_arg, 0, 0, unsigned_arg)
+ NONE, field_name_arg, 0, 0, unsigned_arg)
{}
enum Item_result result_type () const { return INT_RESULT; }
enum_field_types type() const { return MYSQL_TYPE_SHORT;}
@@ -1570,10 +1567,9 @@ public:
class Field_medium :public Field_num {
public:
Field_medium(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg,
- bool zero_arg, bool unsigned_arg)
- :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg, bool zero_arg, bool unsigned_arg)
+ :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg,
0, zero_arg,unsigned_arg)
{}
@@ -1619,17 +1615,16 @@ public:
class Field_long :public Field_num {
public:
Field_long(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg,
- bool zero_arg, bool unsigned_arg)
- :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg, bool zero_arg, bool unsigned_arg)
+ :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg,
0, zero_arg,unsigned_arg)
{}
Field_long(uint32 len_arg, bool is_nullable, const char *field_name_arg,
bool unsigned_arg)
:Field_num((uchar*) 0, len_arg, is_nullable ? (uchar*) "": 0, 0,
- is_nullable, NONE, field_name_arg, 0, 0, unsigned_arg)
+ NONE, field_name_arg, 0, 0, unsigned_arg)
{}
enum Item_result result_type () const { return INT_RESULT; }
enum_field_types type() const { return MYSQL_TYPE_LONG;}
@@ -1675,18 +1670,17 @@ public:
class Field_longlong :public Field_num {
public:
Field_longlong(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg,
- bool zero_arg, bool unsigned_arg)
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg, bool zero_arg, bool unsigned_arg)
:Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
- is_nullable, unireg_check_arg, field_name_arg,
+ unireg_check_arg, field_name_arg,
0, zero_arg,unsigned_arg)
{}
Field_longlong(uint32 len_arg, bool is_nullable,
const char *field_name_arg,
bool unsigned_arg)
:Field_num((uchar*) 0, len_arg, is_nullable ? (uchar*) "": 0, 0,
- is_nullable, NONE, field_name_arg,0,0,unsigned_arg)
+ NONE, field_name_arg,0,0,unsigned_arg)
{}
enum Item_result result_type () const { return INT_RESULT; }
enum_field_types type() const { return MYSQL_TYPE_LONGLONG;}
@@ -1737,17 +1731,17 @@ public:
class Field_float :public Field_real {
public:
Field_float(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg,
- uint8 dec_arg,bool zero_arg,bool unsigned_arg)
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg, uint8 dec_arg,
+ bool zero_arg,bool unsigned_arg)
:Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
- is_nullable, unireg_check_arg, field_name_arg,
+ unireg_check_arg, field_name_arg,
dec_arg, zero_arg, unsigned_arg)
{}
Field_float(uint32 len_arg, bool is_nullable, const char *field_name_arg,
uint8 dec_arg)
:Field_real((uchar*) 0, len_arg, is_nullable ? (uchar*) "": 0, (uint) 0,
- is_nullable, NONE, field_name_arg, dec_arg, 0, 0)
+ NONE, field_name_arg, dec_arg, 0, 0)
{}
enum_field_types type() const { return MYSQL_TYPE_FLOAT;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_FLOAT; }
@@ -1780,22 +1774,22 @@ private:
class Field_double :public Field_real {
public:
Field_double(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg,
- uint8 dec_arg,bool zero_arg,bool unsigned_arg)
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg, uint8 dec_arg,
+ bool zero_arg, bool unsigned_arg)
:Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
- is_nullable, unireg_check_arg, field_name_arg,
+ unireg_check_arg, field_name_arg,
dec_arg, zero_arg, unsigned_arg)
{}
Field_double(uint32 len_arg, bool is_nullable, const char *field_name_arg,
uint8 dec_arg)
:Field_real((uchar*) 0, len_arg, is_nullable ? (uchar*) "" : 0, (uint) 0,
- is_nullable, NONE, field_name_arg, dec_arg, 0, 0)
+ NONE, field_name_arg, dec_arg, 0, 0)
{}
Field_double(uint32 len_arg, bool is_nullable, const char *field_name_arg,
uint8 dec_arg, my_bool not_fixed_arg)
:Field_real((uchar*) 0, len_arg, is_nullable ? (uchar*) "" : 0, (uint) 0,
- is_nullable, NONE, field_name_arg, dec_arg, 0, 0)
+ NONE, field_name_arg, dec_arg, 0, 0)
{not_fixed= not_fixed_arg; }
enum_field_types type() const { return MYSQL_TYPE_DOUBLE;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
@@ -1833,8 +1827,8 @@ public:
Field_null(uchar *ptr_arg, uint32 len_arg,
enum utype unireg_check_arg, const char *field_name_arg,
const CHARSET_INFO *cs)
- :Field_str(ptr_arg, len_arg, null, 1, true,
- unireg_check_arg, field_name_arg, cs)
+ :Field_str(ptr_arg, len_arg, null, 1, unireg_check_arg,
+ field_name_arg, cs)
{}
enum_field_types type() const { return MYSQL_TYPE_NULL;}
int store(const char *to, uint length, const CHARSET_INFO *cs)
@@ -2018,12 +2012,12 @@ public:
@param dec_arg Number of second fraction digits, 0..6.
*/
Field_temporal(uchar *ptr_arg,
- uchar *null_ptr_arg, uchar null_bit_arg, bool is_nullable,
+ uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
uint32 len_arg, uint8 dec_arg)
:Field(ptr_arg,
len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0),
- null_ptr_arg, null_bit_arg, is_nullable,
+ null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg)
{ flags|= BINARY_FLAG; }
/**
@@ -2037,7 +2031,7 @@ public:
uint32 len_arg, uint8 dec_arg)
:Field((uchar *) 0,
len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0),
- is_nullable ? (uchar *) "" : 0, 0, is_nullable,
+ is_nullable ? (uchar *) "" : 0, 0,
NONE, field_name_arg)
{ flags|= BINARY_FLAG; }
virtual Item_result result_type() const { return STRING_RESULT; }
@@ -2103,11 +2097,11 @@ public:
@param dec_arg Number of second fraction digits, 0..6.
*/
Field_temporal_with_date(uchar *ptr_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
+ uchar null_bit_arg,
enum utype unireg_check_arg,
const char *field_name_arg,
uint8 int_length_arg, uint8 dec_arg)
- :Field_temporal(ptr_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ :Field_temporal(ptr_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg,
int_length_arg, dec_arg)
{ }
@@ -2120,7 +2114,7 @@ public:
*/
Field_temporal_with_date(bool is_nullable, const char *field_name_arg,
uint int_length_arg, uint8 dec_arg)
- :Field_temporal((uchar*) 0, is_nullable ? (uchar*) "": 0, 0, is_nullable,
+ :Field_temporal((uchar*) 0, is_nullable ? (uchar*) "": 0, 0,
NONE, field_name_arg, int_length_arg, dec_arg)
{ }
bool send_binary(Protocol *protocol);
@@ -2179,11 +2173,11 @@ public:
@param dec_arg Number of second fraction digits, 0..6.
*/
Field_temporal_with_date_and_time(uchar *ptr_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
+ uchar null_bit_arg,
enum utype unireg_check_arg,
const char *field_name_arg,
uint8 dec_arg)
- :Field_temporal_with_date(ptr_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ :Field_temporal_with_date(ptr_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg,
MAX_DATETIME_WIDTH, dec_arg)
{ }
@@ -2214,12 +2208,12 @@ public:
@param dec_arg Number of second fraction digits, 0..6.
*/
Field_temporal_with_date_and_timef(uchar *ptr_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
+ uchar null_bit_arg,
enum utype unireg_check_arg,
const char *field_name_arg,
uint8 dec_arg)
:Field_temporal_with_date_and_time(ptr_arg, null_ptr_arg, null_bit_arg,
- is_nullable, unireg_check_arg,
+ unireg_check_arg,
field_name_arg, dec_arg)
{ }
/**
@@ -2233,7 +2227,7 @@ public:
uint8 dec_arg)
:Field_temporal_with_date_and_time((uchar *) 0,
is_nullable ? (uchar*) "" : 0, 0,
- is_nullable, NONE, field_name_arg,
+ NONE, field_name_arg,
dec_arg)
{ }
@@ -2268,7 +2262,7 @@ protected:
public:
static const int PACK_LENGTH= 4;
Field_timestamp(uchar *ptr_arg, uint32 len_arg,
- uchar *null_ptr_arg, uchar null_bit_arg, bool is_nullable,
+ uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg);
Field_timestamp(bool is_nullable, const char *field_name_arg);
enum_field_types type() const { return MYSQL_TYPE_TIMESTAMP;}
@@ -2329,8 +2323,8 @@ public:
@param dec_arg Number of fractional second digits, 0..6.
*/
Field_timestampf(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
- bool is_nullable, enum utype unireg_check_arg,
- const char *field_name_arg, uint8 dec_arg);
+ enum utype unireg_check_arg, const char *field_name_arg,
+ uint8 dec_arg);
/**
Field_timestampf constructor
@param is_nullable See Field definition
@@ -2378,9 +2372,9 @@ public:
class Field_year :public Field_tiny {
public:
Field_year(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg)
- :Field_tiny(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg)
+ :Field_tiny(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, 1, 1)
{}
enum_field_types type() const { return MYSQL_TYPE_YEAR;}
@@ -2413,15 +2407,15 @@ protected:
public:
Field_newdate(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
- bool is_nullable, enum utype unireg_check_arg,
+ enum utype unireg_check_arg,
const char *field_name_arg)
:Field_temporal_with_date(ptr_arg, null_ptr_arg, null_bit_arg,
- is_nullable, unireg_check_arg, field_name_arg,
+ unireg_check_arg, field_name_arg,
MAX_DATE_WIDTH, 0)
{ }
Field_newdate(bool is_nullable, const char *field_name_arg)
:Field_temporal_with_date((uchar *) 0, is_nullable ? (uchar *) "" : 0,
- 0, is_nullable, NONE, field_name_arg,
+ 0, NONE, field_name_arg,
MAX_DATE_WIDTH, 0)
{ }
enum_field_types type() const { return MYSQL_TYPE_DATE;}
@@ -2485,9 +2479,9 @@ public:
@param dec_arg Number of second fraction digits, 0..6.
*/
Field_time_common(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
- bool is_nullable, enum utype unireg_check_arg,
- const char *field_name_arg, uint8 dec_arg)
- :Field_temporal(ptr_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ enum utype unireg_check_arg, const char *field_name_arg,
+ uint8 dec_arg)
+ :Field_temporal(ptr_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg,
MAX_TIME_WIDTH, dec_arg)
{ }
@@ -2500,7 +2494,7 @@ public:
Field_time_common(bool is_nullable, const char *field_name_arg,
uint8 dec_arg)
:Field_temporal((uchar *) 0, is_nullable ? (uchar *) "" : 0, 0,
- is_nullable, NONE, field_name_arg, MAX_TIME_WIDTH, dec_arg)
+ NONE, field_name_arg, MAX_TIME_WIDTH, dec_arg)
{ }
int store_time(MYSQL_TIME *ltime, uint8 dec);
String *val_str(String*, String *);
@@ -2519,14 +2513,14 @@ protected:
int store_internal(const MYSQL_TIME *ltime, int *error);
public:
Field_time(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
- bool is_nullable, enum utype unireg_check_arg,
+ enum utype unireg_check_arg,
const char *field_name_arg)
- :Field_time_common(ptr_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ :Field_time_common(ptr_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, 0)
{ }
Field_time(bool is_nullable, const char *field_name_arg)
:Field_time_common((uchar *) 0, is_nullable ? (uchar *) "" : 0, 0,
- is_nullable, NONE, field_name_arg, 0)
+ NONE, field_name_arg, 0)
{ }
enum_field_types type() const { return MYSQL_TYPE_TIME;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_INT24; }
@@ -2574,9 +2568,9 @@ public:
@param dec_arg Number of second fraction digits, 0..6.
*/
Field_timef(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
- bool is_nullable, enum utype unireg_check_arg,
- const char *field_name_arg, uint8 dec_arg)
- :Field_time_common(ptr_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ enum utype unireg_check_arg, const char *field_name_arg,
+ uint8 dec_arg)
+ :Field_time_common(ptr_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, dec_arg)
{ }
/**
@@ -2587,7 +2581,7 @@ public:
*/
Field_timef(bool is_nullable, const char *field_name_arg, uint8 dec_arg)
:Field_time_common((uchar *) 0, is_nullable ? (uchar *) "" : 0, 0,
- is_nullable, NONE, field_name_arg, dec_arg)
+ NONE, field_name_arg, dec_arg)
{ }
Field_timef *clone(MEM_ROOT *mem_root) const
{
@@ -2676,16 +2670,15 @@ public:
ON UPDATE CURRENT_TIMESTAMP
*/
Field_datetime(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
- bool is_nullable, enum utype unireg_check_arg,
+ enum utype unireg_check_arg,
const char *field_name_arg)
:Field_temporal_with_date_and_time(ptr_arg, null_ptr_arg, null_bit_arg,
- is_nullable, unireg_check_arg,
- field_name_arg, 0)
+ unireg_check_arg, field_name_arg, 0)
{}
Field_datetime(bool is_nullable, const char *field_name_arg)
:Field_temporal_with_date_and_time((uchar *) 0,
- is_nullable ? (uchar *) "" : 0,
- 0, is_nullable, NONE, field_name_arg, 0)
+ is_nullable ? (uchar *) "" : 0, 0,
+ NONE, field_name_arg, 0)
{}
enum_field_types type() const { return MYSQL_TYPE_DATETIME;}
#ifdef HAVE_LONG_LONG
@@ -2752,11 +2745,11 @@ public:
@param dec_arg Number of second fraction digits, 0..6.
*/
Field_datetimef(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
- bool is_nullable, enum utype unireg_check_arg,
+ enum utype unireg_check_arg,
const char *field_name_arg, uint8 dec_arg)
:Field_temporal_with_date_and_timef(ptr_arg, null_ptr_arg, null_bit_arg,
- is_nullable, unireg_check_arg,
- field_name_arg, dec_arg)
+ unireg_check_arg, field_name_arg,
+ dec_arg)
{}
/**
Constructor for Field_datetimef
@@ -2769,7 +2762,7 @@ public:
uint8 dec_arg)
:Field_temporal_with_date_and_timef((uchar *) 0,
is_nullable ? (uchar *) "" : 0, 0,
- is_nullable, NONE, field_name_arg,
+ NONE, field_name_arg,
dec_arg)
{}
Field_datetimef *clone(MEM_ROOT *mem_root) const
@@ -2810,16 +2803,15 @@ class Field_string :public Field_longstr
public:
bool can_alter_field_type;
Field_string(uchar *ptr_arg, uint32 len_arg,uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg,
- const CHARSET_INFO *cs)
- :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg, const CHARSET_INFO *cs)
+ :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, cs),
can_alter_field_type(1) {};
Field_string(uint32 len_arg, bool is_nullable, const char *field_name_arg,
const CHARSET_INFO *cs)
:Field_longstr((uchar*) 0, len_arg, is_nullable ? (uchar*) "": 0, 0,
- is_nullable, NONE, field_name_arg, cs),
+ NONE, field_name_arg, cs),
can_alter_field_type(1) {};
enum_field_types type() const
@@ -2898,10 +2890,10 @@ public:
uint32 length_bytes;
Field_varstring(uchar *ptr_arg,
uint32 len_arg, uint length_bytes_arg,
- uchar *null_ptr_arg, uchar null_bit_arg, bool is_nullable,
+ uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
TABLE_SHARE *share, const CHARSET_INFO *cs)
- :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, cs),
length_bytes(length_bytes_arg)
{
@@ -2911,7 +2903,7 @@ public:
const char *field_name_arg,
TABLE_SHARE *share, const CHARSET_INFO *cs)
:Field_longstr((uchar*) 0,len_arg, is_nullable ? (uchar*) "": 0, 0,
- is_nullable, NONE, field_name_arg, cs),
+ NONE, field_name_arg, cs),
length_bytes(len_arg < 256 ? 1 :2)
{
share->varchar_fields++;
@@ -2962,7 +2954,7 @@ public:
Field *new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type);
Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
uchar *new_ptr, uchar *new_null_ptr,
- uint new_null_bit, bool is_nullable);
+ uint new_null_bit);
Field_varstring *clone(MEM_ROOT *mem_root) const {
DBUG_ASSERT(type() == MYSQL_TYPE_VARCHAR);
DBUG_ASSERT(real_type() == MYSQL_TYPE_VARCHAR);
@@ -2994,13 +2986,13 @@ protected:
public:
Field_blob(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
- bool is_nullable, enum utype unireg_check_arg,
- const char *field_name_arg, TABLE_SHARE *share,
- uint blob_pack_length, const CHARSET_INFO *cs);
+ enum utype unireg_check_arg, const char *field_name_arg,
+ TABLE_SHARE *share, uint blob_pack_length,
+ const CHARSET_INFO *cs);
Field_blob(uint32 len_arg, bool is_nullable, const char *field_name_arg,
const CHARSET_INFO *cs)
:Field_longstr((uchar*) 0, len_arg, is_nullable ? (uchar*) "": 0, 0,
- is_nullable, NONE, field_name_arg, cs),
+ NONE, field_name_arg, cs),
packlength(4)
{
flags|= BLOB_FLAG;
@@ -3008,7 +3000,7 @@ public:
Field_blob(uint32 len_arg, bool is_nullable, const char *field_name_arg,
const CHARSET_INFO *cs, bool set_packlength)
:Field_longstr((uchar*) 0, len_arg, is_nullable ? (uchar*) "": 0, 0,
- is_nullable, NONE, field_name_arg, cs)
+ NONE, field_name_arg, cs)
{
flags|= BLOB_FLAG;
packlength= 4;
@@ -3021,7 +3013,7 @@ public:
}
}
Field_blob(uint32 packlength_arg)
- :Field_longstr((uchar*) 0, 0, (uchar*) "", 0, false, NONE, "temp", system_charset_info),
+ :Field_longstr((uchar*) 0, 0, (uchar*) "", 0, NONE, "temp", system_charset_info),
packlength(packlength_arg) {}
/* Note that the default copy constructor is used, in clone() */
enum_field_types type() const { return MYSQL_TYPE_BLOB;}
@@ -3170,10 +3162,10 @@ public:
enum geometry_type geom_type;
Field_geom(uchar *ptr_arg, uchar *null_ptr_arg, uint null_bit_arg,
- bool is_nullable, enum utype unireg_check_arg,
- const char *field_name_arg, TABLE_SHARE *share,
- int blob_pack_length, enum geometry_type geom_type_arg)
- :Field_blob(ptr_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ enum utype unireg_check_arg, const char *field_name_arg,
+ TABLE_SHARE *share, int blob_pack_length,
+ enum geometry_type geom_type_arg)
+ :Field_blob(ptr_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, share,
blob_pack_length, &my_charset_bin)
{ geom_type= geom_type_arg; }
@@ -3215,12 +3207,10 @@ protected:
public:
TYPELIB *typelib;
Field_enum(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg,
- uint packlength_arg,
- TYPELIB *typelib_arg,
- const CHARSET_INFO *charset_arg)
- :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, is_nullable,
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg, uint packlength_arg,
+ TYPELIB *typelib_arg, const CHARSET_INFO *charset_arg)
+ :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, charset_arg),
packlength(packlength_arg),typelib(typelib_arg)
{
@@ -3276,12 +3266,11 @@ private:
class Field_set :public Field_enum {
public:
Field_set(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg,
- uint32 packlength_arg,
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg, uint32 packlength_arg,
TYPELIB *typelib_arg, const CHARSET_INFO *charset_arg)
:Field_enum(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
- is_nullable, unireg_check_arg, field_name_arg,
+ unireg_check_arg, field_name_arg,
packlength_arg,
typelib_arg,charset_arg),
empty_set_string("", 0, charset_arg)
@@ -3330,7 +3319,7 @@ public:
uint bit_len; // number of 'uneven' high bits
uint bytes_in_rec;
Field_bit(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable, uchar *bit_ptr_arg,
+ uchar null_bit_arg, uchar *bit_ptr_arg,
uchar bit_ofs_arg, enum utype unireg_check_arg,
const char *field_name_arg);
enum_field_types type() const { return MYSQL_TYPE_BIT; }
@@ -3394,7 +3383,7 @@ public:
Field *new_key_field(MEM_ROOT *root, TABLE *new_table,
uchar *new_ptr, uchar *new_null_ptr,
- uint new_null_bit, bool is_nullable);
+ uint new_null_bit);
void set_bit_ptr(uchar *bit_ptr_arg, uchar bit_ofs_arg)
{
bit_ptr= bit_ptr_arg;
@@ -3437,8 +3426,8 @@ private:
class Field_bit_as_char: public Field_bit {
public:
Field_bit_as_char(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
- uchar null_bit_arg, bool is_nullable,
- enum utype unireg_check_arg, const char *field_name_arg);
+ uchar null_bit_arg, enum utype unireg_check_arg,
+ const char *field_name_arg);
enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
int store(const char *to, uint length, const CHARSET_INFO *charset);
int store(double nr) { return Field_bit::store(nr); }
=== modified file 'sql/field_conv.cc'
--- a/sql/field_conv.cc 2012-05-11 08:55:35 +0000
+++ b/sql/field_conv.cc 2012-05-15 15:47:14 +0000
@@ -102,7 +102,7 @@ static void do_field_to_null_str(Copy_fi
int
set_field_to_null(Field *field)
{
- if (field->real_is_nullable())
+ if (field->is_real_nullable())
{
field->set_null();
field->reset();
@@ -145,7 +145,7 @@ set_field_to_null(Field *field)
int
set_field_to_null_with_conversions(Field *field, bool no_conversions)
{
- if (field->real_is_nullable())
+ if (field->is_real_nullable())
{
field->set_null();
field->reset();
@@ -555,7 +555,7 @@ void Copy_field::set(uchar *to,Field *fr
if (from->is_nullable())
{
from_null_ptr=from->null_ptr;
- is_nullable= from->real_is_nullable();
+ is_nullable= from->is_real_nullable();
from_bit= from->null_bit;
to_ptr[0]= 1; // Null as default value
to_null_ptr= (uchar*) to_ptr++;
@@ -608,9 +608,9 @@ void Copy_field::set(Field *to,Field *fr
if (from->is_nullable())
{
from_null_ptr= from->null_ptr;
- is_nullable= from->real_is_nullable();
+ is_nullable= from->is_real_nullable();
from_bit= from->null_bit;
- if (to_field->real_is_nullable())
+ if (to_field->is_real_nullable())
{
to_null_ptr= to->null_ptr;
to_bit= to->null_bit;
@@ -626,7 +626,7 @@ void Copy_field::set(Field *to,Field *fr
do_copy= do_copy_not_null;
}
}
- else if (to_field->real_is_nullable())
+ else if (to_field->is_real_nullable())
{
to_null_ptr= to->null_ptr;
to_bit= to->null_bit;
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2012-03-28 11:25:37 +0000
+++ b/sql/ha_ndbcluster.cc 2012-05-15 12:39:41 +0000
@@ -1943,7 +1943,7 @@ ha_ndbcluster::set_blob_values(const Ndb
NdbBlob *ndb_blob= ndb_op->getBlobHandle(field_no);
if (ndb_blob == NULL)
ERR_RETURN(ndb_op->getNdbError());
- if (field->is_null_in_record_with_offset(row_offset))
+ if (field->is_real_null(row_offset))
{
DBUG_PRINT("info", ("Setting Blob %d to NULL", field_no));
if (ndb_blob->setNull() != 0)
@@ -6117,7 +6117,7 @@ void ha_ndbcluster::unpack_record(uchar
if (field->type() == MYSQL_TYPE_BIT)
{
Field_bit *field_bit= static_cast<Field_bit*>(field);
- if (!field->is_null_in_record_with_offset(src_offset))
+ if (!field->is_real_null(src_offset))
{
field->move_field_offset(src_offset);
longlong value= field_bit->val_int();
@@ -6208,7 +6208,7 @@ static void get_default_value(void *def_
if (field->type() == MYSQL_TYPE_BIT)
{
Field_bit *field_bit= static_cast<Field_bit*>(field);
- if (!field->is_null_in_record_with_offset(src_offset))
+ if (!field->is_real_null(src_offset))
{
field->move_field_offset(src_offset);
longlong value= field_bit->val_int();
@@ -8587,7 +8587,7 @@ static int create_ndb_column(THD *thd,
{
my_ptrdiff_t src_offset= field->table->s->default_values
- field->table->record[0];
- if ((! field->is_null_in_record_with_offset(src_offset)) ||
+ if ((! field->is_real_null(src_offset)) ||
((field->flags & NOT_NULL_FLAG)))
{
/* Set a non-null native default */
=== modified file 'sql/item.cc'
--- a/sql/item.cc 2012-05-11 08:55:35 +0000
+++ b/sql/item.cc 2012-05-15 12:39:41 +0000
@@ -5908,30 +5908,30 @@ Field *Item::tmp_table_field_from_field_
field= Field_new_decimal::create_from_item(this);
break;
case MYSQL_TYPE_TINY:
- field= new Field_tiny((uchar*) 0, max_length, null_ptr, 0, maybe_null,
+ field= new Field_tiny((uchar*) 0, max_length, null_ptr, 0,
Field::NONE, item_name.ptr(), 0, unsigned_flag);
break;
case MYSQL_TYPE_SHORT:
- field= new Field_short((uchar*) 0, max_length, null_ptr, 0, maybe_null,
+ field= new Field_short((uchar*) 0, max_length, null_ptr, 0,
Field::NONE, item_name.ptr(), 0, unsigned_flag);
break;
case MYSQL_TYPE_LONG:
- field= new Field_long((uchar*) 0, max_length, null_ptr, 0, maybe_null,
+ field= new Field_long((uchar*) 0, max_length, null_ptr, 0,
Field::NONE, item_name.ptr(), 0, unsigned_flag);
break;
#ifdef HAVE_LONG_LONG
case MYSQL_TYPE_LONGLONG:
- field= new Field_longlong((uchar*) 0, max_length, null_ptr, 0, maybe_null,
+ field= new Field_longlong((uchar*) 0, max_length, null_ptr, 0,
Field::NONE, item_name.ptr(), 0, unsigned_flag);
break;
#endif
case MYSQL_TYPE_FLOAT:
- field= new Field_float((uchar*) 0, max_length, null_ptr, 0, maybe_null,
+ field= new Field_float((uchar*) 0, max_length, null_ptr, 0,
Field::NONE, item_name.ptr(), decimals, 0,
unsigned_flag);
break;
case MYSQL_TYPE_DOUBLE:
- field= new Field_double((uchar*) 0, max_length, null_ptr, 0, maybe_null,
+ field= new Field_double((uchar*) 0, max_length, null_ptr, 0,
Field::NONE, item_name.ptr(), decimals, 0,
unsigned_flag);
break;
@@ -5940,7 +5940,7 @@ Field *Item::tmp_table_field_from_field_
item_name.ptr(), &my_charset_bin);
break;
case MYSQL_TYPE_INT24:
- field= new Field_medium((uchar*) 0, max_length, null_ptr, 0, maybe_null,
+ field= new Field_medium((uchar*) 0, max_length, null_ptr, 0,
Field::NONE, item_name.ptr(), 0, unsigned_flag);
break;
case MYSQL_TYPE_DATE:
@@ -5957,11 +5957,11 @@ Field *Item::tmp_table_field_from_field_
field= new Field_datetimef(maybe_null, item_name.ptr(), decimals);
break;
case MYSQL_TYPE_YEAR:
- field= new Field_year((uchar*) 0, max_length, null_ptr, 0, maybe_null,
+ field= new Field_year((uchar*) 0, max_length, null_ptr, 0,
Field::NONE, item_name.ptr());
break;
case MYSQL_TYPE_BIT:
- field= new Field_bit_as_char(NULL, max_length, null_ptr, 0, maybe_null,
+ field= new Field_bit_as_char(NULL, max_length, null_ptr, 0,
Field::NONE, item_name.ptr());
break;
default:
@@ -9282,7 +9282,7 @@ Field *Item_type_holder::make_field_by_t
switch (fld_type) {
case MYSQL_TYPE_ENUM:
DBUG_ASSERT(enum_set_typelib);
- field= new Field_enum((uchar *) 0, max_length, null_ptr, 0, maybe_null,
+ field= new Field_enum((uchar *) 0, max_length, null_ptr, 0,
Field::NONE, item_name.ptr(),
get_enum_pack_length(enum_set_typelib->count),
enum_set_typelib, collation.collation);
@@ -9291,7 +9291,7 @@ Field *Item_type_holder::make_field_by_t
return field;
case MYSQL_TYPE_SET:
DBUG_ASSERT(enum_set_typelib);
- field= new Field_set((uchar *) 0, max_length, null_ptr, 0, maybe_null,
+ field= new Field_set((uchar *) 0, max_length, null_ptr, 0,
Field::NONE, item_name.ptr(),
get_set_pack_length(enum_set_typelib->count),
enum_set_typelib, collation.collation);
=== modified file 'sql/item_subselect.cc'
--- a/sql/item_subselect.cc 2012-05-11 08:55:35 +0000
+++ b/sql/item_subselect.cc 2012-05-15 15:47:14 +0000
@@ -3401,7 +3401,7 @@ bool subselect_hash_sj_engine::setup(Lis
Item_func_eq *eq_cond;
/* Item for the corresponding field from the materialized temp table. */
Item_field *right_col_item;
- const bool nullable= key_parts[part_no].field->real_is_nullable();
+ const bool nullable= key_parts[part_no].field->is_real_nullable();
tmp_tab->ref.items[part_no]= item_in->left_expr->element_index(part_no);
if (!(right_col_item= new Item_field(thd, context,
=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc 2012-05-11 08:55:35 +0000
+++ b/sql/opt_range.cc 2012-05-15 15:47:14 +0000
@@ -75,7 +75,7 @@
keypart_data: [isnull_byte] keypart-value-bytes
- If a keypart may have a NULL value (key_part->field->real_is_nullable() can
+ If a keypart may have a NULL value (key_part->field->is_real_nullable() can
be used to check this), then the first byte is a NULL indicator with the
following valid values:
1 - keypart has NULL value.
@@ -1857,7 +1857,7 @@ inline void SEL_ARG::make_root()
SEL_ARG::SEL_ARG(Field *f,const uchar *min_value_arg,
const uchar *max_value_arg)
- :min_flag(0), max_flag(0), maybe_flag(0), maybe_null(f->real_is_nullable()),
+ :min_flag(0), max_flag(0), maybe_flag(0), maybe_null(f->is_real_nullable()),
elements(1), use_count(1), field(f), min_value((uchar*) min_value_arg),
max_value((uchar*) max_value_arg), next(NULL), prev(NULL),
next_key_part(0), color(BLACK), type(KEY_RANGE)
@@ -1869,7 +1869,7 @@ SEL_ARG::SEL_ARG(Field *field_,uint8 par
uchar *min_value_, uchar *max_value_,
uint8 min_flag_,uint8 max_flag_,uint8 maybe_flag_)
:min_flag(min_flag_),max_flag(max_flag_),maybe_flag(maybe_flag_),
- part(part_),maybe_null(field_->real_is_nullable()), elements(1),use_count(1),
+ part(part_),maybe_null(field_->is_real_nullable()), elements(1),use_count(1),
field(field_), min_value(min_value_), max_value(max_value_),
next(NULL), prev(NULL), next_key_part(0), color(BLACK), type(KEY_RANGE)
{
@@ -1960,7 +1960,7 @@ static int sel_cmp(Field *field, uchar *
if (b_flag & (NO_MIN_RANGE | NO_MAX_RANGE))
return (b_flag & NO_MIN_RANGE) ? 1 : -1;
- if (field->real_is_nullable()) // If null is part of key
+ if (field->is_real_nullable()) // If null is part of key
{
if (*a != *b)
{
@@ -3222,7 +3222,7 @@ void store_key_image_to_rec(Field *field
/* Do the same as print_key_value() does */
my_bitmap_map *old_map;
- if (field->real_is_nullable())
+ if (field->is_real_nullable())
{
if (*ptr)
{
@@ -6348,7 +6348,7 @@ static SEL_ARG *
get_mm_leaf(RANGE_OPT_PARAM *param, Item *conf_func, Field *field,
KEY_PART *key_part, Item_func::Functype type,Item *value)
{
- uint maybe_null=(uint) field->real_is_nullable();
+ uint maybe_null=(uint) field->is_real_nullable();
bool optimize_range;
SEL_ARG *tree= 0;
MEM_ROOT *alloc= param->mem_root;
@@ -12203,7 +12203,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::update_
}
}
else if (have_min && min_max_arg_part &&
- min_max_arg_part->field->real_is_nullable())
+ min_max_arg_part->field->is_real_nullable())
{
/*
If a MIN/MAX argument value is NULL, we can quickly determine
@@ -13090,7 +13090,7 @@ print_key_value(String *out, const KEY_P
Field *field= key_part->field;
store_length= key_part->store_length;
- if (field->real_is_nullable())
+ if (field->is_real_nullable())
{
/*
Byte 0 of key is the null-byte. If set, key is NULL.
@@ -13241,7 +13241,7 @@ print_multiple_key_values(KEY_PART *key_
Field *field= key_part->field;
store_length= key_part->store_length;
- if (field->real_is_nullable())
+ if (field->is_real_nullable())
{
if (*key)
{
=== modified file 'sql/opt_sum.cc'
--- a/sql/opt_sum.cc 2012-05-11 08:55:35 +0000
+++ b/sql/opt_sum.cc 2012-05-15 15:47:14 +0000
@@ -160,7 +160,7 @@ static int get_index_min_value(TABLE *ta
Check if case 1 from above holds. If it does, we should read
the skipped tuple.
*/
- if (item_field->field->real_is_nullable() &&
+ if (item_field->field->is_real_nullable() &&
ref->key_buff[prefix_len] == 1 &&
/*
Last keypart (i.e. the argument to MIN) is set to NULL by
@@ -172,7 +172,7 @@ static int get_index_min_value(TABLE *ta
(error == HA_ERR_KEY_NOT_FOUND ||
key_cmp_if_same(table, ref->key_buff, ref->key, prefix_len)))
{
- DBUG_ASSERT(item_field->field->real_is_nullable());
+ DBUG_ASSERT(item_field->field->is_real_nullable());
error= table->file->ha_index_read_map(table->record[0],
ref->key_buff,
make_prev_keypart_map(ref->key_parts),
@@ -803,7 +803,7 @@ static bool matching_cond(bool max_fl, T
If we have a non-nullable index, we cannot use it,
since set_null will be ignored, and we will compare uninitialized data.
*/
- if (!part->field->real_is_nullable())
+ if (!part->field->is_real_nullable())
DBUG_RETURN(false);
part->field->set_null();
*key_ptr= (uchar) 1;
=== modified file 'sql/sql_optimizer.cc'
--- a/sql/sql_optimizer.cc 2012-05-11 08:55:35 +0000
+++ b/sql/sql_optimizer.cc 2012-05-15 15:47:14 +0000
@@ -4563,7 +4563,7 @@ add_key_field(KEY_FIELD **key_fields,uin
{
// Don't remove column IS NULL on a LEFT JOIN table
if (!eq_func || (*value)->type() != Item::NULL_ITEM ||
- !field->table->maybe_null || field->real_is_nullable())
+ !field->table->maybe_null || field->is_real_nullable())
return; // Not a key. Skip it
exists_optimize= KEY_OPTIMIZE_EXISTS;
DBUG_ASSERT(num_values == 1);
@@ -4583,7 +4583,7 @@ add_key_field(KEY_FIELD **key_fields,uin
if (!(usable_tables & field->table->map))
{
if (!eq_func || (*value)->type() != Item::NULL_ITEM ||
- !field->table->maybe_null || field->real_is_nullable())
+ !field->table->maybe_null || field->is_real_nullable())
return; // Can't use left join optimize
exists_optimize= KEY_OPTIMIZE_EXISTS;
}
@@ -5487,7 +5487,7 @@ update_ref_and_keys(THD *thd, Key_use_ar
{
/* Mark that we can optimize LEFT JOIN */
if (fld->val->type() == Item::NULL_ITEM &&
- !fld->field->real_is_nullable())
+ !fld->field->is_real_nullable())
{
/*
Example:
@@ -8413,7 +8413,7 @@ list_contains_unique_index(JOIN_TAB *tab
key_part < key_part_end;
key_part++)
{
- if (key_part->field->real_is_nullable() ||
+ if (key_part->field->is_real_nullable() ||
!find_func(key_part->field, data))
break;
}
=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc 2012-05-11 08:55:35 +0000
+++ b/sql/sql_partition.cc 2012-05-15 15:47:14 +0000
@@ -7416,7 +7416,7 @@ uint32 store_tuple_to_record(Field **pfi
while (value < value_end)
{
loc_value= value;
- if ((*pfield)->real_is_nullable())
+ if ((*pfield)->is_real_nullable())
{
if (*loc_value)
(*pfield)->set_null();
@@ -7733,7 +7733,7 @@ int get_part_iter_for_interval_via_mappi
Find minimum: Do special handling if the interval has left bound in form
" NULL <= X ":
*/
- if (field->real_is_nullable() && part_info->has_null_value &&
+ if (field->is_real_nullable() && part_info->has_null_value &&
!(flags & (NO_MIN_RANGE | NEAR_MIN)) && *min_value)
{
part_iter->ret_null_part= part_iter->ret_null_part_orig= TRUE;
@@ -7864,7 +7864,7 @@ int get_part_iter_for_interval_via_walki
}
/* Handle the "t.field IS NULL" interval, it is a special case */
- if (field->real_is_nullable() && !(flags & (NO_MIN_RANGE | NO_MAX_RANGE)) &&
+ if (field->is_real_nullable() && !(flags & (NO_MIN_RANGE | NO_MAX_RANGE)) &&
*min_value && *max_value)
{
/*
@@ -7898,7 +7898,7 @@ int get_part_iter_for_interval_via_walki
DBUG_RETURN(0); /* No partitions match */
}
- if ((field->real_is_nullable() &&
+ if ((field->is_real_nullable() &&
((!(flags & NO_MIN_RANGE) && *min_value) || // NULL <? X
(!(flags & NO_MAX_RANGE) && *max_value))) || // X <? NULL
(flags & (NO_MIN_RANGE | NO_MAX_RANGE))) // -inf at any bound
@@ -8177,7 +8177,7 @@ uint get_partition_field_store_length(Fi
uint store_length;
store_length= field->key_length();
- if (field->real_is_nullable())
+ if (field->is_real_nullable())
store_length+= HA_KEY_NULL_LENGTH;
if (field->real_type() == MYSQL_TYPE_VARCHAR)
store_length+= HA_KEY_BLOB_LENGTH;
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2012-05-11 08:55:35 +0000
+++ b/sql/sql_select.cc 2012-05-15 15:47:14 +0000
@@ -1132,7 +1132,7 @@ void calc_used_field_length(THD *thd, JO
rec_length+=field->pack_length();
if (flags & BLOB_FLAG)
blobs++;
- if (field->real_is_nullable())
+ if (field->is_real_nullable())
null_fields++;
if (field->type() == MYSQL_TYPE_BIT &&
((Field_bit*)field)->bit_len)
@@ -2480,7 +2480,7 @@ bool setup_sj_materialization(JOIN_TAB *
part_no++, cur_key_part++, ref_key++)
{
tab_ref->items[part_no]= outer_expr++;
- int null_count= test(cur_key_part->field->real_is_nullable());
+ int null_count= test(cur_key_part->field->is_real_nullable());
*ref_key= new store_key_item(thd, cur_key_part->field,
/* TODO:
the NULL byte is taken into account in
=== modified file 'sql/sql_select.h'
--- a/sql/sql_select.h 2012-05-11 08:55:35 +0000
+++ b/sql/sql_select.h 2012-05-15 12:39:41 +0000
@@ -969,14 +969,14 @@ public:
Key segments are always packed with a 2 byte length prefix.
See mi_rkey for details.
*/
- to_field= new Field_varstring(ptr, length, 2, null, 1, null != NULL,
+ to_field= new Field_varstring(ptr, length, 2, null, 1,
Field::NONE, field_arg->field_name,
field_arg->table->s, field_arg->charset());
to_field->init(field_arg->table);
}
else
to_field=field_arg->new_key_field(thd->mem_root, field_arg->table,
- ptr, null, 1, null != NULL);
+ ptr, null, 1);
}
virtual ~store_key() {} /** Not actually needed */
virtual const char *name() const=0;
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2012-05-11 08:55:35 +0000
+++ b/sql/sql_show.cc 2012-05-15 15:47:14 +0000
@@ -1530,7 +1530,7 @@ int store_create_info(THD *thd, TABLE_LI
}
}
- if (!field->real_is_nullable())
+ if (!field->is_real_nullable())
packet->append(STRING_WITH_LEN(" NOT NULL"));
else if (field->type() == MYSQL_TYPE_TIMESTAMP)
{
@@ -4691,7 +4691,7 @@ static int get_schema_column_record(THD
cs);
table->field[IS_COLUMNS_COLUMN_DEFAULT]->set_notnull();
}
- pos=(uchar*) ((!field->real_is_nullable()) ? "NO" : "YES");
+ pos=(uchar*) ((!field->is_real_nullable()) ? "NO" : "YES");
table->field[IS_COLUMNS_IS_NULLABLE]->store((const char*) pos,
strlen((const char*) pos), cs);
store_column_type(table, field, cs, IS_COLUMNS_DATA_TYPE);
@@ -5367,7 +5367,7 @@ static int get_schema_stat_record(THD *t
key_part->field->charset()->mbmaxlen, TRUE);
table->field[10]->set_notnull();
}
- const char *pos=(key_part->field ? (key_part->field->real_is_nullable() ? "YES" : "")
+ const char *pos=(key_part->field ? (key_part->field->is_real_nullable() ? "YES" : "")
: "YES");
table->field[12]->store(pos, strlen(pos), cs);
if (!show_table->s->keys_in_use.is_set(i))
=== modified file 'sql/sql_tmp_table.cc'
--- a/sql/sql_tmp_table.cc 2012-05-11 08:55:35 +0000
+++ b/sql/sql_tmp_table.cc 2012-05-15 12:39:41 +0000
@@ -1036,8 +1036,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
group_buff +
test(maybe_null),
field->null_ptr,
- field->null_bit,
- maybe_null)))
+ field->null_bit)))
goto err; /* purecov: inspected */
if (maybe_null)
{
@@ -1110,7 +1109,6 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
(uint32) key_part_info->length,
(uchar*) 0,
(uint) 0,
- true,
Field::NONE,
NullS, &my_charset_bin);
if (!key_part_info->field)
@@ -1424,7 +1422,7 @@ TABLE *create_duplicate_weedout_tmp_tabl
if (!(key_field= field->new_key_field(thd->mem_root, table,
group_buff,
field->null_ptr,
- field->null_bit, true)))
+ field->null_bit)))
goto err;
key_part_info->key_part_flag|= HA_END_SPACE_ARE_EQUAL; //todo need this?
}
=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc 2012-05-11 08:55:35 +0000
+++ b/sql/sql_update.cc 2012-05-15 15:47:14 +0000
@@ -86,7 +86,7 @@ bool compare_records(const TABLE *table)
Field *field= *ptr;
if (bitmap_is_set(table->write_set, field->field_index))
{
- if (field->real_is_nullable())
+ if (field->is_real_nullable())
{
uchar null_byte_index= field->null_ptr - table->record[0];
=== modified file 'sql/table.cc'
--- a/sql/table.cc 2012-05-11 08:55:35 +0000
+++ b/sql/table.cc 2012-05-15 15:47:14 +0000
@@ -791,7 +791,7 @@ void KEY_PART_INFO::init_from_field(Fiel
store_length= length;
key_part_flag= 0;
- if (field->real_is_nullable())
+ if (field->is_real_nullable())
store_length+= HA_KEY_NULL_LENGTH;
if (field->type() == MYSQL_TYPE_BLOB ||
field->real_type() == MYSQL_TYPE_VARCHAR ||
@@ -1616,7 +1616,7 @@ static int open_binary_frm(THD *thd, TAB
{
uint fieldnr= key_part[i].fieldnr;
if (!fieldnr ||
- share->field[fieldnr-1]->real_is_nullable() ||
+ share->field[fieldnr-1]->is_real_nullable() ||
share->field[fieldnr-1]->key_length() !=
key_part[i].length)
{
@@ -1641,7 +1641,7 @@ static int open_binary_frm(THD *thd, TAB
}
field= key_part->field= share->field[key_part->fieldnr-1];
key_part->type= field->key_type();
- if (field->real_is_nullable())
+ if (field->is_real_nullable())
{
key_part->null_offset=(uint) ((uchar*) field->null_ptr -
share->default_values);
=== modified file 'storage/csv/ha_tina.cc'
--- a/storage/csv/ha_tina.cc 2012-05-11 08:55:35 +0000
+++ b/storage/csv/ha_tina.cc 2012-05-15 15:47:14 +0000
@@ -1658,7 +1658,7 @@ int ha_tina::create(const char *name, TA
*/
for (Field **field= table_arg->s->field; *field; field++)
{
- if ((*field)->real_is_nullable())
+ if ((*field)->is_real_nullable())
{
my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "nullable columns");
DBUG_RETURN(HA_ERR_UNSUPPORTED);
=== modified file 'storage/federated/ha_federated.cc'
--- a/storage/federated/ha_federated.cc 2012-05-11 08:55:35 +0000
+++ b/storage/federated/ha_federated.cc 2012-05-15 15:47:14 +0000
@@ -1722,7 +1722,7 @@ static inline uint field_in_record_is_nu
int null_offset;
DBUG_ENTER("ha_federated::field_in_record_is_null");
- if (!field->real_is_nullable())
+ if (!field->is_real_nullable())
DBUG_RETURN(0);
null_offset= (uint) ((char*)field->null_ptr - (char*)table->record[0]);
=== modified file 'storage/heap/ha_heap.cc'
--- a/storage/heap/ha_heap.cc 2012-05-11 08:55:35 +0000
+++ b/storage/heap/ha_heap.cc 2012-05-15 15:47:14 +0000
@@ -703,7 +703,7 @@ heap_prepare_hp_create_info(TABLE *table
seg->charset= &my_charset_bin;
else
seg->charset= field->charset_for_protocol();
- if (field->real_is_nullable())
+ if (field->is_real_nullable())
{
seg->null_bit= field->null_bit;
seg->null_pos= (uint) (field->null_ptr - (uchar*) table_arg->record[0]);
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc 2012-05-11 08:55:35 +0000
+++ b/storage/innobase/handler/ha_innodb.cc 2012-05-15 15:47:14 +0000
@@ -4844,7 +4844,7 @@ field_in_record_is_null(
{
int null_offset;
- if (!field->real_is_nullable()) {
+ if (!field->is_real_nullable()) {
return(0);
}
@@ -5779,7 +5779,7 @@ build_template_field(
templ->rec_field_no = dict_index_get_nth_col_pos(index, i);
}
- if (field->real_is_nullable()) {
+ if (field->is_real_nullable()) {
templ->mysql_null_byte_offset =
(ulint) ((char*) field->null_ptr
- (char*) table->record[0]);
@@ -6571,7 +6571,7 @@ calc_row_difference(
}
- if (field->real_is_nullable()) {
+ if (field->is_real_nullable()) {
if (field_in_record_is_null(table, field,
(char*) old_row)) {
o_len = UNIV_SQL_NULL;
@@ -8033,7 +8033,7 @@ create_table_check_doc_id_col(
/* Note the name is case sensitive due to
our internal query parser */
if (col_type == DATA_INT
- && !field->real_is_nullable()
+ && !field->is_real_nullable()
&& col_len == sizeof(doc_id_t)
&& (strcmp(field->field_name,
FTS_DOC_ID_COL_NAME) == 0)) {
@@ -8184,7 +8184,7 @@ create_table_def(
goto err_col;
}
- nulls_allowed = field->real_is_nullable() ? 0 : DATA_NOT_NULL;
+ nulls_allowed = field->is_real_nullable() ? 0 : DATA_NOT_NULL;
binary_type = field->binary() ? DATA_BINARY_TYPE : 0;
charset_no = 0;
=== modified file 'storage/innobase/handler/handler0alter.cc'
--- a/storage/innobase/handler/handler0alter.cc 2012-05-11 08:55:35 +0000
+++ b/storage/innobase/handler/handler0alter.cc 2012-05-15 15:47:14 +0000
@@ -235,7 +235,7 @@ ha_innobase::check_if_supported_inplace_
prebuilt->table, key_part->fieldnr);
if (!(col->prtype & DATA_NOT_NULL)
- != !!key_part->field->real_is_nullable()) {
+ != !!key_part->field->is_real_nullable()) {
sql_print_warning(
"InnoDB table '%s' column '%s' "
"attributes differ from "
@@ -417,7 +417,7 @@ null_field:
/* Assign the NULL flag */
if (ilen == UNIV_SQL_NULL) {
- ut_ad(field->real_is_nullable());
+ ut_ad(field->is_real_nullable());
goto null_field;
}
@@ -759,7 +759,7 @@ innobase_fts_check_doc_id_col(
field->field_name);
} else if (field->type() != MYSQL_TYPE_LONGLONG
|| field->pack_length() != 8
- || field->real_is_nullable()
+ || field->is_real_nullable()
|| !(field->flags & UNSIGNED_FLAG)) {
my_error(ER_INNODB_FT_WRONG_DOCID_COLUMN, MYF(0),
field->field_name);
@@ -1529,7 +1529,7 @@ col_fail:
fits in two bytes */
ut_a(field_type <= MAX_CHAR_COLL_NUM);
- if (!field->real_is_nullable()) {
+ if (!field->is_real_nullable()) {
field_type |= DATA_NOT_NULL;
}
=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc 2012-05-11 08:55:35 +0000
+++ b/storage/myisam/ha_myisam.cc 2012-05-15 15:47:14 +0000
@@ -285,7 +285,7 @@ int table2myisam(TABLE *table_arg, MI_KE
keydef[i].seg[j].bit_pos= 0;
keydef[i].seg[j].language= field->charset_for_protocol()->number;
- if (field->real_is_nullable())
+ if (field->is_real_nullable())
{
keydef[i].seg[j].null_bit= field->null_bit;
keydef[i].seg[j].null_pos= (uint) (field->null_ptr-
@@ -369,7 +369,7 @@ int table2myisam(TABLE *table_arg, MI_KE
found->type() == MYSQL_TYPE_VAR_STRING ?
FIELD_SKIP_ENDSPACE :
FIELD_SKIP_PRESPACE);
- if (found->real_is_nullable())
+ if (found->is_real_nullable())
{
recinfo_pos->null_bit= found->null_bit;
recinfo_pos->null_pos= (uint) (found->null_ptr -
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (Dmitry.Shulga:3785 to 3788) WL#6030 | Dmitry Shulga | 16 May |