~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.cc

  • Committer: Brian Aker
  • Date: 2008-08-05 04:10:42 UTC
  • mfrom: (261.2.8 codestyle)
  • mto: This revision was merged to the branch mainline in revision 263.
  • Revision ID: brian@tangent.org-20080805041042-1l4893r3bwy2lxz2
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
                     res->ptr(), res->length(), res->charset(),
260
260
                     decimal_value) & E_DEC_BAD_NUM)
261
261
  {
262
 
    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
262
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
263
263
                        ER_TRUNCATED_WRONG_VALUE,
264
264
                        ER(ER_TRUNCATED_WRONG_VALUE), "DECIMAL",
265
265
                        str_value.c_ptr());
704
704
    if (orig_len != length && !is_autogenerated_name)
705
705
    {
706
706
      if (length == 0)
707
 
        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
707
        push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
708
708
                            ER_NAME_BECOMES_EMPTY, ER(ER_NAME_BECOMES_EMPTY),
709
709
                            str + length - orig_len);
710
710
      else
711
 
        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
711
        push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
712
712
                            ER_REMOVED_SPACES, ER(ER_REMOVED_SPACES),
713
713
                            str + length - orig_len);
714
714
    }
903
903
    {
904
904
      char buff[22], *end;
905
905
      end= int64_t10_to_str(value, buff, -10);
906
 
      make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
906
      make_truncated_value_warning(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
907
907
                                   buff, (int) (end-buff), DRIZZLE_TIMESTAMP_NONE,
908
908
                                   NullS);
909
909
      goto err;
912
912
  return 0;
913
913
 
914
914
err:
915
 
  memset((char*) ltime, 0, sizeof(*ltime));
 
915
  memset(ltime, 0, sizeof(*ltime));
916
916
  return 1;
917
917
}
918
918
 
929
929
  if (!(res=val_str(&tmp)) ||
930
930
      str_to_time_with_warn(res->ptr(), res->length(), ltime))
931
931
  {
932
 
    memset((char*) ltime, 0, sizeof(*ltime));
 
932
    memset(ltime, 0, sizeof(*ltime));
933
933
    return 1;
934
934
  }
935
935
  return 0;
1623
1623
{
1624
1624
  if ((null_value=field->is_null()) || field->get_date(ltime,fuzzydate))
1625
1625
  {
1626
 
    memset((char*) ltime, 0, sizeof(*ltime));
 
1626
    memset(ltime, 0, sizeof(*ltime));
1627
1627
    return 1;
1628
1628
  }
1629
1629
  return 0;
1634
1634
  if ((null_value=result_field->is_null()) ||
1635
1635
      result_field->get_date(ltime,fuzzydate))
1636
1636
  {
1637
 
    memset((char*) ltime, 0, sizeof(*ltime));
 
1637
    memset(ltime, 0, sizeof(*ltime));
1638
1638
    return 1;
1639
1639
  }
1640
1640
  return 0;
1644
1644
{
1645
1645
  if ((null_value=field->is_null()) || field->get_time(ltime))
1646
1646
  {
1647
 
    memset((char*) ltime, 0, sizeof(*ltime));
 
1647
    memset(ltime, 0, sizeof(*ltime));
1648
1648
    return 1;
1649
1649
  }
1650
1650
  return 0;
2034
2034
      We can use str_value.ptr() here as Item_string is gurantee to put an
2035
2035
      end \0 here.
2036
2036
    */
2037
 
    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
2037
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
2038
2038
                        ER_TRUNCATED_WRONG_VALUE,
2039
2039
                        ER(ER_TRUNCATED_WRONG_VALUE), "DOUBLE",
2040
2040
                        str_value.ptr());
2064
2064
  if (err > 0 ||
2065
2065
      (end != org_end && !check_if_only_end_space(cs, end, org_end)))
2066
2066
  {
2067
 
    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
2067
    push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
2068
2068
                        ER_TRUNCATED_WRONG_VALUE,
2069
2069
                        ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER",
2070
2070
                        str_value.ptr());
2247
2247
  {
2248
2248
    char buff[MAX_DATE_STRING_REP_LENGTH];
2249
2249
    uint length= my_TIME_to_str(&value.time, buff);
2250
 
    make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
2250
    make_truncated_value_warning(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
2251
2251
                                 buff, length, time_type, 0);
2252
2252
    set_zero_time(&value.time, DRIZZLE_TIMESTAMP_ERROR);
2253
2253
  }
2916
2916
  current->mark_as_dependent(last);
2917
2917
  if (thd->lex->describe & DESCRIBE_EXTENDED)
2918
2918
  {
2919
 
    char warn_buff[MYSQL_ERRMSG_SIZE];
 
2919
    char warn_buff[DRIZZLE_ERRMSG_SIZE];
2920
2920
    sprintf(warn_buff, ER(ER_WARN_FIELD_RESOLVED),
2921
2921
            db_name, (db_name[0] ? "." : ""),
2922
2922
            table_name, (table_name [0] ? "." : ""),
2923
2923
            resolved_item->field_name,
2924
2924
            current->select_number, last->select_number);
2925
 
    push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
 
2925
    push_warning(thd, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
2926
2926
                 ER_WARN_FIELD_RESOLVED, warn_buff);
2927
2927
  }
2928
2928
}
3165
3165
        !((*group_by_ref)->eq(*select_ref, 0)))
3166
3166
    {
3167
3167
      ambiguous_fields= true;
3168
 
      push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_NON_UNIQ_ERROR,
 
3168
      push_warning_printf(thd, DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_NON_UNIQ_ERROR,
3169
3169
                          ER(ER_NON_UNIQ_ERROR), ref->full_name(),
3170
3170
                          current_thd->where);
3171
3171
 
3977
3977
  {
3978
3978
    THD *thd= current_thd;
3979
3979
    char hexbuf[7];
3980
 
    enum MYSQL_ERROR::enum_warning_level level;
 
3980
    enum DRIZZLE_ERROR::enum_warning_level level;
3981
3981
    uint diff= str->length() - wlen;
3982
3982
    set_if_smaller(diff, 3);
3983
3983
    octet2hex(hexbuf, str->ptr() + wlen, diff);
3988
3988
      return 0;
3989
3989
    }
3990
3990
    {
3991
 
      level= MYSQL_ERROR::WARN_LEVEL_ERROR;
 
3991
      level= DRIZZLE_ERROR::WARN_LEVEL_ERROR;
3992
3992
      null_value= 1;
3993
3993
      str= 0;
3994
3994
    }
4555
4555
 
4556
4556
warn:
4557
4557
  if (!field->store((int64_t) nr, true))
4558
 
    field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE,
 
4558
    field->set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE,
4559
4559
                       1);
4560
4560
  return 1;
4561
4561
}
5608
5608
 
5609
5609
      {
5610
5610
        push_warning_printf(field_arg->table->in_use,
5611
 
                            MYSQL_ERROR::WARN_LEVEL_WARN,
 
5611
                            DRIZZLE_ERROR::WARN_LEVEL_WARN,
5612
5612
                            ER_NO_DEFAULT_FOR_FIELD,
5613
5613
                            ER(ER_NO_DEFAULT_FOR_FIELD),
5614
5614
                            field_arg->field_name);