summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.h
Commit message (Collapse)AuthorAgeFilesLines
* manual mergemikael@dator6.(none)2007-06-131-2/+2
|
* Merge dator6.(none):/home/mikael/mysql_clones/clean-mysql-5.1mikael@dator6.(none)2007-06-131-15/+2
|\ | | | | | | into dator6.(none):/home/mikael/mysql_clones/bug18198
| * Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1mikron@mikael-ronstr-ms-dator.local2007-04-041-15/+2
| |\ | | | | | | | | | into mikael-ronstr-ms-dator.local:/Users/mikron/mysql_clones/bug18198
| | * Reapplied patch for bug18198mikron@mikael-ronstr-ms-dator.local2007-04-041-15/+2
| | |
* | | WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (first part) The following type conversions was done: - Changed byte to uchar - Changed gptr to uchar* - Change my_string to char * - Change my_size_t to size_t - Change size_s to size_t Removed declaration of byte, gptr, my_string, my_size_t and size_s. Following function parameter changes was done: - All string functions in mysys/strings was changed to use size_t instead of uint for string lengths. - All read()/write() functions changed to use size_t (including vio). - All protocoll functions changed to use size_t instead of uint - Functions that used a pointer to a string length was changed to use size_t* - Changed malloc(), free() and related functions from using gptr to use void * as this requires fewer casts in the code and is more in line with how the standard functions work. - Added extra length argument to dirname_part() to return the length of the created string. - Changed (at least) following functions to take uchar* as argument: - db_dump() - my_net_write() - net_write_command() - net_store_data() - DBUG_DUMP() - decimal2bin() & bin2decimal() - Changed my_compress() and my_uncompress() to use size_t. Changed one argument to my_uncompress() from a pointer to a value as we only return one value (makes function easier to use). - Changed type of 'pack_data' argument to packfrm() to avoid casts. - Changed in readfrm() and writefrom(), ha_discover and handler::discover() the type for argument 'frmdata' to uchar** to avoid casts. - Changed most Field functions to use uchar* instead of char* (reduced a lot of casts). - Changed field->val_xxx(xxx, new_ptr) to take const pointers. Other changes: - Removed a lot of not needed casts - Added a few new cast required by other changes - Added some cast to my_multi_malloc() arguments for safety (as string lengths needs to be uint, not size_t). - Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done explicitely as this conflict was often hided by casting the function to hash_get_key). - Changed some buffers to memory regions to uchar* to avoid casts. - Changed some string lengths from uint to size_t. - Changed field->ptr to be uchar* instead of char*. This allowed us to get rid of a lot of casts. - Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar - Include zlib.h in some files as we needed declaration of crc32() - Changed MY_FILE_ERROR to be (size_t) -1. - Changed many variables to hold the result of my_read() / my_write() to be size_t. This was needed to properly detect errors (which are returned as (size_t) -1). - Removed some very old VMS code - Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix) - Removed windows specific code to restore cursor position as this causes slowdown on windows and we should not mix read() and pread() calls anyway as this is not thread safe. Updated function comment to reflect this. Changed function that depended on original behavior of my_pwrite() to itself restore the cursor position (one such case). - Added some missing checking of return value of malloc(). - Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow. - Changed type of table_def::m_size from my_size_t to ulong to reflect that m_size is the number of elements in the array, not a string/memory length. - Moved THD::max_row_length() to table.cc (as it's not depending on THD). Inlined max_row_length_blob() into this function. - More function comments - Fixed some compiler warnings when compiled without partitions. - Removed setting of LEX_STRING() arguments in declaration (portability fix). - Some trivial indentation/variable name changes. - Some trivial code simplifications: - Replaced some calls to alloc_root + memcpy to use strmake_root()/strdup_root(). - Changed some calls from memdup() to strmake() (Safety fix) - Simpler loops in client-simple.c
* | | Removed not used define YY_MAGIC_BELOWmonty@mysql.com/narttu.mysql.fi2007-03-231-24/+24
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made year 2000 handling more uniform Removed year 2000 handling out from calc_days() The above removes some bugs in date/datetimes with year between 0 and 200 Now we get a note when we insert a datetime value into a date column For default values to CREATE, don't give errors for warning level NOTE Fixed some compiler failures Added library ws2_32 for windows compilation (needed if we want to compile with IOCP support) Removed duplicate typedef TIME and replaced it with MYSQL_TIME Better (more complete) fix for: Bug#21103 "DATE column not compared as DATE" Fixed properly Bug#18997 "DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value" Fixed Bug#23093 "Implicit conversion of 9912101 to date does not match cast(9912101 as date)"
* | Merge mysql.com:/home/hf/work/mrg/mysql-5.0-optholyfoot/hf@hfmain.(none)2007-03-221-11/+8
|\ \ | | | | | | | | | into mysql.com:/home/hf/work/mrg/mysql-5.1-opt
| * | bug #16546 (DATETIME+0 not always coerced the same way)holyfoot/hf@mysql.com/hfmain.(none)2007-03-221-11/+8
| | | | | | | | | | | | | | | | | | fix for cast( AS DATETIME)+0 in 5.0 and above versions. val_real now works using val_decimal for DATETIME Items Superfluous val_real() methods deleted
* | | Merge mysql.com:/home/hf/work/mrg/mysql-5.0-optholyfoot/hf@hfmain.(none)2007-03-221-0/+6
|\ \ \ | |/ / | | | | | | into mysql.com:/home/hf/work/mrg/mysql-5.1-opt
| * | Merge mysql.com:/home/hf/work/mrg/mysql-4.1-optholyfoot/hf@mysql.com/hfmain.(none)2007-03-221-0/+7
| |\ \ | | | | | | | | | | | | into mysql.com:/home/hf/work/mrg/mysql-5.0-opt
| | * | bug #16546 (DATETIME + 0 not always coerced in the same way)holyfoot/hf@mysql.com/hfmain.(none)2007-03-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fix for cast( AS DATETIME) + 0 operation. I just implemented Item_datetime_typecast::val() method as it is usually done in other classes. Should be fixed more radically in 5.0
| | * | Manually mergedevgen@moonbone.local2006-06-171-0/+12
| | |\ \
* | | | | BUG#9953: CONVERT_TZ requires mysql.time_zone_name to be lockedkroki/tomash@moonlight.home2007-03-091-3/+0
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that some facilities (like CONVERT_TZ() function or server HELP statement) may require implicit access to some tables in 'mysql' database. This access was done by ordinary means of adding such tables to the list of tables the query is going to open. However, if we issued LOCK TABLES before that, we would get "table was not locked" error trying to open such implicit tables. The solution is to treat certain tables as MySQL system tables, like we already do for mysql.proc. Such tables may be opened for reading at any moment regardless of any locks in effect. The cost of this is that system table may be locked for writing only together with other system tables, it is disallowed to lock system tables for writing and have any other lock on any other table. After this patch the following tables are treated as MySQL system tables: mysql.help_category mysql.help_keyword mysql.help_relation mysql.help_topic mysql.proc (it already was) mysql.time_zone mysql.time_zone_leap_second mysql.time_zone_name mysql.time_zone_transition mysql.time_zone_transition_type These tables are now opened with open_system_tables_for_read() and closed with close_system_tables(), or one table may be opened with open_system_table_for_update() and closed with close_thread_tables() (the latter is used for mysql.proc table, which is updated as part of normal MySQL server operation). These functions may be used when some tables were opened and locked already. NOTE: online update of time zone tables is not possible during replication, because there's no time zone cache flush neither on LOCK TABLES, nor on FLUSH TABLES, so the master may serve stale time zone data from cache, while on slave updated data will be loaded from the time zone tables.
* | | | Merge mysql.com:/home/kent/bk/main/mysql-5.0kent@kent-amd64.(none)2006-12-311-1/+1
|\ \ \ \ | |/ / / | | | | | | | | into mysql.com:/home/kent/bk/main/mysql-5.1
| * | | my_strtoll10-x86.s:kent@mysql.com/kent-amd64.(none)2006-12-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge mysql.com:/home/kent/bk/main/mysql-5.0kent@kent-amd64.(none)2006-12-231-2/+1
|\ \ \ \ | |/ / / | | | | | | | | into mysql.com:/home/kent/bk/main/mysql-5.1
| * | | Many files:kent@mysql.com/kent-amd64.(none)2006-12-231-2/+1
| | | | | | | | | | | | | | | | Changed header to GPL version 2 only
| * | | Merge bk@192.168.21.1:mysql-5.0-optholyfoot/hf@mysql.com/deer.(none)2006-11-171-38/+113
| |\ \ \ | | | | | | | | | | | | | | | into mysql.com:/home/hf/work/mysql-5.0-0mrg
| * | | | Bug#21811 Odd casting with date + INTERVAL arithmeticKristofer.Pettersson@naruto.2006-10-021-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* | | | | Merge mysql.com:/home/hf/work/mysql-5.0.cleanholyfoot/hf@deer.(none)2006-11-081-46/+104
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | into mysql.com:/home/hf/work/mysql-5.1.clean
| * | | | bug #19491 (CAST do DATETIME wrong result)holyfoot/hf@mysql.com/deer.(none)2006-10-251-38/+113
| |/ / /
* | | | BUG#18198mikael/pappa@dator5.(none)2006-09-261-30/+30
| | | | | | | | | | | | | | | | Review comments
* | | | BUG#18198: Partition function handlingmikael/pappa@dator5.(none)2006-07-211-32/+30
| | | | | | | | | | | | | | | | Review fixes
* | | | BUG#18198: Less flexibility in defining partition functionsmikael@dator5.(none)2006-06-231-30/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed test for functions if they are supported. 3 categories: 1) Fully supported 2) Supported for single character collations 3) Supported for binary collations
* | | | Manually mergedevgen@moonbone.local2006-06-181-0/+12
|\ \ \ \ | |/ / /
| * | | Manually mergedevgen@moonbone.local2006-06-171-0/+12
| |\ \ \
| | * \ \ Manually mergedevgen@moonbone.local2006-06-141-0/+12
| | |\ \ \ | | | | |/ | | | |/|
| | | * | Fixed bug#16377: result of DATE/TIME functions were compared as strings whichevgen@moonbone.local2006-06-131-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge rurik.mysql.com:/home/igor/tmp_mergeigor@rurik.mysql.com2006-06-141-0/+1
|\ \ \ \ \ | |/ / / / | | | | | | | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.1-0
| * | | | Merge rurik.mysql.com:/home/igor/tmp_mergeigor@rurik.mysql.com2006-06-091-0/+1
| |\ \ \ \ | | |/ / / | |/| | / | | | |/ | | |/| into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
| | * | Fix for bug #16546: DATETIME+0 not always coerced the same wayramil@mysql.com2006-05-021-0/+1
| | |/
* | | Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1-newmikael@c-3d08e253.1238-1-64736c10.cust.bredbandsbolaget.se2006-05-311-0/+30
|\ \ \ | | | | | | | | | | | | into c-3d08e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug18198
| * | | BUG#18198: Many strange partition functions were allowed, now only strictly ↵mikael@c-3d08e253.1238-1-64736c10.cust.bredbandsbolaget.se2006-05-311-30/+30
| | | | | | | | | | | | | | | | allowed functions are ok
| * | | Merge mronstrom@bk-internal.mysql.com:/home/bk/bugs/bug18198mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se2006-04-211-0/+1
| |\ \ \ | | | | | | | | | | | | | | | into c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug18198
| * | | | BUG#18198: Errors due to too much allowed in partition functionsmikael@c-4908e253.1238-1-64736c10.cust.bredbandsbolaget.se2006-04-081-0/+30
| | | | | | | | | | | | | | | | | | | | Added functions to enable/disable allowed/disallowed partition functions
* | | | | Merge april.(none):/home/svoj/devel/mysql/merge/mysql-5.0svoj@april.(none)2006-04-241-1/+1
|\ \ \ \ \ | |_|/ / / |/| | / / | | |/ / | |/| | into april.(none):/home/svoj/devel/mysql/merge/mysql-5.1-new
| * | | Merge mysql.com:/usr/home/bar/mysql-4.1.b18691bar@mysql.com2006-04-171-1/+1
| |\ \ \ | | | |/ | | |/| | | | | into mysql.com:/usr/home/bar/mysql-5.0
| | * | Bug#18691: Converting number to UNICODE string returns invalid result.bar@mysql.com2006-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conversion from int and real numbers to UCS2 didn't work fine: CONVERT(100, CHAR(50) UNICODE) CONVERT(103.9, CHAR(50) UNICODE) The problem appeared because numbers have binary charset, so, simple charset recast binary->ucs2 was performed instead of real conversion. Fixed to make numbers pretend to be non-binary.
* | | | Merge rurik.mysql.com:/home/igor/dev/mysql-5.0-0igor@rurik.mysql.com2006-04-121-0/+1
|\ \ \ \ | |/ / / | | | / | |_|/ |/| | into rurik.mysql.com:/home/igor/dev/mysql-5.1-0
| * | Fix for bug #14360: Date Between Interval Broken. ramil@mysql.com2006-04-111-0/+1
| | |
* | | - fix bug #16435 (Weekly events execute every second) (WL#1034 Internal CRON)andrey@lmy004.2006-01-181-14/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | WL#2985 "Partition Pruning"sergefp@mysql.com2005-12-221-0/+2
| | |
* | | Table definition cache, part 2monty@mysql.com2005-11-231-33/+27
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The table opening process now works the following way: - Create common TABLE_SHARE object - Read the .frm file and unpack it into the TABLE_SHARE object - Create a TABLE object based on the information in the TABLE_SHARE object and open a handler to the table object Other noteworthy changes: - In TABLE_SHARE the most common strings are now LEX_STRING's - Better error message when table is not found - Variable table_cache is now renamed 'table_open_cache' - New variable 'table_definition_cache' that is the number of table defintions that will be cached - strxnmov() calls are now fixed to avoid overflows - strxnmov() will now always add one end \0 to result - engine objects are now created with a TABLE_SHARE object instead of a TABLE object. - After creating a field object one must call field->init(table) before using it - For a busy system this change will give you: - Less memory usage for table object - Faster opening of tables (if it's has been in use or is in table definition cache) - Allow you to cache many table definitions objects - Faster drop of table
* | Merge mysql.com:/home/mysql_src/mysql-4.1-gcaguilhem@mysql.com2005-11-101-4/+4
|\ \ | |/ | | | | into mysql.com:/home/mysql_src/mysql-5.0-release
| * Declaring some class members public for BUG#12377:guilhem@mysql.com2005-11-101-4/+4
| | | | | | | | | | | | "Item_date_add_interval needs to have the int_type member as Public". As explained in the bug report, this change is is to help http://search.cpan.org/~philips/DBIx-MyParse-0.20/ So please keep those members public.
| * Review of new pushed codemonty@mysql.com2005-11-011-0/+1
| | | | | | | | | | Removed wrong fix for bug #14009 (use of abs() on null value causes problems with filesort) Mark that add_time(), time_diff() and str_to_date() can return null values
* | Reverting patch for BUG #14009 (use of abs() on null value causes problems ↵monty@mysql.com2005-11-011-0/+1
| | | | | | | | | | | | with filesort Fix for bug #14536: SELECT @a,@a:=... fails with prepared statements
* | Merge 4.1 - 5.0jani@ua141d10.elisa.omakaista.fi2005-10-281-0/+1
| |
* | Fixed BUG#12963, BUG#13000: wrong VIEW creation with DAYNAME(),aivanov@mysql.com2005-09-141-1/+4
| | | | | | | | DAYOFWEEK(), and WEEKDAY().
* | Make SYSDATE() behave as in Oracle: always the current datetime, not thejimw@mysql.com2005-08-241-0/+27
| | | | | | | | | | datetime of when the current statement began. This also makes SYSDATE() not safe in replication. (Bug #12562)