Commit graph

50845 commits

Author SHA1 Message Date
unknown
f0e24c795f Merge bk-internal.mysql.com:/home/bk/mysql-5.1-community
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-forcollapseandmerge


sql/ha_ndbcluster.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
sql/sql_parse.cc:
  Manual merge.
sql/sql_select.cc:
  Manual merge.
2007-11-09 14:55:32 -05:00
unknown
69aee07373 Rewrite profiler code to be easier to maintain and less buggy.
Between 5.0 and 5.1, the step of incrementing the global query id
changed, which broke how the profiler noticed when a new query had
started.  That reset the state list and caused all but the last 
five (or so) states to be thrown away.

Now, don't watch for query_id changes in the lower level.

Add a bogus state change at the end of profiling so that the last 
real state change is timed.

Emit source reference for the start of the span of time instead of
the end of it.


mysql-test/r/profiling.result:
  Add a test that shows continuation of execution with multi-statement
  packets.
mysql-test/t/profiling.test:
  Add a test that shows continuation of execution with multi-statement
  packets.
sql/sql_parse.cc:
  Insert profiling calls at beginnings and ends of each query.
  
  Remove the old way of keeping or discarding profiles, and flipping 
  to new query profiles.
sql/sql_profile.cc:
  No longer use the thread's query_id to determine when we flip
  to a new statement.
  
  Some status statements are set to be NULL in the server.  We don't
  log those, as it doesn't fit this style of profiling yet.
  
  Rewrite the parser code to be more active and legible.  
  
  Relying on passive/lazy discovery of new queries was buggy.
  
  Add a bogus status change before ending a profile, so that the 
  previous real status has a endpoint.
  
  Emit source reference of the start of the span-of-time instead of
  the end of it.
sql/sql_profile.h:
  Store the server_query_id at instantiation time for a new query.
  
  Rewrite the parser code to be more active.  Relying on passive/lazy
  discovery of new queries was buggy.
  
  Name first state to more honestly describe the state.  We don't 
  really know of initialization that will follow.
sql/sql_show.cc:
  Update comment to note the decidedly weird field_length behavior
  on Decimal types in information_schema.
2007-11-09 14:45:44 -05:00
unknown
10397af9c5 Merge kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1
into  kindahl-laptop.dnsalias.net:/home/bk/b31611-mysql-5.1-target-5.1.22


sql/sql_binlog.cc:
  Auto merged
2007-11-08 08:54:19 +01:00
unknown
af48b26ed8 Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-runtime
2007-11-06 11:31:00 -07:00
unknown
c33d42eb32 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  magare.gmz:/home/kgeorge/mysql/autopush/B31974-5.1-runtime
2007-11-06 15:41:12 +02:00
unknown
17698ca0bb Bug #31974: additional commit (test case updates)
loose index scan enabled for subqueries


mysql-test/r/group_min_max.result:
  Bug #31974: test case updates
   loose index scan enabled for subqueries
mysql-test/r/index_merge_myisam.result:
  Bug #31974: test case updates
   loose index scan enabled for subqueries
2007-11-06 15:29:55 +02:00
unknown
cecc270212 fixed coding style
sql/sql_yacc.yy:
  Fixed coding style (tabs)
2007-11-05 16:52:04 -07:00
unknown
b5bf2f73fc Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-runtime
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge


sql/sql_acl.cc:
  Auto merged
2007-11-05 16:34:10 -07:00
unknown
56d00051a0 Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-base
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge


sql/handler.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
2007-11-05 10:20:20 -07:00
unknown
441b86087a Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-base
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-rt-merge
2007-11-05 09:50:09 -07:00
unknown
cda4afc2bf BUG#31611 (Security risk with BINLOG statement):
Incremental patch to remove redundant, but benign, my_error() call.


sql/sql_binlog.cc:
  Removing redundant error reporting.
2007-11-05 14:24:20 +01:00
unknown
5d8ade4b1e Merge mysqldev@production:/data0/mysqldev/my/mysql-5.1-release
into  kindahl-laptop.dnsalias.net:/home/bk/b31611-mysql-5.1-target-5.1.22
2007-11-05 13:46:46 +01:00
unknown
8a1ede49e1 workaround for case insensitive filesystems 2007-11-05 13:33:20 +01:00
unknown
860f7db3b9 Bug #31974: Wrong EXPLAIN output
The fix for bug 31148 is not correct. It does not
have a relation to the problem described in this bug.
And removing the fix will not make the bug to re-appear.
Fixed the bug #31974 by removing the fix for bug 31148
and adding a test case.


mysql-test/r/key.result:
  Bug #31974: test case
mysql-test/t/key.test:
  Bug #31974: test case
sql/sql_select.cc:
  Bug #31974: revert the fix for bug 31148
2007-11-05 13:19:56 +02:00
unknown
b835c18a80 BUG#31611 (Security risk with BINLOG statement):
Adding check that the user executing a BINLOG statement has SUPER
privileges and aborting execution of the statement with an error
otherwise.


mysql-test/r/mysqlbinlog.result:
  Result change.
mysql-test/t/mysqlbinlog.test:
  Adding test that generates a BINLOG command for inserting data into a
  table and feed the BINLOG statement into the database as an untrusted
  user. Also checking that insertion into the table fails for that user
  and that the table only contain a single line: the original one inserted.
sql/sql_binlog.cc:
  Adding a check that the executor of the BINLOG command has
  SUPER privileges and give an error and abort execution if not.
2007-11-03 01:33:48 +01:00
unknown
d0b91efcb7 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-merge
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge


sql/ha_ndbcluster.cc:
  Auto merged
storage/ndb/include/ndbapi/Ndb.hpp:
  Auto merged
2007-11-02 23:40:19 +01:00
unknown
082bdc7eb1 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-merge


ndb/include/ndbapi/Ndb.hpp:
  Auto merged
2007-11-02 23:33:25 +01:00
unknown
e308ad708c Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-merge


sql/ha_ndbcluster.cc:
  Auto merged
2007-11-02 23:31:23 +01:00
unknown
6dbc0c5ab1 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-community
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1


CMakeLists.txt:
  Auto merged
configure.in:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
2007-11-02 12:02:22 -04:00
unknown
b01c89ed8c Fix several merge problems. There are many changes in 5.1 from 5.0
that affect profiling.


mysql-test/r/information_schema.result:
  Merge fixed.  This result moved to a new file.
sql/sql_parse.cc:
  Include profiling in statistics.
  
  Add hook for SHOW_PROFILE in execution.
sql/sql_profile.cc:
  Move/add the FEATURE_DISABLED warning to the I_S filling func.
  
  Fix merge, where a new member was added to ST_FIELD_INFO.
  
  orig_sql_command method was removed from Lex structure.
sql/sql_show.cc:
  Fix merge problem.
sql/sql_yacc.yy:
  orig_sql_command member removed from Lex structure in 5.1 .
2007-11-02 11:41:58 -04:00
unknown
6a79a2196f Cleanup the test case for Bug#32030 "DELETE does not return an error and
deletes rows if error evaluating WHERE"


mysql-test/r/ps.result:
  Disable warnings.
mysql-test/t/ps.test:
  Disable warnings.
2007-11-02 14:47:18 +03:00
unknown
bc8e5574ae Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime-inc-2
2007-11-02 02:40:23 +03:00
unknown
0c1bdcbd24 A fix for Bug#32030 "DELETE does not return an error and deletes rows if
error evaluating WHERE"

DELETE with a subquery in WHERE clause would sometimes ignore subquery
evaluation error and proceed with deletion.

The fix is to check for an error after evaluation of the WHERE clause
in DELETE.

Addressed review comments.


mysql-test/r/group_min_max.result:
  Update the test results to reflect the fix for Bug#32030.
mysql-test/r/ps.result:
  Update test results (Bug#32030)
mysql-test/t/group_min_max.test:
  Update the test case to reflect the fix for Bug#32030
mysql-test/t/ps.test:
  Add a test case for Bug#32030
sql/sql_delete.cc:
  Check for an error before calling send_ok(). Two different places are
  covered because the subquery code has slightly different execution
  paths depending on ps-protocol/old-protocol
2007-11-02 02:36:12 +03:00
unknown
fe6834439d Merge endora.local:/Users/davi/mysql/bugs/30882-5.1
into  endora.local:/Users/davi/mysql/mysql-5.1-runtime


sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
2007-11-01 20:48:14 -02:00
unknown
0e675d81ae Merge endora.local:/Users/davi/mysql/bugs/31850-5.1
into  endora.local:/Users/davi/mysql/mysql-5.1-runtime


sql/sql_connect.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2007-11-01 20:44:09 -02:00
unknown
611dbd0bb3 Bug#30882 Dropping a temporary table inside a stored function may cause a server crash
If a stored function that contains a drop temporary table statement
is invoked by a create temporary table of the same name may cause
a server crash. The problem is that when dropping a table no check
is done to ensure that table is not being used by some outer query
(or outer statement), potentially leaving the outer query with a
reference to a stale (freed) table.

The solution is when dropping a temporary table, always check if
the table is being used by some outer statement as a temporary
table can be dropped inside stored procedures.

The check is performed by looking at the TABLE::query_id value for
temporary tables. To simplify this check and to solve a bug related
to handling of temporary tables in prelocked mode, this patch changes
the way in which this member is used to track the fact that table is
used/unused. Now we ensure that TABLE::query_id is zero for unused
temporary tables (which means that all temporary tables which were
used by a statement should be marked as free for reuse after it's
execution has been completed).


mysql-test/include/handler.inc:
  Add test case for side effect of Bug#30882
mysql-test/r/handler_innodb.result:
  Add test case result for side effect of Bug#30882
mysql-test/r/handler_myisam.result:
  Add test case result for side effect of Bug#30882
mysql-test/r/sp-error.result:
  Add test case result for Bug#30882
mysql-test/t/sp-error.test:
  Add test case for Bug#30882
sql/event_db_repository.cc:
  Update close_thread_tables call, no more default values.
sql/mysql_priv.h:
  Remove implicit default parameters values of the close_thread_tables
  function as no callers are using it.
sql/slave.cc:
  Update close_thread_tables call, no more default values
sql/sp_head.cc:
  Update close_thread_tables call, no more default values
sql/sql_base.cc:
  Changed the approach to distinguishing currently unused temporary tables.
  Now we ensure that such tables always have TABLE::query_id set to 0 and
  use this fact to perform checks during opening and dropping of temporary
  tables. This means that we have to call close_thread_tables() even for
  statements which use only temporary tables. To make this call cheaper,
  we re-factored close_thread_tables() to not take LOCK_open unless there
  are open base tables.
sql/sql_handler.cc:
  Properly close temporary tables associated with a handler.
sql/sql_insert.cc:
  close_temporary_table is now merged into drop_temporary_table.
sql/sql_parse.cc:
  Now the condition doesn't cover all cases because close_thread_tables()
  must be called even for statements that use only temporary tables.
sql/sql_table.cc:
  Use drop_temporary_table which perform checks to verify if
  the table is not being used. Error path problem is due to
  a handler tables issue and is going to be addressed in bug
  31397.
sql/table.h:
  Rename previously unused clear_query_id and document the usage of
  query_id and open_by_handler.
2007-11-01 18:52:56 -02:00
unknown
8f0df2efe8 Bug#31850 Test crashes in "embedded" server
The mysql_change_user command fails to properly update the database pointer
when no database is selected, leading to "use after free" errors. The same
happens on the user privilege pointer in the thread security context.

The solution is to properly reset and update the database name. Also update
the user_priv pointer so that it doesn't point to freed memory.


sql/sql_connect.cc:
  After a successful call to check_user() without specifying a new
  database name, the previous database thd->db) is freed but the
  pointer is not updated to NULL.
sql/sql_parse.cc:
  Update the security_ctx->priv_user pointer as it is a alias for
  the user security_ctx->user pointer. Also remove unneeded cast,
  the x_free macro casts the argument.
2007-11-01 17:29:20 -02:00
unknown
81246745a9 disable test 2007-11-01 17:24:21 +01:00
unknown
6dd04c22a6 Cleanup execute_ddl_log_recovery() to not generate an error if
there is nothing to recover.

Discovered while working on Bug#12713


sql/sql_table.cc:
  Use MYF(0) in my_open() in read_ddl_log_header() called from
  execute_ddl_log_recovery() called during the server start up to not
  generate an error if no ddl log exists. This is not an erroneous situation,
  in fact it's the case in any server statrtup. The error was lost
  anyway, since it was pushed into the stack of the artificial thd.
2007-11-01 18:33:51 +03:00
unknown
e70f6a90db Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-net_end
2007-11-01 18:10:45 +03:00
unknown
3536c5d5f5 Use Internal_error_handler mechanism to silence ER_TOO_MANY_FIELDS
error in mysql_create_frm instead of
direct access to my_error() members.

This is a pre-requisite for the patch for Bug#12713.


sql/unireg.cc:
  Use Internal_error_handler mechanism to silence ER_TOO_MANY_FIELDS
  error in mysql_create_frm instead of
  direct access to my_error() members.
2007-11-01 18:06:46 +03:00
unknown
8c3a08e4ea Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge
2007-11-01 08:33:54 -06:00
unknown
ecef837931 Use thd->is_error() instead of direct access to thd->net.report_error
in evaluate_join_record().

A minor cleanup required for the fix for Bug#12713.


sql/sql_select.cc:
  Use thd->is_error() instead of direct access to thd->net.report_error
  in evaluate_join_record()
2007-11-01 17:08:02 +03:00
unknown
fbf75e0dcf Fix a compilation warning.
sql/sql_connect.cc:
  Fix a compilation warning (unused variable).
2007-11-01 17:00:24 +03:00
unknown
cf8275e086 Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-base
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge


sql/item_func.cc:
  Auto merged
2007-11-01 06:41:50 -06:00
unknown
74394b27fe Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-base
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-rt-merge
2007-11-01 06:35:22 -06:00
unknown
ad723cd5f8 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime-inc-2


sql/sql_parse.cc:
  Auto merged
2007-11-01 14:24:32 +03:00
unknown
f75923b1b9 disable tests
BitKeeper/etc/ignore:
  Added libmysql_r/client_settings.h to the ignore list
2007-11-01 12:02:41 +01:00
unknown
a9d61e097c Merge whalegate.ndb.mysql.com:/home/tomas/cge-5.1
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge
2007-11-01 11:37:32 +01:00
unknown
8011819ad1 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge
2007-11-01 11:33:04 +01:00
unknown
c67d7e67d2 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into  whalegate.ndb.mysql.com:/home/tomas/cge-5.1
2007-11-01 10:19:26 +01:00
unknown
6be01f7f52 Merge 10.102.0.1:/usr/local/mysql/mysql-5.0-ndb
into  loke.(none):/home/knielsen/devel/mysql-5.1-new-ndb


storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Null merge.
2007-11-01 08:30:18 +01:00
unknown
8890b29508 Bug #31848: Test failure: Cluster has problems on insert with auto-increment
Fix uninitialized variable causing failures for some interpreted update
operations on gcc 4.2.1.


ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Fix uninitialized variable causing failures for some interpreted update
  operations on gcc 4.2.1.
2007-11-01 07:59:55 +01:00
unknown
16bf418de5 Another attempt to fix the Windows compilation failre. 2007-11-01 00:55:25 +03:00
unknown
2848d22d5c Adding dbutil to ndb test lib
storage/ndb/test/include/dbutil.hpp:
  Hearder file for SQL Database Utilities class for adding MySQL SQL abilities to NDB API tests cases.
storage/ndb/test/src/dbutil.cpp:
  Implementation file for SQL Database Utilities class for adding MySQL SQL abilities to NDB API tests cases.
storage/ndb/test/src/Makefile.am:
  Updated to include dbutil
2007-10-31 22:37:10 +01:00
unknown
189ec0e0af A fix for Bug#32007 select udf_function() doesn't return an error if error
during udf initialization. The bug is spotted while working on Bug 12713.

If a user-defined function was used in a SELECT statement, and an
error would occur during UDF initialization, this error would not terminate
execution of the SELECT, but rather would be converted to a warning.

The fix is to use a stack buffer to store the message from udf_init instead
of private my_error() buffer.


mysql-test/r/udf.result:
  Update the result to reflect the fix for Bug#32007 select udf_function() 
  doesn't return an error if error during udf initialization
mysql-test/t/udf.test:
  Update the test to reflect the fix for Bug #32007 select udf_function() 
  doesn't return an error if error during udf initialization
sql/item_func.cc:
  A fix for Bug#32007.
  
  net.last_error buffer was used to store the temporary message from udf_init.
  Then, when my_error() was called, net.last_error was not empty so 
  my_error() would conclude that there is already an error in the error stack, 
  and not "overwrite" it.
  However, thd->net.report_error was not set, so the the 
  SELECT was not aborted.
  
  The fix is to use a stack buffer instead of thd->net.last_error
  to store the message from udf_init. The message will end up in
  thd->net.last_error anyway after a call to my_error.
2007-11-01 00:31:57 +03:00
unknown
cca4ea275b Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1


CMakeLists.txt:
  Auto merged
BitKeeper/deleted/.del-Makefile.am~2:
  Auto merged
BitKeeper/deleted/.del-README~1:
  Auto merged
BitKeeper/deleted/.del-configure.js:
  Auto merged
BitKeeper/deleted/.del-ha_berkeley.cc:
  Auto merged
BitKeeper/triggers/post-commit:
  Auto merged
client/CMakeLists.txt:
  Auto merged
extra/CMakeLists.txt:
  Auto merged
include/config-win.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/r/func_in.result:
  Auto merged
mysql-test/r/information_schema_db.result:
  Auto merged
mysql-test/t/func_in.test:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
server-tools/instance-manager/CMakeLists.txt:
  Auto merged
sql/CMakeLists.txt:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/lex.h:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/structs.h:
  Auto merged
storage/archive/ha_archive.cc:
  Auto merged
storage/myisam/CMakeLists.txt:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
storage/ndb/src/ndbapi/DictCache.cpp:
  Auto merged
BitKeeper/deleted/.del-mysqld.vcproj~6aa7b3f9c3e28fcb:
  Manual merge.
configure.in:
  Manual merge.
mysql-test/r/information_schema.result:
  Manual merge.
mysql-test/t/profiling.test:
  Manual merge.
sql/set_var.cc:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
sql/sql_profile.cc:
  Manual merge.
sql/sql_profile.h:
  Manual merge.
sql/sql_select.cc:
  Manual merge.
sql/sql_show.cc:
  Manual merge.
sql/table.h:
  Manual merge.
storage/ndb/src/common/util/File.cpp:
  Manual merge.
support-files/mysql.spec.sh:
  Manual merge.
2007-10-31 17:24:32 -04:00
unknown
bfae473053 Remove net_printf_error(). Do not talk to network directly in
check_user()/check_connection()/check_for_max_user_connections().

This is a pre-requisite patch for the fix for Bug#12713 "Error in a stored 
function called from a SELECT doesn't cause ROLLBACK of statem"

Implement review comments.


sql/mysql_priv.h:
  check_for_max_user_connections() is used in one place only, make it static.
sql/mysqld.cc:
  Remove net_printf_error(): a consolidation of error reporting facilities
  is necessary to simplify maintenance of the query cache, the 
  client-server protocol, stored procedure continue handlers. 
  Rewrite the only place where its use is somewhat justified 
  (my_error() can not be used since we need to report an error for the thread 
  that does not exist) with my_snprintf()/net_send_error().
sql/protocol.cc:
  Remove net_printf_error().
sql/protocol.h:
  Remove net_printf_error().
sql/sql_connect.cc:
  Remove net_printf_error(). In check_connection()/check_user()/
  check_for_max_user_connections() do not write directly to the network,
  but use the standard my_error() mechanism to record an error in THD.
  It will be sent to the client by the caller. This was the last place
  in the server that would attempt to send an error directly, mainly left 
  untouched by 5.0 refactoring because it is executed only during 
  thread startup.
sql/sql_parse.cc:
  In the old code, when res was greater than 0, it contained an exact 
  error code, e.g. ER_OUT_OF_RESOURCES or NO SUCH DATABASE, 
  or ER_HANDSHAKE_ERROR. I don't know the reason why this error code was 
  ignored, and instead a generic  ER_UNKNOWN_COM_ERROR was pushed into the
  error stack, but knowing the relaxed attitude towards preserving the error
  codes in the old code, I'm inclinded to think that it was a bug.
  
  After this patch, the most specific error message is already pushed,
  so calling my_message() again is useless.
  
  If res is < 0, the error used to be already sent. This is not done
  by the new code, but will be done later, in the end
  of dispatch_command(). When this is done, clear_error() will be called 
  for us - it is in the first lines of do_command.
  
  To sum up, this change is to remove COM_CHANGE_USER specific error handling
  in favor of the standard one employed for all other COM_* commands.
2007-11-01 00:10:58 +03:00
unknown
c2dadab136 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime-inc
2007-10-31 23:51:01 +03:00
unknown
d757ae80d6 Try to fix a Windows compilation warning.
sql-common/client.c:
  Move a block of auxiliary functions to the beginning of the file,
  to avoid compilation warnings on Windows.
  Add comments, albeit trivial, while we're at it.
2007-10-31 23:48:41 +03:00