Commit graph

1261 commits

Author SHA1 Message Date
Sergei Golubchik
5d16592d44 mysql-5.5.38 merge 2014-06-03 09:55:08 +02:00
Sergei Golubchik
926661ac7c MDEV-6273 Export my_progname symbol in libmysqlclient.so 2014-05-27 20:57:28 +02:00
Sergei Golubchik
2221029f54 MDEV-6131 Unable to build Connector/ODBC 5.2.5 undefined reference to `my_charset_latin1'
Add charsets to the client API
(they are declared with MYSQL_PLUGIN_IMPORT, meaning the intention is to have them public)
2014-05-05 12:51:11 +02:00
Nisha Gopalakrishnan
501de3a027 BUG#18080920: CRASH; MY_REALLOC_STR DEREFERENCES NEGATIVE VALUE
INTO CLIENT_ERRORS ARRAY
              
Analysis:
--------
The client may crash while executing a statement due to
the missing mapping of the server error to it's equivalent
client error.

When trying to reallocate memory for the packet buffer, if
the system is out of memory or the packet buffer is large,
the server errors 'ER_OUT_OF_RESOURCES' or 'ER_PACKET_TOO_LARGE'
is returned respectively. The client error number calculated is
negative and when trying to dereference the array of client 
error messages with the calculated error number, the client
crashes.

Fix:
----
Map the server error returned to it's equivalent client error
prior to dereferencing the array of client error messages.

Note: Test case is not added since it is difficult to simulate
the error condition.
2014-04-24 09:30:21 +05:30
Sergei Golubchik
cb0a661cd7 don't put libmysqlclient symbols extra-used on debian
in the libmysqlclient_16 version node.
2014-03-25 17:34:45 +01:00
Sergei Golubchik
31bf348449 MDEV-5773 symbol list_add, version libmysqlclient_18 not defined in file libmysqlclient.so.18 with link time reference
MDEV-5763 libmyodbc.so: undefined symbol: int2str
MDEV-5739 Symbol missing in libmysqlclient.so.18 (make_scrambled_password)

pam_mysql and especially myodbc need tons of internal symbols on Debian, argh!
2014-03-19 10:03:34 +01:00
Sergei Golubchik
afcd7091a0 MDEV-5529 Sync libmysqlclient.so symbol versioning across distributions
An attempt to introduce libmysqlclient.so symbol versioning that is
compatible both with Debian and Fedora all versions: put all symbols into
libmysqlclient_18 version node (as on Debian), but also put aliases of
old symbols into libmysqlclient_16 version node (as on Fedora).

Also use a linker script to create aliases of exported symbols, not
rpm_support.cc source file.
2014-02-19 21:39:16 +01:00
Sergei Golubchik
84651126c0 MySQL-5.5.36 merge
(without few incorrect bugfixes and with 1250 files where only a copyright year was changed)
2014-02-17 11:00:51 +01:00
Tor Didriksen
e613d2ed00 Backport of Bug#16809055 MYSQL 5.6 AND 5.7 STILL USE LIBMYSQLCLIENT.SO.18
Backported only the softlink part of the patch,
*not* the bumping of library version.

With this patch, the libmysql/ directory contains:
libmysqlclient.a
libmysqlclient_r.a -> libmysqlclient.a
libmysqlclient_r.so -> libmysqlclient.so*
libmysqlclient_r.so.18 -> libmysqlclient.so.18*
libmysqlclient_r.so.18.0.0 -> libmysqlclient.so.18.0.0*
libmysqlclient.so -> libmysqlclient.so.18*
libmysqlclient.so.18 -> libmysqlclient.so.18.0.0*
libmysqlclient.so.18.0.0*
2014-01-23 09:02:47 +01:00
Sergei Golubchik
37d240ecf9 MySQL-5.5.35 merge 2014-01-22 15:29:36 +01:00
Murthy Narkedimilli
c92223e198 Updated/added copyright headers 2014-01-06 10:52:35 +05:30
Alexey Botchkov
fb2de58294 MDEV-5321 Calling mysql_library_end accesses freed memory; dumps memory to display.
Don't call the vio_end() in the clean_up() in EMBEDDED mode.
        Call vio_end() before the end_embedded_server().
2013-11-25 21:38:01 +04:00
Sreedhar.S
c8c948ffa6 Bug 13878021 - WINDOWS PACKAGE THAT INCLUDES .PDB FILES FOR INTERMEDIATE LIBRARIES USED 2013-10-09 11:10:46 +05:30
Sergei Golubchik
005c7e5421 mysql-5.5.32 merge 2013-07-16 19:09:54 +02:00
Alexander Barkov
1f3ec9800c Merging from 5.3
modified:
  include/my_time.h
  libmysql/libmysql.c
  mysql-test/r/adddate_454.result
  mysql-test/r/cast.result
  mysql-test/r/date_formats.result
  mysql-test/r/func_sapdb.result
  mysql-test/r/func_time.result
  mysql-test/r/mdev316.result
  mysql-test/r/parser.result
  mysql-test/r/partition_datatype.result
  mysql-test/r/partition_pruning.result
  mysql-test/r/type_date.result
  mysql-test/r/type_datetime.result
  mysql-test/suite/vcol/r/vcol_misc.result
  mysql-test/t/cast.test
  sql-common/my_time.c
  sql/field.cc
  sql/field_conv.cc
  sql/filesort.cc
  sql/item.cc
  sql/item.h
  sql/item_cmpfunc.cc
  sql/item_func.cc
  sql/item_strfunc.cc
  sql/item_timefunc.cc
  sql/sql_time.cc
pending merges:
  Sergei Golubchik 2013-07-03 MDEV-4667 DATE('string') incompability betwe...
2013-07-08 16:49:42 +04:00
Sergei Golubchik
78cc6db44a MDEV-4667 DATE('string') incompability between mysql and mariadb
Cleanup: remove TIME_FUZZY_DATE.

Introduce TIME_FUZZY_DATES which means "very fuzzy, the resulting
value is only used for comparison. It can be invalid date, fine, as long as it can be
compared".

Updated many tests results (they're better now).
2013-07-03 09:46:20 +02:00
Sergei Golubchik
b381cf843c mysql-5.5.31 merge 2013-05-07 13:05:09 +02:00
Vladislav Vaintroub
db65e4f537 Fixes for Windows XP 2013-03-26 10:34:21 +01:00
Vladislav Vaintroub
bfac7d637f MDEV-4330 - get_tty_password() does not work if input redirection is used.
The reason is the limitation of ReadConsole() API, it returns error if handle to redirected  input  is used.
  
 The fix is to use a  handle returned by CreateFile("CONIN$",...), rather than GetStdHandle(STD_HANDLE_INPUT) to get the true console handle.
2013-03-26 08:17:22 +01:00
Murthy Narkedimilli
8afe262ae5 Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 15:53:48 +01:00
Vladislav Vaintroub
6c4f41ff32 MDEV-4216 : export additional functions mysql_get_timeout_value(),mysql_get_timeout_value_ms(), mysql_get_socket() from shared client library. They are documented as part of async API.
Also, remove  functions mysql_close_slow_part_start() and mysql_close_slow_part_cont() from exports - they are not documented anywhere.
2013-03-01 20:58:19 +01:00
Vladislav Vaintroub
c6d31b279b MDEV-4021 : Enable Ctrl-C handler when reading password, on Windows.
Prior to this patch, _getch() was used to read password input from console. getch() has a property that it reads Ctrl-C as character with ASCII code 0x03, and disregards Ctrl-C handler for  current process. 
The fix is to use ReadConsole() API instead of getch() , after setting console mode to ENABLE_PROCESSED_INPUT - this mode allows current process to handle Ctrl-C events.
2013-02-21 21:46:24 +01:00
Vladislav Vaintroub
4e9b5ff543 fix typo 2013-02-18 20:51:36 +01:00
Vladislav Vaintroub
0995ab2e1a MDEV-4183: Export additional symbols from RPMs , compatibly to distribution RPMs.
-Ensure that symbols listed in CLIENT_API_EXTRA are not thrown away by the linker.
-Add THR_KEY_mysys to this list, because Fedora18 exports it.
2013-02-18 20:35:11 +01:00
Vladislav Vaintroub
bfd179e8ed MDEV-4127 : Export additional symbols when building RPM,
to enable both recompiling mysqli or odbc from sources in addition to drop-in replacement functionality.

The case in question is compiling mysqli from sources, that needs client_errors via ER() macro.

Previously, we exported it as mysql_client_errors (compatibly to Fedora's style symbol renaming, see MDEV-3842).
However, if MariaDB header files are used when compiling mysqli, client_errors needs to be exported with its original name.
2013-02-04 15:43:26 +01:00
unknown
f08a404a6d MDEV-4091: Dynamic columns C functions should be included in libmysqlclient 2013-01-28 13:49:14 +02:00
Vladislav Vaintroub
76400fcc25 MDEV-3842, MDEV-3923 :
Miscellaneous workarounds for  drop-in compatibility problems with Linux distributions, arounf versioning of the 
MySQL 5.5 client shared library. There seems to be 3 different ways major distributions handle versioning

1. Fedora  (also Mageia, and likely  other Redhat descendants) way 
   old, 5.1 API functions are given version libmysqlclient_16
   new API functions  (client plugins, mysql_stmt_next ) are given version libmysqlclient_18
   some extra functions beyond API are exported.
   some functions are renamed.

2.Debian Wheezy way 
  all functions are given libmysqlclient_18 version

3. Ubuntu  way (or MySQL/MariaDB download packages)
  no versioning

UIp to this fix, MariaDB distributions did not have any versioning in the libraries, this rendered client library incompatible to distributions 
thus exchanging  distribution's libmysqlclient.so.18.0.0  with MariaDB's did not work nicely (anywhere but on Ubuntu)


THE FIX  
is to build libraries the same way as distributions do it 
- when building RPMs, use  same version script as Fedora does, Make sure to export extra-symbols, the same as Fedora exports.
- when building DEBs, use the same version script as Debian Wheezy
- do not use version scripts otherwise


Also, makes sure that extensions of  MySQL APIs (asynchronous client functionality) is exported by  the shared libraries.
2013-01-25 17:26:10 +01:00
Venkata Sidagam
3fa76fd05d Bug #14553380 MYSQL C API LIBRARY EXITS AT NET_CLEAR AT NET_SERV.CC:223
Problem description: When client loses the connection to the MySQL server or 
if the server gets shutdown after mysql_stmt_prepare() then the next 
mysql_stmt_prepare() will return an error(as expected) but consecutive call 
mysql_stmt_execute(), will crash the client program. 
The expected behavior would be, it should through an error.

Analysis: The mysql_stmt_prepare() interns calls the function end_server() 
and net->vio and net->buff are freed and set to NULL. Then the next call 
mysql_stmt_execute() will interns call net_clear() where we are "net->vio" 
with out validating it.

Fix: we are validating the net->vio, before calling net_clear().
2013-01-10 16:37:20 +05:30
Tor Didriksen
c8ab849365 merge 5.1 => 5.5 2012-11-01 17:33:55 +01:00
Tor Didriksen
86c0a80b0d Bug#14840488 VALGRIND ERRORS IN MYSQL_CLIENT_TEST
Add missing DBUG_RETURNs, otherwise the debug-stack gets messed up,
and _db_enter_ and _db_exit_ will access data outside the current stack frame.
2012-11-01 17:23:06 +01:00
Vladislav Vaintroub
b8ca6c2e68 MDEV-546 : error when compiling client library - incorrect client_settings.h
Remove sql directory from the include path to workaround the problem. This removes the ambiguity , since then only one client_settings.h will be in the include paths
2012-09-25 00:46:54 +02:00
Sergei Golubchik
f72a765997 5.2 merge.
two tests still fail:
  main.innodb_icp and main.range_vs_index_merge_innodb
  call records_in_range() with both range ends being open
  (which triggers an assert)
2012-08-22 16:45:25 +02:00
Sergei Golubchik
1fd8150a5b 5.1 merge
increase xtradb verson from 13.0 to 13.01
2012-08-22 16:13:54 +02:00
Sergei Golubchik
cefc30b166 merge with MySQL 5.1.65 2012-08-22 11:40:39 +02:00
Sergei Golubchik
d11829654c merge with MySQL 5.5.27
manually checked every change, reverted incorrect or stupid changes.
2012-08-09 17:22:00 +02:00
Sergei Golubchik
0117a92fed MDEV-419 ensure that all HAVE_XXX constants can be set by cmake
add missing checks to configure.cmake
remove dead code and unused HAVE_xxx constants from the sources
2012-07-31 19:29:07 +02:00
Georgi Kodinov
e65c291807 merge bug#13708485 5.1->5.5 2012-06-29 16:54:55 +03:00
Georgi Kodinov
107c894a54 Bug #13708485: malformed resultset packet crashes client
Several fixes :

* sql-common/client.c
Added a validity check of the fields metadata packet sent 
by the server.
Now libmysql will check if the length of the data sent by
the server matches what's expected by the protocol before
using the data.

* client/mysqltest.cc
Fixed the error handling code in mysqltest to avoid sending
new commands when the reading the result set failed (and 
there are unread data in the pipe).

* sql_common.h + libmysql/libmysql.c + sql-common/client.c
unpack_fields() now generates a proper error when it fails.
Added a new argument to this function to support the error 
generation.

* sql/protocol.cc
Added a debug trigger to cause the server to send a NULL
insted of the packet expected by the client for testing 
purposes.
2012-06-28 18:38:55 +03:00
Sergei Golubchik
20e706689d mysql-5.5.22 merge
mysql-test/suite/innodb/t/group_commit_crash.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysys/my_addr_resolve.c:
  a pointer to a buffer is returned to the caller -> the buffer cannot be on the stack
mysys/stacktrace.c:
  my_vsnprintf() is ok here, in 5.5
2012-03-28 01:04:46 +02:00
Sergei Golubchik
4933d21e5d merge with mysql-5.5.21 2012-03-09 08:06:59 +01:00
MySQL Build Team
7a35cb9150 Updated/added copyright headers 2012-02-16 10:48:16 +01:00
unknown
9305f2b52f Merge latest MariaDB 5.5 into MWL#192: Non-blocking client library. 2012-02-22 12:14:34 +01:00
unknown
f6b68a1070 Merge MWL#192: Non-blocking client library, into MariaDB 5.5. 2012-02-21 22:15:44 +01:00
Sergei Golubchik
25609313ff 5.3.4 merge 2012-02-15 18:08:08 +01:00
Igor Babaev
7b79d8a33f Merge 5.2->5.3 in preparation for the release of mariadb-5.3.4-rc. 2012-02-01 15:48:02 -08:00
Tor Didriksen
2a5d233881 Bug#13604121 - LIBMYSQLCIENT.SO MISSING SOME FUNCTIONS PRESENT IN LIBMYSQLCLIENT.A
+get_tty_password  this is the only external symbol in get_password.c,
                   which is explicitly listed in CLIENT_SOURCES
+handle_options    this is in mysys/my_getopt.c
                   adding this sysmbol pulls in the other externals:
T getopt_compare_strings
T getopt_double_limit_value
T getopt_ll_limit_value
T getopt_ull_limit_value
T handle_options
T my_cleanup_options
T my_getopt_register_get_addr
T my_print_help
T my_print_variables
2012-01-30 10:08:22 +01:00
Sergei Golubchik
1433621c14 fixes for non-debug builds (CMAKE_BUILD_TYPE=Release or RelWithDebInfo)
client/CMakeLists.txt:
  1. -rdynamic is a linker flag.
  2. it should be used in all builds, not debug only
libmysql/get_password.c:
  prefer a standard function, when possible
  (otherwise a plugin will need to load it from the client)
2012-01-17 09:11:20 +01:00
Sergei Golubchik
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
Sergei Golubchik
3c1125d4ca fixes for get_password():
1. on windows: don't hang when there's no console, that is, _getch() returns -1. 
2. on windows: _getch() returns an int, not char.
   to distinguish between (char)255 and (int)-1
3. everywhere. isspace(pos[-1]) == ' ' never worked,
   isspace() returns a boolean, not a char. the never-worked loop was
   removed to preserve the existing behavior.
2012-01-12 20:12:14 +01:00
Sergei Golubchik
745c53ec06 5.2->5.3 merge 2011-12-12 13:00:33 +01:00