summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
Commit message (Collapse)AuthorAgeFilesLines
*-. 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
| * | Bug#20095 Changing length of VARCHAR field with UTF8 collation does not ↵bar@mysql.com2007-04-131-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | truncate values Problem: single byte do_varstring1() function was called, which didn't check limit on "number of character", and checked only "number of bytes". Fix: adding a multi-byte aware function do_varstring1_mb(), to limit on "number of characters"
* | | Merge moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.0-optevgen@moonbone.local2007-03-311-1/+1
|\ \ \ | |/ / | | | | | | into moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.1-opt
| * | Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the evgen@sunlight.local2007-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NO_AUTO_VALUE_ON_ZERO mode. In the NO_AUTO_VALUE_ON_ZERO mode the table->auto_increment_field_not_null variable is used to indicate that a non-NULL value was specified by the user for an auto_increment column. When an INSERT .. ON DUPLICATE updates the auto_increment field this variable is set to true and stays unchanged for the next insert operation. This makes the next inserted row sometimes wrongly have 0 as the value of the auto_increment field. Now the fill_record() function resets the table->auto_increment_field_not_null variable before filling the record. The table->auto_increment_field_not_null variable is also reset by the open_table() function for a case if we missed some auto_increment_field_not_null handling bug. Now the table->auto_increment_field_not_null is reset at the end of the mysql_load() function. Reset the table->auto_increment_field_not_null variable after each write_row() call in the copy_data_between_tables() function.
* | | Merge mysql.com:/home/ram/work/b24558/b24558.5.0ramil/ram@ramil.myoffice.izhnet.ru2007-03-151-0/+9
|\ \ \ | |/ / | | | | | | into mysql.com:/home/ram/work/b24558/b24558.5.1
| * | Fix for bug #24558: Increasing decimal column length causes data lossramil/ram@mysql.com/ramil.myoffice.izhnet.ru2007-03-151-0/+9
| | | | | | | | | | | | | | | | | | | | | Altering to a decimal field we get double value then store it that may cause data loss. Fix: use store_decimal() instead.
* | | Merge olga.mysql.com:/home/igor/mysql-5.0-optigor@olga.mysql.com2007-02-131-8/+7
|\ \ \ | |/ / | | | | | | into olga.mysql.com:/home/igor/mysql-5.1-opt
| * | Bug #22344: InnoDB keys act strange on datetime vs timestamp comparisongkodinov/kgeorge@macbook.gmz2007-02-061-8/+7
| | | | | | | | | | | | | | | | | | Ignoring error codes from type conversion allows default (wrong) values to go unnoticed in the formation of index search conditions. Fixed by correctly checking for conversion errors.
* | | 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-internal.mysql.com:/data0/bk/mysql-5.1pgalbraith@bk-internal.mysql.com2006-12-091-0/+24
|\ \ \ | | | | | | | | | | | | into bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
| * \ \ Merge 192.168.0.5:mysql/mysql-5.1-maintmsvensson@neptunus.(none)2006-11-291-6/+6
| |\ \ \ | | | | | | | | | | | | | | | into neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint
| * \ \ \ Merge neptunus.(none):/home/msvensson/mysql/bug19731/my50-bug19731msvensson@neptunus.(none)2006-11-291-0/+24
| |\ \ \ \ | | | |/ / | | |/| | | | | | | into neptunus.(none):/home/msvensson/mysql/bug19731/my51-bug19731
| | * | | Bug#19371 VARBINARY() have trailing zeros after upgrade from 4.1msvensson@neptunus.(none)2006-11-091-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Detect if a table has field of type MYSQL_TYPE_VAR_STRING while running "CHECK TABLE t FOR UPGRADE" and indicate it need to be fixed with "REPAIR TABLE t". - When running a "REPAIR TABLE t" or "ALTER TABLE t FORCE" on the above table, install a special copy function to trim off the trailing spaces which we safely can say that the pre 5.0 mysqld didn't put there.
* | | | | This finishes the work (someone) started to remove FIELD_ types and use the ↵brian@zim.(none)2006-12-011-24/+24
| |_|/ / |/| | | | | | | | | | | Enum MYSQL types. The second part to this is to actually deprecate the FIELD defines in mysql_com.h
* | | | Added --debug-info to most clients to detect memory leaks in mysql-test-runmonty@mysql.com/nosik.monty.fi2006-11-211-6/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | Moved .progress files into the log directory Moved 'cluster' database tables into the MySQL database, to not have 'cluster' beeing a reserved database name Fixed bug where mysqld got a core dump when trying to use a table created by MySQL 3.23 Fixed some compiler warnings Fixed small memory leak in libmysql Note that this doesn't changeset doesn't include the new mysqldump.c code required to run some tests. This will be added when I merge 5.0 to 5.1
* | | After merge fixbar@bar.intranet.mysql.r18.ru2006-10-031-1/+17
|\ \ \ | |/ /
| * | Bug#19960 Inconsistent results when joining InnoDB tables using partial UTF8 ↵bar@mysql.com/bar.intranet.mysql.r18.ru2006-09-291-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | indexes Adding a multibyte-aware VARCHAR copying function, to put correct column prefix, taking in account number of characters (instead just limiting on number of bytes). For example, for a KEY(col(3)) on a UTF8 column when copying the string 'foo bar foo', we should put only 3 leftmost characters: 'foo'. 9 characters were incorrectly put before this fix.
* | | Merge bodhi.local:/opt/local/work/tmp_mergekostja@bodhi.local2006-07-151-3/+8
|\ \ \ | |/ / | | | | | | into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge-5.0
| * | Bug#17226: Variable set in cursor on first iteration is assignedkroki@mysql.com2006-06-301-3/+8
| | | | | | | | | | | | | | | | | | | | | second iterations value During assignment to the BLOB variable in routine body the value wasn't copied.
* | | Merge mysql.com:/usr/local/mysql/tmp_mergeknielsen@mysql.com2006-05-181-1/+2
|\ \ \ | |/ / | | | | | | into mysql.com:/usr/local/mysql/merge-5.1
| * | Fix for BUG#18587: Function that accepts and returns TEXTanozdrin@mysql.com2006-05-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | garbles data if longer than 766 chars. The problem is that a stored routine returns BLOBs to the previous caller, BLOBs are shallow-copied (i.e. only pointers to the data are copied). The fix is to also copy data of BLOBs.
* | | Re commit of previous fix as the bk tree was broken.jani@ibmlab.site2006-03-141-1/+1
| | |
* | | Merge mysql.com:/extern/mysql/5.0/bug17476/mysql-5.0pem@mysql.com2006-03-031-1/+17
|\ \ \ | |/ / | | | | | | into mysql.com:/extern/mysql/5.1/generic/mysql-5.1-new
| * | Expanding a binary field should result in 0x00-filled positions, not 0x20 cmiller@zippy.(none)2006-03-021-1/+17
| | | | | | | | | | | | (ASCII space). For Bug#16857.
* | | Fix for bug#11491 Misleading error message if not NULL column set to NULL,gluh@eagle.intranet.mysql.r18.ru2005-12-011-2/+1
|/ / | | | | | | | | SQL mode TRADITIONAL Message is chenged from 'ER_WARN_NULL_TO_NOTNULL' to 'ER_BAD_NULL_ERROR'
* | Added option --valgrind-mysqltest to mysql-test-runmonty@mishka.mysql.fi2005-09-141-3/+4
| | | | | | | | | | | | | | Added flag to Field::store(longlong) to specify if value is unsigned. This fixes bug #12750: Incorrect storage of 9999999999999999999 in DECIMAL(19, 0) Fixed warning from valgrind in CREATE ... SELECT Fixed double free of mysql.options if reconnect failed
* | Fix bug #11398 Bug in field_conv() results in wrong result of join with indexevgen@moonbone.local2005-08-161-1/+4
| | | | | | | | | | | | | | | | | | When copying varchar fields with field_conv() it's not taken into account that length_bytes of source and destination fields may be different. This results in saving wrong data in field and making wrong key later. Added check so if fields are varchar and have different length_bytes they are not copied by memcpy().
* | Cleanups after merge from 4.1.jimw@mysql.com2005-07-191-1/+1
| |
* | Merge mysql.com:/home/jimw/my/mysql-4.1-cleanjimw@mysql.com2005-07-191-1/+31
|\ \ | |/ | | | | into mysql.com:/home/jimw/my/mysql-5.0-clean
| * Simple fixes during review of new codemonty@mishka.local2005-07-191-1/+31
| |
* | Merge mysql.com:/usr/home/bar/mysql-4.1bar@mysql.com2005-07-121-13/+20
|\ \ | |/ | | | | into mysql.com:/usr/home/bar/mysql-5.0