mariadb/include
unknown 36510232aa 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.


client/mysqlbinlog.cc:
  net_safe_read -> cli_safe_read
include/mysql.h:
  Remove a private function from the public header.
include/mysql_com.h:
  Remove a define that is never used.
include/sql_common.h:
  Add a declaration for cli_safe_read - a function that reads one packet
  from the server.
libmysql/libmysql.c:
  net_safe_read -> cli_safe_read
  Return CR_COMMANDS_OUT_OF_SYNC on attempt to execute a statement
  using a connection which has pending result sets.
sql-common/client.c:
  Actual fix for Bug#15752: if the server has pending result sets for
  the client, return CR_COMMANDS_OUT_OF_SYNC on attempt to execute
  another query. Similarly to the behaviour of mysql_use_result(),
  multiple result sets block the connection and must be fetched
  before it can be used for another query.
  This uncovered an error in the protocol: the server doesn't drop
  SERVER_MORE_RESULTS_EXISTS status flag upon an error, so in case of
  a multi-query like SELECT 1; SELECT syntax_error; SELECT 2; 
  the client has no way to know that the server won't ever come to 
  execution of the third query and won't return any result sets for it.
  For now, fix it in cli_safe_read, as a proper fix requires extension
  of the client-server protocol.
sql/protocol.cc:
  Remove a name that is never used.
sql/slave.cc:
  net_safe_read -> cli_safe_read
tests/mysql_client_test.c:
  Make 'query' a local variable to avoid name clash.
  Add a test case for Bug#15752 "Lost connection to MySQL server when
  calling an SP from C API"
2006-07-24 14:56:53 +04:00
..
.cvsignore
base64.h WL#2835: Base64 mysys functions 2005-10-14 01:14:23 +02:00
config-netware.h Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1 2006-01-12 20:28:23 +02:00
config-os2.h Implemented UTC_TIME, UTC_DATE and UTC_TIMESTAMP functions (WL#345) 2003-08-11 23:43:01 +04:00
config-win.h Fixed Bug#19479:mysqldump creates invalid dump. 2006-06-01 12:34:44 +03:00
decimal.h A lot of fixes to Precision math 2005-05-05 20:06:49 +05:00
errmsg.h A fix and a test case for Bug#9643 " CURSOR_TYPE_SCROLLABLE dos not work" 2005-05-16 18:27:21 +04:00
ft_global.h indexless boolean fulltext search was depending on default_charset_info - Bug#8159 2005-02-04 15:24:06 +01:00
hash.h A fix for Bug#7209 "Client error with "Access Denied" on updates 2006-01-04 17:35:30 +03:00
heap.h Bug #12796: Record lost in HEAP table 2005-11-08 00:26:37 -05:00
help_end.h Several fixes for Netware. 2005-08-24 22:03:34 +03:00
help_start.h Several fixes for Netware. 2005-08-24 22:03:34 +03:00
keycache.h Bug#12920 - key_read_requests counter appears to re-set 2005-09-14 13:18:16 +02:00
m_ctype.h Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1 2006-03-23 14:29:43 +04:00
m_string.h Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1-tmp 2005-10-13 18:23:53 +03:00
Makefile.am Fix for Bug#18246 "compilation error with tcp_wrapper" 2006-06-21 02:23:18 +03:00
md5.h
my_aes.h
my_alarm.h
my_alloc.h Fix incorrect spellings of "dropped" in source and tests. (Bug #12828) 2005-08-30 12:24:37 -07:00
my_base.h Fix for bug#18437 "Wrong values inserted with a before update trigger on 2006-07-02 01:51:10 +04:00
my_bitmap.h Bug#10932 - Building server with key limit of 128, makes test cases fail 2005-07-19 14:13:56 +02:00
my_dbug.h Fix two Valgrind memory leak warnings. 2006-05-15 18:07:18 +02:00
my_dir.h Fix for Bug #1952 2003-12-12 03:39:29 +03:00
my_getopt.h Merge with 4.0 2004-09-01 04:12:09 +03:00
my_global.h mysql.spec.sh: 2006-06-30 02:49:28 +02:00
my_handler.h After merge fixes 2006-06-30 20:07:33 +03:00
my_libwrap.h Cleanup to patch for Bug#18246, "compilation error with tcp_wrapper" 2006-06-21 18:35:19 +03:00
my_list.h Rename rest() macro in my_list.h to list_rest(). (Bug #12327) 2005-08-09 18:02:36 -07:00
my_net.h BUG#7384 IM fails to compile on Solaris. 2004-12-18 03:21:20 +03:00
my_no_pthread.h Include the system header file "pthread.h" even in a non-threaded build. 2006-03-10 17:13:54 +01:00
my_nosys.h
my_pthread.h Merge neptunus.(none):/home/msvensson/mysql/my41-bug13711 2006-05-19 13:09:15 +02:00
my_semaphore.h more #ifdef THREAD added 2003-04-30 12:32:43 +02:00
my_sys.h my_sys.h: 2006-07-01 15:11:59 +02:00
my_time.h Fixes during review of new pushed code 2005-07-31 12:49:55 +03:00
my_tree.h BUG#18160 - Memory-/HEAP Table endless growing indexes 2006-04-19 15:13:50 +05:00
my_user.h Fix for BUG#15110: mysqldump --triggers: does not include DEFINER clause 2006-01-11 02:07:40 +03:00
my_xml.h Portability fixes 2003-02-28 14:32:40 +02:00
myisam.h WL#2645 (CHECK TABLE FOR UPGRADE) 2006-02-17 10:52:32 +04:00
myisammrg.h key_cmp -> key_cmp_if_same 2004-05-16 14:48:32 +03:00
myisampack.h Casted all macro arguments, 2004-07-28 21:46:22 +02:00
mysql.h A fix and a test case for Bug#15752 "Lost connection to MySQL server 2006-07-24 14:56:53 +04:00
mysql_com.h A fix and a test case for Bug#15752 "Lost connection to MySQL server 2006-07-24 14:56:53 +04:00
mysql_embed.h remove the rest of isam/merge references 2005-04-05 13:17:49 +02:00
mysql_time.h Fix for bug #6266 "Invalid DATETIME value is not handled properly". 2004-11-15 15:44:29 +03:00
mysql_version.h.in Merge with 4.0 to get fixes for Windows project files 2004-05-25 02:47:25 +03:00
mysys_err.h Show all generated warnings in SHOW ERROR 2005-02-24 23:33:42 +02:00
queues.h Fix for BUG#4177: 2004-11-21 11:51:19 +03:00
raid.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
rijndael.h
sha1.h A fix for Bug#13944 "libmysqlclient exporting sha1_result function": 2006-01-11 17:31:52 +03:00
sql_common.h A fix and a test case for Bug#15752 "Lost connection to MySQL server 2006-07-24 14:56:53 +04:00
sslopt-case.h
sslopt-longopts.h Merge mysql.com:/home/jimw/my/mysql-5.0-1039 2006-05-19 16:17:24 -07:00
sslopt-vars.h Merge mysql.com:/home/jimw/my/mysql-5.0-1039 2006-05-19 16:17:24 -07:00
t_ctype.h
thr_alarm.h Added patches from Novell 2004-05-25 22:00:14 +03:00
thr_lock.h Merge mysql.com:/home/my/mysql-4.1 2005-07-28 17:09:54 +03:00
typelib.h Bug#6202: ENUMs are not case sensitive even if declared BINARY 2004-10-25 17:51:26 +05:00
violite.h Add new define YASSL_PREFIX beforee including ssl.h to activate inclusion of prefix_*.h files 2006-05-31 22:21:40 +02:00