~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field.cc

  • Committer: Eric Herman
  • Date: 2008-12-06 19:42:46 UTC
  • mto: (656.1.6 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: eric@mysql.com-20081206194246-5cdexuu81i366eek
removed trailing whitespace with simple script:

for file in $(find . -name "*.c") $(find . -name "*.cc") $(find . -name "*.h"); do ruby -pe 'gsub(/\s+$/, $/)' < $file > $file.out; mv $file.out $file; done;

Show diffs side-by-side

added added

removed removed

Lines of Context:
884
884
    return 1;
885
885
  if (*str == 'E' || *str == 'e')
886
886
  {
887
 
    if (length < 3 || (str[1] != '+' && str[1] != '-') || 
 
887
    if (length < 3 || (str[1] != '+' && str[1] != '-') ||
888
888
        !my_isdigit(cs,str[2]))
889
889
      return 0;
890
890
    length-=3;
1515
1515
    assert(vcol_info && vcol_info->expr_item);
1516
1516
    is_stored= vcol_info->get_field_stored();
1517
1517
    /*
1518
 
      Perform per item-type checks to determine if the expression is 
 
1518
      Perform per item-type checks to determine if the expression is
1519
1519
      allowed for a virtual column.
1520
1520
      Note that validation of the specific function is done later in
1521
1521
      procedures open_table_from_share and fix_fields_vcol_func
1542
1542
         my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), field_name);
1543
1543
         return true;
1544
1544
         break;
1545
 
    default: 
 
1545
    default:
1546
1546
      // Continue with the field creation
1547
1547
      break;
1548
1548
    }
1653
1653
    if (fld_default_value)
1654
1654
    {
1655
1655
      /* Grammar allows only NOW() value for ON UPDATE clause */
1656
 
      if (fld_default_value->type() == Item::FUNC_ITEM && 
 
1656
      if (fld_default_value->type() == Item::FUNC_ITEM &&
1657
1657
          ((Item_func*)fld_default_value)->functype() == Item_func::NOW_FUNC)
1658
1658
      {
1659
1659
        unireg_check= (fld_on_update_value ? Field::TIMESTAMP_DNUN_FIELD:
1948
1948
  if (!(flags & (NO_DEFAULT_VALUE_FLAG | BLOB_FLAG)) &&
1949
1949
      old_field->ptr && orig_field &&
1950
1950
      (sql_type != DRIZZLE_TYPE_TIMESTAMP ||                /* set def only if */
1951
 
       old_field->table->timestamp_field != old_field ||  /* timestamp field */ 
 
1951
       old_field->table->timestamp_field != old_field ||  /* timestamp field */
1952
1952
       unireg_check == Field::TIMESTAMP_UN_FIELD))        /* has default val */
1953
1953
  {
1954
1954
    char buff[MAX_FIELD_WIDTH];
1996
1996
    0 otherwise
1997
1997
*/
1998
1998
 
1999
 
bool 
 
1999
bool
2000
2000
Field::set_warning(DRIZZLE_ERROR::enum_warning_level level, uint32_t code,
2001
2001
                   int cuted_increment)
2002
2002
{
2032
2032
    thread.
2033
2033
*/
2034
2034
 
2035
 
void 
2036
 
Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level, 
2037
 
                            unsigned int code, 
2038
 
                            const char *str, uint32_t str_length, 
 
2035
void
 
2036
Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level,
 
2037
                            unsigned int code,
 
2038
                            const char *str, uint32_t str_length,
2039
2039
                            enum enum_drizzle_timestamp_type ts_type, int cuted_increment)
2040
2040
{
2041
2041
  Session *session= table ? table->in_use : current_session;
2062
2062
    thread.
2063
2063
*/
2064
2064
 
2065
 
void 
2066
 
Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level, uint32_t code, 
 
2065
void
 
2066
Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level, uint32_t code,
2067
2067
                            int64_t nr, enum enum_drizzle_timestamp_type ts_type,
2068
2068
                            int cuted_increment)
2069
2069
{
2073
2073
  {
2074
2074
    char str_nr[22];
2075
2075
    char *str_end= int64_t10_to_str(nr, str_nr, -10);
2076
 
    make_truncated_value_warning(session, level, str_nr, (uint32_t) (str_end - str_nr), 
 
2076
    make_truncated_value_warning(session, level, str_nr, (uint32_t) (str_end - str_nr),
2077
2077
                                 ts_type, field_name);
2078
2078
  }
2079
2079
}
2093
2093
    thread.
2094
2094
*/
2095
2095
 
2096
 
void 
2097
 
Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level, const uint32_t code, 
 
2096
void
 
2097
Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level, const uint32_t code,
2098
2098
                            double nr, enum enum_drizzle_timestamp_type ts_type)
2099
2099
{
2100
2100
  Session *session= table ? table->in_use : current_session;