~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item_timefunc.cc

  • Committer: Brian Aker
  • Date: 2008-11-15 19:00:52 UTC
  • mfrom: (584.1.4 devel)
  • Revision ID: brian@tangent.org-20081115190052-a1rpuroqri7zw6d7
Merging Monty's work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1346
1346
    follows:
1347
1347
 
1348
1348
    - If first arg is a DRIZZLE_TYPE_DATETIME result is DRIZZLE_TYPE_DATETIME
1349
 
    - If first arg is a DRIZZLE_TYPE_NEWDATE and the interval type uses hours,
 
1349
    - If first arg is a DRIZZLE_TYPE_DATE and the interval type uses hours,
1350
1350
      minutes or seconds then type is DRIZZLE_TYPE_DATETIME.
1351
1351
    - Otherwise the result is DRIZZLE_TYPE_VARCHAR
1352
1352
      (This is because you can't know if the string contains a DATE, DRIZZLE_TIME or
1357
1357
  if (arg0_field_type == DRIZZLE_TYPE_DATETIME ||
1358
1358
      arg0_field_type == DRIZZLE_TYPE_TIMESTAMP)
1359
1359
    cached_field_type= DRIZZLE_TYPE_DATETIME;
1360
 
  else if (arg0_field_type == DRIZZLE_TYPE_NEWDATE)
 
1360
  else if (arg0_field_type == DRIZZLE_TYPE_DATE)
1361
1361
  {
1362
1362
    if (int_type <= INTERVAL_DAY || int_type == INTERVAL_YEAR_MONTH)
1363
1363
      cached_field_type= arg0_field_type;
1963
1963
 
1964
1964
  cached_field_type= DRIZZLE_TYPE_VARCHAR;
1965
1965
  arg0_field_type= args[0]->field_type();
1966
 
  if (arg0_field_type == DRIZZLE_TYPE_NEWDATE ||
 
1966
  if (arg0_field_type == DRIZZLE_TYPE_DATE ||
1967
1967
      arg0_field_type == DRIZZLE_TYPE_DATETIME ||
1968
1968
      arg0_field_type == DRIZZLE_TYPE_TIMESTAMP)
1969
1969
    cached_field_type= DRIZZLE_TYPE_DATETIME;
2500
2500
      switch (cached_format_type) {
2501
2501
      case DATE_ONLY:
2502
2502
        cached_timestamp_type= DRIZZLE_TIMESTAMP_DATE;
2503
 
        cached_field_type= DRIZZLE_TYPE_NEWDATE; 
 
2503
        cached_field_type= DRIZZLE_TYPE_DATE; 
2504
2504
        max_length= MAX_DATE_WIDTH * MY_CHARSET_BIN_MB_MAXLEN;
2505
2505
        break;
2506
2506
      case TIME_ONLY: