summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.1' into 10.2Sergei Golubchik2016-03-231-3/+0
|\
| * MDEV-5542: GROUP_CONCAT truncate output to 65.536 chars when using DISTINCT ↵Oleksandr Byelkin2016-03-011-3/+0
| | | | | | | | | | | | or ORDER BY port of mysql fix WL#6098
* | Merge branch '10.1' into 10.2Sergei Golubchik2016-02-251-3/+2
|\ \ | |/
| * Merge branch '10.0' into 10.1Sergei Golubchik2016-02-231-4/+8
| |\
| | * Merge branch '5.5' into 10.0Sergei Golubchik2016-02-151-4/+8
| | |\
| | | * Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-02-091-4/+8
| | | |\ | | | | | | | | | | | | | | | | | | | | reverted about half of commits as either not applicable or outright wrong
| | | | * Bug #22232332: SAVING TEXT FIELD TO TEXT VARIABLE IN ASreeharsha Ramanavarapu2016-01-081-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROCEDURE RESULTS IN GARBAGE BYTES Issue: ----- This problem occurs under the following conditions: a) Stored procedure has a variable is declared as TEXT/BLOB. b) Data is copied into the the variable using the SELECT...INTO syntax from a TEXT/BLOB column. Data corruption can occur in such cases. SOLUTION: --------- The blob type does not allocate space for the string to be stored. Instead it contains a pointer to the source string. Since the source is deallocated immediately after the select statement, this can cause data corruption. As part of the fix for Bug #21143080, when the source was part of the table's write-set, blob would allocate the neccessary space. But this fix missed the possibility that, as in the above case, the target might be a variable. The fix will add the copy_blobs check that was removed by the earlier fix.
| | | | * Bug #22123583: MYSQL 5.5: MAIN.SP HAS VALGRIND ISSUESSreeharsha Ramanavarapu2015-11-031-69/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue: ----- When a varchar column is used to fill the record in an internal temporary table, the length of the string stored in the column is not taken into account. Instead the default length of packed data is used to copy with memmove. This will cause valgrind issues since some bytes are uninitialized. SOLUTION: --------- The solution is to take into account the length of the string stored in the column while filling the record. This fix is a backport of BUG#13389854.
* | | | | 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.