Commit graph

249 commits

Author SHA1 Message Date
davi@endora.local
36d3c604c1 Merge mysql.com:/Users/davi/mysql/bugs/29592-5.0
into  mysql.com:/Users/davi/mysql/bugs/29592-5.1
2007-11-26 16:10:26 -02:00
davi@mysql.com/endora.local
cdad8669df Bug#29592 SQL Injection issue
Remove the mysql_odbc_escape_string() function. The function
has multi-byte character escaping issues, doesn't honor the
NO_BACKSLASH_ESCAPES mode and is not used anymore by the
Connector/ODBC as of 3.51.17.
2007-11-26 14:09:37 -02:00
df@pippilotta.erinye.com
493634e4c7 Merge bk-internal:/home/bk/mysql-5.1-marvel
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build-marvel-engines
2007-08-03 17:15:23 +02:00
tnurnberg@sin.intern.azundris.com
d02dd25198 Merge sin.intern.azundris.com:/home/tnurnberg/10776/50-10776
into  sin.intern.azundris.com:/home/tnurnberg/10776/51-10776
2007-08-01 05:07:58 +02:00
tnurnberg@sin.intern.azundris.com
8dd4751be9 Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2
mysqld hasn't been built on AIX with ndb-everything in quite a while.
this allowed a variety of changes to be added that broke the AIX build
for both the GNU and IBM compilers (but the IBM suite in particular).
Changeset lets build to complete on AIX 5.2 for users of the GNU and
the IBM suite both. Tudo bem?
2007-08-01 04:56:58 +02:00
monty@mysql.com/nosik.monty.fi
a33c863ffd Add 'extension' field to all client library structures to make them extensible
Reorder structure elements to make structures smaller and faster on 64 bit systems
This is a first step in cleaning up the client include files (but should be enough to allow us to do future fixes without breaking the library)
This change is part of WL#2872,  Make client library extensible.
2007-07-30 06:22:25 +03:00
jani@a88-113-38-195.elisa-laajakaista.fi
fc3b3a0a86 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
2007-05-24 13:24:36 +03: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
serg@sergbook.mysql.com
6bc9bc92df Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.1-wl2936
2007-04-16 10:37:50 +02:00
msvensson@pilot.blaudden
e57392f4b4 Bug #24121 Incorrect test for SSL_VERIFY_SERVER_CERT
- Change 'mysql_options' third argment "arg" to "const void*"
2007-03-27 21:04:05 +02:00
antony@ppcg5.local
dc24473cb2 WL#2936
"Server Variables for Plugins"
  Implement support for plugins to declare server variables.
  Demonstrate functionality by removing InnoDB specific code from sql/*
  New feature for HASH - HASH_UNIQUE flag
  New feature for DYNAMIC_ARRAY - initializer accepts preallocated ptr.
  Completed support for plugin reference counting.
2007-03-02 08:43:45 -08:00
monty@mysql.com/narttu.mysql.fi
520d1b4144 Fixed compilations problems and warnings on windows 2007-02-23 22:48:15 +02: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
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
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
jpipes@shakedown.(none)
421533e156 Merge shakedown.(none):/home/jpipes/dev/bug20246/my41-bug20246
into  shakedown.(none):/home/jpipes/dev/mysql-5.0-maint
2006-12-07 08:49:53 -05:00
jpipes@shakedown.(none)
07ee2594e5 Fix for Bug #20246 (enum mysql_enum_shutdown_level not well-defined in mysql_com.h)
MYSQL_VERSION_ID is tested before it has been defined.  This leads to
a warning when compiling with -Wundef and it also will break the
internal logic of mysql_com.h as soon as MYSQL_VERSION_ID exceeds
50000.

The fix entailed a simple re-ordering of included files in mysql.h
2006-12-06 19:13:00 -05:00
brian@zim.(none)
31d67280f7 This finishes the work (someone) started to remove FIELD_ types and use the Enum MYSQL types. The second part to this is to actually deprecate the FIELD defines in mysql_com.h 2006-12-01 17:26:52 -08:00
holyfoot/hf@mysql.com/deer.(none)
db5db841a9 Merge bk@192.168.21.1:mysql-4.1
into  mysql.com:/home/hf/work/mysql-4.1-mrg
2006-11-16 20:44:37 +04:00
msvensson@neptunus.(none)
e0985bef96 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-10-24 21:05:35 +02:00
msvensson@neptunus.(none)
1a7676fa65 WL#3462 Add testing of MySQL client ABI to prevent unintentional ABI breaks
BUG#23427 incompatible ABI change in 5.0.26?
   - Use the icheck tool if avaliable and compare the current mysql.h to a version
controlled reference file
2006-10-24 20:32:07 +02:00
holyfoot/hf@mysql.com/deer.(none)
d0ef58b6a4 Bug #23427 (incompatible ABI change)
the incompatibility was caused by current_stmt member added to the MYSQL
structure.
It's possible to move it to THD structure instead which saves ABI
2006-10-24 17:19:02 +05:00
cmiller@zippy.cornsilk.net
b96ab282ea Bug #23427: incompatible ABI change in 5.0.26?
Revert 1 June change enough to restore ABI compatibility with previous
versions.
2006-10-20 17:17:24 -04:00
cmiller@zippy.cornsilk.net
5ea2a01fee Merge zippy.cornsilk.net:/home/cmiller/work/mysql/release/mysql-5.0-release_mergable
into  zippy.cornsilk.net:/home/cmiller/work/mysql/release/mysql-5.0-maint
2006-08-25 11:55:43 -04:00
cmiller@zippy.cornsilk.net
89d759b93e Bug#21543: 5.0.24 breaks ABI compatibility for python bindings: \
InterfaceError on connect

Removed the bool flag from the st_mysql_options struct, since it adds 
another word in size to the memory size and shifts member memory locations
down, both of which break binary-interface compatibility.

Instead, use a flag, 2**30, in the client_options bit-field to represent
that the client should check the SSL certificate of the server.
2006-08-25 11:54:33 -04:00
kostja@bodhi.local
4bfc67fc3c Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
2006-08-02 14:13:01 +04:00
kostja@bodhi.local
2ce1a07c89 A fix and a test case for Bug#15752 "Lost connection to MySQL server
when calling a SP from C API"

The bug was caused by lack of checks for misuse in mysql_real_query. 
A stored procedure always returns at least one result, which is the 
status of execution of the procedure itself.
This result, or so-called OK packet, is similar to a result
returned by INSERT/UPDATE/CREATE operations: it contains the overall
status of execution, the number of affected rows and the number of
warnings. The client test program attached to the bug did not read this 
result and ivnoked the next query. In turn, libmysql had no check for 
such scenario and mysql_real_query was simply trying to send that query 
without reading the pending response, thus messing up the communication
protocol.

The fix is to return an error from mysql_real_query when it's called
prior to retrieval of all pending results.
2006-07-24 14:56:53 +04:00
holyfoot/hf@mysql.com/deer.(none)
bed7b69243 Merge mysql.com:/home/hf/work/mysql-4.1.mrg
into  mysql.com:/home/hf/work/mysql-5.0.mrg
2006-07-18 14:52:29 +05:00
holyfoot@deer.(none)
bc35c50063 bug #16017 (memory leaks in embedded server)
There actually was 3 different problems -
hash_user_connections wasn't cleaned
one strdupped database name wasn't freed
and stmt->mem_root wasn't cleaned as it was
replased with mysql->field_alloc for result
For the last one - i made the library using stmt's
fields to store result if it's the case.
2006-06-01 17:06:42 +05:00
msvensson@neptunus.(none)
31db4898c3 Merge neptunus.(none):/home/msvensson/mysql/bug17208/my50-bug17208
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-04-26 22:24:25 +02:00
msvensson@neptunus.(none)
29ace143a1 Backport fix for mysql client not using SSl library directly
- Add function mysql_get_ssl_cipher
 - Use function mysql_get_ssl_cipher from mysql
2006-04-22 00:48:13 +02:00
msvensson@neptunus.(none)
a51668c74c Bug#17208 SSL: client does not verify server certificate
- Add new function 'ssl_verify_server_cert' which is used if we are 
   connecting to the server with SSL. It will compare the hostname in 
   the server's cert against the hostname that we used when connecting 
   to the server. Will reject the connection if hostname does not match.
 - Add new option "OPT_SSL_VERIFY_SERVER_CERT" to be passed to mysql_options
   which will turn on checking of servers cert.
 - Add new argument "ssl-verify-server-cert" to all mysql* clients which 
   will activate the above option.
 - Generate a new server cert with 1024 bits that has "localhost" as the server name.
2006-04-18 17:58:27 +02:00
monty@mysql.com
3dcbbb7c4d Safer fix for Bug #18435 "5.0.19 libmysqlclient not ABI-compatible with 5.0.18"
This fixes the problem if someone is using struct MYSQL as part of another structure together with a shared
library
2006-03-27 12:02:23 +03:00
monty@mysql.com
82b77cdd90 Fixes to embedded server to be able to run tests with it
(Needed for "list of pushes" web page and autopush)
2006-02-24 18:34:15 +02:00
serg@serg.mylan
e5e22395c9 compatibility define for Bug#15293 2005-12-05 20:47:15 +01:00
jimw@mysql.com
3be42aabc5 Merge mysql.com:/home/jimw/my/mysql-5.0-11787
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-09-03 09:34:34 -07:00
georg@lmy002.wdf.sap.corp
21a88afeed minor fix (backport from 5.0) - changed function prototype/definition 2005-07-19 17:12:00 +02:00
georg@lmy002.wdf.sap.corp
53c630a524 Restore previous used client charset in mysql_reconnect
Moved mysql_set_character_set function to client.c
Changed function prototype for mysql_set_character_set (as suggested
by Konstantin)
2005-07-16 07:13:40 +02:00
georg@lmy002.wdf.sap.corp
55d413252f changes after Bar's review: renamed CHARACTER_SET to MY_CHARSET_INFO 2005-07-12 10:58:21 +02:00
georg@lmy002.wdf.sap.corp
ceba4ee9cd New attempt after Bar's review
Added api function mysql_get_character_set_info which provides
information about the current client character set.
2005-07-12 10:31:43 +02:00
jimw@mysql.com
bef1c77789 Make it possible to change reconnect setting with
mysql_options(..., MYSQL_OPT_RECONNECT, ...). (Bug #11787)
2005-07-06 16:29:31 -07:00
serg@serg.mylan
6e37d8c15d FIELD_TYPE_NEWDECIMAL is numeric too 2005-06-01 09:32:05 +02:00
konstantin@mysql.com
f1916b87d2 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/opt/local/work/mysql-5.0-9643
2005-05-16 18:29:04 +04:00
konstantin@mysql.com
38d68559bf A fix and a test case for Bug#9643 " CURSOR_TYPE_SCROLLABLE dos not work"
- check on the client the unsupported feature and return 
an error message if it's been requested.
Additionally added API support for STMT_ATTR_PREFETCH_ROWS.
Post-review fixes.
2005-05-16 18:27:21 +04:00
konstantin@mysql.com
89bd09fed2 Manual merge (again) 2005-05-14 12:38:12 +04:00
georg@lmy002.wdf.sap.corp
41d284e608 added prototype for mysql_set_character_set function 2005-05-13 15:54:35 +02:00