~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

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