~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/month.cc

  • Committer: Brian Aker
  • Date: 2010-09-09 21:45:53 UTC
  • mto: (1756.1.2 build) (1768.2.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 1757.
  • Revision ID: brian@tangent.org-20100909214553-e687rmf5zk9478on
Force unique to just use memory and let the OS handle paging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        char buff[DRIZZLE_MAX_LENGTH_DATETIME_AS_STRING];
59
59
        String tmp(buff,sizeof(buff), &my_charset_utf8_bin);
60
60
        String *res= args[0]->val_str(&tmp);
61
 
 
62
 
        if (res && (res != &tmp))
63
 
        {
64
 
          tmp.copy(*res);
65
 
        }
66
 
 
67
 
        if (! temporal.from_string(tmp.c_ptr(), tmp.length()))
 
61
        if (! temporal.from_string(res->c_ptr(), res->length()))
68
62
        {
69
63
          /* 
70
64
          * Could not interpret the function argument as a temporal value, 
71
65
          * so throw an error and return 0
72
66
          */
73
 
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
 
67
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
74
68
          return 0;
75
69
        }
76
70
      }
92
86
 
93
87
        res= args[0]->val_str(&tmp);
94
88
 
95
 
        if (res && (res != &tmp))
96
 
        {
97
 
          tmp.copy(*res);
98
 
        }
99
 
 
100
 
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
 
89
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
101
90
        return 0;
102
91
      }
103
92
  }