summaryrefslogtreecommitdiff
path: root/mysys/mf_pack.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug #51893: crash with certain characters given to load_file Georgi Kodinov2010-03-231-0/+3
| | | | | | | | function on windows When making sure that the directory path ends up with a slash/backslash we need to check for the correct length of the buffer and trim at the appropriate location so we don't write past the end of the buffer.
* Manual merge.Davi Arnaut2009-12-181-2/+2
|\
| * Bug#48983: Bad strmake calls (length one too long)Davi Arnaut2009-12-171-2/+2
| | | | | | | | | | | | | | | | The problem is a somewhat common misusage of the strmake function. The strmake(dst, src, len) function writes at most /len/ bytes to the string pointed to by src, not including the trailing null byte. Hence, if /len/ is the exact length of the destination buffer, a one byte buffer overflow can occur if the length of the source string is equal to or greater than /len/.
* | Merge from 5.0 for 43414Staale Smedseng2009-08-281-2/+1
|\ \ | |/
| * Bug #43414 Parenthesis (and other) warnings compiling MySQLStaale Smedseng2009-08-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with gcc 4.3.2 This patch fixes a number of GCC warnings about variables used before initialized. A new macro UNINIT_VAR() is introduced for use in the variable declaration, and LINT_INIT() usage will be gradually deprecated. (A workaround is used for g++, pending a patch for a g++ bug.) GCC warnings for unused results (attribute warn_unused_result) for a number of system calls (present at least in later Ubuntus, where the usual void cast trick doesn't work) are also fixed.
* | Merge from 5.0-bugteam local.Chad MILLER2008-08-181-1/+1
|\ \ | |/
| * Bug#30394: Empty HOME environment variable causes several utilities to crashChad MILLER2008-08-181-1/+1
| | | | | | | | | | | | Tilde expansion could fail when it was to expand to an empty string (such as when HOME is set to an empty string), especially on systems where size_t is unsigned.
* | Up-merge 5.0.66a-release changes (via 5.0) into 5.1.Timothy Smith2008-07-171-24/+55
|\ \ | |/ | | Includes fix for Bug #38180, "options are read from ~/my.cnf instead of ~/.my.cnf"
| * Bug #38180 options are read from ~/my.cnf instead of ~/.my.cnfTimothy Smith2008-07-161-24/+55
| | | | | | | | | | | | | | | | | | Pull out some of unpack_dirname() into normalize_dirname(); this new function does not expand "~" to the home directory. Use this function in unpack_dirname(), and use it during init_default_directories() to remove duplicate entries without losing track of which directory is a user's home dir.
* | Merge mysql.com:/misc/mysql/31752_/50-31752_tnurnberg@mysql.com/white.intern.koehntopp.de2007-12-171-2/+2
|\ \ | |/ | | | | into mysql.com:/misc/mysql/31752_/51-31752_
| * Merge mysql.com:/misc/mysql/31752_/41-31752_tnurnberg@mysql.com/white.intern.koehntopp.de2007-12-171-2/+2
| |\ | | | | | | | | | into mysql.com:/misc/mysql/31752_/50-31752_
| | * Bug#31752: check strmake() boundstnurnberg@mysql.com/white.intern.koehntopp.de2007-12-061-2/+2
| | | | | | | | | | | | post-fixes: prevent semi-related overflow, additional comments
* | | Slow query log to file now displays queries with microsecond precissionmonty@mysql.com/nosik.monty.fi2007-07-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --long-query-time is now given in seconds with microseconds as decimals --min_examined_row_limit added for slow query log long_query_time user variable is now double with 6 decimals Added functions to get time in microseconds Added faster time() functions for system that has gethrtime() (Solaris) We now do less time() calls. Added field->in_read_set() and field->in_write_set() for easier field manipulation by handlers set_var.cc and my_getopt() can now handle DOUBLE variables. All time() calls changed to my_time() my_time() now does retry's if time() call fails. Added debug function for stopping in mysql_admin_table() when tables are locked Some trivial function and struct variable renames to avoid merge errors. Fixed compiler warnings Initialization of some time variables on windows moved to my_init()
* | | WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-134/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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/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
* | Table definition cache, part 2monty@mysql.com2005-11-231-8/+19
|/ | | | | | | | | | | | | | | | | | | | | | | | 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
* Bug#5439 : mysql_server_init() crashes if ShiftJIS path is passedbar@mysql.com2005-08-081-0/+12
| | | | | | | | | | | | | (important for Adobe). mf_pack.c, mf_dirname.c, charset.c, my_sys.h: - adding fs_character_set() function on Windows - ignoring fake slashes which are just multibyte parts in several functions in /mysys Verified by Shu to work on WinXP and Win2k. Test is not possible, or very hard to do.
* fixed stupid typo that added a ! before my_accessreggie@mdk10.(none)2005-05-201-1/+1
|
* BUG# 9148: Denial of servicereggie@mdk10.(none)2005-05-201-1/+1
| | | | | | | | | | The problem was that on Windows the access method indicates that access to file such as "com1" and "lpt1" is allowed (since they are device names) and this causes mysql to attempt to open them as databases or tables. The fix was to write our own my_access method that uses other Win32 functions to determine if the given argument is indeed a file and has to requested mode.
* Fix skipp -> skip once and for all.paul@kite-hub.kitebird.com2004-06-031-6/+6
| | | | (Note: This affects only comments, not variable names.)
* merge with 4.0monty@mysql.com2004-03-161-8/+22
|\
| * Fixed memory leak in DROP DATABASE when using RAID tables (Bug #2882)monty@mysql.com2004-03-101-8/+22
| |
* | just tried to find all 'skipp' and replace it with 'skip'.ram@gw.mysql.r18.ru2004-02-021-1/+1
|/
* Fixed a possible memory leak on MacOSX when using the shared libmysql.so ↵monty@mysql.com2003-12-111-13/+14
| | | | | | | | | | | | library (Bug #2061) mysql_server_init() now returns error code if something went wrong (Bug #2062) Don't use my_fopen() when reading symlink information as this may cause problems when a lot of files are opened. Free thread keys with pthread_key_delete() instead of relying on automatic free. (Bug #2062) Fixed bug in UNION statement with alias '*'. (Bug #1249) Fixed a bug in DELETE ... ORDER BY ... LIMIT where the rows where not deleted in the proper order. (Bug #1024). FOUND_ROWS() could return incorrect number of rows after a query with an impossible WHERE condition. HOW DATABASES doesn't anymore show .sym files (on windows) that doesn't point to a valid directory. (Bug #1385)
* Simple code cleanupmonty@narttu.mysql.fi2003-06-231-7/+19
|
* Update copyrightmonty@hundin.mysql.fi2001-12-061-16/+15
| | | | Fixed memory leak on shutdown (Affects the embedded version & MyODBC)
* Updated manual about embedded version.monty@hundin.mysql.fi2001-10-081-2/+1
| | | | | | | | | Speed up column-completion in 'mysql' Don't use ISAM if HAVE_ISAM is not defined A lot of fixes for the embedded version. All libraries are now included in libmysqld.a Changed arguments to convert_dirname() to make it more general. Renamed files in the 'merge' directory to all use a common prefix. Don't compile both assembler and C functions on x86
* Fix of UNION codemonty@hundin.mysql.fi2001-08-191-1/+1
| | | | | | | Added heap_delete_table Added HA_EXTRA_PREPARE_FOR_DELETE Added and use my_dup() for faster open of tables. Removed not working no-mix-table-type
* Fixed problems with decimals withing IF()monty@donna.mysql.fi2001-05-291-1/+6
| | | | Force add of FN_LIBCHAR to symlinks on windows
* Fixed indention, removed compiler varnings and fixed a bugmonty@donna.mysql.com2000-09-291-2/+1
| | | | in FULLTEXT indexes.
* Fixed for Ia64 + delayed key creation + a lot of small bug fixesmonty@donna.mysql.com2000-08-151-6/+6
|
* Import changesetbk@work.mysql.com2000-07-311-0/+528