Commit graph

92 commits

Author SHA1 Message Date
serg@serg.mylan
67ba2e367a fixes/cleanups according to Coverity report 2005-01-24 15:48:25 +01:00
dlenev@brandersnatch.localdomain
23c9e0a75a Fix for bug #7586 "TIMEDIFF for sec+microsec not working properly". 2005-01-12 12:18:36 +03:00
dlenev@brandersnatch.localdomain
cd98fcf4e9 Merged fixes for bug #7297 "Two digit year should be interpreted
correctly even with zero month and day" and bug #7515 "from_unixtime(0)
now returns NULL instead of the Epoch" into 4.1 tree.
2004-12-30 23:44:42 +03:00
dlenev@mysql.com
4ef7ac5c09 Manual merge of fix for bugs of #7297 and #7515 into 4.1 tree. 2004-12-30 21:37:32 +03:00
dlenev@mysql.com
2878395ab1 Fix for bug #7515 "from_unixtime(0) now returns NULL instead of
the Epoch". (With after review fixes).
2004-12-30 21:18:10 +03:00
dlenev@brandersnatch.localdomain
d70bd3f8fb Fix for bug #6914 "Problems using time()/date() output in expressions".
When we cast datetime value to DATE (TIME) type we should throw away its
time (date) part. This was not done properly if CAST() function was used
in datetime expressions.
2004-12-30 13:39:01 +03:00
dlenev@brandersnatch.localdomain
7b9fd879f6 Fix for bug #7458 "Microseconds are gobbled from the string result of
STR_TO_DATE() function if there is another format specifier after %f 
in format string". Also small cleanup of STR_TO_DATE() implementation.
(After review version.)
2004-12-22 18:58:25 +03:00
dlenev@mysql.com
5627dddb93 Manual merge of fix for bug #6439 "from_unixtime() function returns
wrong datetime values for too big argument" from 4.0 tree to 4.1 tree.
2004-11-19 19:19:45 +03:00
dlenev@mysql.com
5ddc564d89 Proposed fix for bug #6439 "from_unixtime() function returns wrong datetime
values for too big argument".

Added range checking for from_unixtime() argument, cleaned up code 
a bit.
2004-11-15 16:11:13 +03:00
monty@mysql.com
d45bbae2de Fix for valgrind/purify for variables that the compiler touches but that doesn't affect the outcome of the tests 2004-11-09 14:46:26 +02:00
monty@mysql.com
b903a129e2 Simpler arena swapping code
Now thd->mem_root is a pointer to thd->main_mem_root and THR_MALLOC is a pointer to thd->mem_root.
This gives us the following benefits:
- Allow us to easily detect if arena has already been swapped before (this fixes a bug in setup_conds() where arena was swaped twice in some cases)
- Faster swaps of arenas (as we don't have to copy the whole MEM_ROOT)
- We don't anymore have to call my_pthread_setspecific_ptr(THR_MALLOC,...) to change where memory is alloced. Now it's enough to set thd->mem_root
2004-11-08 01:13:54 +02:00
bar@mysql.com
7577c8bfc9 A fix according to Monty's request:
"uint *errors" is now a non-optional parameter in String:copy()
and copy_and_convert().
2004-10-29 17:00:39 +05:00
bar@mysql.com
217d83a69f Bug#6202: ENUMs are not case sensitive even if declared BINARY 2004-10-25 17:51:26 +05:00
konstantin@mysql.com
33fb5ab61b A fix and test case for Bug#6049 "Loss of sign when using prepared
statements and negative time/date values". 
The bug was in wrong sprintf format used in the client library.
The fix moves TIME -> string conversion functions to sql-common and
utilized them in the client library.
2004-10-16 00:12:59 +04:00
dlenev@brandersnatch.localdomain
2511990c97 Support for TIMESTAMP columns holding NULL values. Unlike all other
column types TIMESTAMP is NOT NULL by default, so in order to have 
TIMESTAMP column holding NULL valaues you have to specify NULL as
one of its attributes (this needed for backward compatibility).

Main changes:
Replaced TABLE::timestamp_default_now/on_update_now members with
TABLE::timestamp_auto_set_type flag which is used everywhere
for determining if we should auto-set value of TIMESTAMP field 
during this operation or not. We are also use Field_timestamp::set_time()
instead of handler::update_timestamp() in handlers.
2004-10-01 18:54:06 +04:00
bar@mysql.com
2c86049dec Bug #5228 ORDER BY CAST(enumcol) sorts incorrectly under certain conditions 2004-09-07 15:42:19 +05:00
dlenev@brandersnatch.localdomain
da36c03a51 Portablity fix.
hpux11 compiler dislikes empty array initializers.
2004-08-17 12:05:34 +04:00
dlenev@brandersnatch.localdomain
f49d4f5350 Fix for bug #4508 "CONVERT_TZ() function with new time zone as param crashes server".
Instead of trying to open time zone tables during calculation of CONVERT_TZ() function
or setting of @@time_zone variable we should open and lock them with the rest of 
statement's table (so we should add them to global table list) and after that use such 
pre-opened tables for loading info about time zones.
2004-08-10 12:42:31 +04:00
dlenev@brandersnatch.localdomain
1902790634 Fix for bug #4756 "STR_TO_DATE() returning bad results with AM/PM".
Added support of converion specifiers mentioned in manual but missing in code.
2004-08-06 10:01:29 +04:00
konstantin@mysql.com
a30fcdc690 Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
  MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
2004-06-24 19:08:36 +04:00
dlenev@brandersnatch.localdomain
09ba29e539 WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public
domain elsie-code). Now user can select current time zone
(from the list of time zones described in system tables).
All NOW-like functions honor this time zone, values of TIMESTAMP
type are interpreted as values in this time zone, so now
our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH
LOCAL TIME ZONE (or proper PostgresSQL type).
  
WL#1266 "CONVERT_TZ() - basic time with time zone conversion 
function".
  
Fixed problems described in Bug #2336 (Different number of warnings 
when inserting bad datetime as string or as number). This required
reworking of datetime realted warning hadling (they now generated 
at Field object level not in conversion functions).
  
Optimization: Now Field class descendants use table->in_use member
instead of current_thd macro.
2004-06-18 10:11:31 +04:00
konstantin@mysql.com
f207b33a7b Support for character set conversion in binary protocol: another go
after Monty's review.
- Item_param was rewritten.
- it turns out that we can't convert string data to character set of
  connection on the fly, because they first should be written to the binary
  log.
  To support efficient conversion we need to rewrite prepared statements
  binlogging code first.
2004-05-25 02:03:49 +04:00
monty@mysql.com
939ea71ecd Portability fixes
Change strtoll -> my_strtoll10()
Fixed bug in my_strntoul() and my_strntol() where we got different values on 32 and 64 bit systems (Bug #3472)
2004-05-07 01:43:17 +03:00
monty@mysql.com
a5d8b846fa after merge fixes 2004-05-05 21:24:21 +03:00
monty@mysql.com
d21d49a32a Merge with 4.0.19 2004-05-05 17:05:24 +03:00
serg@serg.mylan
8c2ce22e43 compatibility fix. warning removed 2004-05-03 18:26:50 +02:00
monty@mysql.com
f10d098f7d Fixed http address in some scripts (Bug #3460)
Output TIMESTAMP in 4.1 format for 4.1 tables (or for TIMESTAMP(19)) (portability fix)
Fixed that INTERVAL can handle big integers. (Bug #3498)
Fixed that hostname="" works identical as hostname="%" for table/column grants (Bug #3473)
2004-04-28 17:45:08 +03:00
hf@deer.(none)
386feb494b Fix for #3264 (FROM_DAYS doesn't work properly in range comparison)
Item_func_from_days::get_date didn't change 'hr', 'min' and some
other fields of incoming ltime, so they got random values.

bzeroing of the ltime added
2004-03-23 21:10:23 +04:00
bell@sanja.is.com.ua
2b45b53066 DBUG_ASSERT(fixed == 1); added to val*
small optimisation in signed_literal
2004-03-18 15:14:36 +02:00
gluh@gluh.mysql.r18.ru
df0ede69fc Task #835: additional changes fot str_to_date 2004-03-15 18:28:21 +04:00
monty@mysql.com
cc78e2d97a Ensure that result from date_format() is binary
Removed warnings from test suite
2004-02-09 13:59:41 +01:00
bar@bar.intranet.mysql.r18.ru
d13ad0822e Problem fix:
http://bugs.mysql.com/bug.php?id=2366
Wrong utf8 behaviour when data is trancated
2004-02-06 16:59:25 +04:00
bar@bar.intranet.mysql.r18.ru
6f0c8a7bf4 Bug 2202: CAST from binary to char still returns a binary string 2003-12-25 17:42:17 +04:00
monty@mysql.com
e0cc6799ec Merge with 4.0.17 2003-12-17 17:35:34 +02:00
gluh@gluh.mysql.r18.ru
4831778587 WL#1175: more default_week_formats for iso compatibility
New formats added for 'week()' function and 'default_week_format' option(4 - 7).
Next formats is supported now:
*Value* *Meaning*
  `0'     Week starts on Sunday; First Sunday of the year starts week 1.
  	  Week() returns 0-53.
  `1'     Week starts on Monday; Weeks numbered according to ISO 8601:1988.
	  Week() returns 0-53.
  `2'     Week starts on Sunday; First Sunday of the year starts week 1.
  	  Week() returns 1-53.
  `3'     Week starts on Monday; Weeks numbered according to ISO 8601:1988.
	  Week() returns 1-53.
  `4'     Week starts on Sunday; Weeks numbered according to ISO 8601:1988.
	  Week() returns 0-53.
  `5'     Week starts on Monday;  First Monday of the year starts week 1.
  	  Week() returns 0-53.
  `6'     Week starts on Sunday; Weeks numbered according to ISO 8601:1988.
	  Week() returns 1-53.
  `7'     Week starts on Monday;  First Monday of the year starts week 1.
  	  Week() returns 1-53.
2003-12-07 15:10:21 +04:00
monty@mysql.com
ede8169d24 Added missing SSL library (Should be in source distribution)
Fixed compiler warnings (a lot of hidden variables detected by the Forte compiler)
Added a lot of 'version_xxx' strings to 'show variables'
Prevent copying of TMP_TABLE_PARAM (This caused core dump bug on Solaris)
Fixed problem with printing sub selects to debug log
2003-11-28 12:18:13 +02:00
monty@mysql.com
8aeb63dd3b Update VC++ files
Portability fixes
After merge fixes
2003-11-21 01:53:01 +02:00
monty@mysql.com
7c6113a39f Merge key cache structures to one
Fixed compiler warnings (IRIX C compiler and VC++)
2003-11-20 22:06:25 +02:00
gluh@gluh.mysql.r18.ru
5ade64831e WL#1253: LAST_DAY 2003-11-17 18:02:08 +04:00
monty@narttu.mysql.fi
6b79cd5c23 Merge 2003-11-03 22:48:03 +02:00
monty@narttu.mysql.fi
a444a3449f Simplified 'wrong xxx name' error messages by introducing 'general' ER_WRONG_NAME error
Cleaned up (and disabled part of) date/time/datetime format patch. One can't anymore change default read/write date/time/formats.
This is becasue the non standard datetime formats can't be compared as strings and MySQL does still a lot of datetime comparisons as strings
Changed flag argument to str_to_TIME() and get_date() from bool to uint
Removed THD from str_to_xxxx functions and Item class.
Fixed core dump when doing --print-defaults
Move some common string functions to strfunc.cc
Dates as strings are now of type my_charset_bin instead of default_charset()
Introduce IDENT_QUOTED to not have to create an extra copy of simple identifiers (all chars < 128)
Removed xxx_FORMAT_TYPE enums and replaced them with the old TIMESTAMP_xxx enums
Renamed some TIMESTAMP_xxx enums to more appropriate names
Use defines instead of integers for date/time/datetime string lengths
Added to build system and use the new my_strtoll10() function.
2003-11-03 14:01:59 +02:00
bell@sanja.is.com.ua
c56e75e2c1 after review fix 2003-11-03 12:28:36 +02:00
bell@sanja.is.com.ua
33346e26af added code covarage for functions convert(), nullif(), crc32(), is_used_lock(), char_lengtrh(), bit_xor()
added string length for more speed
made code covarage for print() method of Item
fixed printability of some items (SCRUM) (WL#1274)
2003-10-30 12:57:26 +02:00
bell@sanja.is.com.ua
934fa2a104 Merge 2003-10-22 20:52:47 +03:00
gluh@gluh.mysql.r18.ru
62b0b8b800 Scrum task 835 - text-to-datetime conversion function 2003-10-20 13:24:18 +05:00
bell@laptop.sanja.is.com.ua
ddf4d1e529 fixed printability of Items (all items except subselects)
(SCRUM) (WL#1274)
2003-10-12 17:56:05 +03:00
bar@bar.mysql.r18.ru
8c55440ba4 CAST(expr AS CHAR(10)) is now working 2003-08-21 14:15:25 +05:00
monty@mashka.mysql.fi
10c4acfb4f merge 2003-08-19 00:10:21 +03:00
monty@mashka.mysql.fi
2263e3e51f Merge with 4.0.14 2003-08-11 22:44:43 +03:00
dlenev@dlenev.mshome
921ac8af8b Implemented UTC_TIME, UTC_DATE and UTC_TIMESTAMP functions (WL#345) 2003-08-11 23:43:01 +04:00