Comment 1 for bug 597778

Revision history for this message
ziminq (ziminq) wrote :

In drizzled/temporal.cc:1357

1357 bool DateTime::is_valid() const
1358 {
1359 return (_years >= DRIZZLE_MIN_YEARS_SQL && _years <= DRIZZLE_MAX_YEARS_SQL)
1360 && (_months >= 1 && _months <= 12)
1361 && (_days >= 1 && _days <= days_in_gregorian_year_month(_years, _months))
1362 && (_hours <= 23)
1363 && (_minutes <= 59)
1364 && (_seconds <= 61); /* Leap second... */
1365 }

it seems it's legal to be 61 seconds in case there is a leap second. any background on this?

backtrace:

(gdb) bt
#0 drizzled::DateTime::is_valid (this=0x6400000000) at drizzled/temporal.cc:1357
#1 0x0000000000840d5b in drizzled::Timestamp::is_valid (this=0x7f15d42579b0)
    at drizzled/temporal.cc:1370
#2 0x0000000000843186 in drizzled::DateTime::from_string (this=0x7f15d42579b0,
    from=0x3ac47c0 "2000-01-01 12:00:61", from_len=19) at drizzled/temporal.cc:161
#3 0x00000000005dc964 in drizzled::Field_timestamp::store (this=0x3acd558,
    from=0x3ac47c0 "2000-01-01 12:00:61", len=19) at drizzled/field/timestamp.cc:167
#4 0x0000000000628bd2 in drizzled::Item::save_str_value_in_field (this=0x3ac47d8,
    field=0x3acd558, result=0x3ac47e8) at drizzled/item.cc:261
#5 0x000000000066296a in drizzled::Item_string::save_in_field (this=0x3ac47d8,
    field=0x3acd558) at drizzled/item/string.cc:174
#6 0x000000000071b0ba in drizzled::fill_record (session=0x3abf1e0, fields=@0x3ac01a8,
    values=@0x3ac4710, ignore_errors=false) at drizzled/sql_base.cc:4378
#7 0x000000000072c0db in drizzled::mysql_insert (session=0x3abf1e0,
    table_list=0x3ac43e8, fields=@0x3ac01a8, values_list=@0x3ac01f0,
    update_fields=@0x3ac01d8, update_values=@0x3ac01c0, duplic=drizzled::DUP_ERROR,
    ignore=false) at drizzled/sql_insert.cc:358
#8 0x0000000000789c3c in drizzled::statement::Insert::execute (this=0x3ac7b00)
    at drizzled/statement/insert.cc:57
#9 0x000000000073ad69 in mysql_execute_command (session=0x3abf1e0)
    at drizzled/sql_parse.cc:478
#10 0x000000000073ae7d in drizzled::mysql_parse (session=0x3abf1e0,
    inBuf=0x3ac9a38 "insert into t1 (a, b) values (4, '2000-01-01 12:00:61')", length=55)
    at drizzled/sql_parse.cc:736
#11 0x000000000073b346 in drizzled::dispatch_command (command=drizzled::COM_QUERY,
    session=0x3abf1e0,
    packet=0x3abb1d1 "insert into t1 (a, b) values (4, '2000-01-01 12:00:61')",
---Type <return> to continue, or q <return> to quit---
    packet_length=55) at drizzled/sql_parse.cc:223
#12 0x0000000000705d38 in drizzled::Session::executeStatement (this=0x3abf1e0)
    at drizzled/session.cc:646
#13 0x0000000000706484 in drizzled::Session::run (this=0x3abf1e0)
    at drizzled/session.cc:505
#14 0x00007f15e7b97b50 in MultiThreadScheduler::runSession (this=0x32a0960,
    session=0x3abf1e0) at ./plugin/multi_thread/multi_thread.h:67
#15 0x00007f15e7b95fa2 in session_thread (arg=0x3abf1e0)
    at plugin/multi_thread/multi_thread.cc:43
#16 0x00000033d84073da in start_thread () from /lib64/libpthread.so.0
#17 0x00000033d78e62bd in clone () from /lib64/libc.so.6