~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/mf_loadpath.cc

  • Committer: Jay Pipes
  • Date: 2009-01-30 04:01:12 UTC
  • mto: This revision was merged to the branch mainline in revision 830.
  • Revision ID: jpipes@serialcoder-20090130040112-svbn774guj98pwi4
To remain in compatibility with MySQL, added ability to interpret
decimal arguments as datetime strings for temporal functions.

Fixed YEAR(), MONTH(), DAYOFMONTH(), DAYOFYEAR(), HOUR(), MINUTE(), SECOND(), and MICROSECOND()
to accept decimal parameters and interpret them the same way as MySQL.

Fixed an issue with the TemporalFormat::matches() method which was 
incorrectly assuming all microsecond arguments were specified as 6 digits.
Added power of 10 multiplier to usecond calculation. This fixes issues with
failures in type_date and func_sapdb test cases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
 
 
16
 
#include "config.h"
17
 
 
18
 
#include "drizzled/internal/my_sys.h"
19
 
#include "drizzled/internal/m_string.h"
20
 
 
21
 
namespace drizzled
22
 
{
23
 
namespace internal
24
 
{
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#include "mysys_priv.h"
 
17
#include <mystrings/m_string.h>
25
18
 
26
19
        /* Returns full load-path for a file. to may be = path */
27
20
        /* if path is a hard-path return path */
40
33
      test_if_hard_path(path))
41
34
    strcpy(buff,path);
42
35
  else if ((is_cur=(path[0] == FN_CURLIB && path[1] == FN_LIBCHAR)) ||
43
 
           (strncmp(path,FN_PARENTDIR, strlen(FN_PARENTDIR)) == 0) ||
 
36
           (is_prefix(path,FN_PARENTDIR)) ||
44
37
           ! own_path_prefix)
45
38
  {
46
39
    if (is_cur)
47
40
      is_cur=2;                                 /* Remove current dir */
48
 
    if (! getcwd(buff,(uint32_t) (FN_REFLEN-strlen(path)+is_cur)))
 
41
    if (! getcwd(buff,(uint) (FN_REFLEN-strlen(path)+is_cur)))
49
42
      strcat(buff,path+is_cur);
50
43
    else
51
44
      strcpy(buff,path);                        /* Return org file name */
52
45
  }
53
46
  else
54
 
    snprintf(buff, sizeof(buff), "%s%s",own_path_prefix,path);
 
47
    sprintf(buff,"%s%s",own_path_prefix,path);
55
48
  strcpy(to,buff);
56
49
  return(to);
57
50
} /* my_load_path */
58
 
 
59
 
} /* namespace internal */
60
 
} /* namespace drizzled */