Commit graph

110 commits

Author SHA1 Message Date
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
4a5dd6956d Merge mysql.com:/home/ram/work/b23616/b23616.4.1
into  mysql.com:/home/ram/work/b23616/b23616.5.0
2007-03-02 15:09:20 +04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
10475626c1 Fix for bug #23616: Week() changed behaviour between 5.0.22 and 5.0.24
Consider double values as legal date{time} function's arguments
(i.e. allow dates in internal format YYYYMMDDHHMMSS.XXXXXX).
2006-12-26 15:08:41 +04:00
ramil/ram@mysql.com/myoffice.izhnet.ru
b1664c220c Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/usr/home/ram/work/bug22229/my50-bug22229
2006-11-29 13:41:03 +04:00
msvensson@neptunus.(none)
86f0d1bb03 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into  neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
2006-11-24 12:12:25 +01:00
ramil/ram@mysql.com/myoffice.izhnet.ru
b4dd41de69 Merge mysql.com:/usr/home/ram/work/bug23653/my41-bug23653
into  mysql.com:/usr/home/ram/work/bug23653/my50-bug23653
2006-11-16 15:26:33 +04:00
petr/cps@outpost.site
e06f74f9f9 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  outpost.site:/home/cps/mysql/trees/4.1-runtime-bug9191
2006-11-10 15:05:38 +03:00
ramil/ram@mysql.com/myoffice.izhnet.ru
4b823e045f Fix for bug #23653: Crash if last_day('0000-00-00')
As get_arg0_date() in the Item_func_last_day::get_date() returns 
0000-00-00 date sometimes, we have to check ltime->month for 0 after the call.
2006-11-09 16:17:50 +04:00
anozdrin/alik@alik.
7cf65fd309 Merge alik.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  alik.:/mnt/raid/alik/MySQL/devel/5.0-merged-5.0-rt
2006-11-07 13:45:56 +03:00
petr/cps@outpost.site
8de747b0c7 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-4.1-runtime
into  outpost.site:/home/cps/mysql/trees/4.1-runtime-bug9191
2006-11-06 00:05:02 +03:00
petr/cps@mysql.com/owlet.local
7974bf90aa Merge mysql.com:/home/cps/mysql/trees/4.1-runtime-bug9191
into  mysql.com:/home/cps/mysql/trees/5.0-runtime-bug9191
2006-11-01 17:35:35 +03:00
petr/cps@mysql.com/owlet.local
3ec542dfbd Fix Bug #9191 "TIMESTAMP/from_unixtime() no longer accepts 2^31-1"
(4.1 version, with post-review fixes)
  
  The fix for another Bug (6439) limited FROM_UNIXTIME() to
  TIMESTAMP_MAX_VALUE which is 2145916799 or 2037-12-01 23:59:59 GMT,
  however unix timestamp in general is not considered to be limited 
  by this value. All dates up to power(2,31)-1 are valid.
  
  This patch extends allowed TIMESTAMP range so, that max
  TIMESTAMP value is power(2,31)-1. It also corrects
  FROM_UNIXTIME() and UNIX_TIMESTAMP() functions, so that
  max allowed UNIX_TIMESTAMP() is power(2,31)-1. FROM_UNIXTIME()
  is fixed accordingly to allow conversion of dates up to
  2038-01-19 03:14:07 UTC. The patch also fixes CONVERT_TZ()
  function to allow extended range of dates.
  
  The main problem solved in the patch is possible overflows
  of variables, used in broken-time representation to time_t
  conversion (required for UNIX_TIMESTAMP).
2006-11-01 16:47:40 +03:00
ramil/ram@mysql.com/myoffice.izhnet.ru
d39a012441 Fix for bug #22229: Bug in DATE_ADD()
From the manual:
date arithmetic operations require complete dates and do not work with
incomplete dates such as '2006-07-00' or badly malformed dates.
2006-10-17 16:30:49 +05:00
msvensson@shellback.(none)
ffc9538bb4 Merge shellback.(none):/home/msvensson/mysql/mysql-4.1-maint
into  shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-10-14 19:55:06 +02:00
kaa@polly.local
2667443173 Merge polly.local:/tmp/maint/bug11655/my50-bug11655
into  polly.local:/home/kaa/src/maint/mysql-5.0-maint
2006-10-12 11:28:44 +04:00
kaa@polly.local
a050de9837 Merge polly.local:/tmp/maint/bug11655/my41-bug11655
into  polly.local:/home/kaa/src/maint/m41-maint--07OGk
2006-10-11 14:55:23 +04:00
kaa@polly.local
02ac635027 Merge polly.local:/tmp/maint/bug11655/my41-bug11655
into  polly.local:/tmp/maint/bug11655/my50-bug11655
2006-10-11 14:16:30 +04:00
kaa@polly.local
609a3cd295 Fixes a number of problems with time/datetime <-> string conversion functions:
- bug #11655 "Wrong time is returning from nested selects - maximum time exists
- input and output TIME values were not validated properly in several conversion functions
- bug #20927 "sec_to_time treats big unsigned as signed"
- integer overflows were not checked in several functions. As a result, input values like 2^32 or 3600*2^32 were treated as 0
- BIGINT UNSIGNED values were treated as SIGNED in several functions
- in cases where both input string truncation and out-of-range TIME value occur, only 'truncated incorrect time value' warning was produced
2006-10-04 17:13:32 +04:00
cmiller@zippy.cornsilk.net
ca7ade8825 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2006-09-28 07:30:24 -04:00
ramil/ram@mysql.com/myoffice.izhnet.ru
43194fad43 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/mysql-4.1-maint
2006-09-21 09:35:17 +05:00
gkodinov@dl145s.mysql.com
fae596aafd merge fixes 2006-09-18 12:14:27 +02:00
gkodinov@dl145s.mysql.com
a9b3bd0eec Merge dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-4.1-opt
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
2006-09-15 14:14:38 +02:00
evgen@moonbone.local
31c738d8a2 query_cache.result, func_time.test, type_date.result, func_time.result:
Corrected test case after removal of fix for bug#16377         
type_date.test:
  Corrected test case after removal of fix for bug#16377
item_cmpfunc.cc:
  Removed changes to the agg_cmp_type() made in the for bug#16377
2006-09-08 00:59:34 +04:00
tnurnberg@salvation.intern.azundris.com
e3baa2e92a Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-4.1-maint
into  salvation.intern.azundris.com:/home/tnurnberg/21913/my41-21913
2006-09-04 09:28:39 +02:00
tnurnberg@salvation.intern.azundris.com
13200c3f96 Bug#21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.
Variable character_set_results can legally be NULL (for "no conversion.")
This could result in a NULL deref that crashed the server.  Fixed.

(Although ran some additional precursory tests to see whether I could break
anything else, but no breakage so far.)
2006-09-04 09:13:40 +02:00
tnurnberg@maint1.mysql.com
ab7810c8e9 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  maint1.mysql.com:/data/localhome/tnurnberg/my50-21913
2006-09-04 07:45:49 +02:00
tnurnberg@salvation.intern.azundris.com
72c6c14bb2 Merge salvation.intern.azundris.com:/home/tnurnberg/21913/my41-21913
into  salvation.intern.azundris.com:/home/tnurnberg/21913/my50-21913

21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.

Variable character_set_results can legally be NULL (for "no conversion.")
This could result in a NULL deref that crashed the server.  Fixed.

(Although ran some additional precursory tests to see whether I could break
anything else, but no breakage so far.)
2006-09-04 07:01:15 +02:00
tnurnberg@salvation.intern.azundris.com
41f1932488 Bug#21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.
Variable character_set_results can legally be NULL (for "no conversion.")
This could result in a NULL deref that crashed the server.  Fixed.

(Although ran some additional precursory tests to see whether I could break
anything else, but no breakage so far.)
2006-09-04 06:16:34 +02:00
iggy@rolltop.ignatz42.dyndns.org
00ab7be7b9 Merge rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-4.1-maint_20328
into  rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-5.0-merge
2006-08-16 19:31:33 -04:00
tnurnberg@salvation.intern.azundris.com
170392850d Bug#19844: time_format in Union truncates values
time_format() claimed %H and %k would return at most two digits
(hours 0-23), but this coincided neither with actual behaviour
nor with docs.  this is not visible in simple queries; forcing
a temp-table is probably the easiest way to see this.  adjusted
the return-length appropriately; the alternative would be to
adjust the docs to say that behaviour for > 99 hours is undefined.
---
Bug#19844: time_format in Union truncates values

time_format() claimed %H and %k would return at most two digits
(hours 0-23), but this coincided neither with actual behaviour
nor with docs.  this is not visible in simple queries; forcing
a temp-table is probably the easiest way to see this.  adjusted
the return-length appropriately; the alternative would be to
adjust the docs to say that behaviour for > 99 hours is undefined.
2006-08-10 15:37:24 +02:00
msvensson@neptunus.(none)
31be565d2e Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-08-01 20:24:30 +02:00
igreenhoe/greenman@anubis.greendragongames.com
61a3a8e95c Fix for bug #16226 (timestamp_diff truncation issue when requesting
difference between timestamp in values of months and quarters.)

Problem:  when requesting timestamp diff in months or quarters, it
would only examine the date (and not the time) for the comparison.

Solution:  increased precision of comparison.
2006-07-28 20:51:17 -07:00
tsmith/tim@siva.hindu.god
80465ab6af Merge siva.hindu.god:/usr/home/tim/m/bk/global-41
into  siva.hindu.god:/usr/home/tim/m/bk/global-50
2006-07-26 13:30:03 -06:00
ramil/ram@mysql.com/myoffice.izhnet.ru
694d4999ef Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b16327
2006-07-23 14:17:01 +05:00
konstantin@mysql.com
7ca3749f59 Merge mysql.com:/opt/local/work/tmp_merge
into  mysql.com:/opt/local/work/mysql-5.0-merge
2006-06-29 18:34:49 +04:00
kroki@mysql.com
49cc2904d2 Dec. 31st, 9999 is still a valid date, only starting with Jan 1st 10000 things become invalid (Bug #12356) 2006-06-27 19:33:59 +04:00
tnurnberg@mysql.com
8fd6830478 Bug#19408 Test 'func_time' fails on Windows x64
- The setting of "ENV{'TZ'}" doesn't affect the timezone
  used by MySQL Server on Windows.
- Explicitly set timezone to "+03:00" in test case before
  doing the calculatiosn to check that there is three hours
  difference between utc and local time.
(Magnus' fix)
2006-06-22 20:23:22 +02:00
ramil@mysql.com
81277475f8 Merge mysql.com:/usr/home/ram/work/mysql-4.1
into  mysql.com:/usr/home/ram/work/mysql-5.0
2006-06-21 09:16:22 +05:00
ramil@mysql.com
49797c23b3 Fix for bug #20496: func_time.test failure 2006-06-19 13:03:29 +05:00
evgen@moonbone.local
7f24667598 Manually merged 2006-06-17 02:11:12 +04:00
evgen@moonbone.local
28cf3c3e64 Manually merged 2006-06-17 00:58:36 +04:00
evgen@moonbone.local
e35a0ca4b7 Manually merged 2006-06-14 23:54:08 +04:00
evgen@moonbone.local
67de8c46a5 Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.

All date/time functions has the STRING result type thus their results are
compared as strings. The string date representation allows a user to skip 
some of leading zeros. This can lead to wrong comparison result if a date/time 
function result is compared to such a string constant.

The idea behind this bug fix is to compare results of date/time functions
and data/time constants as ints, because that date/time representation is 
more exact. To achieve this the agg_cmp_type() is changed to take in the
account that a date/time field or an date/time item should be compared 
as ints.

This bug fix is partially back ported from 5.0.

The agg_cmp_type() function now accepts THD as one of parameters. 
In addition, it now checks if a date/time field/function is present in the
list. If so, it tries to coerce all constants to INT to make date/time
comparison return correct result. The field for the constant coercion is
taken from the Item_field or constructed from the Item_func. In latter case
the constructed field will be freed after conversion of all constant items.
Otherwise the result is same as before - aggregated with help of the
item_cmp_type() function.

From the Item_func_between::fix_length_and_dec() function removed the part
which was converting date/time constants to int if possible. Now this is 
done by the agg_cmp_type() function.

The new function result_as_longlong() is added to the Item class. 
It indicates that the item is a date/time item and result of it can be
compared as int. Such items are date/time fields/functions.

Correct val_int() methods are implemented for classes Item_date_typecast, 
Item_func_makedate, Item_time_typecast, Item_datetime_typecast. All these
classes are derived from Item_str_func and Item_str_func::val_int() converts
its string value to int without regard to the date/time type of these items.

Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func()
functions are changed to substitute result type of an item with the INT_RESULT
if the item is a date/time item and another item is a constant. This is done
to get a correct result of comparisons like date_time_function() = string_constant.
2006-06-13 19:09:24 +04:00
igor@rurik.mysql.com
940fe6fea6 Merge rurik.mysql.com:/home/igor/tmp_merge
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-06-09 17:56:08 -07:00
ramil@mysql.com
19e312af08 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b16546
2006-06-06 09:10:28 +05:00
ramil@mysql.com
7319ef4ef1 Fix for #16327: invalid TIMESTAMP values retrieved 2006-05-17 17:00:30 +05:00
ramil@mysql.com
a2466179ce Merge mysql.com:/usr/home/ram/work/mysql-4.1
into  mysql.com:/usr/home/ram/work/mysql-5.0
2006-05-10 18:27:42 +05:00
ramil@mysql.com
2d52881789 Fix for bug #16546: DATETIME+0 not always coerced the same way 2006-05-02 18:00:44 +05:00
ramil@mysql.com
8cdd68a830 Fix for bug #18501: Server crashes with monthname(). 2006-04-25 14:34:19 +05:00
igor@rurik.mysql.com
dfd8f0211c Fixed bug #18618.
If the second or the third argument of a BETWEEN predicate was
a constant expression, like '2005.09.01' - INTERVAL 6 MONTH,
while the other two arguments were fields then the predicate 
was evaluated incorrectly and the query returned a wrong
result set.
The bug was introduced in 5.0.17 when in the fix for 12612.
2006-04-11 10:03:37 -07:00
hartmut@mysql.com
7ed2c6207a fix for wrong QUARTER calculation in EXTRACT() (Bug #18100) 2006-04-07 11:15:15 +02:00