Commit graph

37 commits

Author SHA1 Message Date
monty@mysql.com/narttu.mysql.fi
088e2395f1 WL#3817: Simplify string / memory area types and make things more consistent (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
2007-05-10 12:59:39 +03:00
jani@ua141d10.elisa.omakaista.fi
1c7beca65e Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-marvel
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-marvel
2007-03-29 17:27:42 +03:00
jani@ua141d10.elisa.omakaista.fi
3c3b0391f8 Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1-main
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-marvel
2007-03-28 20:46:42 +03:00
jani@ua141d10.elisa.omakaista.fi
5c542a4656 Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
kent@kent-amd64.(none)
be15e3bc15 Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-23 20:20:40 +01:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
monty@nosik.monty.fi
89570bf966 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
2006-11-22 14:11:36 +02:00
monty@mysql.com/nosik.monty.fi
e825879800 Remove compiler warnings
(Mostly in DBUG_PRINT() and unused arguments)
Fixed bug in query cache when used with traceing (--with-debug)
Fixed memory leak in mysqldump
Removed warnings from mysqltest scripts (replaced -- with #)
2006-11-20 22:42:06 +02:00
cmiller@zippy.(none)
91b8b26411 Merge zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.1
into  zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.1-new-maint
2006-07-05 16:16:09 -04:00
cmiller@zippy.(none)
6110a83a0e Merge zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.0
into  zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.1
2006-07-03 11:35:58 -04:00
elliot@mysql.com
d11c890bf1 BUG#20528 Added missing parenthesis to DBUG_PRINT statement 2006-06-23 11:21:57 -04:00
msvensson@neptunus.(none)
2c538f6cde Merge bk-internal:/home/bk/mysql-5.1
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
2006-06-10 20:33:50 +02:00
msvensson@neptunus.(none)
27ec02b216 Merge neptunus.(none):/home/msvensson/mysql/my51-bug15936
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
2006-06-07 12:05:42 +02:00
reggie@big_geek.
11d66e8068 removing MSDOS defines and code 2006-05-08 14:50:13 -05:00
brian@zim.(none)
53dce52086 Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  zim.(none):/home/brian/mysql/dep-5.1
2006-04-15 08:50:56 -07:00
brian@zim.(none)
ba2502b9c3 Another long patch to remove the rest of the OS2 support. 2006-04-15 08:49:00 -07:00
msvensson@neptunus.(none)
a4b19285e5 Bug#18474 Unlistable directories yield no info from information_schema, part2
- Improved solution by adding an else stetment so that do find next is avoided if erorr occurs, but we still return zero files found instaed of an error
2006-04-11 20:41:05 +02:00
msvensson@shellback.
661d572ae1 Remove unused defined USES_TYPES 2006-04-11 20:12:57 +02:00
msvensson@shellback.(none)
de6b1b777c Bug#18474 Unlistable directories yield no info from information_schema, part2
- Make the windows implementation of 'my_dir' behave like the default implementation
2006-03-23 23:09:34 +01:00
gluh@eagle.intranet.mysql.r18.ru
fa776a6f67 Fix for bug#15851 Unlistable directories yield no info from information_schema
to skip directories which are not allowed for read
2006-01-24 15:59:08 +04:00
aivanov@mysql.com
e203a42dfc Fix for BUG#4375: Windows specific directories are copied
during replication.
 Modified my_dir(). Now this function skips hidden and system
 files which sometimes are created by Windows.
 NOTE. The fix is similar to the previuos one (05 July 2004)
 except for correct setting of the 'attrib' variable value
 (within the previous fix this variable was left uninitialized
 when my_dir() was called with My_flags & MY_WANT_STAT == 0).
2005-10-19 18:01:23 +04:00
monty@mysql.com
f585ccb2ab Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1
2004-08-23 13:47:52 +03:00
monty@mysql.com
309d691e65 Changed %lx -> 0x%lx (for easier comparison of debug files)
Cosmetic cleanups
Don't call 'delete_elements' on copy_funcs as this causes elements to be freed twice
2004-08-23 13:46:51 +03:00
miguel@hegel.txg
7a00a99583 Fix for bug report #4737 and revert fix for bug #4375 (re-opened). 2004-07-29 18:35:54 -03:00
guilhem@mysql.com
2d5fbe0aec my_lib.c:
more accurate comment
2004-07-05 19:12:23 +02:00
guilhem@mysql.com
912eb811ba Windows-specific:
Fix for BUG#4375 "Windows specific directories are copied during
replication": in the Windows version of my_dir(), do not show hidden
or system files which Windows sometimes creates in the root directory
of drive (like RECYCLER and SYSTEM VOLUME INFORMATION directories) (so
this problem showed up only when the datadir was the root dir of a
drive).
This will make SHOW DATABASES display better, and will do no harm to
MySQL. For example, DROP DATABASE will not miss some files, as MySQL
creates no hidden or system files.
2004-07-05 19:07:26 +02:00
dlenev@mysql.com
d7ebfbab1c Fix for Bug #1952
"SHOW TABLE STATUS very slow w/large number of tables"
Replaced old algorithm which were used in my_dir() and stored
all information about directory entries in one chunk of memory
with new one which stores file names and MY_STAT structures in
separate memroot, so now we don't need to copy this data during
reallocation of dir_entry array.
2003-12-12 03:39:29 +03:00
monty@mysql.com
7e92336b1d Fixed a possible memory leak on MacOSX when using the shared libmysql.so 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)
2003-12-11 06:24:08 +02:00
monty@mashka.mysql.fi
8edc752573 Simple fixes (nothing notable) 2003-03-12 01:40:06 +02:00
monty@hundin.mysql.fi
b658662ae4 Update copyright
Fixed memory leak on shutdown (Affects the embedded version & MyODBC)
2001-12-06 14:10:51 +02:00
monty@hundin.mysql.fi
578ab3f1b1 new crash-me results for Interbase. 2001-11-08 17:40:55 +02:00
monty@hundin.mysql.fi
52b83ea218 Fixed bug in UNION
Fixed replication bug in load_master_data
2001-09-14 19:50:56 +03:00
monty@work.mysql.com
447c18954e merge with 3.23.42 2001-09-02 18:38:33 +02:00
monty@hundin.mysql.fi
733f865f54 Fixes for OS2.
Fix bug in isamlog
Add argument types to function declarations.
2001-08-22 01:45:07 +03:00
monty@hundin.mysql.fi
a1be2a894f Fix of UNION code
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
2001-08-19 14:43:51 +03:00
monty@donna.mysql.com
ea013c2152 Fixed for Ia64 + delayed key creation + a lot of small bug fixes 2000-08-15 20:09:37 +03:00
bk@work.mysql.com
f4c589ff6c Import changeset 2000-07-31 21:29:14 +02:00