summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_time.test
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.0' into 10.1Sergei Golubchik2016-12-111-0/+25
|\
| * MDEV-10787 Assertion `ltime->neg == 0' failed in void ↵Alexander Barkov2016-12-071-0/+25
| | | | | | | | date_to_datetime(MYSQL_TIME*)
* | MDEV-10317 EXCTACT(MINUTE_MICROSECOND) truncates dataAlexander Barkov2016-07-031-0/+74
| |
* | Merge branch '10.0' into 10.1Sergei Golubchik2016-02-231-0/+18
|\ \ | |/
| * Merge branch '5.5' into 10.0Sergei Golubchik2016-02-151-0/+18
| |\
| | * Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-02-091-0/+18
| | |\ | | | | | | | | | | | | | | | | reverted about half of commits as either not applicable or outright wrong
| | | * Bug #21564557: INCONSISTENT OUTPUT FROM 5.5 AND 5.6Sreeharsha Ramanavarapu2015-12-311-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%M" Issue: ----- When an invalid date is supplied to the UNIX_TIMESTAMP function from STR_TO_DATE, no check is performed before converting it to a timestamp value. SOLUTION: --------- Add the check_date function and only if it succeeds, proceed to the timestamp conversion. No warning will be returned for dates having zero in month/date, since partial dates are allowed. UNIX_TIMESTAMP will return only a zero for such values. The problem has been handled in 5.6+ with WL#946.
| | | * Merging BUG#13458237 from 5.1.Alexander Barkov2012-01-241-0/+61
| | | |\
| | | | * BUG#13458237 - INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY. ↵Alexander Barkov2012-01-241-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SIMILAR TO '2009-10-00' - Reverting the patch for Bug # 12584302 The patch will be reverted in 5.1 and 5.5. The patch will not be reverted in 5.6, the change will be properly documented in 5.6. - Backporting DBUG_ASSERT not to crash on '0000-01-00' (already fixed in mysql-trunk (5.6))
| | | * | BUG#13354387 - CRASH IN IN MY_DECIMAL::OPERATOR FOR VIEW AND FUNCTION UNIX_TIMEAlexander Barkov2012-01-121-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixing the 5.5 part (the 5.6 part will go in a separate commit soon). Problem: Item_direct_ref::get_date() incorrectly calculated its "null_value", which made UNIX_TIMESTAMP(view_column) incorrectly return NULL for a NOT NULL view_column. Fix: Make Item_direct_ref::get_date() calculate null_value in the similar way with the other methods (val_real,val_str,val_int,val_decimal): copy null_value from the referenced Item. modified: mysql-test/r/func_time.result mysql-test/t/func_time.test sql/item.cc
| | | * | 5.1 -> 5.5 mergeSergey Glukhov2011-07-271-0/+6
| | | |\ \ | | | | |/
| | | | * Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) ↵Sergey Glukhov2011-07-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Y/4-TEMP > 0, The problem is that TIME_FUZZY_DATE is explicitly used for get_arg0_date() function in Item_date_typecast::get_date method. The fix is to use real fuzzy_date value.
| | | * | 5.1 -> 5.5 mergeSergey Glukhov2011-05-181-0/+7
| | | |\ \ | | | | |/
| | | | * Bug#12403504 AFTER FIX FOR #11889186 : ASSERTION FAILED: DELSUM+(INT) ↵Sergey Glukhov2011-05-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Y/4-TEMP > 0 There are two problems: 1. There is a missing check for 'year' parameter(year can not be greater than 9999) in makedate function. fix: added check that year can not be greater than 9999. 2. There is a missing check for zero date in from_days() function. fix: added zero date check into Item_func_from_days::get_date() function.
| | | * | 5.1 -> 5.5 mergeSergey Glukhov2011-04-271-0/+8
| | | |\ \ | | | | |/
| | | | * Bug#11889186 60503: CRASH IN MAKE_DATE_TIME WITH DATE_FORMAT / STR_TO_DATE ↵Sergey Glukhov2011-04-271-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | COMBINATION calc_daynr() function returns negative result if malformed date with zero year and month is used. Attempt to calculate week day on negative value leads to crash. The fix is return NULL for 'W', 'a', 'w' specifiers if zero year and month is used. Additional fix for calc_daynr(): --added assertion that result can not be negative --return 0 if zero year and month is used
| | | * | 5.1 -> 5.5 mergeSergey Glukhov2011-03-301-0/+12
| | | |\ \ | | | | |/
| | | | * Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIMESergey Glukhov2011-03-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Valgrind warning happens due to missing NULL value check in Item::get_date. The fix is to add this check.
| | | | * Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNINGSergey Glukhov2011-03-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Valgrind warning happens because null values check happens too late in Item_func_month::val_str(after result string calculation).The fix is to check null value before result string calculation.
| | | * | 5.1 -> 5.5 mergeSergey Glukhov2011-03-281-0/+14
| | | |\ \ | | | | |/
| | | | * Bug#11766087 59125: VALGRIND UNINITIALISED VALUE WARNING IN ULL2DEC, ↵Sergey Glukhov2011-03-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LONGLONG2DECIMAL Valgrind warning happens due to missing NULL value check in Item_func::val_decimal. The fix is to add this check.
| | | | * Bug#11765216 58154: UNINITIALIZED VARIABLE FORMAT IN STR_TO_DATE FUNCTIONSergey Glukhov2011-03-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Valgrind warning happens due to uninitialized cached_format_type field which is used later in Item_func_str_to_date::val_str method. The fix is to init cached_format_type field.
| | | * | 5.1->5.5 mergeSergey Glukhov2011-03-281-0/+6
| | | |\ \ | | | | |/
| | | | * Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH ↵Sergey Glukhov2011-03-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | STR_TO_DATE(SPACE(..) ... Valgrind warining happens due to missing 'end of the string' check. The fix is to check if we reached the end of the string.
| | | * | Merge from mysql-5.5.10-releasehery.ramilison@oracle.com2011-03-161-0/+8
| | | |\ \
| | | | * | Bug #59686 crash in String::copy() with time data typeTor Didriksen2011-02-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that Item_sum_hybrid::val_xxx() did not propagate null values up the expression tree.
| | | * | | BUG#11766720 - setting storage engine to null segfaults mysqldSergey Vojtovich2011-02-181-0/+7
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MONTHNAME(0) claims that it is about to return NOT NULL value, whereas it actually returns NULL. As a result storage_engine variable (which cannot be NULL) protection was bypassed and NULL value was accepted, causing server crash. Fixed MONTHNAME(0) to report valid NULL flag.
| | | * | mergeGeorgi Kodinov2011-02-021-1/+3
| | | |\ \ | | | | |/
| | | | * mergeGeorgi Kodinov2011-02-021-0/+3
| | | | |\
| | | | | * Bug #52315 part 2 addendum : reset back the timestampGeorgi Kodinov2011-02-021-0/+3
| | | | | |
| | | * | | mergeGeorgi Kodinov2011-02-021-0/+18
| | | |\ \ \ | | | | |/ /
| | | | * | merge to 5.1.Georgi Kodinov2011-02-021-0/+19
| | | | |\ \ | | | | | |/
| | | | | * Fixes for Bug #55755 and Bug #52315 part 2Georgi Kodinov2011-02-021-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug #55755 : Date STD variable signness breaks server on FreeBSD and OpenBSD * Added a check to configure on the size of time_t * Created a macro to check for a valid time_t that is safe to use with datetime functions and store in TIMESTAMP columns. * Used the macro consistently instead of the ad-hoc checks introduced by 52315 * Fixed compliation warnings on platforms where the size of time_t is smaller than the size of a long (e.g. OpenBSD 4.8 64 amd64). Bug #52315: utc_date() crashes when system time > year 2037 * Added a correct check for the timestamp range instead of just variable size check to SET TIMESTAMP. * Added overflow checking before converting to time_t. * Using a correct localized error message in this case instead of the generic error. * Added a test suite. * fixed the checks so that they check for unsigned time_t as well. Used the checks consistently across the source code. * fixed the original test case to expect the new error code.
| | | * | | Auto-merge from mysql-5.5.7-rc-release.Alexander Nozdrin2010-11-251-0/+8
| | | |\ \ \
| | | | * | | Bug#57512 str_to_date crash...Oystein Grovlen2010-10-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | str_to_date function should only try to generate a warning for invalid input strings, not when input value is NULL. In latter case, val_str() of input argument will return a nil pointer. Trying to generate a warning using this pointer lead to a segmentation fault. Solution: Only generate warning when pointer to input string is non-nil.
| | | * | | | manual merge 5.1-bugteam --> 5.5-bugteam (bug 52160)Gleb Shchepa2010-11-011-0/+10
| | | |\ \ \ \ | | | | |/ / / | | | |/| / / | | | | |/ /
| | | | * | Bug #52160: crash and inconsistent results when groupingGleb Shchepa2010-10-311-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by a function and column The bugreport reveals two different bugs about grouping on a function: 1) grouping by the TIME_TO_SEC function result caused a server crash or wrong results and 2) grouping by the function returning a blob caused an unexpected "Duplicate entry" error and wrong result. Details for the 1st bug: TIME_TO_SEC() returns NULL if its argument is invalid (empty string for example). Thus its nullability depends not only on the nullability of its arguments but also on their values. Fixed by (overoptimistically) setting TIME_TO_SEC() to be nullable despite the nullability of its arguments. Details for the 2nd bug: The server is unable to create indices on blobs without explicit blob key part length. However, this fact was ignored for blob function result fields of GROUP BY intermediate tables. Fixed by disabling GROUP BY index creation for blob function result fields like regular blob fields.
| | | * | | Bug#57039: constant subtime expression returns incorrect result.Evgeny Potemkin2010-10-071-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The subtime function wasn't able to produce correct int representation of its result. For constant expressions the Item_datetime_cache is used to speedup evaluation and Item_datetime_cache expects underlying item to return correct int representation of DATETIME value. These two factors combined led to a wrong query result. Now the Item_func_add_time has function val_datetime which performs the calculation and saves result into given MYSQL_TIME struct, it also sets null_value to appropriate value. val_int and val_str member functions convert the result obtained from val_datetime to int or string respectively and returns it.
| | | * | | mergeGeorgi Kodinov2010-08-161-0/+11
| | | |\ \ \ | | | | |/ /
| | | | * | Bug #55565: debug assertion when ordering by expressions with user Georgi Kodinov2010-08-131-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | variable assignments The assert() that is firing is checking if expressions that can't be null return a NULL when evaluated. MAKEDATE() function can return NULL if the second argument is less then or equal to 0. Thus its nullability depends not only on the nullability of its arguments but also on their values. Fixed by (overoptimistically) setting MAKEDATE() to be nullable despite the nullability of its arguments. Test added. Had to update one test result to reflect the metadata change.
| | | * | | WL#5154 Remove deprecated 4.1 featuresMagne Mahre2010-02-171-30/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A set of program options and variables was deprecated in MySQL 5.1, and is hereby removed.
| | | * | | Bug #36466: Adding days to day_microsecond changes interpretation of microsecoMagne Mahre2009-11-031-0/+10
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When less than six places are given for microseconds, we zerofill from the right (leftmost place is always 1/10s). We only did this when all announced date/time fields were given; now we also format fractional seconds when more significant fields are left out.
| | | * | merge: 5.1 -> 5.1-rplLuis Soares2009-01-231-0/+9
| | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | conflicts: Text conflict in client/mysqltest.cc Text conflict in mysql-test/include/wait_until_connected_again.inc Text conflict in mysql-test/lib/mtr_report.pm Text conflict in mysql-test/mysql-test-run.pl Text conflict in mysql-test/r/events_bugs.result Text conflict in mysql-test/r/log_state.result Text conflict in mysql-test/r/myisam_data_pointer_size_func.result Text conflict in mysql-test/r/mysqlcheck.result Text conflict in mysql-test/r/query_cache.result Text conflict in mysql-test/r/status.result Text conflict in mysql-test/suite/binlog/r/binlog_index.result Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_packet.result Text conflict in mysql-test/suite/rpl/t/rpl_packet.test Text conflict in mysql-test/t/disabled.def Text conflict in mysql-test/t/events_bugs.test Text conflict in mysql-test/t/log_state.test Text conflict in mysql-test/t/myisam_data_pointer_size_func.test Text conflict in mysql-test/t/mysqlcheck.test Text conflict in mysql-test/t/query_cache.test Text conflict in mysql-test/t/rpl_init_slave_func.test Text conflict in mysql-test/t/status.test
| | | | * \ 5.0-bugteam->5.1-bugteam mergeSergey Glukhov2008-12-231-0/+9
| | | | |\ \ | | | | | |/
| | | | | * Bug#37575 UCASE fails on monthnameSergey Glukhov2008-12-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MONTHNAME/DAYNAME functions returns binary string, so the LOWER/UPPER functions are not effective on the result of MONTHNAME/DAYNAME call. Character set of the MONTHNAME/DAYNAME function result has been changed to connection character set.
| | | * | | BUG#37975: wait_for_slave_* should increase the timeoutSven Sandberg2008-07-101-0/+2
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem 1: tests often fail in pushbuild with a timeout when waiting for the slave to start/stop/receive error. Fix 1: Updated the wait_for_slave_* macros in the following way: - The timeout is increased by a factor ten - Refactored the macros so that wait_for_slave_param does the work for the other macros. Problem 2: Tests are often incorrectly written, lacking a source include/wait_for_slave_to_[start|stop].inc. Fix 2: Improved the chance to get it right by adding include/start_slave.inc and include/stop_slave.inc, and updated tests to use these. Problem 3: The the built-in test language command wait_for_slave_to_stop is a misnomer (does not wait for the slave io thread) and does not give as much debug info in case of failure as the otherwise equivalent macro source include/wait_for_slave_sql_to_stop.inc Fix 3: Replaced all calls to the built-in command by a call to the macro. Problem 4: Some, but not all, of the wait_for_slave_* macros had an implicit connection slave. This made some tests confusing to read, and made it more difficult to use the macro in circular replication scenarios, where the connection named master needs to wait. Fix 4: Removed the implicit connection slave from all wait_for_slave_* macros, and updated tests to use an explicit connection slave where necessary. Problem 5: The macros wait_slave_status.inc and wait_show_pattern.inc were unused. Moreover, using them is difficult and error-prone. Fix 5: remove these macros. Problem 6: log_bin_trust_function_creators_basic failed when running tests because it assumed @@global.log_bin_trust_function_creators=1, and some tests modified this variable without resetting it to its original value. Fix 6: All tests that use this variable have been updated so that they reset the value at end of test.
| | | * | Merge kaamos.(none):/data/src/opt/bug33834/my50-bug33834kaa@kaamos.(none)2008-02-271-1/+7
| | | |\ \ | | | | |/ | | | | | | | | | | into kaamos.(none):/data/src/opt/bug33834/my51-bug33834
| | | | * Fixed test suite failures with --ps-protocol introduced in PB bykaa@kaamos.(none)2008-02-271-1/+7
| | | | | | | | | | | | | | | | | | | | the patch for bug #33834.
| | | * | Merge kaamos.(none):/data/src/opt/bug33834/my50-bug33834kaa@kaamos.(none)2008-02-251-0/+19
| | | |\ \ | | | | |/ | | | | | | | | | | into kaamos.(none):/data/src/opt/bug33834/my51-bug33834
| | | | * Fix for bug #33834: FRAC_SECOND: Applicability not clear in kaa@kaamos.(none)2008-02-251-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | documentation While the manual mentions FRAC_SECOND only for the TIMESTAMPADD() function, it was also possible to use FRAC_SECOND with DATE_ADD(), DATE_SUB() and +/- INTERVAL. Fixed the parser to match the manual, i.e. using FRAC_SECOND for anything other than TIMESTAMPADD()/TIMESTAMPDIFF() now produces a syntax error. Additionally, the patch allows MICROSECOND to be used in TIMESTAMPADD/ TIMESTAMPDIFF and marks FRAC_SECOND as deprecated.