Commit graph

173 commits

Author SHA1 Message Date
Alexey Kopytov
aacfd6ddb7 Manual merge. 2009-07-28 22:44:28 +04:00
Alexey Kopytov
53434623ff Bug #45031: invalid memory reads in my_real_read using protocol
compression 
 
Since uint3korr() may read 4 bytes depending on build flags and 
platform, allocate 1 extra "safety" byte in the network buffer 
for cases when uint3korr() in my_real_read() is called to read
last 3 bytes in the buffer. 
 
It is practically hard to construct a reliable and reasonably 
small test case for this bug as that would require constructing 
input stream such that a certain sequence of bytes in a 
compressed packet happens to be the last 3 bytes of the network 
buffer.
2009-07-28 22:35:55 +04:00
Ignacio Galarza
2d9421c3bb Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-13 11:41:47 -05:00
Ignacio Galarza
2b85c64d65 Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-10 17:47:54 -05:00
iggy@amd64.(none)
79e434bc67 Bug#26243 mysql command line crash after control-c
- Backported the 5.1 DBUG to 5.0.
- Avoid memory cleanup race on Windows client for CTRL-C
2008-03-28 14:02:27 -04:00
davi@mysql.com/endora.local
41545137ef Bug#34655 Compile error
Rename client_last_error to last_error and client_last_errno to last_errno
to not break connectors which use the internal net structure for error handling.
2008-02-28 14:55:46 -03:00
serg@janus.mylan
d9ca7b670e Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-12-20 22:11:37 +01:00
cmiller@zippy.cornsilk.net
c940d64a69 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
2007-12-14 10:52:10 -05:00
kostja@bodhi.(none)
ebb9c5d983 Bug#12713 "Error in a stored function called from a SELECT doesn't
cause ROLLBACK of statement", part 1. Review fixes.

Do not send OK/EOF packets to the client until we reached the end of 
the current statement.
This is a consolidation, to keep the functionality that is shared by all 
SQL statements in one place in the server.
Currently this functionality includes:
- close_thread_tables()
- log_slow_statement().

After this patch and the subsequent patch for Bug#12713, it shall also include:
- ha_autocommit_or_rollback()
- net_end_statement()
- query_cache_end_of_result().

In future it may also include:
- mysql_reset_thd_for_next_command().
2007-12-12 18:21:01 +03:00
kostja@bodhi.(none)
5cda50307f Fix broken compilation. 2007-10-15 15:49:16 +04:00
cmiller@zippy.cornsilk.net
2d615a6169 Doxygenized comments. 2007-10-11 14:37:45 -04:00
monty@mysql.com/nosik.monty.fi
b16289a5e0 Slow query log to file now displays queries with microsecond precission
--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()
2007-07-30 11:33:50 +03:00
holyfoot/hf@hfmain.(none)
46405f5a25 Merge mysql.com:/home/hf/work/29117/my50-29117
into  mysql.com:/home/hf/work/29117/my51-29117
2007-06-19 12:32:18 +05:00
holyfoot/hf@hfmain.(none)
438422d929 Merge mysql.com:/home/hf/work/29117/my41-29117
into  mysql.com:/home/hf/work/29117/my50-29117
2007-06-19 12:31:37 +05:00
holyfoot/hf@mysql.com/hfmain.(none)
5a9d6856de Bug #29117 (init_file test crashes with embedded server)
we use net->vio in my_net_local_init, but in the my_net_init
implementation we set it after the call, so work with unspecified
net->vio value
2007-06-19 11:13:11 +05:00
tsmith@quadxeon.mysql.com
4b93804592 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/51
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/51
2007-06-05 17:51:30 +02:00
msvensson@pilot.blaudden
4ac551f499 Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-new-maint
2007-05-25 16:48:23 +02:00
msvensson@pilot.blaudden
e50116e99e Bug#26664 test suite times out on OS X 64bit
- Add checks to make sure net has a vio assigned
 - For example bootstrap will create a fake "net" with vio
   set to 0
2007-05-25 16:47:43 +02:00
msvensson@pilot.blaudden
374de2c7cb Merge pilot.blaudden:/home/msvensson/mysql/bug26664/my50-bug26664
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
2007-05-24 20:51:37 +02:00
msvensson@pilot.blaudden
5d22eb6552 Merge pilot.blaudden:/home/msvensson/mysql/bug26664/my50-bug26664
into  pilot.blaudden:/home/msvensson/mysql/bug26664/my51-bug26664
2007-05-24 20:43:12 +02:00
msvensson@pilot.blaudden
93b1fe65d8 Bug#26664 test suite times out on OS X 64bit
- The "mysql client in mysqld"(which is used by
   replication and federated) should use alarms instead of setting
   socket timeout value if the rest of the server uses alarm. By
   always calling 'my_net_set_write_timeout'
   or 'my_net_set_read_timeout' when changing the timeout value(s), the
   selection whether to use alarms or timeouts will be handled by
   ifdef's in those two functions. 
 - Move declaration of 'vio_timeout' into "vio_priv.h"
2007-05-24 11:21:27 +02:00
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
monty@mysql.com/narttu.mysql.fi
0a35bd923f Fixed federated and some replication tests to not stop slave until it's up and running.
(Removes some warnings about UNIX_TIMESTAMP from the slave.err logs)
Marked federated_server as a '--big-test'
Change error in net_clear to 'Note', as it interfered with mysql-test-run.
2007-04-17 14:41:16 +03:00
monty@mysql.com/narttu.mysql.fi
6e8b72a6bb Added more descriptive error message of why statement was automaticly dropped
Print information if net_clear() skipped bytes (As this otherwise hides critical timeing bugs)
Added DBUG_ASSERT if we get packets out of order
mysql_change_user() could on error send multiple packets, which caused mysql_client_test to randomly fail
2007-04-13 01:56:22 +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
9147ad3a8d Small fixes. 2007-03-27 18:48:05 +03:00
jani@ua141d10.elisa.omakaista.fi
5c542a4656 Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
monty@mysql.com/narttu.mysql.fi
520d1b4144 Fixed compilations problems and warnings on windows 2007-02-23 22:48:15 +02:00
monty@mysql.com/narttu.mysql.fi
26aa385bc5 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2007-02-21 14:07:08 +02:00
msvensson@neptunus.(none)
e4001b3b5a Merge neptunus.(none):/home/msvensson/mysql/mysql-5.1
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint
2007-02-06 15:46:17 +01:00
msvensson@pilot.mysql.com
719a8f5896 Merge pilot.mysql.com:/home/msvensson/mysql/bug22943/my50-bug22943
into  pilot.mysql.com:/home/msvensson/mysql/bug22943/my51-bug22943
2007-01-29 14:35:09 +01:00
msvensson@pilot.mysql.com
007d170ad2 Merge pilot.mysql.com:/home/msvensson/mysql/bug22943/my41-bug22943
into  pilot.mysql.com:/home/msvensson/mysql/bug22943/my50-bug22943
2007-01-29 14:33:53 +01:00
msvensson@pilot.mysql.com
7eaa82ea38 Bug#22943 syscall pruning in libmysql
- Set the timeout values only where needed
2007-01-29 14:31:48 +01:00
monty@narttu.mysql.fi
8a80e36ac3 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
Merge of 'remove compiler warnings when using -Wshadow'
2007-01-27 03:46:45 +02:00
monty@mysql.com/narttu.mysql.fi
807526ff79 Fixed compiler warnings
Fixed wrong merge that disabled 'make test'
Renamed all suppress files to end in '.supp'
Don't give "skipped %d bytes from file" warnings in 5.0
2007-01-22 15:52:15 +02:00
monty@mysql.com/narttu.mysql.fi
a04157fbb3 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2007-01-22 14:04:40 +02:00
tsmith/tim@siva.hindu.god
682596d7ce Merge siva.hindu.god:/usr/home/tim/m/bk/g50
into  siva.hindu.god:/usr/home/tim/m/bk/50
2006-12-26 22:28:28 -07:00
tsmith/tim@siva.hindu.god
0cb9cee7f4 Merge siva.hindu.god:/usr/home/tim/m/bk/g51
into  siva.hindu.god:/usr/home/tim/m/bk/tmp/mrg51-dec26
2006-12-26 16:49:10 -07: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
msvensson@neptunus.(none)
d399c34412 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint
2006-12-15 00:15:52 +01:00
monty@mysql.com/narttu.mysql.fi
88dd873de0 Fixed compiler warnings detected by option -Wshadow and -Wunused:
- Removed not used variables and functions
- Added #ifdef around code that is not used
- Renamed variables and functions to avoid conflicts
- Removed some not used arguments

Fixed some class/struct warnings in ndb
Added define IS_LONGDATA() to simplify code in libmysql.c

I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
2006-12-15 00:51:37 +02:00
msvensson@neptunus.(none)
110b8af303 Put the DBUG_DUMP inside ifdef DEBUG_DATA_PACKETS 2006-12-14 21:48:08 +01:00
monty@mysql.com/narttu.mysql.fi
3a35c30027 Fixed compiler warnings (Mostly VC++):
- Removed not used variables
- Changed some ulong parameters/variables to ulonglong (possible serious bug)
- Added casts to get rid of safe assignment from longlong to long (and similar)
- Added casts to function parameters
- Fixed signed/unsigned compares
- Added some constructores to structures
- Removed some not portable constructs

Better fix for bug Bug #21428 "skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown"
(Added new parameter to net_clear() to define when we want the communication buffer to be emptied)
2006-11-30 03:40:42 +02:00
monty@mysql.com/narttu.mysql.fi
23263db66e Added back sql-bench directory, so that one can more easily run benchmarks on a server and add new benchmarks for new optimizations
Fixed memory leak in _db_set() (Bug#24497 Valgrind warning: get_one_option)
Don't call net_clear() on COM_QUIT. This avoids a warning from net_clear() after shutdown: "skipped ## bytes from file"
BUG#21428: skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown"
2006-11-29 22:51:09 +02: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.cornsilk.net
7ca1a49437 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
2006-09-05 16:46:55 -04:00
tsmith@maint2.mysql.com
e2f40aa6d0 Merge maint2.mysql.com:/data/localhome/tsmith/bk/41
into  maint2.mysql.com:/data/localhome/tsmith/bk/50
2006-09-01 08:53:56 +02:00