Commit graph

128 commits

Author SHA1 Message Date
unknown
3e42dddaa5 Merge polly.local:/tmp/maint/bug20293/my50-bug20293
into  polly.local:/home/kaa/src/maint/mysql-5.0-maint


mysql-test/r/func_time.result:
  Manual merge.
mysql-test/t/func_time.test:
  Manual merge.
2007-03-06 20:50:49 +03:00
unknown
a6c2de6067 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/ram/work/b23616/b23616.5.0


mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql-common/my_time.c:
  Auto merged
2007-03-05 12:04:37 +04:00
unknown
fed9bb9820 Bug #21103: DATE column not compared as DATE
If we compare two items A and B, with B being (a constant) of a
larger type, then A gets promoted to B's type for comparison if
it's a constant, function, or CAST() column, but B gets demoted
to A's type if A is a (not explicitly CAST()) column. This is
counter-intuitive and not mandated by the standard.
 
Disabling optimisation where it would be lossy so field value
will properly get promoted and compared as binary string (rather
than as integers).


mysql-test/include/ps_conv.inc:
  Bug #21103: DATE column not compared as DATE
  
  When comparing a DATE field with a DATETIME constant, we now compare
  as DATETIMEs, not as DATEs.  Fix certain queries to still work.
mysql-test/r/func_time.result:
  Bug #21103: DATE column not compared as DATE
  
  When comparing a DATE field with a DATETIME constant, we now compare
  as DATETIMEs, not as DATEs.  Show that everything works as expected.
mysql-test/r/ps_2myisam.result:
  Bug #21103: DATE column not compared as DATE
  
  When comparing a DATE field with a DATETIME constant, we now compare
  as DATETIMEs, not as DATEs.  Fix certain queries to still work.
mysql-test/r/ps_3innodb.result:
  Bug #21103: DATE column not compared as DATE
  
  When comparing a DATE field with a DATETIME constant, we now compare
  as DATETIMEs, not as DATEs.  Fix certain queries to still work.
mysql-test/r/ps_4heap.result:
  Bug #21103: DATE column not compared as DATE
  
  When comparing a DATE field with a DATETIME constant, we now compare
  as DATETIMEs, not as DATEs.  Fix certain queries to still work.
mysql-test/r/ps_5merge.result:
  Bug #21103: DATE column not compared as DATE
  
  When comparing a DATE field with a DATETIME constant, we now compare
  as DATETIMEs, not as DATEs.  Fix certain queries to still work.
mysql-test/r/ps_7ndb.result:
  Bug #21103: DATE column not compared as DATE
  
  When comparing a DATE field with a DATETIME constant, we now compare
  as DATETIMEs, not as DATEs.  Fix certain queries to still work.
mysql-test/t/func_time.test:
  Bug #21103: DATE column not compared as DATE
  
  When comparing a DATE field with a DATETIME constant, we now compare
  as DATETIMEs, not as DATEs.  Show that everything works as expected.
sql/field.cc:
  Bug #21103: DATE column not compared as DATE
  
  #0 stores the date only as a 3-byte integer; save_in_field() in
  #1 saves 'this' in field's format (DATE), #2 "converts a constant
  item to an int and replaces the original item" -- consequently,
  this replaces the Item_string "2006-11-06 04:08:36.0" with the
  Item_int_with_ref 20061106.
  
  #0  Field_newdate::store (this=0x8d26880, from=0x8d5e658 "2006-11-06
  04:08:36.0", len=21, cs=0x88022c0) at field.cc:5344
  #1  0x0817e3b0 in Item_string::save_in_field (this=0x8d5e670, field=0x8d26880, no_conversions=true) at item.cc:4340
  #2  0x081b22ae in convert_constant_item (thd=0x8d25240, field=0x8d26880, item=0x8d5e74c) at item_cmpfunc.cc:245
  #3  0x081b8a36 in Item_bool_func2::fix_length_and_dec (this=0x8d5e6f8) at item_cmpfunc.cc:309
  #4  0x081a3427 in Item_func::fix_fields (this=0x8d5e6f8, thd=0x8d25240, ref=0x8d5f5fc) at item_func.cc:190
  #5  0x0825bc2d in setup_conds (thd=0x8d25240, tables=0x8d5e410, leaves=0x8d5e410, conds=0x8d5f5fc) at sql_base.cc:4941
  ...
  
  Disabling optimisation where it would be lossy so field value will
  properly get promoted and compared as binary string (rather than as
  integers).
2007-03-02 15:23:13 +01:00
unknown
7fc2a2a765 Merge mysql.com:/home/ram/work/b23616/b23616.4.1
into  mysql.com:/home/ram/work/b23616/b23616.5.0


mysql-test/r/func_sapdb.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql-common/my_time.c:
  Auto merged
2007-03-02 15:09:20 +04:00
unknown
3cb3a9a149 Bug #25643: SEC_TO_TIME function problem
Checking for NULL before calling the val_xxx()
 methods only checks for such arguments that are 
 known to be NULLs at compile time. 
 The arguments that may or may not contain
 NULLs (e.g. function calls and possibly others)
 are not checked at all.
 Fixed by first calling the val_xxx() method and
 then checking for null in SEC_TO_TIME().
 In addition QUARTER() was not returning 0 (as all the 
 val_int() functions do when processing a NULL value).


mysql-test/r/func_time.result:
  Bug #25643: SEC_TO_TIME function problem
   - test case
mysql-test/t/func_time.test:
  Bug #25643: SEC_TO_TIME function problem
   - test case
sql/item_timefunc.cc:
  Bug #25643: SEC_TO_TIME function problem
   - null handling fixed for QUARTER() and SEC_TO_TIME()
2007-01-30 17:43:34 +02:00
unknown
cccad802ef Added a test case for bug #20293 "group by cuts off value from time_format" 2007-01-25 19:58:04 +03:00
unknown
33b6bab871 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).


mysql-test/r/func_sapdb.result:
  Fix for bug #23616: Week() changed behaviour between 5.0.22 and 5.0.24
    - result adjusted.
mysql-test/r/func_time.result:
  Fix for bug #23616: Week() changed behaviour between 5.0.22 and 5.0.24
    - test result.
mysql-test/t/func_time.test:
  Fix for bug #23616: Week() changed behaviour between 5.0.22 and 5.0.24
    - test case.
sql-common/my_time.c:
  Fix for bug #23616: Week() changed behaviour between 5.0.22 and 5.0.24
    - consider '.' as an acceptable separator for dates like YYYYYMMDDHHMMSS.XXXXXX
2006-12-26 15:08:41 +04:00
unknown
89d106c1a4 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/usr/home/ram/work/bug22229/my50-bug22229


mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
2006-11-29 13:41:03 +04:00
unknown
87e3047501 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into  neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint


mysql-test/Makefile.am:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
mysql-test/mysql-test-run-shell.sh:
  Auto merged
mysql-test/mysql-test-run.pl:
  Manual merge of changes for RPM
2006-11-24 12:12:25 +01:00
unknown
096631a3d3 Merge mysql.com:/usr/home/ram/work/bug23653/my41-bug23653
into  mysql.com:/usr/home/ram/work/bug23653/my50-bug23653


mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
2006-11-16 15:26:33 +04:00
unknown
cb80733a89 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  outpost.site:/home/cps/mysql/trees/4.1-runtime-bug9191


configure.in:
  Auto merged
include/my_time.h:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/rename.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/time.cc:
  Auto merged
mysql-test/t/rename.test:
  choose one of the race problem solutions. It was solved
  differently in -runtime and mainstream
2006-11-10 15:05:38 +03:00
unknown
69d8bfe231 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.


mysql-test/r/func_time.result:
  Fix for bug #23653: Crash if last_day('0000-00-00')
    - test result.
mysql-test/t/func_time.test:
  Fix for bug #23653: Crash if last_day('0000-00-00')
    - test case.
sql/item_timefunc.cc:
  Fix for bug #23653: Crash if last_day('0000-00-00')
    - return error if month is 0.
2006-11-09 16:17:50 +04:00
unknown
b4093b65be Merge alik.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  alik.:/mnt/raid/alik/MySQL/devel/5.0-merged-5.0-rt


configure.in:
  Auto merged
include/my_time.h:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/rename.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/im_daemon_life_cycle.imtest:
  Auto merged
mysql-test/t/rename.test:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/time.cc:
  Auto merged
2006-11-07 13:45:56 +03:00
unknown
6cf8ceebbf Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-4.1-runtime
into  outpost.site:/home/cps/mysql/trees/4.1-runtime-bug9191


mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
2006-11-06 00:05:02 +03:00
unknown
b2c40c1698 Merge mysql.com:/home/cps/mysql/trees/4.1-runtime-bug9191
into  mysql.com:/home/cps/mysql/trees/5.0-runtime-bug9191


configure.in:
  Auto merged
include/my_time.h:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/timezone2.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/timezone2.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/time.cc:
  Auto merged
BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003:
  Auto merged
sql-common/my_time.c:
  manual merge
sql/item_timefunc.cc:
  manual merge
sql/tztime.cc:
  manual merge
2006-11-01 17:35:35 +03:00
unknown
8a7bc05288 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).


acinclude.m4:
  Add new macro to check time_t range
configure.in:
  Call the macro to check time_t range
include/my_time.h:
  Move time-related defines to proper place.
  Add a function to perform a rough check if
  a TIMESTAMP value fits into the boundaries.
  Note: it is defined as "static inline", as
  otherwise libmysql won't compile (due to the
  way how gcc handles "inline" directive).
mysql-test/r/func_time.result:
  Update test result
mysql-test/r/timezone.result:
  Update test result
mysql-test/r/timezone2.result:
  Update test result
mysql-test/t/func_time.test:
  Add test for Bug#9191 and update test to be consistent
  with new TIMESTAMP boundaries
mysql-test/t/timezone.test:
  Update old tests to be consistent
  with new TIMESTAMP boundaries
mysql-test/t/timezone2.test:
  Update tests for convert_tz to be consistent with new
  TIMESTAMP boundaries
sql/item_timefunc.cc:
  Fix convert_tz to allow dates from the new (extended)
  TIMESTAMP range
sql/mysql_priv.h:
  Move time handling defaults to my_time.h
sql-common/my_time.c:
  Because of increased TIMESTAMP_MAX_VALUE overflows in my_system_gmt_sec()
  became possible. Here we make it safe against the overflows by stepping
  back from the boundary dates which are likely to trigger them.
sql/time.cc:
  Update TIME_to_timestamp to allow conversion of
  extended date range
sql/tztime.cc:
  Fix new (4.1) implementation of broken-down time representation
  to time_t conversion routine to avoid overflows during conversion
  of boundary dates
mysql-test/r/timezone4.result:
  New BitKeeper file ``mysql-test/r/timezone4.result''
mysql-test/t/timezone4-master.opt:
  New BitKeeper file ``mysql-test/t/timezone4-master.opt''
mysql-test/t/timezone4.test:
  New BitKeeper file ``mysql-test/t/timezone4.test''
2006-11-01 16:47:40 +03:00
unknown
4c02f402d4 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.


mysql-test/r/func_time.result:
  Fix for bug #22229: Bug in DATE_ADD()
    - test result.
mysql-test/t/func_time.test:
  Fix for bug #22229: Bug in DATE_ADD()
    - test case.
sql/item_timefunc.cc:
  Fix for bug #22229: Bug in DATE_ADD()
    - Item_func_str_to_date::get_date() should return NULL if TIME_NO_ZERO_DATE 
      flag is set and year||month||day is 0.
2006-10-17 16:30:49 +05:00
unknown
be0f6405c4 Merge polly.local:/tmp/maint/bug11655/my50-bug11655
into  polly.local:/home/kaa/src/maint/mysql-5.0-maint


sql-common/my_time.c:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/time.cc:
  Auto merged
mysql-test/r/func_time.result:
  Manually merged
mysql-test/t/func_time.test:
  Manually merged
2006-10-12 11:28:44 +04:00
unknown
62e102b42e 5.0-specific fixes when merging the fix for bug #11655 and bug #20927 from 4.1
mysql-test/r/func_time.result:
  Fixed func_time test when merging the fix for bug #11655 and bug #20927 to 5.0
sql/item_timefunc.cc:
  Fixed compilation when merging the fix for bug #11655 and bug #20927 to 5.0
2006-10-12 11:21:12 +04:00
unknown
3baf203483 Merge polly.local:/tmp/maint/bug11655/my41-bug11655
into  polly.local:/home/kaa/src/maint/m41-maint--07OGk


sql/field.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
mysql-test/r/func_time.result:
  Manually merged
mysql-test/t/func_time.test:
  Manually merged
2006-10-11 14:55:23 +04:00
unknown
78f47fbf3a Merge polly.local:/tmp/maint/bug11655/my41-bug11655
into  polly.local:/tmp/maint/bug11655/my50-bug11655


sql/time.cc:
  Auto merged
include/my_time.h:
  Manually merged
mysql-test/r/func_sapdb.result:
  Manually merged
mysql-test/r/func_time.result:
  Manually merged
mysql-test/t/func_time.test:
  Manually merged
sql-common/my_time.c:
  Manually merged
sql/field.cc:
  Manually merged
sql/item_timefunc.cc:
  Manually merged
2006-10-11 14:16:30 +04:00
unknown
1e0ebb9105 Merge naruto.:C:/cpp/bug21811/my50-bug21811
into  naruto.:C:/cpp/mysql-5.0-maint


mysql-test/r/func_time.result:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
2006-10-11 10:41:22 +02:00
unknown
634d3ff2c6 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


include/my_time.h:
  Added defines for the TIME limits
  Added defines for the warning flags set by str_to_time() and check_time_range()
  Added check_time_range() declaration
mysql-test/r/func_sapdb.result:
  Fixed testcases which relied on incorrect TIMEDIFF() behaviour
mysql-test/r/func_time.result:
  Fixed testcase which relied on incorrect behaviour
  Added testcases for out-of-range values in SEC_TO_TIME(), TIME_TO_SEC(), ADDTIME(), SUBTIME() and EXTRACT()
mysql-test/t/func_time.test:
  Added testcases for out-of-range values in SEC_TO_TIME(), TIME_TO_SEC(), ADDTIME(), SUBTIME() and EXTRACT()
sql-common/my_time.c:
  Added check_time_range() to be used from str_to_time() and item_timefunc.cc
  Added new out-of-range flag to str_to_time() warnings
  Use '%u' instead of '%d' in my_*_to_str() because the arguments are unsigned
sql/field.cc:
  Replaced out-of-range checks with checks for flags returned by str_to_time()
sql/item_timefunc.cc:
  Added wrappers over make_datetime() and make_time() which perform out-of-range checks on input values
  Moved common code in Item_func_sec_to_time::val_str() and Item_func_sec_to_time::val_int() into a separate function sec_to_time()
  Replaced calls to make_datetime() with make_datetime_with_warn() in Item_func_add_time and Item_func_timediff
  Checks for 'unsigned int' overflows in Item_func_maketime
  Use make_time_with_warn() instead of make_time() in Item_func_maketime
  Fixed incorrect sizeof() in Item_func_str_to_date::get_time()
sql/time.cc:
  Check for return value of str_to_time() along with warning flags
2006-10-04 17:13:32 +04:00
unknown
5e71afcbe7 Bug#21811 Odd casting with date + INTERVAL arithmetic
- Type casting was not consequent, thus when adding a DATE type with
  a WEEK interval the result type was DATETIME and not DATE as is the
  norm.
- By changing the order of the date internal enumerations the deviant
  type casting is resolved (Item_date_add_interval::fix_length_and_dec()
  which determines result type for this operation assumes that addition
  of any interval with value <= INTERVAL_DAY to date value will result
  in date). There are two independant places to change:
  interval_names[] and interval_type.


mysql-test/r/func_date_add.result:
  Updated result file for type casting test
mysql-test/r/func_time.result:
  Updated result file for type casting test
mysql-test/t/func_date_add.test:
  Added test for type casting when adding intervals to date.
sql/item_timefunc.cc:
  Changed order of "week" key word to match the date interval enumeration.
sql/item_timefunc.h:
  Changed the order of the enumeration to better follow interval sizes.
2006-10-02 12:37:01 +02:00
unknown
d165736b8d Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint


mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_string.cc:
  Auto merged
strings/strtod.c:
  Auto merged
client/mysql.cc:
  Manual merge.
mysql-test/r/ctype_utf8.result:
  Manual merge.
2006-09-28 07:30:24 -04:00
unknown
c19ac9ec91 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/mysql-4.1-maint


mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
2006-09-21 09:35:17 +05:00
unknown
4c8e0e192b merge fixes 2006-09-18 12:14:27 +02:00
unknown
c97cc11392 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


mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/type_date.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/insert_update.test:
  Auto merged
sql/item.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2006-09-15 14:14:38 +02:00
unknown
aa840645e6 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


mysql-test/t/type_date.test:
  Corrected test case after removal of fix for bug#16377
mysql-test/t/func_time.test:
  Corrected test case after removal of fix for bug#16377
mysql-test/r/type_date.result:
  Corrected test case after removal of fix for bug#16377
mysql-test/r/query_cache.result:
  Corrected test case after removal of fix for bug#16377
mysql-test/r/func_time.result:
  Corrected test case after removal of fix for bug#16377
sql/item_cmpfunc.cc:
  Removed changes to the agg_cmp_type() made in the for bug#16377
2006-09-08 00:59:34 +04:00
unknown
43eeeac033 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-4.1-maint
into  salvation.intern.azundris.com:/home/tnurnberg/21913/my41-21913


mysql-test/r/func_time.result:
  manual merge
mysql-test/t/func_time.test:
  manual merge
2006-09-04 09:28:39 +02:00
unknown
52f3977eef 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.)


mysql-test/r/func_time.result:
  Bug#21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.
  
  Prove DATE_FORMAT() no longer crashes the server when character_set_results is
  NULL (which is a legal value and means, "no conversion").
mysql-test/t/func_time.test:
  Bug#21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.
  
  Prove DATE_FORMAT() no longer crashes the server when character_set_results is
  NULL (which is a legal value and means, "no conversion").
sql/sql_string.cc:
  Bug#21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.
  
  Avoid NULL deref in my_charset_same() -- if !to_cs, we won't need to compare
  because it is magic for, "no conversion."
2006-09-04 09:13:40 +02:00
unknown
2ed26cd7a8 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  maint1.mysql.com:/data/localhome/tnurnberg/my50-21913


mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
2006-09-04 07:45:49 +02:00
unknown
8ce43f8d23 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.)


mysql-test/r/func_time.result:
  Bug#21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.
  
  Prove DATE_FORMAT() no longer crashes the server when character_set_results is
  NULL (which is a legal value and means, "no conversion").
mysql-test/t/func_time.test:
  Bug#21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.
  
  Prove DATE_FORMAT() no longer crashes the server when character_set_results is
  NULL (which is a legal value and means, "no conversion").
sql/sql_string.cc:
  Bug#21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.
  
  Avoid NULL deref in my_charset_same() -- if !to_cs, we won't need to compare
  because it is magic for, "no conversion."
2006-09-04 07:01:15 +02:00
unknown
617189958b 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.)


mysql-test/r/func_time.result:
  Bug#21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.
  
  Prove DATE_FORMAT() no longer crashes the server when character_set_results is
  NULL (which is a legal value and means, "no conversion").
mysql-test/t/func_time.test:
  Bug#21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.
  
  Prove DATE_FORMAT() no longer crashes the server when character_set_results is
  NULL (which is a legal value and means, "no conversion").
sql/sql_string.cc:
  Bug#21913: DATE_FORMAT() Crashes mysql server if I use it through mysql-connector-j driver.
  
  Avoid NULL deref in my_charset_same() -- if !to_cs, we won't need to compare
  because it is magic for, "no conversion."
2006-09-04 06:16:34 +02:00
unknown
b2cfa703f4 Merge rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-4.1-maint_20328
into  rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-5.0-merge


sql/item_timefunc.cc:
  Auto merged
sql/slave.cc:
  Auto merged
mysql-test/r/func_time.result:
  manual merge
mysql-test/r/mysql_client.result:
  manual merge
mysql-test/t/func_time.test:
  manual merge
mysql-test/t/mysql_client.test:
  manual merge
sql/sql_acl.cc:
  manual merge
2006-08-16 19:31:33 -04:00
unknown
fa1641e1f3 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.


mysql-test/r/func_time.result:
  Bug#19844: time_format in Union truncates values
  
  show time_format() handles %H and %k correctly four > 99 hours
mysql-test/t/func_time.test:
  Bug#19844: time_format in Union truncates values
  
  show time_format() handles %H and %k correctly four > 99 hours
sql/item_timefunc.cc:
  Bug#19844: time_format in Union truncates values
  
  unbreak promises we make about field-length of %H and %k in
  time_format() so they coincide with the actual range rather
  than just 0..23. the docs say we must operate outside that
  range, so we'd better do it right.
  ---
  Bug#19844: time_format in Union truncates values
  
  unbreak promises we make about field-length of %H and %k in
  time_format() so they coincide with the actual range rather
  than just 0..23. the docs say we must operate outside that
  range, so we'd better do it right.
  One digit values are padded to two digits with %H, "longer"
  values are handled correctly up to seven digits including
  any sign.
  (clarified comments as per jimw's suggestion.)
2006-08-10 15:37:24 +02:00
unknown
1081dd6f0d Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint


configure.in:
  Auto merged
client/mysql.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/r/federated.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/mysql.result:
  Auto merged
mysql-test/r/type_ranges.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2006-08-01 20:24:30 +02:00
unknown
32fbc6da63 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.


mysql-test/r/func_time.result:
  Additional test results
mysql-test/t/func_time.test:
  Additional tests
sql/item_timefunc.cc:
  Fix for timestamp diff issue.  Added microsecond precision when
  comparing months or quarters; previously only examined date for
  these comparisons.
2006-07-28 20:51:17 -07:00
unknown
b60272915f Merge siva.hindu.god:/usr/home/tim/m/bk/global-41
into  siva.hindu.god:/usr/home/tim/m/bk/global-50


mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql/field.cc:
  Auto merged
2006-07-26 13:30:03 -06:00
unknown
9d5b76eba9 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b16327


sql/field.cc:
  Auto merged
mysql-test/r/func_time.result:
  merging
mysql-test/t/func_time.test:
  merging
2006-07-23 14:17:01 +05:00
unknown
c4cffdbfe9 Merge mysql.com:/opt/local/work/tmp_merge
into  mysql.com:/opt/local/work/mysql-5.0-merge


mysql-test/r/func_sapdb.result:
  Auto merged
mysql-test/t/func_sapdb.test:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
mysql-test/r/func_time.result:
  Manual merge.
mysql-test/t/func_time.test:
  Manual merge.
2006-06-29 18:34:49 +04:00
unknown
90cb4c03fd Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement
The problem was that we restored SQL_CACHE, SQL_NO_CACHE flags in SELECT
statement from internal structures based on value set later at runtime, not
the original value set by the user.

The solution is to remember that original value.


mysql-test/r/auto_increment.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/func_compress.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/func_math.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/func_system.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/func_time.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/information_schema.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/query_cache.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/rpl_get_lock.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/rpl_master_pos_wait.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/show_check.result:
  Add result for bug#17203.
mysql-test/r/subselect.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/type_blob.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/variables.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/view.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/t/show_check.test:
  Add test case for bug#17203.
sql/sql_lex.cc:
  Reset SELECT_LEX::sql_cache together with SELECT_LEX::options.
sql/sql_lex.h:
  Add SELECT_LEX::sql_cache field to store original user setting.
sql/sql_select.cc:
  Output SQL_CACHE and SQL_NO_CACHE depending on stored original user setting.
sql/sql_yacc.yy:
  Make effect of SQL_CACHE and SQL_NO_CACHE mutually exclusive.  Ignore
  SQL_CACHE if SQL_NO_CACHE was used.  Remember what was set by the user.
  Reset SELECT_LEX::sql_cache together with SELECT_LEX::options.
2006-06-27 21:28:32 +04:00
unknown
82d127b55b Dec. 31st, 9999 is still a valid date, only starting with Jan 1st 10000 things become invalid (Bug #12356)
mysql-test/r/func_sapdb.result:
  test cases for date range edge cases added
mysql-test/r/func_time.result:
  test cases for date range edge cases added
mysql-test/t/func_sapdb.test:
  test cases for date range edge cases added
mysql-test/t/func_time.test:
  test cases for date range edge cases added
2006-06-27 19:33:59 +04:00
unknown
e8beb72cc6 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)


mysql-test/r/func_time.result:
  Update test results
mysql-test/t/func_time.test:
  Set timezone to GMT-3, to make it possible to use "interval 3 hour"
2006-06-22 20:23:22 +02:00
unknown
c6b67f0d15 Merge mysql.com:/usr/home/ram/work/mysql-4.1
into  mysql.com:/usr/home/ram/work/mysql-5.0


mysql-test/r/func_str.result:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
mysql-test/r/func_time.result:
  SCCS merged
2006-06-21 09:16:22 +05:00
unknown
ac2c480f26 func_time.result:
After merge fix


mysql-test/r/func_time.result:
  After merge fix
2006-06-20 15:35:54 +04:00
unknown
95939476ab Fix for bug #20496: func_time.test failure
mysql-test/r/func_time.result:
  Fix for bug #20496: func_time.test failure                                      
    - floating point calculations removed.
mysql-test/t/func_time.test:
  Fix for bug #20496: func_time.test failure                                      
    - floating point calculations removed.
2006-06-19 13:03:29 +05:00
unknown
d0f39b6aeb Manually merged
sql/item_timefunc.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
2006-06-17 02:11:12 +04:00
unknown
de292d6799 Manually merged
configure.in:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2006-06-17 00:58:36 +04:00
unknown
b2f308160b Many files:
After merge fix


mysql-test/r/func_time.result:
  After merge fix
mysql-test/r/func_concat.result:
  After merge fix
mysql-test/r/cast.result:
  After merge fix
sql/item_cmpfunc.h:
  After merge fix
sql/item_cmpfunc.cc:
  After merge fix
sql/field.cc:
  After merge fix
2006-06-15 01:48:41 +04:00