summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | MDEV-9393 Split Copy_field::get_copy_func() into virtual methods in FieldAlexander Barkov2016-01-111-119/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also fixes: MDEV-9391 InnoDB does not produce warnings when doing WHERE int_column=varchar_column MDEV-9337 ALTER from DECIMAL and INT to DATETIME returns a wrong result MDEV-9340 Copying from INT/DOUBLE to ENUM is inconsistent MDEV-9392 Copying from DECIMAL to YEAR is not consistent about warnings
* | | | | Merge remote-tracking branch 'origin/10.1' into 10.2Alexander Barkov2015-12-291-54/+51
|\ \ \ \ \ | |/ / / /
| * | | | Merge remote-tracking branch 'origin/10.0' into 10.1Alexander Barkov2015-12-291-8/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge remote-tracking branch 'origin/5.5' into 10.0Alexander Barkov2015-12-291-8/+1
| | |\ \ \ | | | |/ /
| | | * | MDEV-9319 ALTER from a bigger to a smaller blob type truncates too much dataAlexander Barkov2015-12-291-8/+1
| | | | |
| * | | | MDEV-8605 MariaDB not use DEFAULT value even when inserted NULL for NOT ↵Sergei Golubchik2015-12-211-20/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NULLABLE column NOT NULL constraint must be checked *after* the BEFORE triggers. That is for INSERT and UPDATE statements even NOT NULL fields must be able to store a NULL temporarily at least while BEFORE INSERT/UPDATE triggers are running.
| * | | | cleanupSergei Golubchik2015-12-211-28/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move common code to a new set_bad_null_error() function * move repeated comparison out of the loop * remove unused code * unused method Table_triggers_list::set_table * redundant condition (if (table) after table was dereferenced) * add an assert
* | | | | Adding "const" qualifier to methods Field::eq_def() andAlexander Barkov2015-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | Copy_field::get_copy_func().
* | | | | MDEV-9327 Split memcpy_field_possible() into virtual methods in FieldAlexander Barkov2015-12-271-36/+6
| | | | |
* | | | | MDEV-9326 Split field_conv_incompatible() into methodsAlexander Barkov2015-12-261-69/+32
|/ / / /
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2015-10-121-11/+5
|\ \ \ \ | |/ / /
| * | | Merge branch '5.5' into 10.0Sergei Golubchik2015-10-091-11/+5
| |\ \ \ | | |/ /
| | * | Merge remote-tracking branch 'mysql/5.5' into 5.5Sergei Golubchik2015-10-081-11/+5
| | |\ \ | | | |/
| | | * Bug #21143080: UPDATE ON VARCHAR AND TEXT COLUMNS PRODUCESreeharsha Ramanavarapu2015-07-161-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INCORRECT RESULTS Issue: ----- Updating varchar and text fields in the same update statement can produce incorrect results. When a varchar field is assigned to the text field and the varchar field is then set to a different value, the text field's result contains the varchar field's new value. SOLUTION: --------- Currently the blob type does not allocate space for the string to be stored. Instead it contains a pointer to the varchar string. So when the varchar field is changed as part of the update statement, the value contained in the blob also changes. The fix would be to actually store the value by allocating space for the blob's string. We can avoid allocating this space when the varchar field is not being written into.
| | | * Merge 5.5.24 back into main 5.5.Joerg Bruehe2012-05-071-6/+7
| | | |\ | | | | | | | | | | | | | | | | | | | | This is a weave merge, but without any conflicts. In 14 source files, the copyright year needed to be updated to 2012.
| | | | * Bug#13871079 RQG_MYISAM_DML_ALTER_VALGRIND FAILS ON VALGRIND PN PB2Tor Didriksen2012-04-121-5/+6
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The class Copy_field contains a String tmp, which may allocate memory on the heap. That means that all instances of Copy_field must be properly destroyed. Alas they are not. Solution: don't use Copy_field::tmp for copying from_field => tmp => to_field in do_field_string()
| | | * Merge BUG#12997905 from 5.1 to 5.5Jorgen Loland2011-11-181-1/+1
| | | |\
| | | | * Backmerge of BUG#12997905Jorgen Loland2011-11-181-1/+1
| | | | |
| | | * | Bug#11908153: CRASH AND/OR VALGRIND ERRORS IN FIELD_BLOB::GET_KEY_IMAGETor Didriksen2011-07-041-0/+3
| | | | | | | | | | | | | | | | | | | | Field_geom::reset() failed to reset its base Field_blob. The range optimizer used the un-initilized field during optimization and execution.
| | | * | Updated/added copyright headersKent Boortz2011-06-301-2/+2
| | | |\ \ | | | | |/
| | | | * Updated/added copyright headersKent Boortz2011-06-301-2/+4
| | | | |\
| | | | | * Updated/added copyright headersKent Boortz2011-06-301-2/+3
| | | | | |
| | | | | * Bug #43414 Parenthesis (and other) warnings compiling MySQL Staale Smedseng2009-06-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with gcc 4.3.2 Compiling MySQL with gcc 4.3.2 and later produces a number of warnings, many of which are new with the recent compiler versions. This bug will be resolved in more than one patch to limit the size of changesets. This is the second patch, fixing more of the warnings.
| | | * | | merge of 5.1-bugteamGuilhem Bichot2010-11-221-5/+2
| | | |\ \ \ | | | | |/ /
| | | | * | Fix for Bug#56138 "valgrind errors about overlapping memory when ↵Guilhem Bichot2010-11-221-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | double-assigning same variable", and related small fixes.
| | | * | | WL#5498: Remove dead and unused source codeDavi Arnaut2010-07-231-1/+1
| | | | | | | | | | | | | | | | | | Remove workarounds for ancient systems.
| | | * | | Manual merge of mysql-5.1-bugteam toAlexey Kopytov2010-04-191-1/+2
| | | |\ \ \ | | | | |/ / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-trunk-merge. Conflicts: Text conflict in sql/sql_priv.h
| | | | * | WL#5030: Split and remove mysql_priv.hMats Kindahl2010-03-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch: - Moves all definitions from the mysql_priv.h file into header files for the component where the variable is defined - Creates header files if the component lacks one - Eliminates all include directives from mysql_priv.h - Eliminates all circular include cycles - Rename time.cc to sql_time.cc - Rename mysql_priv.h to sql_priv.h
| | | * | | Bug#48525: trigger changes "Column 'id' cannot be null" behaviourTatiana A. Nurnberg2010-03-291-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CHECK_FIELD_IGNORE was treated as CHECK_FIELD_ERROR_FOR_NULL; UPDATE...SET...NULL on NOT NULL fields behaved differently after a trigger. Now distinguishes between IGNORE and ERROR_FOR_NULL and save/restores check-field options.
| | | * | | revert 48525Tatiana A. Nurnberg2010-02-221-18/+8
| | | | | |
| | | * | | Bug#48525: trigger changes "Column 'id' cannot be null" behaviourTatiana A. Nurnberg2010-02-181-8/+18
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CHECK_FIELD_IGNORE was treated as CHECK_FIELD_ERROR_FOR_NULL; UPDATE...SET...NULL on NOT NULL fields behaved differently after a trigger. Now distinguishes between IGNORE and ERROR_FOR_NULL and save/restores check-field options.
| | | | |
| | | | \
| | | *-. \ Merge from 5.0-bugteam for 43414Staale Smedseng2009-06-091-6/+6
| | | |\ \ \ | | | | | |/
| | | | | * Bug #43414 Parenthesis (and other) warnings compiling MySQL Staale Smedseng2009-06-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with gcc 4.3.2 Compiling MySQL with gcc 4.3.2 and later produces a number of warnings, many of which are new with the recent compiler versions. This bug will be resolved in more than one patch to limit the size of changesets. This is the first patch, fixing a number of the warnings, predominantly "suggest using parentheses around && in ||", and empty for and while bodies.
| | | | * | Bug #43414 Parenthesis (and other) warnings compiling MySQL Staale Smedseng2009-06-091-4/+4
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with gcc 4.3.2 Compiling MySQL with gcc 4.3.2 and later produces a number of warnings, many of which are new with the recent compiler versions. This bug will be resolved in more than one patch to limit the size of changesets. This is the first patch, fixing a number of the warnings, predominantly "suggest using parentheses around && in ||", and empty for and while bodies.
| | | * | Doxygenization of comments.cmiller@zippy.cornsilk.net2007-10-111-28/+31
| | | | |
| | | * | Fix doxygen warnings.kostja@bodhi.(none)2007-08-161-1/+2
| | | | |
| | | * | Merge gleb.loc:/home/uchum/work/bk/5.0-optgshchepa/uchum@gleb.loc2007-07-131-5/+12
| | | |\ \ | | | | |/ | | | | | | | | | | into gleb.loc:/home/uchum/work/bk/5.1-opt
| | | | * field_conv.cc:gshchepa/uchum@gleb.loc2007-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | Additional fix for bug #29360.
| | | | * Fixed bug #29360.gshchepa/uchum@gleb.loc2007-07-121-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The special `zero' enum value was coerced to the normal empty string enum value during a field-to-field copy. This bug affected CREATE ... SELECT statements and SELECT aggregate GROUP BY enum field statements. Also this bug made unnecessary warnings during the execution of CREATE ... SELECT statements: Warning 1265 Data truncated for column...
| | | * | Merge olga.mysql.com:/home/igor/mysql-5.0-optigor@olga.mysql.com2007-06-301-1/+16
| | | |\ \ | | | | |/ | | | | | | | | | | into olga.mysql.com:/home/igor/dev-opt/mysql-5.1-opt
| | | | * Merge olga.mysql.com:/home/igor/mysql-4.1-optigor@olga.mysql.com2007-06-301-1/+16
| | | | |\ | | | | | | | | | | | | | | | | | | into olga.mysql.com:/home/igor/mysql-5.0-opt
| | | | | * Fixed bug #29251.gshchepa/uchum@gleb.loc2007-06-271-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes special 0 ENUM values was ALTERed to normal empty string ENUM values. Special 0 ENUM value has the same string representation as normal ENUM value defined as '' (empty string). The do_field_string function was used to convert ENUM data at an ALTER TABLE request, but this function doesn't care about numerical "indices" of ENUM values, i.e. do_field_string doesn't distinguish a special 0 value from an empty string value. A new copy function called do_field_enum has been added to copy special 0 ENUM values without conversion to an empty string.
| | | | | * Valgrind error fixesgluh@mysql.com/eagle.(none)2007-02-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: This patch doesn't fix all issues in the tree and we need jani's fix for that This patch shoud not be merged into 5.0
| | | | | * a fix (bug #7589: Decimal types are ignored when updating data from another ↵ramil@mysql.com2005-09-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | column).
| | | | * | backport of Bug#11491 Misleading error message if not NULL column set to ↵gluh@mysql.com/eagle.(none)2007-05-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | NULL, SQL mode TRADITIONAL
| | | * | | Merge bk-internal.mysql.com:/data0/bk/mysql-5.1ibabaev@bk-internal.mysql.com2007-06-011-0/+14
| | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | into bk-internal.mysql.com:/data0/bk/mysql-5.1-opt
| | | | * \ \ Merge dl145s.mysql.com:/users/mhansson/mysql/push/bug23856/my50-bug23856mhansson@dl145s.mysql.com2007-05-211-0/+14
| | | | |\ \ \ | | | | | |/ / | | | | | | | | | | | | | | into dl145s.mysql.com:/users/mhansson/mysql/push/bug23856/my51-bug23856
| | | | | * | bug#23856mhansson@dl145s.mysql.com2007-05-211-0/+14
| | | | | | |
| | | * | | | WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-14/+19
| | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
| | | * | | Merge mysql.com:/home/bar/mysql-5.0.b20095bar@bar.myoffice.izhnet.ru2007-04-131-2/+30
| | | |\ \ \ | | | | |/ / | | | | | | | | | | | | into mysql.com:/home/bar/mysql-5.1-new-rpl