Commit graph

1151 commits

Author SHA1 Message Date
Alexander Barkov
bf617c3654 MDEV-20423 Assertion 0' failed or btr_validate_index(index, 0, false)' in row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with TIME_ROUND_FRACTIONAL 2019-09-18 09:51:13 +04:00
Alexander Barkov
c99f9766b1 MDEV-19166 Assertion `!is_zero_datetime()' failed in Timestamp_or_zero_datetime::tv 2019-08-05 14:41:17 +04:00
Alexander Barkov
cfbd714868 MDEV-19774 Assertion `sec.se c() <= 0x7FFFFFFFL' failed in Item_func_from_unixtime::get_date 2019-06-20 09:48:34 +04:00
Oleksandr Byelkin
c07325f932 Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
Marko Mäkelä
be85d3e61b Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
Marko Mäkelä
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
Vicențiu Ciorbaru
cb248f8806 Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
Vicențiu Ciorbaru
5543b75550 Update FSF Address
* Update wrong zip-code
2019-05-11 21:29:06 +03:00
Alexander Barkov
ea5cda5269 MDEV-18402 Assertion `sec.sec() <= 59' failed in Item_func_maketime::get_date 2019-04-02 11:40:22 +04:00
Marko Mäkelä
514b305dfb Merge 10.3 into 10.4
The MDEV-17262 commit 26432e49d3
was skipped. In Galera 4, the implementation would seem to require
changes to the streaming replication.

In the tests archive.rnd_pos main.profiling, disable_ps_protocol
for SHOW STATUS and SHOW PROFILE commands until MDEV-18974
has been fixed.
2019-03-20 10:41:32 +02:00
Sergei Golubchik
b64fde8f38 Merge branch '10.2' into 10.3 2019-03-17 13:06:41 +01:00
Sergei Golubchik
0508d327ae Merge branch '10.1' into 10.2 2019-03-15 21:00:41 +01:00
Alexander Barkov
ddfa722a03 MDEV-18626 ASAN stack-buffer-overflow in int10_to_str / make_date_time upon DATE_FORMAT 2019-03-14 14:40:33 +04:00
Alexander Barkov
cb66cdc6f8 MDEV-14926 AddressSanitizer: heap-use-after-free in make_date_time on weird combination of functions 2019-03-14 10:05:38 +04:00
Marko Mäkelä
b5763ecd01 Merge 10.3 into 10.4 2018-12-18 11:33:53 +02:00
Marko Mäkelä
45531949ae Merge 10.2 into 10.3 2018-12-18 09:15:41 +02:00
Alexey Botchkov
c4ab352b67 MDEV-14576 Include full name of object in message about incorrect value for column.
The error message modified.
Then the TABLE_SHARE::error_table_name() implementation taken from 10.3,
          to be used as a name of the table in this message.
2018-12-16 02:21:41 +04:00
Alexander Barkov
34eb98387f MDEV-13995 MAX(timestamp) returns a wrong result near DST change 2018-12-10 19:25:12 +04:00
Alexander Barkov
4447a02cf1 MDEV-16991 Rounding vs truncation for TIME, DATETIME, TIMESTAMP 2018-11-26 08:10:47 +04:00
Alexander Barkov
740ce108a5 MDEV-17792 New class Timestamp and cleanups in Date, Datetime, Field for rounding 2018-11-22 14:53:25 +04:00
Alexander Barkov
d2ba9edd66 MDEV-17740 Extend EXTRACT(x AS DAY*) to understand long time intervals 2018-11-17 10:14:44 +04:00
Alexander Barkov
a5e2a14ef3 MDEV-17634 Regression: TIME(0)=TIME('z') returns NULL vs 1 2018-11-07 14:42:36 +04:00
Alexander Barkov
f7179c4432 MDEV-17460 Move the code from Item_extract::val_int() to a new class Extract_source 2018-10-16 11:14:39 +04:00
Alexander Barkov
1c5fd80a04 Fixing a test failure on 32bit platforms in the new MDEV-17434 code 2018-10-16 06:59:30 +04:00
Alexander Barkov
22e75434e7 MDEV-17434 EXTRACT(DAY FROM negative_time) returns wrong result 2018-10-15 17:46:25 +04:00
Marko Mäkelä
444c380ceb Merge 10.3 into 10.4 2018-10-05 08:09:49 +03:00
Alexander Barkov
e5aebc1408 A cleanup for MDEV-17317 Add THD* parameter into Item::get_date() and stricter data type control to "fuzzydate"
Fixing C++ function check_date() to get the "fuzzydate" as
date_mode_t rather than ulonglong, so conversion from
date_time_t to ulonglong is now done inside C++ check_date(),
and no conversion is needed in the callers' code.

As an additional safety, modified the code not to pass
TIME_FUZZY_DATE to the low level C functions:
- check_date()
- str_to_datetime()
- str_to_time()
- number_to_datetime()
because TIME_FUZZY_DATE is known only on the C++ level,
C functions do not know it.

Soon we'll be adding more flags into the C++ level (i.e. to date_time_t),
e.g. for rounding. It's a good idea to prevent passing C++ specific
flags into pure C routines before this change.

Asserts were added into the affected C functions to verify
that the caller passed only known C level flags.
2018-10-01 12:34:03 +04:00
Sergei Golubchik
57e0da50bb Merge branch '10.2' into 10.3 2018-09-28 16:37:06 +02:00
Alexander Barkov
ad8e02ac45 MDEV-17317 Add THD* parameter into Item::get_date() and stricter data type control to "fuzzydate" 2018-09-28 14:01:17 +04:00
Alexander Barkov
25ad38abe5 MDEV-17288 Replace Item_func::get_arg0_date() to Date/Datetime methods 2018-09-25 10:07:45 +04:00
Sergei Golubchik
5ae8fce50b Merge branch '10.1' into 10.2 2018-09-24 11:46:08 +02:00
Sergei Golubchik
1fc5a6f30c Merge branch '10.0' into 10.1 2018-09-23 12:58:11 +02:00
Alexander Barkov
80bcb05b24 Merge remote-tracking branch 'origin/5.5' into 10.0 2018-09-21 08:37:42 +04:00
Alexander Barkov
935a163dd9 MDEV-17244 MAKETIME(900,0,0.111) returns a wrong result 2018-09-20 16:51:56 +04:00
Alexander Barkov
0c6455aa46 MDEV-17249 MAKETIME(-1e50,0,0) returns a wrong result 2018-09-20 16:02:58 +04:00
Alexander Barkov
d93399746d MDEV-17203 Move fractional second truncation from Item_xxx_typecast::get_date() to Time and Datetime constructors 2018-09-16 12:41:48 +04:00
Alexander Barkov
ffdae1a960 MDEV-16926 CAST(COALESCE(year_field)) returns wrong value 2018-08-09 11:08:11 +04:00
Alexander Barkov
8524bb6872 MDEV-14032 SEC_TO_TIME executes side effect two times
- Adding a helper class Sec6 to store (neg,seconds,microseconds)
- Adding a helper class VSec6 (Sec6  with a flag for "IS NULL")
- Wrapping related functions as methods of Sec6;
  * number_to_datetime()
  * number_to_time()
  * my_decimal2seconds()
  * Item::get_seconds()
  * A big piece of code in Item_func_sec_to_time::get_date()

- Using the new classes in places where second-to-temporal
  conversion takes place:
  * Field_timestamp::store(double)
  * Field_timestamp::store(longlong)
  * Field_timestamp_with_dec::store_decimal(my_decimal)
  * Field_temporal_with_date::store(double)
  * Field_temporal_with_date::store(longlong)
  * Field_time::store(double)
  * Field_time::store(longlong)
  * Field_time::store_decimal(my_decimal)
  * Field_temporal_with_date::store_decimal(my_decimal)
  * get_interval_value()
  * Item_func_sec_to_time::get_date()
  * Item_func_from_unixtime::get_date()
  * Item_func_maketime::get_date()
  This change simplifies these methods and functions a lot.

- Warnings are now sent at VSec6 initialization time, when the source
  data is available in its original data type representation.

  If Sec6::to_time() or Sec6::to_datetime() truncate data again during
  conversion to MYSQL_TIME, they send warnings, but only if no warnings
  were sent during VSec6 initialization. This helps prevents double warnings.

  The call for val_str() in Item_func_sec_to_time::get_date() is not
  needed any more, so it's removed. This change actually fixes the problem.

  As a good effect, FROM_UNIXTIME() and MAKETIME() now also send warnings
  in case if the seconds arguments is out of range. Previously these
  functions returned NULL silently.

- Splitting the code in the global function make_truncated_value_warning()
  into a number of methods THD::raise_warning_xxxx().
  This was needed to reuse the logic that chooses between:
  * ER_TRUNCATED_WRONG_VALUE
  * ER_WRONG_VALUE
  * ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
  for non-temporal data types (Sec6).

- Removing:
  * Item::get_seconds()
  * number_to_time_with_warn()
  as this code now resides inside methods of Sec6.

- Cleanup (changes that are not directly related to the fix):
  * Removing calls for field_name_or_null() and passing NULL instead
    in Item_func_hybrid_field_type::get_date_from_{int|real}_op,
    because Item_func_hybrid_field_type::field_name_or_null()
    always returns NULL
  * Replacing a number of calls for make_truncated_value_warning()
    to calls for THD::raise_warning_xxx(). In these places
    we know that the execution went through a certain
    branch of make_truncated_value_warning(),
    (e.g. the exact error code is known, or field name is always NULL,
     or field name is always not-NULL). So calls for the entire
    make_truncated_value_warning() after splitting are not necessary.
2018-08-09 06:31:05 +04:00
Alexander Barkov
385ee993d9 A cleanup for MDEV-16852
Changing data types for:
- seconds from longlong to ulonglong
- microseconds from long to ulong
in:
- parameters of calc_time_diff()
- parameters of calc_time_from_sec()
- Members of Sec6_add

This will help to reuse the code easier:
all other functions use ulonglong+long
for seconds/microsecond, e.g.:

- number_to_time()
- number_to_datetime()
- number_to_datetime_with_warn()
- Field_temporal_with_date::store_decimal()
- my_decimal2seconds()
- Item::get_seconds()
2018-08-07 16:26:35 +04:00
Alexander Barkov
cb7b5fbf1c MDEV-16910 Add class VDec
Adding classes VDec and VDec2_lazy, according to the task description.
This patch removes around 250 duplicate code lines.
2018-08-07 10:48:42 +04:00
Alexander Barkov
c7115428ed MDEV-16881 Remove Item::get_temporal_with_sql_mode() and val_xxx_from_date() 2018-08-02 15:36:13 +04:00
Alexander Barkov
1b87cd80a2 MDEV-16878 Functions ADDTIME and SUBTIME get wrongly removed from WHERE by the equal expression optimizer 2018-08-02 10:48:55 +04:00
Alexander Barkov
54fc47960d MDEV-16874 Implement class Item_handled_func 2018-08-01 16:15:16 +04:00
Alexander Barkov
b1ae4e7e15 MDEV-16864 Implement class Item_func_timestamp 2018-07-31 16:58:02 +04:00
Alexander Barkov
28ff7e89c6 MDEV-16852 Get rid of Item_temporal_hybrid_func::fix_temporal_type()
- Implementing the task according to the MDEV description.
- Adding a helper class Sec6_add to share the code in type-specific
  branches in Item_func_add_time::get_date().
2018-07-30 20:40:48 +04:00
Oleksandr Byelkin
083279f783 Merge commit '6b8802e8dd5467556a024d807a1df23940b00895' into bb-10.3-fix_len_dec 2018-06-19 14:51:50 +02:00
Oleksandr Byelkin
6b8802e8dd MDEV-11071: Assertion `thd->transaction.stmt.is_empty()' failed in Locked_tables_list::unlock_locked_table
fix_length_and_dec now return result (error/OK)
2018-06-15 10:31:30 +02:00
Monty
30ebc3ee9e Add likely/unlikely to speed up execution
Added to:
- if (error)
- Lex
- sql_yacc.yy and sql_yacc_ora.yy
- In header files to alloc() calls
- Added thd argument to thd_net_is_killed()
2018-05-07 00:07:32 +03:00
Monty
cd48c1e23a Removed some old #if MYSQL_VERSION
- Removed never used warning that explicit_defaults_for_timestamp was
  not set
2018-04-26 17:57:38 +03:00
Sergei Golubchik
b1818dccf7 Merge branch '10.2' into 10.3 2018-03-28 17:31:57 +02:00