summaryrefslogtreecommitdiff
path: root/extra/resolveip.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug#42733: Type-punning warnings when compiling MySQL --Davi Arnaut2010-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | strict aliasing violations. Essentially, the problem is that large parts of the server were developed in simpler times (last decades, pre C99 standard) when strict aliasing and compilers supporting such optimizations were rare to non-existent. Thus, when compiling the server with a modern compiler that uses strict aliasing rules to perform optimizations, there are several places in the code that might trigger undefined behavior. As evinced by some recent bugs, GCC does a somewhat good of job misoptimizing such code, but on the other hand also gives warnings about suspicious code. One problem is that the warnings aren't always accurate, yet we can't afford to just shut them off as we might miss real cases. False-positive cases are aggravated mostly by casts that are likely to trigger undefined behavior. The solution is to start a cleanup process focused on fixing and reducing the amount of strict-aliasing related warnings produced by GCC and others compilers. A good deal of noise reduction can be achieved by just removing useless casts that are product of historical cruft and are likely to trigger undefined behavior if dereferenced.
* Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-builddf@pippilotta.erinye.com2008-02-131-0/+8
|\ | | | | | | into pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build
| * Make this build on Windows.df@pippilotta.erinye.com2008-02-111-0/+8
| |
| * Merge trift2.:/MySQL/M50/mysql-5.0joerg@trift2.2008-01-281-6/+8
| |\ | | | | | | | | | into trift2.:/MySQL/M50/push-5.0
* | \ Merge trift2.:/MySQL/M51/mysql-5.1joerg@trift2.2008-01-281-6/+8
|\ \ \ | | | | | | | | | | | | into trift2.:/MySQL/M51/push-5.1
| * \ \ Merge mysql.com:/home/kent/bk/windows-cleanup/mysql-5.0-buildkent@kent-amd64.(none)2007-12-281-6/+8
| |\ \ \ | | | |/ | | |/| | | | | into mysql.com:/home/kent/bk/windows-cleanup/mysql-5.1-build
| | * | make_win_bin_dist CMakeLists.txt resolveip.c Makefile.am:kent@mysql.com/kent-amd64.(none)2007-12-281-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Better Windows support in the scripts directory mysql_config.pl.in, mysql_install_db.pl.in: New Perl version of Unix shell script, mainly for Windows Many files in scripts directory: Use default Perl location "#!/usr/bin/perl" instead of the build host path
* | | | Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maintcmiller@zippy.cornsilk.net2008-01-231-2/+4
|\ \ \ \ | |/ / / |/| | / | | |/ | |/| into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
| * | Bug#27427: resolveip fails on hostnames with a leading digitcmiller@zippy.cornsilk.net2008-01-231-2/+4
| |/ | | | | | | | | | | | | | | | | | | | | Patch by Kasper Dupont. No CLA required for this size of patch. "resolveip" program produces incorrect result if given a hostname starting with a digit. Someone seems to have thought that names can not have digits at the beginning. Instead, use the resolver library to work out the rules of hostnames, as it will undoubtedly be better at it than we are.
* | WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* | UNIXWARE removalbrian@zim.(none)2006-04-171-1/+1
|/
* Merge with 4.0monty@narttu.mysql.fi2003-11-041-4/+0
|\
| * 4 small items in this:guilhem@mysql.com2003-10-311-4/+0
| | | | | | | | | | | | | | | | | | | | | | - when we don't have in_addr_t, use uint32. - a forgotten initialization of slave_proxy_id in sql/log_event.cc (was not really "forgot", was "we needn't init it there", but there was one case where we needed...). - made slave_proxy_id always meaningful in THD and Log_event, so we can rely more on it (no need to test if it's meaningful). THD::slave_proxy_id is equal to THD::thread_id except for the slave SQL thread. - clean up the slave's temporary table (i.e. free their memory) when slave server shuts down.
* | Merge with 4.0.16monty@narttu.mysql.fi2003-10-071-2/+1
|\ \ | |/
| * After merge fixesmonty@narttu.mysql.fi2003-10-071-0/+1
| |
| * Merge with 3.23.58monty@narttu.mysql.fi2003-10-061-3/+1
| |\
| | * Portability fixmonty@narttu.mysql.fi2003-10-061-1/+1
| | |
| | * - backported compatibility fix for extra/resolveip.c from 4.0lenz@mysql.com2003-09-111-0/+4
| | | | | | | | | | | | to be able to compile on HP-UX 10.20 (which does not have in_add_t).
* | | merge with 4.0.15monty@narttu.mysql.fi2003-08-291-3/+5
|\ \ \ | |/ /
| * | Add detection of in_addr_tmonty@narttu.mysql.fi2003-08-281-2/+4
| | | | | | | | | | | | | | | | | | | | | Add pack_bits to pack_reclength for dynamic rows. This solves buffer a possible buffer overflow on update. (This will probably solve bug #563) Fix test for available file descriptors in mysqltest Fixed core dump bug in replication tests when running without transactional table support
| * | mergedserg@serg.mylan2003-08-211-1/+1
| |\ \ | | |/
| | * Fix for 64-bit CPUs (u_long is 64 bit there, but in_addr_t is always uint32).guilhem@mysql.com2003-08-181-1/+1
| | | | | | | | | | | | That's to make resolveip work on our FreeBSD-5.0/Sparc64 build host.
* | | consistency fix - all help texts for command-line options should end with a dot.serg@serg.mylan2003-06-131-1/+1
| | |
* | | system_charset_info has been moved to /sql directoryroot@home.(none)2003-03-161-1/+1
| | | | | | | | | | | | and isn't used in libraries any longer
* | | Merge with 4.0.11monty@mashka.mysql.fi2003-02-041-1/+4
|\ \ \ | |/ /
| * | Fixes for Netwaremonty@mashka.mysql.fi2003-01-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Call pthread_mutex_destroy() on not used mutex. Changed comments in .h and .c files from // -> /* */ Added detection of mutex on which one didn't call pthread_mutex_destroy() Fixed bug in create_tmp_field() which causes a memory overrun in queries that uses "ORDER BY constant_expression" Added optimisation for ORDER BY NULL
* | | merge with 4.0monty@hundin.mysql.fi2002-06-031-42/+36
|\ \ \ | |/ /
| * | merge with 3.23monty@hundin.mysql.fi2002-06-021-1/+1
| |\ \ | | |/
| | * Portability fixes for SCO and HPUXmonty@hundin.mysql.fi2002-05-311-1/+1
| | | | | | | | | | | | | | | Change TRUNCATE(number) to truncate towards zero for negative numbers Fix NULL handling for DESCRIBE table_name
| * | Added useful exit error code for programs using my_getopt in casejani@hynda.(none)2002-05-291-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of an error in option handling. This can sometimes be useful in scripts. Changed some exit code names and corresponding numbers. Fixed a bug in mysqld.cc, in replication related options. Added a global flag in my_getopt, which can be set by any program that is using my_getopt, which tells whether the client should print the error message itself, or whether my_getopt should do it. The default is that my_getopt will print the error messages.
| * | merge with 3.23.51monty@hundin.mysql.fi2002-05-271-5/+0
| |\ \ | | |/
| | * Split raid C function to separate file to make things more portable.monty@hundin.mysql.fi2002-05-271-5/+0
| | | | | | | | | | | | | | | Fixed some portability things in my_gethostbyname_r Portability fix for type_decimal.test
| | * Portability fix for SCOmonty@hundin.mysql.fi2001-12-271-24/+25
| | |
| | * Small safety fixmonty@hundin.mysql.fi2001-11-281-0/+2
| | |
| * | moved my_getopt.h under client_priv.hjani@hynda.(none)2002-05-221-34/+36
| | | | | | | | | | | | | | | Changed my_print_defaults, mysql_install, perror, resolve_stack_dump, resolveip and pack_isam to use my_getopt.
* | | New ctype functions/macros to support many charsets at a timebar@gw.udmsearch.izhnet.ru2002-03-121-1/+1
|/ /
* | Removed not used functions from sql_cachemonty@hundin.mysql.fi2001-12-141-2/+6
| | | | | | | | Added new tests to testsuite.
* | Update copyrightmonty@hundin.mysql.fi2001-12-061-21/+17
| | | | | | | | Fixed memory leak on shutdown (Affects the embedded version & MyODBC)
* | Patch for SCOmonty@hundin.mysql.fi2001-11-261-0/+2
| | | | | | | | Update test results for MySQL 4.0
* | merge with 3.23.44monty@hundin.mysql.fi2001-11-041-0/+6
|\ \ | |/
| * Portability fixesmonty@hundin.mysql.fi2001-10-311-2/+3
| |
* | One should not only have to include my_net.h to work with sockets.monty@hundin.mysql.fi2001-10-091-7/+2
| | | | | | | | | | | | This wrapper noew will include all the necessary, system specific files, which makes all normal source files much easier to write and maintain. Portability fixes.
* | Changed to use my_global.hmonty@hundin.mysql.fi2001-09-141-1/+1
| | | | | | | | | | Fixed problem with LIKE with latin1_de Added parsing support of UNSIGNED LONG LONG
* | Some warning fixes and some SSL testprograms check-intonu@x153.internalnet2001-08-261-0/+1
|/
* Import changesetbk@work.mysql.com2000-07-311-0/+204