~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

Viewing changes to sql/sql_time.cc

  • Committer: Package Import Robot
  • Author(s): James Page, Otto Kekäläinen
  • Date: 2014-02-17 16:51:52 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140217165152-k315d3175g865kkx
Tags: 5.5.35-1
[ Otto Kekäläinen ]
* New upstream release, fixing the following security issues:
  - Buffer overflow in client/mysql.cc (Closes: #737597).
    - CVE-2014-0001
  - http://www.oracle.com/technetwork/topics/security/cpujan2014-1972949.html
    - CVE-2013-5891
    - CVE-2013-5908
    - CVE-2014-0386
    - CVE-2014-0393
    - CVE-2014-0401
    - CVE-2014-0402
    - CVE-2014-0412
    - CVE-2014-0420
    - CVE-2014-0437
* Upstream https://mariadb.atlassian.net/browse/MDEV-4902
  fixes compatibility with Bison 3.0 (Closes: #733002)
* Updated Russian debconf translation (Closes: #734426)
* Updated Japanese debconf translation (Closes: #735284)
* Updated French debconf translation (Closes: #736480)
* Renamed SONAME properly (Closes: #732967)

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
}
231
231
 
232
232
 
 
233
bool
 
234
adjust_time_range_with_warn(MYSQL_TIME *ltime, uint dec)
 
235
{
 
236
  MYSQL_TIME copy= *ltime;
 
237
  ErrConvTime str(&copy);
 
238
  int warnings= 0;
 
239
  if (check_time_range(ltime, dec, &warnings))
 
240
    return true;
 
241
  if (warnings)
 
242
    make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
243
                                 &str, MYSQL_TIMESTAMP_TIME, NullS);
 
244
  return false;
 
245
}
 
246
 
233
247
/*
234
248
  Convert a string to 8-bit representation,
235
249
  for use in str_to_time/str_to_date/str_to_date.
1085
1099
  return 0;
1086
1100
}
1087
1101
 
 
1102
 
 
1103
/*
 
1104
  Convert a TIME value to DAY-TIME interval, e.g. for extraction:
 
1105
    EXTRACT(DAY FROM x), EXTRACT(HOUR FROM x), etc.
 
1106
  Moves full days from ltime->hour to ltime->day.
 
1107
  Note, time_type is set to MYSQL_TIMESTAMP_NONE, to make sure that
 
1108
  the structure is not used for anything else other than extraction:
 
1109
  non-extraction TIME functions expect zero day value!
 
1110
*/
 
1111
void time_to_daytime_interval(MYSQL_TIME *ltime)
 
1112
{
 
1113
  DBUG_ASSERT(ltime->time_type == MYSQL_TIMESTAMP_TIME);
 
1114
  DBUG_ASSERT(ltime->year == 0);
 
1115
  DBUG_ASSERT(ltime->month == 0);
 
1116
  DBUG_ASSERT(ltime->day == 0);
 
1117
  ltime->day= ltime->hour / 24;
 
1118
  ltime->hour%= 24;
 
1119
  ltime->time_type= MYSQL_TIMESTAMP_NONE;
 
1120
}