Commit graph

84 commits

Author SHA1 Message Date
tsmith@quadxeon.mysql.com
e9fd9a18e0 Bug #27638: slow logging to CSV table inserts bad query_time and lock_time values
When MySQL logged slow query information to a CSV table, it stored the
query_time and lock_time values with an incorrect formula.

If the time was over 59 seconds, this caused incorrect statistics (either the
slow query was not logged, or the time was far from correct).  This change
fixes the method used to store those TIME values in the slow_log table.
2007-04-04 21:40:47 +02:00
kent@kent-amd64.(none)
58763e383e Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-31 01:32:21 +01:00
kent@mysql.com/kent-amd64.(none)
6523aca729 my_strtoll10-x86.s:
Corrected spelling in copyright text
Makefile.am:
  Don't update the files from BitKeeper
Many files:
  Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
  Adjusted year(s) in copyright header 
Many files:
  Added GPL copyright text
Removed files:
  Docs/Support/colspec-fix.pl
  Docs/Support/docbook-fixup.pl
  Docs/Support/docbook-prefix.pl
  Docs/Support/docbook-split
  Docs/Support/make-docbook
  Docs/Support/make-makefile
  Docs/Support/test-make-manual
  Docs/Support/test-make-manual-de
  Docs/Support/xwf
2006-12-31 01:02:27 +01:00
kent@kent-amd64.(none)
be15e3bc15 Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-23 20:20:40 +01:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
anozdrin/alik@alik.
ee15c11b7c Merge alik.:/mnt/raid/alik/MySQL/devel/5.1
into  alik.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged-2
2006-11-07 16:24:35 +03: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@owlet.local
3df8165cf9 Merge mysql.com:/home/cps/mysql/trees/5.0-runtime-bug9191
into  mysql.com:/home/cps/mysql/trees/5.1-runtime-bug9191
2006-11-01 18:18:01 +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
kaa@polly.local
a82e5d4a55 Merge polly.local:/tmp/maint/bug11655/my51-bug11655
into  polly.local:/home/kaa/src/maint/m51-new-maint--07OGx
2006-10-12 12:36:13 +04:00
kaa@polly.local
29b5e2955e Merge polly.local:/tmp/maint/bug11655/my50-bug11655
into  polly.local:/tmp/maint/bug11655/my51-bug11655
2006-10-11 14:22:17 +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
Kristofer.Pettersson@naruto.
3ef964bbfe 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 tpe was DATETIME and not DATE as is the
  norm.
- By changing the order of the date type enumerations the type casting
  bug is resolved. To comply with the new order the array 
  interval_type_to_name needed to change accordingly.
2006-10-11 10:17:39 +02: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.(none)
22485908ce Bug#20729: Bad date_format() call makes mysql server crash
The problem is that the author used the wrong function to send a warning to the 
user about truncation of data.  push_warning() takes a constant string and 
push_warning_printf() takes a format and variable arguments to fill it.

Since the string we were complaining about contains percent characters, the 
printf() code interprets the "%Y" et c. that the user sends.  That's wrong, and
often causes a crash, especially if the date mentions seconds, "%s".

A alternate fix would be to use  push_warning_printf(..., "%s", warn_buff) .
2006-07-11 13:06:29 -04:00
ingo@chilla.local
44ed4b8ecb After merge fixes. 2006-07-06 15:38:47 +02:00
andrey@lmy004.
45598df7d4 manual merge 2006-06-20 17:14:36 +02:00
andrey@lmy004.
40fe2b9a45 forgot to event_timed.h
STRING_WITH_LEN -> C_STRING_WITH_LEN
2006-06-20 17:05:41 +02:00
andrey@lmy004.
1d1e9d10b6 Reorganize, physically the events code
Unify method naming -> create/update/drop_event
Move class Event_timed to event_timed.h
class Events is in events.h (renamed from event.h)
The implementation is in events.cc (renamed from event.h)
2006-06-08 23:07:11 +02:00
monty@mysql.com
a703ff60c7 Fixed some issues found by valgrind
(one testcase, one memory leak and some accesses to not initialized memory)
2006-06-06 02:47:30 +03:00
andrey@lmy004.
36cfa4dfa1 fix for bug #17494 (The algorithm for calculating execution times is not fully correct)
This also should fix 17493 and 17346, and probably 16397 (not tested).
WL#1034 (Internal CRON)
(post-review commit)
2006-04-07 09:08:58 +02:00
andrey@lmy004.
0322cb1df8 - fix bug #16435 (Weekly events execute every second) (WL#1034 Internal CRON)
Before the interval expression was considered to be in seconds, now it is
just a number and the type of interval is considered.

- this changeset introduces also fix for bug#16432 (Events: error re interval
  misrepresents the facts)
  the code of event_timed::set_interval() was refactored anyway so it is meaningful to
  fix the bug in the same changeset.
2006-01-18 20:41:22 +01:00
gluh@eagle.intranet.mysql.r18.ru
e9d70e4b97 Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
-issue more correct message for incorrect date|datetime|time values
  -ER_WARN_DATA_OUT_OF_RANGE message is changed
  -added new error message
2005-12-02 15:01:44 +04:00
monty@mishka.local
8437e9c1be Fixes during review of new pushed code
Change bool in C code to my_bool
Added to mysqltest --enable_parsning and --disable_parsing to avoid to have to comment parts of tests
Added comparison of LEX_STRING's and use this to compare file types for view and trigger files.
2005-07-31 12:49:55 +03:00
monty@mysql.com
5ba3f707f7 Don't use -lsupc++ with gcc 3.3 and below as this gives linking problems when linking staticly
Fix that mysql.proc works with new VARCHAR fields
Give warnings for wrong zero dates
2005-04-04 16:43:25 +03:00
monty@mysql.com
201ee3eb78 Invalid DEFAULT values for CREATE TABLE now generates errors. (Bug #5902)
CAST() now produces warnings when casting a wrong INTEGER or CHAR values. This also applies to implicite string to number casts. (Bug #5912)
ALTER TABLE now fails in STRICT mode if it generates warnings.
Inserting a zero date in a DATE, DATETIME or TIMESTAMP column during TRADITIONAL mode now produces an error. (Bug #5933)
2005-04-01 15:04:50 +03:00
konstantin@mysql.com
7216594f4f Data truncation reporting implementation (libmysql) + post review
fixes. Still to do: 
-  deploy my_strtoll10 in limbysql.c
- add mysql_options option to switch MYSQL_DATA_TRUNCATED on and off.
2004-12-16 03:15:06 +03:00
monty@mysql.com
afbe601302 merge with 4.1 2004-10-29 19:26:52 +03: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
monty@mishka.local
f2941380c4 Strict mode & better warnings
Under strict mode MySQL will generate an error message if there was any conversion when assigning data to a field.
Added checking of date/datetime fields.
If strict mode, give error if we have not given value to field without a default value (for INSERT)
2004-09-28 20:08:00 +03:00
guilhem@mysql.com
0f3e279a05 WL#1580: --start-datetime, --stop-datetime, --start-position (alias for --position) and --stop-position
options for mysqlbinlog, with a test file.
This enables user to say "recover my database to how it was this morning at 10:30"
(mysqlbinlog "--stop-datetime=2003-07-29 10:30:00").
Using time functions into client/ made me move them out of sql/ into sql-common/.
+ (small) fix for BUG#4507 "mysqlbinlog --read-from-remote-server sometimes
cannot accept 2 binlogs" (that is, on command line).
2004-07-29 23:25:58 +02: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
konstantin@mysql.com
b793142c8f Unused variables removed (many files). 2004-06-21 20:39:19 +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
paul@kite-hub.kitebird.com
2f0ca1ce42 Fix skipp -> skip once and for all.
(Note: This affects only comments, not variable names.)
2004-06-03 11:52:54 -05: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
ram@gw.mysql.r18.ru
f8718e005b A comment for str_to_datetime(). 2004-05-20 14:21:30 +05:00
ram@gw.mysql.r18.ru
0f3ab4174e A fix (Bug #3728: Missing warning in 4.1). 2004-05-18 12:16:00 +05:00
gluh@gluh.mysql.r18.ru
1dfe9a0330 Fix for valgrind errors in str_to_TIME(using of uninitialize variable). 2004-03-18 15:51:08 +04: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
ce14578909 Merge with 4.0.18 2004-02-11 00:06:46 +01:00
dlenev@mysql.com
4578f22271 Fix for bug #2523 '"func_time" test fails on QNX'.
Moved all range checks for TIMESTAMP value to my_gmt_sec().
Also fixed check of upper boundary of TIMESTAMP range (which 
also now will catch datetime values which are too small for
TIMESTAMP in case if time_t is unsigned).
2004-01-30 19:15:11 +03:00
monty@mysql.com
e0cc6799ec Merge with 4.0.17 2003-12-17 17:35:34 +02:00
monty@mysql.com
f995a5f4aa Fix autoincrement for signed columns (Bug #1366)
Fixed problem with char > 128 in QUOTE() function. (Bug #1868)
Disable creation of symlinks if my_disable_symlink is set
Fixed searching of TEXT with end space. (Bug #1651)
Fixed caching bug in multi-table-update where same table was used twice. (Bug #1711)
Fixed problem with UNIX_TIMESTAMP() for timestamps close to 0. (Bug #1998)
Fixed timestamp.test
2003-12-12 22:26:58 +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
7c6113a39f Merge key cache structures to one
Fixed compiler warnings (IRIX C compiler and VC++)
2003-11-20 22:06:25 +02:00
monty@mysql.com
6622d6f8cd Fixed access to uninitialized memory in protocol::store_time 2003-11-04 14:59:38 +02:00
monty@narttu.mysql.fi
f763d4c31d Removed some warnings reported by valgrind
After merge fixes.
Now code compiles, but there is still some valgrind warnings that needs to be fixed
2003-11-04 14:09: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