2012-08-09 17:22:00 +02:00
|
|
|
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
|
|
|
|
Copyright (c) 2008, 2012, Monty Program Ab
|
2002-12-11 08:17:51 +01:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2006-12-23 20:17:15 +01:00
|
|
|
the Free Software Foundation; version 2 of the License.
|
2002-12-11 08:17:51 +01:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2019-05-11 20:29:06 +02:00
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
/**
|
|
|
|
@file
|
|
|
|
|
|
|
|
Low level functions for storing data to be send to the MySQL client.
|
2002-12-11 08:17:51 +01:00
|
|
|
The actual communction is handled by the net_xxx functions in net_serv.cc
|
|
|
|
*/
|
|
|
|
|
2005-05-26 12:09:14 +02:00
|
|
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
2002-12-11 08:17:51 +01:00
|
|
|
#pragma implementation // gcc: Class implementation
|
|
|
|
#endif
|
|
|
|
|
2017-06-18 05:42:16 +02:00
|
|
|
#include "mariadb.h"
|
2010-03-31 16:05:33 +02:00
|
|
|
#include "sql_priv.h"
|
|
|
|
#include "protocol.h"
|
|
|
|
#include "sql_class.h" // THD
|
2002-12-11 08:17:51 +01:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2004-06-09 01:21:50 +02:00
|
|
|
static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024;
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
/* Declared non-static only because of the embedded library. */
|
2009-09-10 11:18:29 +02:00
|
|
|
bool net_send_error_packet(THD *, uint, const char *, const char *);
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
/* Declared non-static only because of the embedded library. */
|
2016-04-15 20:40:25 +02:00
|
|
|
bool net_send_ok(THD *, uint, uint, ulonglong, ulonglong, const char *,
|
|
|
|
bool, bool);
|
2009-09-10 11:18:29 +02:00
|
|
|
/* Declared non-static only because of the embedded library. */
|
|
|
|
bool net_send_eof(THD *thd, uint server_status, uint statement_warn_count);
|
2006-12-14 23:51:37 +01:00
|
|
|
#ifndef EMBEDDED_LIBRARY
|
2009-09-10 11:18:29 +02:00
|
|
|
static bool write_eof_packet(THD *, NET *, uint, uint);
|
2006-12-14 23:51:37 +01:00
|
|
|
#endif
|
2004-06-09 01:21:50 +02:00
|
|
|
|
2020-07-14 09:06:27 +02:00
|
|
|
CHARSET_INFO *Protocol::character_set_results() const
|
|
|
|
{
|
|
|
|
return thd->variables.character_set_results;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-01-15 09:11:44 +01:00
|
|
|
#ifndef EMBEDDED_LIBRARY
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
bool Protocol::net_store_data(const uchar *from, size_t length)
|
2003-09-18 09:25:00 +02:00
|
|
|
#else
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
bool Protocol_binary::net_store_data(const uchar *from, size_t length)
|
2003-09-18 09:25:00 +02:00
|
|
|
#endif
|
2003-01-15 09:11:44 +01:00
|
|
|
{
|
|
|
|
ulong packet_length=packet->length();
|
2003-02-04 20:52:14 +01:00
|
|
|
/*
|
|
|
|
The +9 comes from that strings of length longer than 16M require
|
|
|
|
9 bytes to be stored (see net_store_length).
|
|
|
|
*/
|
|
|
|
if (packet_length+9+length > packet->alloced_length() &&
|
|
|
|
packet->realloc(packet_length+9+length))
|
2003-01-15 09:11:44 +01:00
|
|
|
return 1;
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
uchar *to= net_store_length((uchar*) packet->ptr()+packet_length, length);
|
2003-01-15 09:11:44 +01:00
|
|
|
memcpy(to,from,length);
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
packet->length((uint) (to+length-(uchar*) packet->ptr()));
|
2003-01-15 09:11:44 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-09-30 07:09:28 +02:00
|
|
|
/*
|
2014-04-15 15:08:33 +02:00
|
|
|
net_store_data_cs() - extended version with character set conversion.
|
2009-09-30 07:09:28 +02:00
|
|
|
|
|
|
|
It is optimized for short strings whose length after
|
|
|
|
conversion is garanteed to be less than 251, which accupies
|
|
|
|
exactly one byte to store length. It allows not to use
|
|
|
|
the "convert" member as a temporary buffer, conversion
|
|
|
|
is done directly to the "packet" member.
|
|
|
|
The limit 251 is good enough to optimize send_result_set_metadata()
|
|
|
|
because column, table, database names fit into this limit.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EMBEDDED_LIBRARY
|
2014-04-15 15:08:33 +02:00
|
|
|
bool Protocol::net_store_data_cs(const uchar *from, size_t length,
|
2009-09-30 07:09:28 +02:00
|
|
|
CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
|
2014-04-15 15:08:33 +02:00
|
|
|
#else
|
|
|
|
bool Protocol_binary::net_store_data_cs(const uchar *from, size_t length,
|
|
|
|
CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
|
|
|
|
#endif
|
2009-09-30 07:09:28 +02:00
|
|
|
{
|
|
|
|
uint dummy_errors;
|
|
|
|
/* Calculate maxumum possible result length */
|
2018-02-06 13:55:58 +01:00
|
|
|
size_t conv_length= to_cs->mbmaxlen * length / from_cs->mbminlen;
|
2009-07-02 12:15:33 +02:00
|
|
|
|
2009-09-30 07:09:28 +02:00
|
|
|
if (conv_length > 250)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
For strings with conv_length greater than 250 bytes
|
|
|
|
we don't know how many bytes we will need to store length: one or two,
|
|
|
|
because we don't know result length until conversion is done.
|
|
|
|
For example, when converting from utf8 (mbmaxlen=3) to latin1,
|
|
|
|
conv_length=300 means that the result length can vary between 100 to 300.
|
|
|
|
length=100 needs one byte, length=300 needs to bytes.
|
|
|
|
|
|
|
|
Thus conversion directly to "packet" is not worthy.
|
|
|
|
Let's use "convert" as a temporary buffer.
|
|
|
|
*/
|
|
|
|
return (convert->copy((const char*) from, length, from_cs,
|
|
|
|
to_cs, &dummy_errors) ||
|
|
|
|
net_store_data((const uchar*) convert->ptr(), convert->length()));
|
|
|
|
}
|
|
|
|
|
2018-02-06 13:55:58 +01:00
|
|
|
size_t packet_length= packet->length();
|
|
|
|
size_t new_length= packet_length + conv_length + 1;
|
2009-09-30 07:09:28 +02:00
|
|
|
|
|
|
|
if (new_length > packet->alloced_length() && packet->realloc(new_length))
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
char *length_pos= (char*) packet->ptr() + packet_length;
|
|
|
|
char *to= length_pos + 1;
|
|
|
|
|
|
|
|
to+= copy_and_convert(to, conv_length, to_cs,
|
|
|
|
(const char*) from, length, from_cs, &dummy_errors);
|
|
|
|
|
|
|
|
net_store_length((uchar*) length_pos, to - length_pos - 1);
|
|
|
|
packet->length((uint) (to - packet->ptr()));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
/**
|
|
|
|
Send a error string to client.
|
|
|
|
|
|
|
|
Design note:
|
2006-08-23 03:58:14 +02:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
net_printf_error and net_send_error are low-level functions
|
|
|
|
that shall be used only when a new connection is being
|
|
|
|
established or at server startup.
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
For SIGNAL/RESIGNAL and GET DIAGNOSTICS functionality it's
|
|
|
|
critical that every error that can be intercepted is issued in one
|
|
|
|
place only, my_message_sql.
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
|
|
|
|
@param thd Thread handler
|
|
|
|
@param sql_errno The error code to send
|
|
|
|
@param err A pointer to the error message
|
|
|
|
|
|
|
|
@return
|
|
|
|
@retval FALSE The message was sent to the client
|
|
|
|
@retval TRUE An error occurred and the message wasn't sent properly
|
2006-08-23 03:58:14 +02:00
|
|
|
*/
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
|
2009-09-10 11:18:29 +02:00
|
|
|
bool net_send_error(THD *thd, uint sql_errno, const char *err,
|
|
|
|
const char* sqlstate)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
bool error;
|
2004-10-20 15:06:54 +02:00
|
|
|
DBUG_ENTER("net_send_error");
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2006-08-23 03:58:14 +02:00
|
|
|
DBUG_ASSERT(!thd->spcont);
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
DBUG_ASSERT(sql_errno);
|
2009-09-10 11:18:29 +02:00
|
|
|
DBUG_ASSERT(err);
|
2006-08-23 03:58:14 +02:00
|
|
|
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
DBUG_PRINT("enter",("sql_errno: %d err: %s", sql_errno, err));
|
Bug#8153 (Stored procedure with subquery and continue handler, wrong result)
Before this fix,
- a runtime error in a statement in a stored procedure with no error handlers
was properly detected (as expected)
- a runtime error in a statement with an error handler inherited from a non
local runtime context (i.e., proc a with a handler, calling proc b) was
properly detected (as expected)
- a runtime error in a statement with a *local* error handler was executed
as follows :
a) the statement would succeed, regardless of the error condition, (bug)
b) the error handler would be called (as expected).
The root cause is that functions like my_messqge_sql would "forget" to set
the thread flag thd->net.report_error to 1, because of the check involving
sp_rcontext::found_handler_here().
Failure to set this flag would cause, later in the call stack,
in Item_func::fix_fields() at line 190, the code to return FALSE and consider
that executing the statement was successful.
With this fix :
- error handling code, that was duplicated in different places in the code,
is now implemented in sp_rcontext::handle_error(),
- handle_error() correctly sets thd->net.report_error when a handler is
present, regardless of the handler location (local, or in the call stack).
A test case, bug8153_subselect, has been written to demonstrate the change
of behavior before and after the fix.
Another test case, bug8153_function_a, as also been writen.
This test has the same behavior before and after the fix.
This test has been written to demonstrate that the previous expected
result of procedure bug18787, was incorrect, since select no_such_function()
should fail and therefore not produce a result.
The incorrect result for bug18787 has the same root cause as Bug#8153,
and the expected result has been adjusted.
sql/mysqld.cc:
Bug#8153, use sp_rcontext::handle_error() to handle errors.
sql/sql_error.cc:
Bug#8153, use sp_rcontext::handle_error() to handle errors.
sql/protocol.cc:
Bug#8153, use sp_rcontext::handle_error() to handle errors.
sql/sp_rcontext.h:
Bug#8153, created helper sp_rcontext::handle_error() to handle errors.
sql/sp_rcontext.cc:
Bug#8153, created helper sp_rcontext::handle_error() to handle errors.
mysql-test/t/sp.test:
Bug#8153, added test cases.
mysql-test/r/sp.result:
Bug#8153, added test cases, fixed expected result of bug18787.
2006-08-03 07:18:49 +02:00
|
|
|
|
2009-09-10 11:18:29 +02:00
|
|
|
if (sqlstate == NULL)
|
|
|
|
sqlstate= mysql_errno_to_sqlstate(sql_errno);
|
|
|
|
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
/*
|
|
|
|
It's one case when we can push an error even though there
|
|
|
|
is an OK or EOF already.
|
|
|
|
*/
|
2013-06-15 17:32:08 +02:00
|
|
|
thd->get_stmt_da()->set_overwrite_status(true);
|
2005-02-24 22:33:42 +01:00
|
|
|
|
2007-11-29 07:37:07 +01:00
|
|
|
/* Abort multi-result sets */
|
|
|
|
thd->server_status&= ~SERVER_MORE_RESULTS_EXISTS;
|
2002-12-16 15:58:55 +01:00
|
|
|
|
2009-09-10 11:18:29 +02:00
|
|
|
error= net_send_error_packet(thd, sql_errno, err, sqlstate);
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2013-06-15 17:32:08 +02:00
|
|
|
thd->get_stmt_da()->set_overwrite_status(false);
|
2003-11-18 12:47:27 +01:00
|
|
|
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
DBUG_RETURN(error);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
/**
|
2002-12-11 08:17:51 +01:00
|
|
|
Return ok to the client.
|
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
The ok packet has the following structure:
|
|
|
|
|
|
|
|
- 0 : Marker (1 byte)
|
|
|
|
- affected_rows : Stored in 1-9 bytes
|
|
|
|
- id : Stored in 1-9 bytes
|
|
|
|
- server_status : Copy of thd->server_status; Can be used by client
|
|
|
|
to check if we are inside an transaction.
|
|
|
|
New in 4.0 protocol
|
|
|
|
- warning_count : Stored in 2 bytes; New in 4.1 protocol
|
|
|
|
- message : Stored as packed length (1-9 bytes) + message.
|
|
|
|
Is not stored if no message.
|
|
|
|
|
|
|
|
@param thd Thread handler
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
@param server_status The server status
|
2009-09-10 11:18:29 +02:00
|
|
|
@param statement_warn_count Total number of warnings
|
2007-10-11 20:37:45 +02:00
|
|
|
@param affected_rows Number of rows changed by statement
|
|
|
|
@param id Auto_increment id for first row (if used)
|
|
|
|
@param message Message to send to the client (Used by mysql_status)
|
2016-05-30 21:22:50 +02:00
|
|
|
@param is_eof this called instead of old EOF packet
|
2016-04-15 20:40:25 +02:00
|
|
|
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
@return
|
|
|
|
@retval FALSE The message was successfully sent
|
|
|
|
@retval TRUE An error occurred and the messages wasn't sent properly
|
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
*/
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2003-02-04 02:19:19 +01:00
|
|
|
#ifndef EMBEDDED_LIBRARY
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
bool
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
net_send_ok(THD *thd,
|
2009-09-10 11:18:29 +02:00
|
|
|
uint server_status, uint statement_warn_count,
|
2016-05-09 15:26:18 +02:00
|
|
|
ulonglong affected_rows, ulonglong id, const char *message,
|
2016-04-15 20:40:25 +02:00
|
|
|
bool is_eof,
|
2016-05-09 15:26:18 +02:00
|
|
|
bool skip_flush)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
NET *net= &thd->net;
|
2016-04-15 20:40:25 +02:00
|
|
|
StringBuffer<MYSQL_ERRMSG_SIZE + 10> store;
|
|
|
|
|
|
|
|
bool state_changed= false;
|
|
|
|
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
bool error= FALSE;
|
2010-05-14 07:28:51 +02:00
|
|
|
DBUG_ENTER("net_send_ok");
|
2003-02-14 10:47:41 +01:00
|
|
|
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
if (! net->vio) // hack for re-parsing queries
|
2005-06-23 17:29:10 +02:00
|
|
|
{
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
DBUG_PRINT("info", ("vio present: NO"));
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
DBUG_RETURN(FALSE);
|
2005-06-23 17:29:10 +02:00
|
|
|
}
|
2003-02-14 10:47:41 +01:00
|
|
|
|
2016-04-15 20:40:25 +02:00
|
|
|
/*
|
|
|
|
OK send instead of EOF still require 0xFE header, but OK packet content.
|
|
|
|
*/
|
|
|
|
if (is_eof)
|
|
|
|
{
|
|
|
|
DBUG_ASSERT(thd->client_capabilities & CLIENT_DEPRECATE_EOF);
|
|
|
|
store.q_append((char)254);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
store.q_append('\0');
|
|
|
|
|
|
|
|
/* affected rows */
|
|
|
|
store.q_net_store_length(affected_rows);
|
|
|
|
|
|
|
|
/* last insert id */
|
|
|
|
store.q_net_store_length(id);
|
|
|
|
|
2002-12-11 08:17:51 +01:00
|
|
|
if (thd->client_capabilities & CLIENT_PROTOCOL_41)
|
|
|
|
{
|
2003-11-28 11:18:13 +01:00
|
|
|
DBUG_PRINT("info",
|
|
|
|
("affected_rows: %lu id: %lu status: %u warning_count: %u",
|
2016-04-15 20:40:25 +02:00
|
|
|
(ulong) affected_rows,
|
2003-11-28 11:18:13 +01:00
|
|
|
(ulong) id,
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
(uint) (server_status & 0xffff),
|
2009-09-10 11:18:29 +02:00
|
|
|
(uint) statement_warn_count));
|
2016-04-15 20:40:25 +02:00
|
|
|
store.q_append2b(server_status);
|
2002-12-11 08:17:51 +01:00
|
|
|
|
|
|
|
/* We can only return up to 65535 warnings in two bytes */
|
2013-03-25 23:03:13 +01:00
|
|
|
uint tmp= MY_MIN(statement_warn_count, 65535);
|
2016-04-15 20:40:25 +02:00
|
|
|
store.q_append2b(tmp);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
else if (net->return_status) // For 4.0 protocol
|
|
|
|
{
|
2016-04-15 20:40:25 +02:00
|
|
|
store.q_append2b(server_status);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
2013-06-15 17:32:08 +02:00
|
|
|
thd->get_stmt_da()->set_overwrite_status(true);
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
|
2016-05-30 21:22:50 +02:00
|
|
|
state_changed=
|
|
|
|
(thd->client_capabilities & CLIENT_SESSION_TRACK) &&
|
|
|
|
(server_status & SERVER_SESSION_STATE_CHANGED);
|
|
|
|
|
|
|
|
if (state_changed || (message && message[0]))
|
2016-04-15 20:40:25 +02:00
|
|
|
{
|
2016-05-30 21:22:50 +02:00
|
|
|
DBUG_ASSERT(safe_strlen(message) <= MYSQL_ERRMSG_SIZE);
|
|
|
|
store.q_net_store_data((uchar*) safe_str(message), safe_strlen(message));
|
2016-04-15 20:40:25 +02:00
|
|
|
}
|
|
|
|
|
2016-05-30 21:22:50 +02:00
|
|
|
if (unlikely(state_changed))
|
2016-04-15 20:40:25 +02:00
|
|
|
{
|
2016-05-30 21:22:50 +02:00
|
|
|
store.set_charset(thd->variables.collation_database);
|
|
|
|
|
|
|
|
thd->session_tracker.store(thd, &store);
|
2016-04-15 20:40:25 +02:00
|
|
|
}
|
2016-05-30 21:22:50 +02:00
|
|
|
|
|
|
|
DBUG_ASSERT(store.length() <= MAX_PACKET_LENGTH);
|
|
|
|
|
2016-04-15 20:40:25 +02:00
|
|
|
error= my_net_write(net, (const unsigned char*)store.ptr(), store.length());
|
2018-04-04 11:16:12 +02:00
|
|
|
if (likely(!error) && (!skip_flush || is_eof))
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
error= net_flush(net);
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
|
2016-04-15 20:40:25 +02:00
|
|
|
thd->server_status&= ~SERVER_SESSION_STATE_CHANGED;
|
2009-11-24 14:54:59 +01:00
|
|
|
|
2013-06-15 17:32:08 +02:00
|
|
|
thd->get_stmt_da()->set_overwrite_status(false);
|
2005-02-26 11:19:02 +01:00
|
|
|
DBUG_PRINT("info", ("OK sent, so no more error sending allowed"));
|
2005-01-20 09:41:37 +01:00
|
|
|
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
DBUG_RETURN(error);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
2016-04-15 20:40:25 +02:00
|
|
|
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
static uchar eof_buff[1]= { (uchar) 254 }; /* Marker for end of fields */
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
/**
|
|
|
|
Send eof (= end of result set) to the client.
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
The eof packet has the following structure:
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
- 254 : Marker (1 byte)
|
|
|
|
- warning_count : Stored in 2 bytes; New in 4.1 protocol
|
|
|
|
- status_flag : Stored in 2 bytes;
|
|
|
|
For flags like SERVER_MORE_RESULTS_EXISTS.
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
Note that the warning count will not be sent if 'no_flush' is set as
|
|
|
|
we don't want to report the warning count until all data is sent to the
|
|
|
|
client.
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
@param thd Thread handler
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
@param server_status The server status
|
2009-09-10 11:18:29 +02:00
|
|
|
@param statement_warn_count Total number of warnings
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
|
|
|
|
@return
|
|
|
|
@retval FALSE The message was successfully sent
|
|
|
|
@retval TRUE An error occurred and the message wasn't sent properly
|
2002-12-11 08:17:51 +01:00
|
|
|
*/
|
|
|
|
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
bool
|
2009-09-10 11:18:29 +02:00
|
|
|
net_send_eof(THD *thd, uint server_status, uint statement_warn_count)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
NET *net= &thd->net;
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
bool error= FALSE;
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
DBUG_ENTER("net_send_eof");
|
2016-04-15 20:40:25 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
Check if client understand new format packets (OK instead of EOF)
|
|
|
|
|
|
|
|
Normally end of statement reply is signaled by OK packet, but in case
|
|
|
|
of binlog dump request an EOF packet is sent instead. Also, old clients
|
|
|
|
expect EOF packet instead of OK
|
|
|
|
*/
|
|
|
|
if ((thd->client_capabilities & CLIENT_DEPRECATE_EOF) &&
|
|
|
|
(thd->get_command() != COM_BINLOG_DUMP ))
|
|
|
|
{
|
|
|
|
error= net_send_ok(thd, server_status, statement_warn_count, 0, 0, NULL,
|
|
|
|
true, false);
|
|
|
|
DBUG_RETURN(error);
|
|
|
|
}
|
|
|
|
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
/* Set to TRUE if no active vio, to work well in case of --init-file */
|
2007-10-15 13:45:20 +02:00
|
|
|
if (net->vio != 0)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2013-06-15 17:32:08 +02:00
|
|
|
thd->get_stmt_da()->set_overwrite_status(true);
|
2009-09-10 11:18:29 +02:00
|
|
|
error= write_eof_packet(thd, net, server_status, statement_warn_count);
|
2018-04-04 11:16:12 +02:00
|
|
|
if (likely(!error))
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
error= net_flush(net);
|
2013-06-15 17:32:08 +02:00
|
|
|
thd->get_stmt_da()->set_overwrite_status(false);
|
2005-02-26 11:19:02 +01:00
|
|
|
DBUG_PRINT("info", ("EOF sent, so no more error sending allowed"));
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
DBUG_RETURN(error);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
2003-07-18 16:25:54 +02:00
|
|
|
|
2005-06-30 14:17:10 +02:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
/**
|
2005-06-30 14:17:10 +02:00
|
|
|
Format EOF packet according to the current protocol and
|
|
|
|
write it to the network output buffer.
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
|
|
|
|
@param thd The thread handler
|
|
|
|
@param net The network handler
|
|
|
|
@param server_status The server status
|
2009-09-10 11:18:29 +02:00
|
|
|
@param statement_warn_count The number of warnings
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
@return
|
|
|
|
@retval FALSE The message was sent successfully
|
|
|
|
@retval TRUE An error occurred and the messages wasn't sent properly
|
2005-06-30 14:17:10 +02:00
|
|
|
*/
|
|
|
|
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
static bool write_eof_packet(THD *thd, NET *net,
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
uint server_status,
|
2009-09-10 11:18:29 +02:00
|
|
|
uint statement_warn_count)
|
2005-06-30 14:17:10 +02:00
|
|
|
{
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
bool error;
|
2005-06-30 14:17:10 +02:00
|
|
|
if (thd->client_capabilities & CLIENT_PROTOCOL_41)
|
|
|
|
{
|
|
|
|
uchar buff[5];
|
|
|
|
/*
|
|
|
|
Don't send warn count during SP execution, as the warn_list
|
|
|
|
is cleared between substatements, and mysqltest gets confused
|
|
|
|
*/
|
2013-03-25 23:03:13 +01:00
|
|
|
uint tmp= MY_MIN(statement_warn_count, 65535);
|
2005-06-30 14:17:10 +02:00
|
|
|
buff[0]= 254;
|
|
|
|
int2store(buff+1, tmp);
|
|
|
|
/*
|
|
|
|
The following test should never be true, but it's better to do it
|
|
|
|
because if 'is_fatal_error' is set the server is not going to execute
|
|
|
|
other queries (see the if test in dispatch_command / COM_QUERY)
|
|
|
|
*/
|
2018-04-04 11:16:12 +02:00
|
|
|
if (unlikely(thd->is_fatal_error))
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
server_status&= ~SERVER_MORE_RESULTS_EXISTS;
|
|
|
|
int2store(buff + 3, server_status);
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
error= my_net_write(net, buff, 5);
|
2005-06-30 14:17:10 +02:00
|
|
|
}
|
|
|
|
else
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
error= my_net_write(net, eof_buff, 1);
|
|
|
|
|
|
|
|
return error;
|
2005-06-30 14:17:10 +02:00
|
|
|
}
|
|
|
|
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
/**
|
|
|
|
@param thd Thread handler
|
|
|
|
@param sql_errno The error code to send
|
|
|
|
@param err A pointer to the error message
|
|
|
|
|
|
|
|
@return
|
|
|
|
@retval FALSE The message was successfully sent
|
|
|
|
@retval TRUE An error occurred and the messages wasn't sent properly
|
|
|
|
*/
|
|
|
|
|
2009-09-10 11:18:29 +02:00
|
|
|
bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
|
|
|
|
const char* sqlstate)
|
|
|
|
|
2006-01-04 11:20:28 +01:00
|
|
|
{
|
|
|
|
NET *net= &thd->net;
|
|
|
|
uint length;
|
2007-11-30 12:44:28 +01:00
|
|
|
/*
|
|
|
|
buff[]: sql_errno:2 + ('#':1 + SQLSTATE_LENGTH:5) + MYSQL_ERRMSG_SIZE:512
|
|
|
|
*/
|
2009-10-15 14:23:43 +02:00
|
|
|
uint error;
|
2011-07-07 13:22:43 +02:00
|
|
|
char converted_err[MYSQL_ERRMSG_SIZE];
|
|
|
|
char buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos;
|
2016-08-21 19:38:47 +02:00
|
|
|
my_bool ret;
|
|
|
|
uint8 save_compress;
|
2006-01-04 11:20:28 +01:00
|
|
|
DBUG_ENTER("send_error_packet");
|
|
|
|
|
|
|
|
if (net->vio == 0)
|
|
|
|
{
|
|
|
|
if (thd->bootstrap)
|
|
|
|
{
|
|
|
|
/* In bootstrap it's ok to print on stderr */
|
|
|
|
fprintf(stderr,"ERROR: %d %s\n",sql_errno,err);
|
|
|
|
}
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
DBUG_RETURN(FALSE);
|
2006-01-04 11:20:28 +01:00
|
|
|
}
|
|
|
|
|
2009-10-09 11:06:41 +02:00
|
|
|
int2store(buff,sql_errno);
|
|
|
|
pos= buff+2;
|
|
|
|
if (thd->client_capabilities & CLIENT_PROTOCOL_41)
|
2006-01-04 11:20:28 +01:00
|
|
|
{
|
2009-10-09 11:06:41 +02:00
|
|
|
/* The first # is to make the protocol backward compatible */
|
|
|
|
buff[2]= '#';
|
2011-07-07 13:22:43 +02:00
|
|
|
pos= strmov(buff+3, sqlstate);
|
2006-01-04 11:20:28 +01:00
|
|
|
}
|
2009-11-24 14:54:59 +01:00
|
|
|
|
2011-07-07 13:22:43 +02:00
|
|
|
convert_error_message(converted_err, sizeof(converted_err),
|
|
|
|
thd->variables.character_set_results,
|
|
|
|
err, strlen(err), system_charset_info, &error);
|
|
|
|
/* Converted error message is always null-terminated. */
|
|
|
|
length= (uint) (strmake(pos, converted_err, MYSQL_ERRMSG_SIZE - 1) - buff);
|
2009-11-24 14:54:59 +01:00
|
|
|
|
2016-08-21 19:38:47 +02:00
|
|
|
/*
|
|
|
|
Ensure that errors are not compressed. This is to ensure we can
|
|
|
|
detect out of bands error messages in the client
|
|
|
|
*/
|
|
|
|
if ((save_compress= net->compress))
|
|
|
|
net->compress= 2;
|
2019-06-27 16:50:39 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
Sometimes, we send errors "out-of-band", e.g ER_CONNECTION_KILLED
|
|
|
|
on an idle connection. The current protocol "sequence number" is 0,
|
|
|
|
however some client drivers would however always expect packets
|
|
|
|
coming from server to have seq_no > 0, due to missing awareness
|
|
|
|
of "out-of-band" operations. Make these clients happy.
|
|
|
|
*/
|
|
|
|
if (!net->pkt_nr)
|
|
|
|
net->pkt_nr= 1;
|
|
|
|
|
2016-08-21 19:38:47 +02:00
|
|
|
ret= net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) buff,
|
|
|
|
length);
|
|
|
|
net->compress= save_compress;
|
|
|
|
DBUG_RETURN(ret);
|
2006-01-04 11:20:28 +01:00
|
|
|
}
|
|
|
|
|
2002-12-16 15:58:55 +01:00
|
|
|
#endif /* EMBEDDED_LIBRARY */
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
/**
|
2003-09-03 16:07:00 +02:00
|
|
|
Faster net_store_length when we know that length is less than 65536.
|
|
|
|
We keep a separate version for that range because it's widely used in
|
|
|
|
libmysql.
|
2007-10-11 20:37:45 +02:00
|
|
|
|
2003-09-03 16:07:00 +02:00
|
|
|
uint is used as agrument type because of MySQL type conventions:
|
2007-10-11 20:37:45 +02:00
|
|
|
- uint for 0..65536
|
|
|
|
- ulong for 0..4294967296
|
|
|
|
- ulonglong for bigger numbers.
|
2002-12-11 08:17:51 +01:00
|
|
|
*/
|
|
|
|
|
2018-02-06 13:55:58 +01:00
|
|
|
static uchar *net_store_length_fast(uchar *packet, size_t length)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2018-02-06 13:55:58 +01:00
|
|
|
DBUG_ASSERT(length < UINT_MAX16);
|
2002-12-11 08:17:51 +01:00
|
|
|
if (length < 251)
|
|
|
|
{
|
|
|
|
*packet=(uchar) length;
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
return packet+1;
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
*packet++=252;
|
|
|
|
int2store(packet,(uint) length);
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
return packet+2;
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
/**
|
|
|
|
Send the status of the current statement execution over network.
|
|
|
|
|
|
|
|
@param thd in fact, carries two parameters, NET for the transport and
|
|
|
|
Diagnostics_area as the source of status information.
|
|
|
|
|
|
|
|
In MySQL, there are two types of SQL statements: those that return
|
|
|
|
a result set and those that return status information only.
|
|
|
|
|
|
|
|
If a statement returns a result set, it consists of 3 parts:
|
|
|
|
- result set meta-data
|
|
|
|
- variable number of result set rows (can be 0)
|
|
|
|
- followed and terminated by EOF or ERROR packet
|
|
|
|
|
|
|
|
Once the client has seen the meta-data information, it always
|
|
|
|
expects an EOF or ERROR to terminate the result set. If ERROR is
|
|
|
|
received, the result set rows are normally discarded (this is up
|
|
|
|
to the client implementation, libmysql at least does discard them).
|
|
|
|
EOF, on the contrary, means "successfully evaluated the entire
|
|
|
|
result set". Since we don't know how many rows belong to a result
|
|
|
|
set until it's evaluated, EOF/ERROR is the indicator of the end
|
|
|
|
of the row stream. Note, that we can not buffer result set rows
|
|
|
|
on the server -- there may be an arbitrary number of rows. But
|
|
|
|
we do buffer the last packet (EOF/ERROR) in the Diagnostics_area and
|
|
|
|
delay sending it till the very end of execution (here), to be able to
|
|
|
|
change EOF to an ERROR if commit failed or some other error occurred
|
|
|
|
during the last cleanup steps taken after execution.
|
|
|
|
|
|
|
|
A statement that does not return a result set doesn't send result
|
|
|
|
set meta-data either. Instead it returns one of:
|
|
|
|
- OK packet
|
|
|
|
- ERROR packet.
|
|
|
|
Similarly to the EOF/ERROR of the previous statement type, OK/ERROR
|
|
|
|
packet is "buffered" in the diagnostics area and sent to the client
|
|
|
|
in the end of statement.
|
|
|
|
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
@note This method defines a template, but delegates actual
|
|
|
|
sending of data to virtual Protocol::send_{ok,eof,error}. This
|
|
|
|
allows for implementation of protocols that "intercept" ok/eof/error
|
|
|
|
messages, and store them in memory, etc, instead of sending to
|
|
|
|
the client.
|
|
|
|
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
@pre The diagnostics area is assigned or disabled. It can not be empty
|
|
|
|
-- we assume that every SQL statement or COM_* command
|
|
|
|
generates OK, ERROR, or EOF status.
|
|
|
|
|
|
|
|
@post The status information is encoded to protocol format and sent to the
|
|
|
|
client.
|
|
|
|
|
|
|
|
@return We conventionally return void, since the only type of error
|
|
|
|
that can happen here is a NET (transport) error, and that one
|
|
|
|
will become visible when we attempt to read from the NET the
|
|
|
|
next command.
|
|
|
|
Diagnostics_area::is_sent is set for debugging purposes only.
|
|
|
|
*/
|
|
|
|
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
void Protocol::end_statement()
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
{
|
2019-01-23 12:30:00 +01:00
|
|
|
#ifdef WITH_WSREP
|
|
|
|
/*
|
|
|
|
Commented out: This sanity check does not hold in general.
|
|
|
|
Thd->LOCK_thd_data() must be unlocked before sending response
|
|
|
|
to client, so BF abort may sneak in here.
|
|
|
|
DBUG_ASSERT(!WSREP(thd) || thd->wsrep_conflict_state() == NO_CONFLICT);
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
sanity check, don't send end statement while replaying
|
|
|
|
*/
|
|
|
|
DBUG_ASSERT(thd->wsrep_trx().state() != wsrep::transaction::s_replaying);
|
|
|
|
if (WSREP(thd) && thd->wsrep_trx().state() ==
|
|
|
|
wsrep::transaction::s_replaying)
|
|
|
|
{
|
|
|
|
WSREP_ERROR("attempting net_end_statement while replaying");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
#endif /* WITH_WSREP */
|
|
|
|
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
DBUG_ENTER("Protocol::end_statement");
|
2013-06-15 17:32:08 +02:00
|
|
|
DBUG_ASSERT(! thd->get_stmt_da()->is_sent());
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
bool error= FALSE;
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
|
|
|
|
/* Can not be true, but do not take chances in production. */
|
2013-06-15 17:32:08 +02:00
|
|
|
if (thd->get_stmt_da()->is_sent())
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
DBUG_VOID_RETURN;
|
Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
an assertion in a debug build.
The reason is that the C API doesn't support multiple result sets for prepared
statements and attempting to execute a stored routine which returns multiple result
sets sometimes lead to a network error. The network error sets the diagnostic area
prematurely which later leads to the assert when an attempt is made to set a second
server state.
This patch fixes the issue by changing the scope of the error code returned by
sp_instr_stmt::execute() to include any error which happened during the execution.
To assure that Diagnostic_area::is_sent really mean that the message was sent all
network related functions are checked for return status.
libmysqld/lib_sql.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
mysql-test/r/sp_notembedded.result:
* Added test case for bug 44521
mysql-test/t/sp_notembedded.test:
* Added test case for bug 44521
sql/protocol.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/protocol.h:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
sql/sp_head.cc:
* Changed prototype to return success/failure status on net_send_error_packet(),
net_send_ok(), net_send_eof(), write_eof_packet().
2009-07-29 22:07:08 +02:00
|
|
|
|
2013-06-15 17:32:08 +02:00
|
|
|
switch (thd->get_stmt_da()->status()) {
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
case Diagnostics_area::DA_ERROR:
|
|
|
|
/* The query failed, send error to log and abort bootstrap. */
|
2013-06-15 17:32:08 +02:00
|
|
|
error= send_error(thd->get_stmt_da()->sql_errno(),
|
|
|
|
thd->get_stmt_da()->message(),
|
|
|
|
thd->get_stmt_da()->get_sqlstate());
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
break;
|
|
|
|
case Diagnostics_area::DA_EOF:
|
2010-11-12 13:56:21 +01:00
|
|
|
error= send_eof(thd->server_status,
|
2013-06-15 17:32:08 +02:00
|
|
|
thd->get_stmt_da()->statement_warn_count());
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
break;
|
|
|
|
case Diagnostics_area::DA_OK:
|
2016-06-29 20:03:06 +02:00
|
|
|
case Diagnostics_area::DA_OK_BULK:
|
2010-11-12 13:56:21 +01:00
|
|
|
error= send_ok(thd->server_status,
|
2013-06-15 17:32:08 +02:00
|
|
|
thd->get_stmt_da()->statement_warn_count(),
|
|
|
|
thd->get_stmt_da()->affected_rows(),
|
|
|
|
thd->get_stmt_da()->last_insert_id(),
|
2016-05-09 15:26:18 +02:00
|
|
|
thd->get_stmt_da()->message(),
|
|
|
|
thd->get_stmt_da()->skip_flush());
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
break;
|
|
|
|
case Diagnostics_area::DA_DISABLED:
|
|
|
|
break;
|
|
|
|
case Diagnostics_area::DA_EMPTY:
|
|
|
|
default:
|
|
|
|
DBUG_ASSERT(0);
|
2016-05-09 15:26:18 +02:00
|
|
|
error= send_ok(thd->server_status, 0, 0, 0, NULL,
|
|
|
|
thd->get_stmt_da()->skip_flush());
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
break;
|
|
|
|
}
|
2018-04-04 11:16:12 +02:00
|
|
|
if (likely(!error))
|
2013-06-15 17:32:08 +02:00
|
|
|
thd->get_stmt_da()->set_is_sent(true);
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
DBUG_VOID_RETURN;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
A default implementation of "OK" packet response to the client.
|
|
|
|
|
|
|
|
Currently this implementation is re-used by both network-oriented
|
|
|
|
protocols -- the binary and text one. They do not differ
|
|
|
|
in their OK packet format, which allows for a significant simplification
|
|
|
|
on client side.
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool Protocol::send_ok(uint server_status, uint statement_warn_count,
|
|
|
|
ulonglong affected_rows, ulonglong last_insert_id,
|
2016-05-09 15:26:18 +02:00
|
|
|
const char *message, bool skip_flush)
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
{
|
|
|
|
DBUG_ENTER("Protocol::send_ok");
|
2016-04-15 20:40:25 +02:00
|
|
|
const bool retval=
|
2011-02-02 12:54:49 +01:00
|
|
|
net_send_ok(thd, server_status, statement_warn_count,
|
2016-04-15 20:40:25 +02:00
|
|
|
affected_rows, last_insert_id, message, false, skip_flush);
|
2011-02-02 12:54:49 +01:00
|
|
|
DBUG_RETURN(retval);
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
A default implementation of "EOF" packet response to the client.
|
|
|
|
|
|
|
|
Binary and text protocol do not differ in their EOF packet format.
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool Protocol::send_eof(uint server_status, uint statement_warn_count)
|
|
|
|
{
|
|
|
|
DBUG_ENTER("Protocol::send_eof");
|
2016-04-15 20:40:25 +02:00
|
|
|
bool retval= net_send_eof(thd, server_status, statement_warn_count);
|
2011-02-02 12:54:49 +01:00
|
|
|
DBUG_RETURN(retval);
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
A default implementation of "ERROR" packet response to the client.
|
|
|
|
|
|
|
|
Binary and text protocol do not differ in ERROR packet format.
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool Protocol::send_error(uint sql_errno, const char *err_msg,
|
|
|
|
const char *sql_state)
|
|
|
|
{
|
|
|
|
DBUG_ENTER("Protocol::send_error");
|
2011-02-02 12:54:49 +01:00
|
|
|
const bool retval= net_send_error_packet(thd, sql_errno, err_msg, sql_state);
|
|
|
|
DBUG_RETURN(retval);
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
}
|
|
|
|
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2011-07-01 14:08:30 +02:00
|
|
|
/**
|
|
|
|
Send a progress report to the client
|
|
|
|
|
|
|
|
What we send is:
|
|
|
|
header (255,255,255,1)
|
|
|
|
stage, max_stage as on byte integers
|
|
|
|
percentage withing the stage as percentage*1000
|
|
|
|
(that is, ratio*100000) as a 3 byte integer
|
|
|
|
proc_info as a string
|
|
|
|
*/
|
|
|
|
|
|
|
|
const uchar progress_header[2]= {(uchar) 255, (uchar) 255 };
|
|
|
|
|
|
|
|
void net_send_progress_packet(THD *thd)
|
|
|
|
{
|
|
|
|
uchar buff[200], *pos;
|
|
|
|
const char *proc_info= thd->proc_info ? thd->proc_info : "";
|
2018-02-06 13:55:58 +01:00
|
|
|
size_t length= strlen(proc_info);
|
2011-07-01 14:08:30 +02:00
|
|
|
ulonglong progress;
|
|
|
|
DBUG_ENTER("net_send_progress_packet");
|
|
|
|
|
|
|
|
if (unlikely(!thd->net.vio))
|
|
|
|
DBUG_VOID_RETURN; // Socket is closed
|
|
|
|
|
|
|
|
pos= buff;
|
|
|
|
/*
|
|
|
|
Store number of strings first. This allows us to later expand the
|
|
|
|
progress indicator if needed.
|
|
|
|
*/
|
|
|
|
*pos++= (uchar) 1; // Number of strings
|
|
|
|
*pos++= (uchar) thd->progress.stage + 1;
|
|
|
|
/*
|
2013-03-25 23:03:13 +01:00
|
|
|
We have the MY_MAX() here to avoid problems if max_stage is not set,
|
2011-07-01 14:08:30 +02:00
|
|
|
which may happen during automatic repair of table
|
|
|
|
*/
|
2013-03-25 23:03:13 +01:00
|
|
|
*pos++= (uchar) MY_MAX(thd->progress.max_stage, thd->progress.stage + 1);
|
2011-07-01 14:08:30 +02:00
|
|
|
progress= 0;
|
|
|
|
if (thd->progress.max_counter)
|
|
|
|
progress= 100000ULL * thd->progress.counter / thd->progress.max_counter;
|
|
|
|
int3store(pos, progress); // Between 0 & 100000
|
|
|
|
pos+= 3;
|
|
|
|
pos= net_store_data(pos, (const uchar*) proc_info,
|
2013-03-25 23:03:13 +01:00
|
|
|
MY_MIN(length, sizeof(buff)-7));
|
2011-07-01 14:08:30 +02:00
|
|
|
net_write_command(&thd->net, (uchar) 255, progress_header,
|
|
|
|
sizeof(progress_header), (uchar*) buff,
|
|
|
|
(uint) (pos - buff));
|
|
|
|
DBUG_VOID_RETURN;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-12-11 08:17:51 +01:00
|
|
|
/****************************************************************************
|
2008-02-19 13:45:21 +01:00
|
|
|
Functions used by the protocol functions (like net_send_ok) to store
|
|
|
|
strings and numbers in the header result packet.
|
2002-12-11 08:17:51 +01:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* The following will only be used for short strings < 65K */
|
|
|
|
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
uchar *net_store_data(uchar *to, const uchar *from, size_t length)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2006-11-13 11:28:55 +01:00
|
|
|
to=net_store_length_fast(to,length);
|
2002-12-11 08:17:51 +01:00
|
|
|
memcpy(to,from,length);
|
|
|
|
return to+length;
|
|
|
|
}
|
|
|
|
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
uchar *net_store_data(uchar *to,int32 from)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2018-08-11 12:11:59 +02:00
|
|
|
char buff[22];
|
2002-12-11 08:17:51 +01:00
|
|
|
uint length=(uint) (int10_to_str(from,buff,10)-buff);
|
2006-11-13 11:28:55 +01:00
|
|
|
to=net_store_length_fast(to,length);
|
2002-12-11 08:17:51 +01:00
|
|
|
memcpy(to,buff,length);
|
|
|
|
return to+length;
|
|
|
|
}
|
|
|
|
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
uchar *net_store_data(uchar *to,longlong from)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
char buff[22];
|
|
|
|
uint length=(uint) (longlong10_to_str(from,buff,10)-buff);
|
2006-11-13 11:28:55 +01:00
|
|
|
to=net_store_length_fast(to,length);
|
2002-12-11 08:17:51 +01:00
|
|
|
memcpy(to,buff,length);
|
|
|
|
return to+length;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
Default Protocol functions
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
void Protocol::init(THD *thd_arg)
|
|
|
|
{
|
|
|
|
thd=thd_arg;
|
|
|
|
packet= &thd->packet;
|
2004-05-25 00:03:49 +02:00
|
|
|
convert= &thd->convert_buffer;
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
field_handlers= 0;
|
2020-07-17 16:56:17 +02:00
|
|
|
field_pos= 0;
|
2002-12-11 08:17:51 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
/**
|
|
|
|
Finish the result set with EOF packet, as is expected by the client,
|
|
|
|
if there is an error evaluating the next row and a continue handler
|
|
|
|
for the error.
|
|
|
|
*/
|
|
|
|
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
void Protocol::end_partial_result_set(THD *thd_arg)
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
{
|
2008-12-04 01:36:55 +01:00
|
|
|
net_send_eof(thd_arg, thd_arg->server_status,
|
|
|
|
0 /* no warnings, we're inside SP */);
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
}
|
|
|
|
|
2003-02-04 02:19:19 +01:00
|
|
|
|
2004-11-02 19:13:27 +01:00
|
|
|
bool Protocol::flush()
|
|
|
|
{
|
|
|
|
#ifndef EMBEDDED_LIBRARY
|
2010-07-21 09:56:43 +02:00
|
|
|
bool error;
|
2013-06-15 17:32:08 +02:00
|
|
|
thd->get_stmt_da()->set_overwrite_status(true);
|
2010-07-21 09:56:43 +02:00
|
|
|
error= net_flush(&thd->net);
|
2013-06-15 17:32:08 +02:00
|
|
|
thd->get_stmt_da()->set_overwrite_status(false);
|
2010-07-21 09:56:43 +02:00
|
|
|
return error;
|
2004-11-02 19:13:27 +01:00
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
#ifndef EMBEDDED_LIBRARY
|
|
|
|
|
2020-03-10 13:05:42 +01:00
|
|
|
|
|
|
|
class Send_field_packed_extended_metadata: public Binary_string
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool append_chunk(mariadb_field_attr_t type, const LEX_CSTRING &value)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
If we eventually support many metadata chunk types and long metadata
|
|
|
|
values, we'll need to encode type and length using net_store_length()
|
|
|
|
and do corresponding changes to the unpacking code in libmariadb.
|
|
|
|
For now let's just assert that type and length fit into one byte.
|
|
|
|
*/
|
|
|
|
DBUG_ASSERT(net_length_size(type) == 1);
|
|
|
|
DBUG_ASSERT(net_length_size(value.length) == 1);
|
|
|
|
size_t nbytes= 1/*type*/ + 1/*length*/ + value.length;
|
|
|
|
if (reserve(nbytes))
|
|
|
|
return true;
|
|
|
|
qs_append((char) (uchar) type);
|
|
|
|
qs_append((char) (uchar) value.length);
|
|
|
|
qs_append(&value);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
bool pack(const Send_field_extended_metadata &src)
|
|
|
|
{
|
|
|
|
for (uint i= 0 ; i <= MARIADB_FIELD_ATTR_LAST; i++)
|
|
|
|
{
|
|
|
|
const LEX_CSTRING attr= src.attr(i);
|
|
|
|
if (attr.str && append_chunk((mariadb_field_attr_t) i, attr))
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-02-21 18:44:44 +01:00
|
|
|
bool Protocol_text::store_field_metadata(const THD * thd,
|
|
|
|
const Send_field &field,
|
|
|
|
CHARSET_INFO *charset_for_protocol,
|
|
|
|
uint fieldnr)
|
|
|
|
{
|
|
|
|
CHARSET_INFO *thd_charset= thd->variables.character_set_results;
|
|
|
|
char *pos;
|
|
|
|
DBUG_ASSERT(field.is_sane());
|
|
|
|
|
|
|
|
if (thd->client_capabilities & CLIENT_PROTOCOL_41)
|
|
|
|
{
|
2020-07-14 09:06:27 +02:00
|
|
|
const LEX_CSTRING def= {STRING_WITH_LEN("def")};
|
2020-07-24 04:46:40 +02:00
|
|
|
if (store_ident(def) ||
|
2020-07-14 09:06:27 +02:00
|
|
|
store_ident(field.db_name) ||
|
|
|
|
store_ident(field.table_name) ||
|
|
|
|
store_ident(field.org_table_name) ||
|
|
|
|
store_ident(field.col_name) ||
|
|
|
|
store_ident(field.org_col_name))
|
2020-03-10 13:05:42 +01:00
|
|
|
return true;
|
|
|
|
if (thd->client_capabilities & MARIADB_CLIENT_EXTENDED_METADATA)
|
|
|
|
{
|
|
|
|
Send_field_packed_extended_metadata metadata;
|
|
|
|
metadata.pack(field);
|
2020-07-16 15:30:06 +02:00
|
|
|
|
2020-03-10 13:05:42 +01:00
|
|
|
/*
|
|
|
|
Don't apply character set conversion:
|
|
|
|
extended metadata is a binary encoded data.
|
|
|
|
*/
|
2020-07-24 04:46:40 +02:00
|
|
|
if (store_binary_string(metadata.ptr(), metadata.length()))
|
2020-03-10 13:05:42 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (packet->realloc(packet->length() + 12))
|
2019-02-21 18:44:44 +01:00
|
|
|
return true;
|
|
|
|
/* Store fixed length fields */
|
|
|
|
pos= (char*) packet->end();
|
|
|
|
*pos++= 12; // Length of packed fields
|
|
|
|
/* inject a NULL to test the client */
|
|
|
|
DBUG_EXECUTE_IF("poison_rs_fields", pos[-1]= (char) 0xfb;);
|
|
|
|
if (charset_for_protocol == &my_charset_bin || thd_charset == NULL)
|
|
|
|
{
|
|
|
|
/* No conversion */
|
|
|
|
int2store(pos, charset_for_protocol->number);
|
|
|
|
int4store(pos + 2, field.length);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* With conversion */
|
|
|
|
int2store(pos, thd_charset->number);
|
|
|
|
uint32 field_length= field.max_octet_length(charset_for_protocol,
|
|
|
|
thd_charset);
|
|
|
|
int4store(pos + 2, field_length);
|
|
|
|
}
|
2019-04-01 18:29:45 +02:00
|
|
|
pos[6]= field.type_handler()->type_code_for_protocol();
|
2019-02-21 18:44:44 +01:00
|
|
|
int2store(pos + 7, field.flags);
|
|
|
|
pos[9]= (char) field.decimals;
|
|
|
|
pos[10]= 0; // For the future
|
|
|
|
pos[11]= 0; // For the future
|
|
|
|
pos+= 12;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-07-14 09:06:27 +02:00
|
|
|
if (store_ident(field.table_name) ||
|
|
|
|
store_ident(field.col_name) ||
|
2019-02-21 18:44:44 +01:00
|
|
|
packet->realloc(packet->length() + 10))
|
|
|
|
return true;
|
|
|
|
pos= (char*) packet->end();
|
|
|
|
pos[0]= 3;
|
|
|
|
int3store(pos + 1, field.length);
|
|
|
|
pos[4]= 1;
|
2019-04-01 18:29:45 +02:00
|
|
|
pos[5]= field.type_handler()->type_code_for_protocol();
|
2019-02-21 18:44:44 +01:00
|
|
|
pos[6]= 3;
|
|
|
|
int2store(pos + 7, field.flags);
|
|
|
|
pos[9]= (char) field.decimals;
|
|
|
|
pos+= 10;
|
|
|
|
}
|
|
|
|
packet->length((uint) (pos - packet->ptr()));
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
/**
|
2002-12-11 08:17:51 +01:00
|
|
|
Send name and type of result to client.
|
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
Sum fields has table name empty and field_name.
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
@param THD Thread data object
|
|
|
|
@param list List of items to send to client
|
|
|
|
@param flag Bit mask with the following functions:
|
|
|
|
- 1 send number of rows
|
|
|
|
- 2 send default values
|
|
|
|
- 4 don't write eof packet
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
@retval
|
2002-12-11 08:17:51 +01:00
|
|
|
0 ok
|
2007-10-11 20:37:45 +02:00
|
|
|
@retval
|
|
|
|
1 Error (Note that in this case the error is not sent to the
|
|
|
|
client)
|
2002-12-11 08:17:51 +01:00
|
|
|
*/
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
List_iterator_fast<Item> it(*list);
|
|
|
|
Item *item;
|
2019-02-21 18:44:44 +01:00
|
|
|
Protocol_text prot(thd, thd->variables.net_buffer_length);
|
2011-10-19 21:45:18 +02:00
|
|
|
DBUG_ENTER("Protocol::send_result_set_metadata");
|
2002-12-11 08:17:51 +01:00
|
|
|
|
Port of cursors to be pushed into 5.0 tree:
- client side part is simple and may be considered stable
- server side part now just joggles with THD state to save execution
state and has no additional locking wisdom.
Lot's of it are to be rewritten.
include/mysql.h:
Cursor patch to push into the main tree, client library part (considered
stable):
- new statement attribute STMT_ATTR_CURSOR_TYPE
- MYSQL_STMT::flags to store statement cursor type
- MYSQL_STMT::server_status to store server status (i. e. if the server
was able to open a cursor for this query).
include/mysql_com.h:
Cursor patch to push into the main tree, client library part (considered
stable):
- new COMmand, COM_FETCH, to fetch K rows from read-only cursor.
By design should support scrollable cursors as well.
- a few new server statuses:
SERVER_STATUS_CURSOR_EXISTS is sent by server in reply to COM_EXECUTE,
when cursor was successfully opened for this query
SERVER_STATUS_LAST_ROW_SENT is sent along with the last row to prevent one
more round trip just for finding out that all rows were fetched from
this cursor (this is server mem savier also).
- and finally, all possible values of STMT_ATTR_CURSOR_TYPE,
while now we support only CURSORT_TYPE_NO_CURSOR and
CURSOR_TYPE_READ_ONLY
libmysql/libmysql.c:
Cursor patch to push into the main tree, client library part (considered
stable):
- simple additions to mysql_stmt_fetch implementation to read data
from an opened cursor: we can read up to iteration count rows per
one request; read rows are buffered in the same way as rows of
mysql_stmt_store_result.
- now send stmt->flags to server to let him now if we wish to have
a cursor for this statement.
- support for setting/getting statement cursor type.
libmysqld/examples/Makefile.am:
Testing cursors was originally implemented in C++. Now when these tests
go into client_test, it's time to convert it to C++ as well.
libmysqld/lib_sql.cc:
- cleanup: send_fields flags are now named.
sql/ha_innodb.cc:
- cleanup: send_fields flags are now named.
sql/mysql_priv.h:
- cursors support: declaration for server-side handler of COM_FETCH
sql/protocol.cc:
- cleanup: send_fields flags are now named.
- we can't anymore assert that field_types[field_pos] is sensible:
if we have COM_EXCUTE(stmt1), COM_EXECUTE(stmt2), COM_FETCH(stmt1)
field_types[field_pos] will point to fields of stmt2.
sql/protocol.h:
- cleanup: send_fields flag_s_ are now named.
sql/protocol_cursor.cc:
- cleanup: send_fields flags are now named.
sql/repl_failsafe.cc:
- cleanup: send_fields flags are now named.
sql/slave.cc:
- cleanup: send_fields flags are now named.
sql/sp.cc:
- cleanup: send_fields flags are now named.
sql/sp_head.cc:
- cleanup: send_fields flags are now named.
sql/sql_acl.cc:
- cleanup: send_fields flags are now named.
sql/sql_class.cc:
- cleanup: send_fields flags are now named.
sql/sql_class.h:
- cleanup: send_fields flags are now named.
sql/sql_error.cc:
- cleanup: send_fields flags are now named.
sql/sql_handler.cc:
- cleanup: send_fields flags are now named.
sql/sql_help.cc:
- cleanup: send_fields flags are now named.
sql/sql_parse.cc:
Server side support for cursors:
- handle COM_FETCH
- enforce assumption that whenever we free thd->free_list,
we reset it to zero. This way it's much easier to handle free_list
in prepared statements implementation.
sql/sql_prepare.cc:
Server side support for cursors:
- implementation of mysql_stmt_fetch (fetch some rows from open cursor).
- management of cursors memory is quite tricky now.
- execute_stmt can't be reused anymore in mysql_stmt_execute and
mysql_sql_stmt_execute
sql/sql_repl.cc:
- cleanup: send_fields flags are now named.
sql/sql_select.cc:
Server side support for cursors:
- implementation of Cursor::open, Cursor::fetch (buggy when it comes to
non-equi joins), cursor cleanups.
- -4 -3 -0 constants indicating return value of sub_select and end_send are
to be renamed to something more readable:
it turned out to be not so simple, so it should come with the other patch.
sql/sql_select.h:
Server side support for cursors:
- declaration of Cursor class.
- JOIN::fetch_limit contains runtime value of rows fetched via cursor.
sql/sql_show.cc:
- cleanup: send_fields flags are now named.
sql/sql_table.cc:
- cleanup: send_fields flags are now named.
sql/sql_union.cc:
- if there was a cursor, don't cleanup unit: we'll need it to fetch
the rest of the rows.
tests/Makefile.am:
Now client_test is in C++.
tests/client_test.cc:
A few elementary tests for cursors.
BitKeeper/etc/ignore:
Added libmysqld/examples/client_test.cc to the ignore list
2004-08-03 12:32:21 +02:00
|
|
|
if (flags & SEND_NUM_ROWS)
|
2002-12-11 08:17:51 +01:00
|
|
|
{ // Packet with number of elements
|
2017-05-04 14:05:21 +02:00
|
|
|
uchar buff[MAX_INT_WIDTH];
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
uchar *pos= net_store_length(buff, list->elements);
|
2017-05-04 14:05:21 +02:00
|
|
|
DBUG_ASSERT(pos <= buff + sizeof(buff));
|
2010-07-21 09:56:43 +02:00
|
|
|
if (my_net_write(&thd->net, buff, (size_t) (pos-buff)))
|
|
|
|
DBUG_RETURN(1);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
field_handlers= (const Type_handler**) thd->alloc(sizeof(field_handlers[0]) *
|
|
|
|
list->elements);
|
2002-12-11 08:17:51 +01:00
|
|
|
#endif
|
|
|
|
|
2019-02-21 18:44:44 +01:00
|
|
|
for (uint pos= 0; (item=it++); pos++)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
prot.prepare_for_resend();
|
2019-02-21 18:44:44 +01:00
|
|
|
if (prot.store_field_metadata(thd, item, pos))
|
|
|
|
goto err;
|
2002-12-11 08:17:51 +01:00
|
|
|
if (prot.write())
|
2010-07-21 09:56:43 +02:00
|
|
|
DBUG_RETURN(1);
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
field_handlers[pos]= item->type_handler();
|
2002-12-11 08:17:51 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
Port of cursors to be pushed into 5.0 tree:
- client side part is simple and may be considered stable
- server side part now just joggles with THD state to save execution
state and has no additional locking wisdom.
Lot's of it are to be rewritten.
include/mysql.h:
Cursor patch to push into the main tree, client library part (considered
stable):
- new statement attribute STMT_ATTR_CURSOR_TYPE
- MYSQL_STMT::flags to store statement cursor type
- MYSQL_STMT::server_status to store server status (i. e. if the server
was able to open a cursor for this query).
include/mysql_com.h:
Cursor patch to push into the main tree, client library part (considered
stable):
- new COMmand, COM_FETCH, to fetch K rows from read-only cursor.
By design should support scrollable cursors as well.
- a few new server statuses:
SERVER_STATUS_CURSOR_EXISTS is sent by server in reply to COM_EXECUTE,
when cursor was successfully opened for this query
SERVER_STATUS_LAST_ROW_SENT is sent along with the last row to prevent one
more round trip just for finding out that all rows were fetched from
this cursor (this is server mem savier also).
- and finally, all possible values of STMT_ATTR_CURSOR_TYPE,
while now we support only CURSORT_TYPE_NO_CURSOR and
CURSOR_TYPE_READ_ONLY
libmysql/libmysql.c:
Cursor patch to push into the main tree, client library part (considered
stable):
- simple additions to mysql_stmt_fetch implementation to read data
from an opened cursor: we can read up to iteration count rows per
one request; read rows are buffered in the same way as rows of
mysql_stmt_store_result.
- now send stmt->flags to server to let him now if we wish to have
a cursor for this statement.
- support for setting/getting statement cursor type.
libmysqld/examples/Makefile.am:
Testing cursors was originally implemented in C++. Now when these tests
go into client_test, it's time to convert it to C++ as well.
libmysqld/lib_sql.cc:
- cleanup: send_fields flags are now named.
sql/ha_innodb.cc:
- cleanup: send_fields flags are now named.
sql/mysql_priv.h:
- cursors support: declaration for server-side handler of COM_FETCH
sql/protocol.cc:
- cleanup: send_fields flags are now named.
- we can't anymore assert that field_types[field_pos] is sensible:
if we have COM_EXCUTE(stmt1), COM_EXECUTE(stmt2), COM_FETCH(stmt1)
field_types[field_pos] will point to fields of stmt2.
sql/protocol.h:
- cleanup: send_fields flag_s_ are now named.
sql/protocol_cursor.cc:
- cleanup: send_fields flags are now named.
sql/repl_failsafe.cc:
- cleanup: send_fields flags are now named.
sql/slave.cc:
- cleanup: send_fields flags are now named.
sql/sp.cc:
- cleanup: send_fields flags are now named.
sql/sp_head.cc:
- cleanup: send_fields flags are now named.
sql/sql_acl.cc:
- cleanup: send_fields flags are now named.
sql/sql_class.cc:
- cleanup: send_fields flags are now named.
sql/sql_class.h:
- cleanup: send_fields flags are now named.
sql/sql_error.cc:
- cleanup: send_fields flags are now named.
sql/sql_handler.cc:
- cleanup: send_fields flags are now named.
sql/sql_help.cc:
- cleanup: send_fields flags are now named.
sql/sql_parse.cc:
Server side support for cursors:
- handle COM_FETCH
- enforce assumption that whenever we free thd->free_list,
we reset it to zero. This way it's much easier to handle free_list
in prepared statements implementation.
sql/sql_prepare.cc:
Server side support for cursors:
- implementation of mysql_stmt_fetch (fetch some rows from open cursor).
- management of cursors memory is quite tricky now.
- execute_stmt can't be reused anymore in mysql_stmt_execute and
mysql_sql_stmt_execute
sql/sql_repl.cc:
- cleanup: send_fields flags are now named.
sql/sql_select.cc:
Server side support for cursors:
- implementation of Cursor::open, Cursor::fetch (buggy when it comes to
non-equi joins), cursor cleanups.
- -4 -3 -0 constants indicating return value of sub_select and end_send are
to be renamed to something more readable:
it turned out to be not so simple, so it should come with the other patch.
sql/sql_select.h:
Server side support for cursors:
- declaration of Cursor class.
- JOIN::fetch_limit contains runtime value of rows fetched via cursor.
sql/sql_show.cc:
- cleanup: send_fields flags are now named.
sql/sql_table.cc:
- cleanup: send_fields flags are now named.
sql/sql_union.cc:
- if there was a cursor, don't cleanup unit: we'll need it to fetch
the rest of the rows.
tests/Makefile.am:
Now client_test is in C++.
tests/client_test.cc:
A few elementary tests for cursors.
BitKeeper/etc/ignore:
Added libmysqld/examples/client_test.cc to the ignore list
2004-08-03 12:32:21 +02:00
|
|
|
if (flags & SEND_EOF)
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
{
|
2016-04-15 20:40:25 +02:00
|
|
|
|
|
|
|
/* if it is new client do not send EOF packet */
|
|
|
|
if (!(thd->client_capabilities & CLIENT_DEPRECATE_EOF))
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
Mark the end of meta-data result set, and store thd->server_status,
|
|
|
|
to show that there is no cursor.
|
|
|
|
Send no warning information, as it will be sent at statement end.
|
|
|
|
*/
|
|
|
|
if (write_eof_packet(thd, &thd->net, thd->server_status,
|
|
|
|
thd->get_stmt_da()->current_statement_warn_count()))
|
|
|
|
DBUG_RETURN(1);
|
|
|
|
}
|
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().
include/mysql_com.h:
Rename now unused members of NET: no_send_ok, no_send_error, report_error.
These were server-specific variables related to the client/server
protocol. They have been made obsolete by this patch.
Previously the same members of NET were used to store the error message
both on the client and on the server.
The error message was stored in net.last_error (client: mysql->net.last_error,
server: thd->net.last_error).
The error code was stored in net.last_errno (client: mysql->net.last_errno,
server: thd->net.last_errno).
The server error code and message are now stored elsewhere
(in the Diagnostics_area), thus NET members are no longer used by the
server.
Rename last_error to client_last_error, last_errno to client_last_errno
to avoid potential bugs introduced by merges.
include/mysql_h.ic:
Update the ABI file to reflect a rename.
Renames do not break the binary compatibility.
libmysql/libmysql.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
This is necessary to ensure no unnoticed bugs introduced by merged
changesets.
Remove net.report_error, net.no_send_ok, net.no_send_error.
libmysql/manager.c:
Rename net.last_errno to net.client_last_errno.
libmysqld/lib_sql.cc:
Rename net.last_errno to net.client_last_errno.
Update the embedded implementation of the client-server protocol to
reflect the refactoring of protocol.cc.
libmysqld/libmysqld.c:
Rename net.last_errno to net.client_last_errno.
mysql-test/r/events.result:
Update to reflect the change in mysql_rm_db(). Now we drop stored
routines and events for a given database name only if there
is a directory for this database name. ha_drop_database() and
query_cache_invalidate() are called likewise.
Previously we would attempt to drop routines/events even if database
directory was not found (it worked, since routines and events are stored
in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
does not exist".
The change was done because the previous code used to call send_ok()
twice, which led to an assertion failure when asserts against it were
added by this patch.
mysql-test/r/grant.result:
Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error
if mysql.procs_priv is missing.
This fixes the assert that send_ok() must not called after send_error()
(the original patch for Bug 16470 was prone to this).
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Produce a more detailed error message.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Produce a more detailed error message.
mysql-test/t/grant.test:
Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
is missing.
server-tools/instance-manager/mysql_connection.cc:
Rename net.last_errno to net.client_last_errno.
sql/ha_ndbcluster_binlog.cc:
Add asserts.
Use getters to access statement status information.
Add a comment why run_query() is broken. Reset the diagnostics area
in the end of run_query() to fulfill the invariant that the diagnostics_area
is never assigned twice per statement (see the comment in the code
when this can happen). We still do not clear thd->is_fatal_error and
thd->is_slave_error, which may lead to bugs, I consider the whole affair
as something to be dealt with separately.
sql/ha_partition.cc:
fatal_error() doesn't set an error by itself. Perhaps we should
remove this method altogether and instead add a flag to my_error
to set thd->is_fatal_error property.
Meanwhile, this change is a part of inspection made to the entire source
code with the goal to ensure that fatal_error()
is always accompanied by my_error().
sql/item_func.cc:
There is no net.last_error anymore. Remove the obsolete assignment.
sql/log_event.cc:
Use getters to access statement error status information.
sql/log_event_old.cc:
Use getters to access statement error status information.
sql/mysqld.cc:
Previously, if a continue handler for an error was found, my_message_sql()
would not set an error in THD. Since the current statement
must be aborted in any case, find_handler() had a hack to assign
thd->net.report_error to 1.
Remove this hack. Set an error in my_message_sql() even if the continue
handler is found. The error will be cleared anyway when the handler
is executed. This is one action among many in this patch to ensure the
invariant that whenever thd->is_error() is TRUE, we have a message in
thd->main_da.message().
sql/net_serv.cc:
Use a full-blown my_error() in net_serv.cc to report an error,
instead of just setting net->last_errno. This ensures the invariant that
whenever thd->is_error() returns TRUE, we have a message in
thd->main_da.message().
Remove initialization of removed NET members.
sql/opt_range.cc:
Use my_error() instead of just raising thd->net.report_error.
This ensures the invariant that whenever thd->is_error() returns TRUE,
there is a message in thd->main_da.message().
sql/opt_sum.cc:
Move invocation of fatal_error() right next to the place where
we set the error message. That makes it easier to track that whenever
fatal_error() is called, there is a message in THD.
sql/protocol.cc:
Rename send_ok() and send_eof() to net_send_ok() and net_send_eof()
respectively. These functions write directly to the network and are not
for use anywhere outside the client/server protocol code.
Remove the code that was responsible for cases when either there is
no error code, or no error message, or both.
Instead the calling code ensures that they are always present. Asserts
are added to enforce the invariant.
Instead of a direct access to thd->server_status and thd->total_warn_count
use function parameters, since these from now on don't always come directly
from THD.
Introduce net_end_statement(), the single-entry-point replacement API for
send_ok(), send_eof() and net_send_error().
Implement Protocol::end_partial_result_set to use in select_send::abort()
when there is a continue handler.
sql/protocol.h:
Update declarations.
sql/repl_failsafe.cc:
Use getters to access statement status information in THD.
Rename net.last_error to net.client_last_error.
sql/rpl_record.cc:
Set an error message in prepare_record() if there is no default
value for the field -- later we do print this message to the client.
sql/rpl_rli.cc:
Use getters to access statement status information in THD.
sql/slave.cc:
In create_table_from_dump() (a common function that is used in
LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
Update has_temporary_error() to work correctly when no error is set.
This is the case when Incident_log_event is executed: it always returns
an error but does not set an error message.
Use getters to access error status information.
sql/sp_head.cc:
Instead of hacks with no_send_error, work through the diagnostics area
interface to suppress sending of OK/ERROR packets to the client.
Move query_cache_end_of_result before log_slow_statement(), similarly
to how it's done in dispatch_command().
sql/sp_rcontext.cc:
Remove hacks with assignment of thd->net.report_error, they are not
necessary any more (see the changes in mysqld.cc).
sql/sql_acl.cc:
Use getters to access error status information in THD.
sql/sql_base.cc:
Access thd->main_da.sql_errno() only if there is an error. This fixes
a bug when auto-discovery, that was effectively disabled under pre-locking.
sql/sql_binlog.cc:
Remove hacks with no_send_ok/no_send_error, they are not necessary
anymore: the caller is responsible for network communication.
sql/sql_cache.cc:
Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
if the response has been served from the query cache. This raises the
question whether we should store EOF packet in the query cache at all,
or generate it anew for each statement (we should generate it anew), but
this is to be addressed separately.
sql/sql_class.cc:
Implement class Diagnostics_area. Please see comments in sql_class.h
for details.
Fix a subtle coding mistake in select_send::send_data: when on slave,
an error in Item::send() was ignored.
The problem became visible due to asserts that the diagnostics area is
never double assigned.
Remove initialization of removed NET members.
In select_send::abort() do not call select_send::send_eof(). This is
not inheritance-safe. Even if a stored procedure continue handler is
found, the current statement is aborted, not succeeded.
Instead introduce a Protocol API to send the required response,
Protocol::end_partial_result_set().
This simplifies implementation of select_send::send_eof(). No need
to add more asserts that there is no error, there is an assert inside
Diagnostics_area::set_ok_status() already.
Leave no trace of no_send_* in the code.
sql/sql_class.h:
Declare class Diagnostics_area.
Remove the hack with no_send_ok from
Substatement_state.
Provide inline implementations of send_ok/send_eof.
Add commetns.
sql/sql_connect.cc:
Remove hacks with no_send_error.
Since now an error in THD is always set if net->error, it's not necessary
to check both net->error and thd->is_error() in the do_command loop.
Use thd->main_da.message() instead of net->last_errno.
Remove the hack with is_slave_error in sys_init_connect. Since now we do not
reset the diagnostics area in net_send_error (it's reset at the beginning
of the next statement), we can access it safely even after
execute_init_command.
sql/sql_db.cc:
Update the code to satisfy the invariant that the diagnostics area is never
assigned twice.
Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if
mysql.proc does not exist".
sql/sql_delete.cc:
Change multi-delete to abort in abort(), as per select_send protocol.
Fixes the merge error with the test for Bug 29136
sql/sql_derived.cc:
Use getters to access error information.
sql/sql_insert.cc:
Use getters to access error information.
sql-common/client.c:
Rename last_error to client_last_error, last_errno to client_last_errno.
sql/sql_parse.cc:
Remove hacks with no_send_error. Deploy net_end_statement().
The story of COM_SHUTDOWN is interesting. Long story short, the server
would become on its death's door, and only no_send_ok/no_send_error assigned
by send_ok()/net_send_error() would hide its babbling from the client.
First of all, COM_QUIT does not require a response. So, the comment saying
"Let's send a response to possible COM_QUIT" is not only groundless
(even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after
COM_SHUTDOWN), it's plainly incorrect.
Secondly, besides this additional 'OK' packet to respond to a hypothetical
COM_QUIT, there was the following code in dispatch_command():
if (thd->killed)
thd->send_kill_message();
if (thd->is_error()
net_send_error(thd);
This worked out really funny for the thread through which COM_SHUTDOWN
was delivered: we would get COM_SHUTDOWN, say okay, say okay again,
kill everybody, get the kill signal ourselves, and then attempt to say
"Server shutdown in progress" to the client that is very likely long gone.
This all became visible when asserts were added that the Diagnostics_area
is not assigned twice.
Move query_cache_end_of_result() to the end of dispatch_command(), since
net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
is a no-op if there is no started query in the cache.
Consistently use select_send interface to call abort() or send_eof()
depending on the operation result.
Remove thd->fatal_error() from reset_master(), it was a no-op.
in hacks with no_send_error woudl save us
from complete breakage of the client/server protocol.
Consistently use select_send::abort() whenever there is an error,
and select_send::send_eof() in case of success.
The issue became visible due to added asserts.
sql/sql_partition.cc:
Always set an error in THD whenever there is a call to fatal_error().
sql/sql_prepare.cc:
Deploy class Diagnostics_area.
Remove the unnecessary juggling with the protocol in
Select_fetch_protocol_binary::send_eof(). EOF packet format is
protocol-independent.
sql/sql_select.cc:
Call fatal_error() directly in opt_sum_query.
Call my_error() whenever we call thd->fatal_error().
sql/sql_servers.cc:
Use getters to access error information in THD.
sql/sql_show.cc:
Use getters to access error information in THD.
Add comments.
Call my_error() whenever we call fatal_error().
sql/sql_table.cc:
Replace hacks with no_send_ok with the interface of the diagnostics area.
Clear the error if ENOENT error in ha_delete_table().
sql/sql_update.cc:
Introduce multi_update::abort(), which is the proper way to abort a
multi-update. This fixes the merge conflict between this patch and
the patch for Bug 29136.
sql/table.cc:
Use a getter to access error information in THD.
sql/tztime.cc:
Use a getter to access error information in THD.
2007-12-12 16:21:01 +01:00
|
|
|
}
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
DBUG_RETURN(prepare_for_send(list->elements));
|
2002-12-11 08:17:51 +01:00
|
|
|
|
|
|
|
err:
|
2015-07-06 19:24:14 +02:00
|
|
|
my_message(ER_OUT_OF_RESOURCES, ER_THD(thd, ER_OUT_OF_RESOURCES),
|
2004-11-12 13:34:00 +01:00
|
|
|
MYF(0)); /* purecov: inspected */
|
2002-12-11 08:17:51 +01:00
|
|
|
DBUG_RETURN(1); /* purecov: inspected */
|
|
|
|
}
|
|
|
|
|
2003-02-04 02:19:19 +01:00
|
|
|
|
2019-02-21 18:44:44 +01:00
|
|
|
bool Protocol::send_list_fields(List<Field> *list, const TABLE_LIST *table_list)
|
|
|
|
{
|
|
|
|
DBUG_ENTER("Protocol::send_list_fields");
|
|
|
|
List_iterator_fast<Field> it(*list);
|
|
|
|
Field *fld;
|
|
|
|
Protocol_text prot(thd, thd->variables.net_buffer_length);
|
|
|
|
|
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
field_handlers= (const Type_handler **) thd->alloc(sizeof(field_handlers[0]) *
|
|
|
|
list->elements);
|
2019-02-21 18:44:44 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
for (uint pos= 0; (fld= it++); pos++)
|
|
|
|
{
|
|
|
|
prot.prepare_for_resend();
|
|
|
|
if (prot.store_field_metadata_for_list_fields(thd, fld, table_list, pos))
|
|
|
|
goto err;
|
|
|
|
prot.store(fld); // Send default value
|
|
|
|
if (prot.write())
|
|
|
|
DBUG_RETURN(1);
|
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
/*
|
|
|
|
Historically all BLOB variant Fields are displayed as
|
|
|
|
MYSQL_TYPE_BLOB in metadata.
|
|
|
|
See Field_blob::make_send_field() for more comments.
|
|
|
|
*/
|
|
|
|
field_handlers[pos]= Send_field(fld).type_handler();
|
2019-02-21 18:44:44 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
DBUG_RETURN(prepare_for_send(list->elements));
|
|
|
|
|
|
|
|
err:
|
|
|
|
my_message(ER_OUT_OF_RESOURCES, ER_THD(thd, ER_OUT_OF_RESOURCES), MYF(0));
|
|
|
|
DBUG_RETURN(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-12-11 08:17:51 +01:00
|
|
|
bool Protocol::write()
|
|
|
|
{
|
|
|
|
DBUG_ENTER("Protocol::write");
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
DBUG_RETURN(my_net_write(&thd->net, (uchar*) packet->ptr(),
|
|
|
|
packet->length()));
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
2003-01-15 09:11:44 +01:00
|
|
|
#endif /* EMBEDDED_LIBRARY */
|
|
|
|
|
|
|
|
|
2019-02-21 18:44:44 +01:00
|
|
|
bool Protocol_text::store_field_metadata(THD *thd, Item *item, uint pos)
|
|
|
|
{
|
2019-04-01 18:29:45 +02:00
|
|
|
Send_field field(thd, item);
|
2019-02-21 18:44:44 +01:00
|
|
|
return store_field_metadata(thd, field, item->charset_for_protocol(), pos);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Protocol_text::store_field_metadata_for_list_fields(const THD *thd,
|
|
|
|
Field *fld,
|
|
|
|
const TABLE_LIST *tl,
|
|
|
|
uint pos)
|
|
|
|
{
|
|
|
|
Send_field field= tl->view ?
|
2019-05-26 04:17:35 +02:00
|
|
|
Send_field(fld, tl->view_db, tl->view_name) :
|
2019-02-21 18:44:44 +01:00
|
|
|
Send_field(fld);
|
|
|
|
return store_field_metadata(thd, field, fld->charset_for_protocol(), pos);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
/**
|
|
|
|
Send one result set row.
|
|
|
|
|
|
|
|
@param row_items a collection of column values for that row
|
|
|
|
|
|
|
|
@return Error status.
|
|
|
|
@retval TRUE Error.
|
|
|
|
@retval FALSE Success.
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool Protocol::send_result_set_row(List<Item> *row_items)
|
|
|
|
{
|
|
|
|
List_iterator_fast<Item> it(*row_items);
|
|
|
|
|
|
|
|
DBUG_ENTER("Protocol::send_result_set_row");
|
|
|
|
|
|
|
|
for (Item *item= it++; item; item= it++)
|
|
|
|
{
|
2017-05-04 14:05:21 +02:00
|
|
|
/*
|
|
|
|
ValueBuffer::m_string can be altered during Item::send().
|
|
|
|
It's important to declare value_buffer inside the loop,
|
|
|
|
to have ValueBuffer::m_string point to ValueBuffer::buffer
|
|
|
|
on every iteration.
|
|
|
|
*/
|
|
|
|
ValueBuffer<MAX_FIELD_WIDTH> value_buffer;
|
|
|
|
if (item->send(this, &value_buffer))
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
{
|
|
|
|
// If we're out of memory, reclaim some, to help us recover.
|
|
|
|
this->free();
|
|
|
|
DBUG_RETURN(TRUE);
|
|
|
|
}
|
|
|
|
/* Item::send() may generate an error. If so, abort the loop. */
|
2018-04-04 11:16:12 +02:00
|
|
|
if (unlikely(thd->is_error()))
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
DBUG_RETURN(TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
DBUG_RETURN(FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
/**
|
|
|
|
Send \\0 end terminated string.
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
@param from NullS or \\0 terminated string
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
@note
|
2002-12-11 08:17:51 +01:00
|
|
|
In most cases one should use store(from, length) instead of this function
|
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
@retval
|
2002-12-11 08:17:51 +01:00
|
|
|
0 ok
|
2007-10-11 20:37:45 +02:00
|
|
|
@retval
|
2002-12-11 08:17:51 +01:00
|
|
|
1 error
|
|
|
|
*/
|
|
|
|
|
2003-03-17 10:14:04 +01:00
|
|
|
bool Protocol::store(const char *from, CHARSET_INFO *cs)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
if (!from)
|
|
|
|
return store_null();
|
2018-02-06 13:55:58 +01:00
|
|
|
size_t length= strlen(from);
|
2003-03-17 10:14:04 +01:00
|
|
|
return store(from, length, cs);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
/**
|
|
|
|
Send a set of strings as one long string with ',' in between.
|
2002-12-11 08:17:51 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
bool Protocol::store(I_List<i_string>* str_list)
|
|
|
|
{
|
|
|
|
char buf[256];
|
2003-02-26 11:08:31 +01:00
|
|
|
String tmp(buf, sizeof(buf), &my_charset_bin);
|
2002-12-14 16:43:01 +01:00
|
|
|
uint32 len;
|
2002-12-11 08:17:51 +01:00
|
|
|
I_List_iterator<i_string> it(*str_list);
|
|
|
|
i_string* s;
|
|
|
|
|
2002-12-14 16:43:01 +01:00
|
|
|
tmp.length(0);
|
2002-12-11 08:17:51 +01:00
|
|
|
while ((s=it++))
|
|
|
|
{
|
|
|
|
tmp.append(s->ptr);
|
2002-12-14 16:43:01 +01:00
|
|
|
tmp.append(',');
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
2002-12-14 16:43:01 +01:00
|
|
|
if ((len= tmp.length()))
|
|
|
|
len--; // Remove last ','
|
2003-03-17 10:14:04 +01:00
|
|
|
return store((char*) tmp.ptr(), len, tmp.charset());
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
Functions to handle the simple (default) protocol where everything is
|
|
|
|
This protocol is the one that is used by default between the MySQL server
|
|
|
|
and client when you are not using prepared statements.
|
|
|
|
|
|
|
|
All data are sent as 'packed-string-length' followed by 'string-data'
|
|
|
|
****************************************************************************/
|
|
|
|
|
2003-01-15 09:11:44 +01:00
|
|
|
#ifndef EMBEDDED_LIBRARY
|
2007-01-30 22:48:05 +01:00
|
|
|
void Protocol_text::prepare_for_resend()
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
packet->length(0);
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2002-12-11 08:17:51 +01:00
|
|
|
field_pos= 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_text::store_null()
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2002-12-11 08:17:51 +01:00
|
|
|
field_pos++;
|
|
|
|
#endif
|
|
|
|
char buff[1];
|
2003-01-03 12:52:53 +01:00
|
|
|
buff[0]= (char)251;
|
2004-06-09 01:21:50 +02:00
|
|
|
return packet->append(buff, sizeof(buff), PACKET_BUFFER_EXTRA_ALLOC);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
2003-01-20 15:47:25 +01:00
|
|
|
#endif
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2003-02-04 02:19:19 +01:00
|
|
|
|
2007-10-11 20:37:45 +02:00
|
|
|
/**
|
2004-05-25 00:03:49 +02:00
|
|
|
Auxilary function to convert string to the given character set
|
|
|
|
and store in network buffer.
|
|
|
|
*/
|
|
|
|
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
bool Protocol::store_string_aux(const char *from, size_t length,
|
2020-07-24 04:46:40 +02:00
|
|
|
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
|
2004-05-25 00:03:49 +02:00
|
|
|
{
|
|
|
|
/* 'tocs' is set 0 when client issues SET character_set_results=NULL */
|
2020-07-24 04:46:40 +02:00
|
|
|
if (needs_conversion(fromcs, tocs))
|
2004-05-25 00:03:49 +02:00
|
|
|
{
|
2009-09-30 07:09:28 +02:00
|
|
|
/* Store with conversion */
|
2014-04-15 15:08:33 +02:00
|
|
|
return net_store_data_cs((uchar*) from, length, fromcs, tocs);
|
2004-05-25 00:03:49 +02:00
|
|
|
}
|
2009-09-30 07:09:28 +02:00
|
|
|
/* Store without conversion */
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
return net_store_data((uchar*) from, length);
|
2004-05-25 00:03:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-08-09 12:25:22 +02:00
|
|
|
bool Protocol_text::store_numeric_string_aux(const char *from, size_t length)
|
|
|
|
{
|
|
|
|
CHARSET_INFO *tocs= thd->variables.character_set_results;
|
|
|
|
// 'tocs' is NULL when the client issues SET character_set_results=NULL
|
|
|
|
if (tocs && (tocs->state & MY_CS_NONASCII)) // Conversion needed
|
|
|
|
return net_store_data_cs((uchar*) from, length, &my_charset_latin1, tocs);
|
|
|
|
return net_store_data((uchar*) from, length); // No conversion
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-12-06 15:51:05 +01:00
|
|
|
bool Protocol::store_warning(const char *from, size_t length)
|
|
|
|
{
|
|
|
|
BinaryStringBuffer<MYSQL_ERRMSG_SIZE> tmp;
|
|
|
|
CHARSET_INFO *cs= thd->variables.character_set_results;
|
2020-05-06 11:19:35 +02:00
|
|
|
if (!cs || cs == &my_charset_bin)
|
2019-12-06 15:51:05 +01:00
|
|
|
cs= system_charset_info;
|
|
|
|
if (tmp.copy_printable_hhhh(cs, system_charset_info, from, length))
|
|
|
|
return net_store_data((const uchar*)"", 0);
|
|
|
|
return net_store_data((const uchar *) tmp.ptr(), tmp.length());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-07-14 09:06:27 +02:00
|
|
|
bool Protocol_text::store_str(const char *from, size_t length,
|
2020-07-24 04:46:40 +02:00
|
|
|
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2020-07-17 16:56:17 +02:00
|
|
|
DBUG_PRINT("info", ("Protocol_text::store field %u : %.*b", field_pos,
|
|
|
|
(int) length, (length == 0 ? "" : from)));
|
2020-07-13 17:59:09 +02:00
|
|
|
DBUG_ASSERT(field_handlers == 0 || field_pos < field_count);
|
2019-04-01 18:29:45 +02:00
|
|
|
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_STRING));
|
2002-12-11 08:17:51 +01:00
|
|
|
field_pos++;
|
|
|
|
#endif
|
2020-07-24 04:46:40 +02:00
|
|
|
return store_string_aux(from, length, fromcs, tocs);
|
2003-04-07 10:52:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_text::store_tiny(longlong from)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_TINY));
|
2003-03-15 11:56:03 +01:00
|
|
|
field_pos++;
|
2002-12-11 08:17:51 +01:00
|
|
|
#endif
|
2018-08-11 12:11:59 +02:00
|
|
|
char buff[22];
|
2020-08-09 12:25:22 +02:00
|
|
|
size_t length= (size_t) (int10_to_str((int) from, buff, -10) - buff);
|
|
|
|
return store_numeric_string_aux(buff, length);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
2003-02-04 02:19:19 +01:00
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_text::store_short(longlong from)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_SHORT));
|
2003-03-15 11:56:03 +01:00
|
|
|
field_pos++;
|
2002-12-11 08:17:51 +01:00
|
|
|
#endif
|
2018-08-11 12:11:59 +02:00
|
|
|
char buff[22];
|
2020-08-09 12:25:22 +02:00
|
|
|
size_t length= (size_t) (int10_to_str((int) from, buff, -10) - buff);
|
|
|
|
return store_numeric_string_aux(buff, length);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
2003-02-04 02:19:19 +01:00
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_text::store_long(longlong from)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_LONG));
|
2003-03-15 11:56:03 +01:00
|
|
|
field_pos++;
|
2002-12-11 08:17:51 +01:00
|
|
|
#endif
|
2018-08-11 12:11:59 +02:00
|
|
|
char buff[22];
|
2020-08-09 12:25:22 +02:00
|
|
|
size_t length= (size_t) (int10_to_str((long int)from, buff,
|
|
|
|
(from < 0) ? - 10 : 10) - buff);
|
|
|
|
return store_numeric_string_aux(buff, length);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_text::store_longlong(longlong from, bool unsigned_flag)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_LONGLONG));
|
2003-03-15 11:56:03 +01:00
|
|
|
field_pos++;
|
2002-12-11 08:17:51 +01:00
|
|
|
#endif
|
|
|
|
char buff[22];
|
2020-08-09 12:25:22 +02:00
|
|
|
size_t length= (size_t) (longlong10_to_str(from, buff,
|
|
|
|
unsigned_flag ? 10 : -10) -
|
|
|
|
buff);
|
|
|
|
return store_numeric_string_aux(buff, length);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_text::store_decimal(const my_decimal *d)
|
2005-02-08 23:50:45 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
DBUG_ASSERT(0); // This method is not used yet
|
2005-02-08 23:50:45 +01:00
|
|
|
field_pos++;
|
|
|
|
#endif
|
2018-08-07 08:48:42 +02:00
|
|
|
StringBuffer<DECIMAL_MAX_STR_LENGTH> str;
|
|
|
|
(void) d->to_string(&str);
|
2020-08-09 12:25:22 +02:00
|
|
|
return store_numeric_string_aux(str.ptr(), str.length());
|
2005-02-08 23:50:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-07-23 12:48:04 +02:00
|
|
|
bool Protocol_text::store_float(float from, uint32 decimals)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_FLOAT));
|
2003-03-15 11:56:03 +01:00
|
|
|
field_pos++;
|
2002-12-11 08:17:51 +01:00
|
|
|
#endif
|
2020-07-23 12:48:04 +02:00
|
|
|
Float(from).to_string(&buffer, decimals);
|
|
|
|
return store_numeric_string_aux(buffer.ptr(), buffer.length());
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
2003-02-04 02:19:19 +01:00
|
|
|
|
2020-07-23 12:48:04 +02:00
|
|
|
bool Protocol_text::store_double(double from, uint32 decimals)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_DOUBLE));
|
2003-03-15 11:56:03 +01:00
|
|
|
field_pos++;
|
2002-12-11 08:17:51 +01:00
|
|
|
#endif
|
2020-07-23 12:48:04 +02:00
|
|
|
buffer.set_real(from, decimals, thd->charset());
|
|
|
|
return store_numeric_string_aux(buffer.ptr(), buffer.length());
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_text::store(Field *field)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2002-12-14 16:43:01 +01:00
|
|
|
if (field->is_null())
|
|
|
|
return store_null();
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2002-12-11 08:17:51 +01:00
|
|
|
field_pos++;
|
|
|
|
#endif
|
|
|
|
char buff[MAX_FIELD_WIDTH];
|
2003-03-21 12:18:52 +01:00
|
|
|
String str(buff,sizeof(buff), &my_charset_bin);
|
2003-05-21 14:44:12 +02:00
|
|
|
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
|
2017-07-03 10:35:44 +02:00
|
|
|
#ifdef DBUG_ASSERT_EXISTS
|
This changeset is largely a handler cleanup changeset (WL#3281), but includes fixes and cleanups that was found necessary while testing the handler changes
Changes that requires code changes in other code of other storage engines.
(Note that all changes are very straightforward and one should find all issues
by compiling a --debug build and fixing all compiler errors and all
asserts in field.cc while running the test suite),
- New optional handler function introduced: reset()
This is called after every DML statement to make it easy for a handler to
statement specific cleanups.
(The only case it's not called is if force the file to be closed)
- handler::extra(HA_EXTRA_RESET) is removed. Code that was there before
should be moved to handler::reset()
- table->read_set contains a bitmap over all columns that are needed
in the query. read_row() and similar functions only needs to read these
columns
- table->write_set contains a bitmap over all columns that will be updated
in the query. write_row() and update_row() only needs to update these
columns.
The above bitmaps should now be up to date in all context
(including ALTER TABLE, filesort()).
The handler is informed of any changes to the bitmap after
fix_fields() by calling the virtual function
handler::column_bitmaps_signal(). If the handler does caching of
these bitmaps (instead of using table->read_set, table->write_set),
it should redo the caching in this code. as the signal() may be sent
several times, it's probably best to set a variable in the signal
and redo the caching on read_row() / write_row() if the variable was
set.
- Removed the read_set and write_set bitmap objects from the handler class
- Removed all column bit handling functions from the handler class.
(Now one instead uses the normal bitmap functions in my_bitmap.c instead
of handler dedicated bitmap functions)
- field->query_id is removed. One should instead instead check
table->read_set and table->write_set if a field is used in the query.
- handler::extra(HA_EXTRA_RETRIVE_ALL_COLS) and
handler::extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) are removed. One should now
instead use table->read_set to check for which columns to retrieve.
- If a handler needs to call Field->val() or Field->store() on columns
that are not used in the query, one should install a temporary
all-columns-used map while doing so. For this, we provide the following
functions:
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
field->val();
dbug_tmp_restore_column_map(table->read_set, old_map);
and similar for the write map:
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
field->val();
dbug_tmp_restore_column_map(table->write_set, old_map);
If this is not done, you will sooner or later hit a DBUG_ASSERT
in the field store() / val() functions.
(For not DBUG binaries, the dbug_tmp_restore_column_map() and
dbug_tmp_restore_column_map() are inline dummy functions and should
be optimized away be the compiler).
- If one needs to temporary set the column map for all binaries (and not
just to avoid the DBUG_ASSERT() in the Field::store() / Field::val()
methods) one should use the functions tmp_use_all_columns() and
tmp_restore_column_map() instead of the above dbug_ variants.
- All 'status' fields in the handler base class (like records,
data_file_length etc) are now stored in a 'stats' struct. This makes
it easier to know what status variables are provided by the base
handler. This requires some trivial variable names in the extra()
function.
- New virtual function handler::records(). This is called to optimize
COUNT(*) if (handler::table_flags() & HA_HAS_RECORDS()) is true.
(stats.records is not supposed to be an exact value. It's only has to
be 'reasonable enough' for the optimizer to be able to choose a good
optimization path).
- Non virtual handler::init() function added for caching of virtual
constants from engine.
- Removed has_transactions() virtual method. Now one should instead return
HA_NO_TRANSACTIONS in table_flags() if the table handler DOES NOT support
transactions.
- The 'xxxx_create_handler()' function now has a MEM_ROOT_root argument
that is to be used with 'new handler_name()' to allocate the handler
in the right area. The xxxx_create_handler() function is also
responsible for any initialization of the object before returning.
For example, one should change:
static handler *myisam_create_handler(TABLE_SHARE *table)
{
return new ha_myisam(table);
}
->
static handler *myisam_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root)
{
return new (mem_root) ha_myisam(table);
}
- New optional virtual function: use_hidden_primary_key().
This is called in case of an update/delete when
(table_flags() and HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) is defined
but we don't have a primary key. This allows the handler to take precisions
in remembering any hidden primary key to able to update/delete any
found row. The default handler marks all columns to be read.
- handler::table_flags() now returns a ulonglong (to allow for more flags).
- New/changed table_flags()
- HA_HAS_RECORDS Set if ::records() is supported
- HA_NO_TRANSACTIONS Set if engine doesn't support transactions
- HA_PRIMARY_KEY_REQUIRED_FOR_DELETE
Set if we should mark all primary key columns for
read when reading rows as part of a DELETE
statement. If there is no primary key,
all columns are marked for read.
- HA_PARTIAL_COLUMN_READ Set if engine will not read all columns in some
cases (based on table->read_set)
- HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS
Renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
- HA_DUPP_POS Renamed to HA_DUPLICATE_POS
- HA_REQUIRES_KEY_COLUMNS_FOR_DELETE
Set this if we should mark ALL key columns for
read when when reading rows as part of a DELETE
statement. In case of an update we will mark
all keys for read for which key part changed
value.
- HA_STATS_RECORDS_IS_EXACT
Set this if stats.records is exact.
(This saves us some extra records() calls
when optimizing COUNT(*))
- Removed table_flags()
- HA_NOT_EXACT_COUNT Now one should instead use HA_HAS_RECORDS if
handler::records() gives an exact count() and
HA_STATS_RECORDS_IS_EXACT if stats.records is exact.
- HA_READ_RND_SAME Removed (no one supported this one)
- Removed not needed functions ha_retrieve_all_cols() and ha_retrieve_all_pk()
- Renamed handler::dupp_pos to handler::dup_pos
- Removed not used variable handler::sortkey
Upper level handler changes:
- ha_reset() now does some overall checks and calls ::reset()
- ha_table_flags() added. This is a cached version of table_flags(). The
cache is updated on engine creation time and updated on open.
MySQL level changes (not obvious from the above):
- DBUG_ASSERT() added to check that column usage matches what is set
in the column usage bit maps. (This found a LOT of bugs in current
column marking code).
- In 5.1 before, all used columns was marked in read_set and only updated
columns was marked in write_set. Now we only mark columns for which we
need a value in read_set.
- Column bitmaps are created in open_binary_frm() and open_table_from_share().
(Before this was in table.cc)
- handler::table_flags() calls are replaced with handler::ha_table_flags()
- For calling field->val() you must have the corresponding bit set in
table->read_set. For calling field->store() you must have the
corresponding bit set in table->write_set. (There are asserts in
all store()/val() functions to catch wrong usage)
- thd->set_query_id is renamed to thd->mark_used_columns and instead
of setting this to an integer value, this has now the values:
MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE
Changed also all variables named 'set_query_id' to mark_used_columns.
- In filesort() we now inform the handler of exactly which columns are needed
doing the sort and choosing the rows.
- The TABLE_SHARE object has a 'all_set' column bitmap one can use
when one needs a column bitmap with all columns set.
(This is used for table->use_all_columns() and other places)
- The TABLE object has 3 column bitmaps:
- def_read_set Default bitmap for columns to be read
- def_write_set Default bitmap for columns to be written
- tmp_set Can be used as a temporary bitmap when needed.
The table object has also two pointer to bitmaps read_set and write_set
that the handler should use to find out which columns are used in which way.
- count() optimization now calls handler::records() instead of using
handler->stats.records (if (table_flags() & HA_HAS_RECORDS) is true).
- Added extra argument to Item::walk() to indicate if we should also
traverse sub queries.
- Added TABLE parameter to cp_buffer_from_ref()
- Don't close tables created with CREATE ... SELECT but keep them in
the table cache. (Faster usage of newly created tables).
New interfaces:
- table->clear_column_bitmaps() to initialize the bitmaps for tables
at start of new statements.
- table->column_bitmaps_set() to set up new column bitmaps and signal
the handler about this.
- table->column_bitmaps_set_no_signal() for some few cases where we need
to setup new column bitmaps but don't signal the handler (as the handler
has already been signaled about these before). Used for the momement
only in opt_range.cc when doing ROR scans.
- table->use_all_columns() to install a bitmap where all columns are marked
as use in the read and the write set.
- table->default_column_bitmaps() to install the normal read and write
column bitmaps, but not signaling the handler about this.
This is mainly used when creating TABLE instances.
- table->mark_columns_needed_for_delete(),
table->mark_columns_needed_for_delete() and
table->mark_columns_needed_for_insert() to allow us to put additional
columns in column usage maps if handler so requires.
(The handler indicates what it neads in handler->table_flags())
- table->prepare_for_position() to allow us to tell handler that it
needs to read primary key parts to be able to store them in
future table->position() calls.
(This replaces the table->file->ha_retrieve_all_pk function)
- table->mark_auto_increment_column() to tell handler are going to update
columns part of any auto_increment key.
- table->mark_columns_used_by_index() to mark all columns that is part of
an index. It will also send extra(HA_EXTRA_KEYREAD) to handler to allow
it to quickly know that it only needs to read colums that are part
of the key. (The handler can also use the column map for detecting this,
but simpler/faster handler can just monitor the extra() call).
- table->mark_columns_used_by_index_no_reset() to in addition to other columns,
also mark all columns that is used by the given key.
- table->restore_column_maps_after_mark_index() to restore to default
column maps after a call to table->mark_columns_used_by_index().
- New item function register_field_in_read_map(), for marking used columns
in table->read_map. Used by filesort() to mark all used columns
- Maintain in TABLE->merge_keys set of all keys that are used in query.
(Simplices some optimization loops)
- Maintain Field->part_of_key_not_clustered which is like Field->part_of_key
but the field in the clustered key is not assumed to be part of all index.
(used in opt_range.cc for faster loops)
- dbug_tmp_use_all_columns(), dbug_tmp_restore_column_map()
tmp_use_all_columns() and tmp_restore_column_map() functions to temporally
mark all columns as usable. The 'dbug_' version is primarily intended
inside a handler when it wants to just call Field:store() & Field::val()
functions, but don't need the column maps set for any other usage.
(ie:: bitmap_is_set() is never called)
- We can't use compare_records() to skip updates for handlers that returns
a partial column set and the read_set doesn't cover all columns in the
write set. The reason for this is that if we have a column marked only for
write we can't in the MySQL level know if the value changed or not.
The reason this worked before was that MySQL marked all to be written
columns as also to be read. The new 'optimal' bitmaps exposed this 'hidden
bug'.
- open_table_from_share() does not anymore setup temporary MEM_ROOT
object as a thread specific variable for the handler. Instead we
send the to-be-used MEMROOT to get_new_handler().
(Simpler, faster code)
Bugs fixed:
- Column marking was not done correctly in a lot of cases.
(ALTER TABLE, when using triggers, auto_increment fields etc)
(Could potentially result in wrong values inserted in table handlers
relying on that the old column maps or field->set_query_id was correct)
Especially when it comes to triggers, there may be cases where the
old code would cause lost/wrong values for NDB and/or InnoDB tables.
- Split thd->options flag OPTION_STATUS_NO_TRANS_UPDATE to two flags:
OPTION_STATUS_NO_TRANS_UPDATE and OPTION_KEEP_LOG.
This allowed me to remove some wrong warnings about:
"Some non-transactional changed tables couldn't be rolled back"
- Fixed handling of INSERT .. SELECT and CREATE ... SELECT that wrongly reset
(thd->options & OPTION_STATUS_NO_TRANS_UPDATE) which caused us to loose
some warnings about
"Some non-transactional changed tables couldn't be rolled back")
- Fixed use of uninitialized memory in ha_ndbcluster.cc::delete_table()
which could cause delete_table to report random failures.
- Fixed core dumps for some tests when running with --debug
- Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
(This has probably caused us to not properly remove temporary files after
crash)
- slow_logs was not properly initialized, which could maybe cause
extra/lost entries in slow log.
- If we get an duplicate row on insert, change column map to read and
write all columns while retrying the operation. This is required by
the definition of REPLACE and also ensures that fields that are only
part of UPDATE are properly handled. This fixed a bug in NDB and
REPLACE where REPLACE wrongly copied some column values from the replaced
row.
- For table handler that doesn't support NULL in keys, we would give an error
when creating a primary key with NULL fields, even after the fields has been
automaticly converted to NOT NULL.
- Creating a primary key on a SPATIAL key, would fail if field was not
declared as NOT NULL.
Cleanups:
- Removed not used condition argument to setup_tables
- Removed not needed item function reset_query_id_processor().
- Field->add_index is removed. Now this is instead maintained in
(field->flags & FIELD_IN_ADD_INDEX)
- Field->fieldnr is removed (use field->field_index instead)
- New argument to filesort() to indicate that it should return a set of
row pointers (not used columns). This allowed me to remove some references
to sql_command in filesort and should also enable us to return column
results in some cases where we couldn't before.
- Changed column bitmap handling in opt_range.cc to be aligned with TABLE
bitmap, which allowed me to use bitmap functions instead of looping over
all fields to create some needed bitmaps. (Faster and smaller code)
- Broke up found too long lines
- Moved some variable declaration at start of function for better code
readability.
- Removed some not used arguments from functions.
(setup_fields(), mysql_prepare_insert_check_table())
- setup_fields() now takes an enum instead of an int for marking columns
usage.
- For internal temporary tables, use handler::write_row(),
handler::delete_row() and handler::update_row() instead of
handler::ha_xxxx() for faster execution.
- Changed some constants to enum's and define's.
- Using separate column read and write sets allows for easier checking
of timestamp field was set by statement.
- Remove calls to free_io_cache() as this is now done automaticly in ha_reset()
- Don't build table->normalized_path as this is now identical to table->path
(after bar's fixes to convert filenames)
- Fixed some missed DBUG_PRINT(.."%lx") to use "0x%lx" to make it easier to
do comparision with the 'convert-dbug-for-diff' tool.
Things left to do in 5.1:
- We wrongly log failed CREATE TABLE ... SELECT in some cases when using
row based logging (as shown by testcase binlog_row_mix_innodb_myisam.result)
Mats has promised to look into this.
- Test that my fix for CREATE TABLE ... SELECT is indeed correct.
(I added several test cases for this, but in this case it's better that
someone else also tests this throughly).
Lars has promosed to do this.
BitKeeper/etc/ignore:
added mysys/test_bitmap
include/base64.h:
Removed my_global.h, as this must be included first in any program
include/heap.h:
Added heap_reset() (Required by new handler interface)
include/my_base.h:
Removed HA_EXTRA_RESET. MySQL will now call ::reset() instead of ::extra(HA_EXTRA_RESET).
HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIVE_PRIMARY key are deleted as the column bitmaps makes these unnecessary
include/my_bitmap.h:
Remove my_pthread.h (should be included at upper level)
Introduced my_bitmap_map typedef to make it the bitmap handling more like a black box
Added bitmap_is_overlapping(), bitmap_test_and_clear(), bitmap_copy() and bitmap_cmp()
Made bitmap_set_bit(), bitmap_flip_bit(), bitmap_clear_bit() return void
include/myisam.h:
Added mi_reset() (Required by new handler interface)
include/myisammrg.h:
Added myrg_reset() (Required by new handler interface)
include/mysql_com.h:
Added flag FIELD_IN_ADD_INDEX to be able to remove Field->add_index
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Added testing of CREATE ... SELECT in a mixed environment
(This found some bugs that Mats is going to fix shortly)
mysql-test/install_test_db.sh:
Simplify ldata usage
Added --tmpdir=. option to mysqld bootstrap (Removed some warnings when TMPDIR was wrongly set)
mysql-test/mysql-test-run.pl:
Added --tmpdir=. to bootstrap
mysql-test/mysql-test-run.sh:
Use copy instead of INSTALL_DB for master and slave databases.
(Speeds up startup time a lot!)
Remove snapshot directories at startup (removes some strange warnings)
mysql-test/r/binlog_row_mix_innodb_myisam.result:
Added testing of CREATE ... SELECT in a mixed environment
(This found some bugs that Mats is going to fix shortly)
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
Added testing of CREATE ... SELECT in a mixed environment
mysql-test/r/create.result:
Some extra tests of warnings and number of tables opened by CREATE ... SELECT
mysql-test/r/federated.result:
Drop some left over tables
Added testing of multiple table update and multiple table delete (with and without keys)
mysql-test/r/func_gconcat.result:
Enable some disabled tests (converted them slightly to be predictable)
mysql-test/r/func_time.result:
Added drop of test function
mysql-test/r/innodb_mysql.result:
Added tests for CREATE ... SELECT
mysql-test/r/insert.result:
More tests
Added testing of duplicate columns in insert
mysql-test/r/loaddata.result:
Added testing LOAD DATA ... SET ...
mysql-test/r/multi_update.result:
Test multi updates and deletes using primary key and without
mysql-test/r/ndb_index_unique.result:
Better error message
mysql-test/r/ndb_replace.result:
New correct result after fixing REPLACE handling with NDB
mysql-test/r/rpl_ddl.result:
Now we don't get these (wrong) warnings anymore
mysql-test/r/view_grant.result:
Drop used views
mysql-test/t/create.test:
Some extra tests of warnings and number of tables opened by CREATE ... SELECT
mysql-test/t/federated.test:
Drop some left over tables
Added testing of multiple table update and multiple table delete (with and without keys)
mysql-test/t/func_gconcat.test:
Enable some disabled tests (converted them slightly to be predictable)
mysql-test/t/func_time.test:
Added drop of test function
mysql-test/t/innodb_mysql.test:
Added tests for CREATE ... SELECT
mysql-test/t/insert.test:
More tests
Added testing of duplicate columns in insert
mysql-test/t/loaddata.test:
Added testing LOAD DATA ... SET ...
mysql-test/t/multi_update.test:
Test multi updates and deletes using primary key and without
mysql-test/t/view_grant.test:
Drop used views
mysql-test/valgrind.supp:
Added supression of not needed warnings when printing stack trace
mysys/base64.c:
Include my_global.h first
mysys/my_bitmap.c:
Added bitmap_is_overlapping(), bitmap_test_and_clear() and bitmap_copy()
Changed logic of bitmap handling to be a bit more efficent (Did this together with Mikael Ronström)
Now the 'extra, not used bits' in the bitmap are assumed to have a 'random value' and the bitmap functions are free to change them whenever needed.
Changed how mutex is allocated to make 'bitmap_free()' function simpler.
mysys/thr_lock.c:
Added 0x before thread pointers (for easier comparison of DBUG traces)
sql/event.cc:
Ensure 'use_all_columns()' is used for event tables
Don't print warning that event table is damaged if it doesn't exists.
sql/field.cc:
Added ASSERT_COLUMN_MARKED_FOR_WRITE in all store() methods and ASSERT_COLUMN_MARKED_FOR_READ in all val() methods to catch wrong setting if table->read_set and table->write_set
(Rest of changes are only indentation cleanups)
sql/field.h:
Removed Field->query_id (replaced by table->read_set and table->write_set)
Removed Field->fieldnr (use Field->field_index instead)
Removed Field->add_index (Use Field->flags instead)
Add Field->part_of_key_not_clustered (for usage in opt_range.cc)
sql/filesort.cc:
Added paramater sort_postion to filesort() to force sorting by position instead of storing all fields in the result set.
This allowed me to remove checking of sql_command.
Create a temporary column bitmap for fields that are used by the sorting process.
Use column bitmaps instead of query_id
sql/ha_berkeley.cc:
Update to 'newer' table handler interface
sql/ha_berkeley.h:
Update to 'newer' table handler interface
sql/ha_federated.cc:
Update to 'newer' table handler interface
Only read columns that are needed from remote server.
In case of eq ranges, don't generate two conditions in the WHERE clause
(this can still be optimized, but would require a bigger code change)
Use 'simpler to use' XXXX_LEN' macros
A bit simpler logic in ::write_row() when creating statements.
In update, only include test of fields actually read.
(This greatly simplifies the queries sent by the federated engine)
Similar changes done for delete_row()
sql/ha_federated.h:
Update to 'newer' table handler interface
Changed XXX_LEN macros to use sizeof(...)-1, to simplify usage in ha_federated.cc
Added HA_PRIMARY_KEY_REQUIRED_FOR_DELETE to tell MySQL to read all primary key columns in case of DELETE
sql/ha_heap.cc:
Update to 'newer' table handler interface
sql/ha_heap.h:
Update to 'newer' table handler interface
sql/ha_innodb.cc:
Update to 'newer' table handler interface
- Update innobase_create_handler() to new interface
- Removed HA_NOT_EXACT_COUNT (not needed)
- Renamed HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
- Prefixed base status variables with 'stats'
- Use table column bitmaps instead of ha_get_bit_in_read_set()
- Added ::reset(), with code from ::extra(HA_EXTRA_RESET)
- Removed HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIEVE_PRIMARY_KEY as
the table->read_set and table->write_set bitmaps now are accurate
sql/ha_innodb.h:
Update to 'newer' table handler interface
- table_flags are now ulonglong
- Added reset() method
- Removed not needed ha_retrieve_all_cols() and ha_retrieve_all_pk() columns.
- Made build_template() a class function to be able to easier access class variables
sql/ha_myisam.cc:
Update to 'newer' table handler interface
sql/ha_myisam.h:
Update to 'newer' table handler interface
sql/ha_myisammrg.cc:
Update to 'newer' table handler interface
sql/ha_myisammrg.h:
Update to 'newer' table handler interface
sql/ha_ndbcluster.cc:
Update to 'newer' table handler interface
Fixed use_blob_value() to be accurate
In ::complemented_read() we have to check both the read and write bitmap as the old code did mark all changed columns also in the read map
Correct dumping of field data with DBUG_DUMP
Prefix addresses in DBUG_PRINT with 0x
Fixed usage of not initialized memory
Update to use field->flags & FIELD_IN_ADD_INDEX instead of field->add_index.
sql/ha_ndbcluster.h:
Update to 'newer' table handler interface
sql/ha_ndbcluster_binlog.cc:
Mark usage of all columns in ndbcluster binlog tables
false -> FALSE, true -> TRUE
Use table->s->all_set instead of creating a temporary bitmap.
sql/ha_partition.cc:
Update to 'newer' table handler interface
Added memroot to initialise_partitions() and related functions to get faster memory allocation.
partition_create_handler() is now responsible for initialisation of the partition object
Some trivial optimizations and indentation fixes
Ensure that table_flags() are up to date
Removed documentation for removed HA_EXTRA flags
Fixed 'strange' usage of m_file[i] in new_handlers_from_part_info()that worked in current code 'by chance'
sql/ha_partition.h:
Update to 'newer' table handler interface
sql/handler.cc:
create_xxx handler now takes MEMROOT as an argument to simplify memory allocation.
Much simpler get_new_handler()
(Initialization of the object is now handled by the create method for the engine)
Moved all allocation of bitmap handling to the TABLE object (in table.cc)
Added column_bitmaps_signal() to signal column usage changes.
Changed binlog_log_row() to use the exiusting all_set bitmap in the table object.
Added ha_reset() function to test that the file object is ok at end of statement and call handler::reset()
Added use_hidden_primary_key() to signal handler that we we are going to read and update + delete the row and the handler should thus remember the position for the row
sql/handler.h:
Added HA_NO_TRANSACTIONS, HA_PARTIAL_COLUMN_READ, HA_REQUIRES_KEY_COLUMNS_FOR_DELETE,HA_PRIMARY_KEY_REQUIRED_FOR_DELETE and HA_HAS_RECORDS
Removed HA_NOT_EXACT_COUNT, HA_READ_RND_SAME
HA_DUPP_POS -> HA_DUPLICATE_POS
HA_NOT_EXACT_COUNT replaced by HA_STATS_RECORDS_IS_EXACT, HA_HAS_RECORDS and records()
HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION
Added future row type 'ROW_TYPE_PAGES'
Added MEM_ROOT to handlerton 'create' function
Added ha_statistics, a structure for all status variable in the base handler class.
Moved all status variables in the handler class into a stats structs to improve readability.
ha_table_flags() is now a cached (not virtual) version of table_flags()
reset() doesn't anymore call extra(HA_EXTRA_RESET) but is a function of it's own.
Renamed dupp_ref to dup_ref
Renamed not used handler::sortkey
Moved read_set and write_set to TABLE structure
handler::init() function added for cacheing of virtual constants from engine.
sql/item.cc:
Added register_field_in_read_map() for marking used columns in expression.
This is used by filesort() for creating an optimal column bitmap while retrieving columns for sorting.
Initalize value.cs_info.character_set_client to fix core dump bug with --debug
set_query_id -> mark_used_columns
Mark used columns in read_set OR write_set.
sql/item.h:
Removed reset_query_id_processor() as it's not needed anymore.
Added register_field_in_read_map()
Added extra argument to Item::walk() to indicate if we should also
traverse sub queries.
sql/item_cmpfunc.cc:
Temporary mark used columns to be read/writable
Update Item::walk to new interface
sql/item_cmpfunc.h:
Added extra argument to Item::walk() to indicate if we should also traverse sub queries.
sql/item_func.cc:
Update Item::walk() to new interface
table_flags() -> ha_table_flags()
sql/item_func.h:
Update Item::walk() to new interface
sql/item_row.cc:
Update Item::walk() to new interface
sql/item_row.h:
Update Item::walk() to new interface
sql/item_strfunc.h:
Update Item::walk() to new interface
sql/item_subselect.cc:
Added Item_subselect::walk()
(It was a bug it was missing before. Not sure what kind of bugs this could have caused)
sql/item_subselect.h:
Update Item::walk() to new interface
sql/item_sum.cc:
Update Item::walk() to new interface
Updates for new handler interace
sql/item_sum.h:
Update Item::walk() to new interface
sql/key.cc:
Updates for new handler interace
sql/log.cc:
Mark all columns used for log tables
Split options flag
Ensured that second argument to trans_register_ha is a bool
sql/log_event.cc:
Fixed comments to be withing 79 characters
Use OPTION_KEEP_LOG instead of OPTION_STATUS_NO_TRANS_UPDATE to remove wrong warnings
Updates for new handler interface
Use 0x%lx instead of %p (portability problem)
sql/mysql_priv.h:
Added OPTION_KEEP_LOG to indicate that we should replicate the binlog even on rollback
Removed not used 'conds' argument to setup_tables
sql/mysqld.cc:
Indentation fixes and removed old comment
sql/opt_range.cc:
Update to new handler and bitmap interface.
Fixed calls to cp_buffer_from_ref() and walk() (new argument).
Create new temporary bitmaps for ror scans.
(Needed because of handler changes and to get more accurate column bitmaps than before)
Remove not needed file->ha_reset() call before file->close().
Some trivial optimization and indentation fixes.
Use Field->part_of_key_not_clustered() to check if field is part of a key, instead of looping over all key parts.
Added flag 'in_ror_merged_scan' to allow ::get_next() to know that we need a special column bitmap to only fetch pointer to record.
This is needed because ror scan uses the same TABLE object but different file objects, which creates problem for the column bitmap handling.
(This is a temporary solution. A better one would be to allocate an own TABLE object for ROR scans)
Optimized bitmap handling in ror scans:
- Start bitmap at position 0, not 1
- Use same bitmap size as in TABLE
- Use table->read_set and table->write_set to create column bitmaps instead of looping over all fields in table
sql/opt_range.h:
Added 'in_ror_merged_scan' to indicate if we are doing a ROR scan
Added temporary column bitmaps used in ROR scans
sql/opt_sum.cc:
Added get_ext_record_count() which is used in COUNT() optimization if handler has HA_HAS_RECORDS
Note that we don't call this if handler has HA_STATS_RECORDS_IS_EXACT set.
sql/protocol.cc:
We need to mark columns as readable in ::store() as we sometimes return default value for fields to the user
sql/records.cc:
Updates for new handler interface
sql/set_var.cc:
Handle splitting OPTION_STATUS_NO_TRANS_UPDATE to two flags
sql/share/errmsg.txt:
Fixed wrong
sql/sp.cc:
Mark that we are using all columns for the proc table
Update call to setup_tables() to use new prototype
sql/sp_head.cc:
Removed QQ comment
sql/spatial.cc:
Removed wrong QQ comment
sql/sql_acl.cc:
Mark that we need all columns for acl tables
Supply memroot to some 'new' calls.
Indentation fixes
sql/sql_base.cc:
set_query_id removed
Ensure we call ha_reset() at end of each statement
Mark read columns in read_set and changed columns in write_set (Before all columns was marked in read set)
Fixed marking of some columns that was not proplerly marked before
Maintain in TABLE->merge_keys set of all keys that are used in some way
Removed not used 'conds' argument from setup_tables()
Remove not used setting of 'dupp_field' in insert_fields()
Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
(This has probably caused us to not properly remove temporary files after crash)
sql/sql_bitmap.h:
Added is_overlapping()
sql/sql_class.cc:
Slow_logs was not properly initialized, which could maybe cause extra/lost entries in slow log.
set_query_id -> mark_used_columns
Simpler variable usage in pack_row() (cleanup)
Moved some variable declartion at start of function for better code readability
sql/sql_class.h:
Added enum_mark_columns
Updated comments
Renamed dupp_field -> dup_field
Added virtual function 'can_rollback_data()' to select_insert() to be used in CREATE ... SELECT to optimize use of OPTION_STATUS_NO_TRANS_UPDATE.
(This fixes a bug in CREATE ... SELECT where we did give wrong warnings when using non transacational tables)
sql/sql_delete.cc:
Updates to new handler interface
Call table->mark_columns_needed_for_delete() to allow us to put additional columns in column usage maps if handler so requires.
Call table->prepare_for_position() to tell handler that we are going to call ha_position().
Removed call to free_io_cache(). (io_cache is now removed in ha_reset()).
Fixed calls to setup_tables()
sql/sql_do.cc:
Update call to setup_fields()
sql/sql_handler.cc:
Tell handler tables to always read all columns.
Use temporary column map when storing value in field for later index usage
sql/sql_help.cc:
Makr all used fields to be read
Update call to setup_fields()
sql/sql_insert.cc:
Tell handler we are going to update the auto_increment column
dupp_field -> dup_field
Set column usage bits for timestamp field.
Call table->mark_columns_needed_for_insert() and table->mark_auto_increment_column()
Removed not used argument from mysql_prepare_insert_check_table().
If we get an duplicate row on insert, change column map to read and write all columns while retrying the operatation.
This is required by the definition of REPLACE and also ensures that fields that are only part of UPDATE are properly handled.
This fixed a bug in NDB and REPLACE where REPLACE wrongly copied some column values from the replaced row.
Setup new bitmaps for delayed insert rows
Remove reseting of next_number_fields as it will be reset on next call to handler_insert()
Fixed usage of thd->options and OPTION_STATUS_NO_TRANS_UPDATE.
The issue was that one should not to reset this flag as it may be set by a previous statement.
The way it was now used caused us to loose some warnings and get other wrong warnings when using non transactional tables mixed with transactional.
I fixed it by introducing 'select_insert::can_rollback_data' to inform send_error() that the given statement can be rolled back (which in case of CREATE TABLE can always be done)
Don't close tables created with CREATE ... SELECT but keep them in the table cache.
Moved out MY_HOOKS from inside function (better readability)
sql/sql_load.cc:
Update to use new handler and column marking interface
Update using setup_tables()
sql/sql_olap.cc:
Update calls to setup_tables
Use enums instead of constants to setup_fields()
sql/sql_parse.cc:
Handle OPTION_KEEP_LOG:
- Set it on CREATE TEMPORARY TABLE / DROP TABLE
- Reset it when OPTION_STATUS_NO_TRANS_UPDATE is reset
- Don't set it for CREATE ... SELECT (this is handled in select_create class)
Remove reseting of OPTION_STATUS_NO_TRANS_UPDATE in begin_trans() as this should already be reset.
If in autocommit mode, reset OPTION_KEEP_LOG and OPTION_STATUS_NO_TRANS_UPDATE to not give warnings in future commands
sql/sql_partition.cc:
Update walk() usage
Trivial indentation fixes
sql/sql_plugin.cc:
Mark all columns as used for plugins
sql/sql_prepare.cc:
Added assert to find out hidden bugs in character_set_client (got an error in debug binary when this not set correctly)
Updates for new handler interface
Update calls to setup_fields()
sql/sql_repl.cc:
Indentation fixes
sql/sql_select.cc:
Update call to setup_tables() and setup_fields()
Remove some old disabled code
Update to new hadler interface
Indentation cleanups
Added column bitmaps for temporary tables.
Remove updating of the removed slots in the Field class
Added TABLE argument to cp_buffer_from_ref() (To be able to install temporary column maps)
For internal temporary tables, use handler::write_row(), handler::delete_row() and handler::update_row() instead of handler::ha_xxxx() for faster execution.
sql/sql_select.h:
Indentaition fixes.
Install temporary column usage maps when needed
Added TABLE element to cp_buffer_from_ref()
sql/sql_show.cc:
Update to new handler interface
Mark all columns used for internal tables.
Style fixes.
Added support for 'future' ROW_TYPE_PAGES.
Don't allocate TMP_TABLE_PARAM with calloc. The 'init()' function will initialize the structure properly.
sql/sql_table.cc:
Update to new handler interface
Simple my_snprintf -> strmake()
Changed some constants to defines
Don't test for NULL in primary key (as we a couple of line above force the PRIMARY KEY to be NOT NULL)
Change field->add_index to use field->flags & FIELD_IN_ADD_INDEX
Mark all columns as used for ALTER TABLE
Style fixes
Update call to filesort()
sql/sql_trigger.h:
Added friend functions to be able to test if triggers exists for table we are going to insert/update or delete in.
sql/sql_udf.cc:
Mark all columns as used for udf system table.
sql/sql_union.cc:
Update call to walk()
Update to new handler interface
sql/sql_update.cc:
Remove query_id argument from compare_record()
Use column bitmaps instead of query_id.
We can't use compare_records() to skip updates for handlers that returns a partial column set and the read_set doesn't cover all columns in the write set, because compare_record() can't in this case know if a not read column changed value.
Update call to setup_fields()
Using separate column read and write sets allows for easier checking of timestamp field was set by statement.
Removed call to free_io_cache() as this is now done in ha_reset()
Call table->mark_columns_needed_for_update() and table->prepare_for_position()
Style fixes
sql/sql_view.cc:
Style fixes
sql/table.cc:
Remove implicitely include 'errno.h'
Remove code for building normalized path, as this is now identical to 'path'
Remove field->fieldnr
Added update of field->part_of_key_not_clustered()
Create column bitmaps in TABLE and TABLE_SHARE
Don't setup a temporary MEM_ROOT object as a thread specific variable for the handler. Instead we send the to-be-used MEMROOT to get_new_handler()
Update to new handler interface
Update call to walk()
Added new functions:
- st_table::clear_column_bitmaps()
- st_table::prepare_for_position()
- st_table::mark_columns_used_by_index()
- st_table::restore_column_maps_after_mark_index()
- st_table::mark_columns_used_by_index_no_reset()
- st_table::mark_auto_increment_column()
- st_table::mark_columns_needed_for_delete()
- st_table::mark_columns_needed_for_update()
- st_table::mark_columns_needed_for_insert()
sql/table.h:
Moved column usage bitmaps from handler to TABLE
Added to TABLE_SHARE all_set and column_bitmap_size
Added to TABLE merge_keys, bitmap_init_values, def_read_set, def_write_set, tmp_set, read_set and write_set.
Declared all new table column bitmap functions
Added TABLE functions column_bitmaps_set(), column_bitmaps_set_no_signal(), use_all_columns() and default_column_bitmaps()
Added functions: tmp_use_all_columns() and tmp_restore_column_map() to temporarly switch column bitmaps
Added functions: dbug_tmp_use_all_columns() and dbug_tmp_restore_column_map() to temporarly switch column bitmaps to avoid asserts in Field::store() and Field::val().
sql/tztime.cc:
Mark all columns as used for timezone tables
storage/archive/ha_archive.cc:
Update to new handler interface
storage/archive/ha_archive.h:
Update to new handler interface
storage/blackhole/ha_blackhole.cc:
Update to new handler interface
storage/blackhole/ha_blackhole.h:
Update to new handler interface
removed not needed flag HA_DUPP_POS
storage/csv/ha_tina.cc:
Update to new handler interface
storage/csv/ha_tina.h:
Update to new handler interface
storage/example/ha_example.cc:
Update to new handler interface
storage/example/ha_example.h:
Update to new handler interface
storage/heap/hp_extra.c:
Added heap_reset() (Required by new handler interface)
storage/heap/hp_test2.c:
Use heap_reset()
storage/myisam/ft_boolean_search.c:
Fixed compiler warning
storage/myisam/mi_extra.c:
Added mi_reset() (Required by new handler interface)
storage/myisam/mi_search.c:
Fixed DBUG_PRINT messages to use 0x%lx instead of %lx
storage/myisam/mi_test2.c:
Use mi_reset()
storage/myisam/myisampack.c:
Use mi_reset()
storage/myisammrg/myrg_extra.c:
Added myrg_reset() (Required by new handler interface)
unittest/mysys/base64.t.c:
Include my_global.h
Don't include implictely include file 'stdlib.h'
2006-06-04 17:52:22 +02:00
|
|
|
TABLE *table= field->table;
|
|
|
|
my_bitmap_map *old_map= 0;
|
|
|
|
if (table->file)
|
|
|
|
old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
|
|
|
#endif
|
2003-05-21 14:44:12 +02:00
|
|
|
|
::reset(), HA_FAST_KEY_READ, disable_indexes(), enable_indexes(), start_bulk_insert(), end_bulk_insert()
Field::val_str simplification, comment
include/my_base.h:
typos fixed
mysql-test/r/myisam.result:
alter table enable/disable keys
mysql-test/t/help.test:
cleanup
mysql-test/t/myisam.test:
alter table enable/disable keys
sql/field.cc:
Field::val_str() simplification
sql/field.h:
Field::val_str() simplification and comment
sql/field_conv.cc:
Field::val_str() simplification
sql/ha_berkeley.cc:
::reset(), HA_FAST_KEY_READ
sql/ha_berkeley.h:
::reset(), HA_FAST_KEY_READ
sql/ha_heap.cc:
::reset(), HA_FAST_KEY_READ
sql/ha_heap.h:
::reset(), HA_FAST_KEY_READ
sql/ha_innodb.cc:
::reset(), HA_FAST_KEY_READ
sql/ha_innodb.h:
::reset(), HA_FAST_KEY_READ
sql/ha_isam.cc:
::reset(), HA_FAST_KEY_READ
sql/ha_isam.h:
::reset(), HA_FAST_KEY_READ
sql/ha_isammrg.cc:
::reset(), HA_FAST_KEY_READ
sql/ha_isammrg.h:
::reset(), HA_FAST_KEY_READ
sql/ha_myisam.cc:
::reset(), HA_FAST_KEY_READ, disable_indexes(), enable_indexes(), start_bulk_insert(), end_bulk_insert()
sql/ha_myisam.h:
::reset(), HA_FAST_KEY_READ, disable_indexes(), enable_indexes(), start_bulk_insert(), end_bulk_insert()
sql/ha_myisammrg.cc:
::reset(), HA_FAST_KEY_READ
sql/ha_myisammrg.h:
::reset(), HA_FAST_KEY_READ
sql/handler.h:
::reset(), HA_FAST_KEY_READ, disable_indexes(), enable_indexes(), start_bulk_insert(), end_bulk_insert()
sql/item.cc:
Field::val_str() simplification
sql/item_sum.cc:
Field::val_str() simplification
sql/key.cc:
Field::val_str() simplification
sql/opt_range.cc:
Field::val_str() simplification
sql/protocol.cc:
Field::val_str() simplification
sql/records.cc:
HA_FAST_KEY_READ
sql/sql_acl.cc:
Field::val_str() simplification
sql/sql_base.cc:
::reset
sql/sql_insert.cc:
::reset(), start_bulk_insert(), end_bulk_insert()
sql/sql_load.cc:
start_bulk_insert(), end_bulk_insert()
sql/sql_show.cc:
Field::val_str() simplification
sql/sql_table.cc:
disable_indexes(), enable_indexes(), start_bulk_insert(), end_bulk_insert()
sql/table.cc:
Field::val_str() simplification
2004-04-06 21:35:26 +02:00
|
|
|
field->val_str(&str);
|
2017-07-03 10:35:44 +02:00
|
|
|
#ifdef DBUG_ASSERT_EXISTS
|
This changeset is largely a handler cleanup changeset (WL#3281), but includes fixes and cleanups that was found necessary while testing the handler changes
Changes that requires code changes in other code of other storage engines.
(Note that all changes are very straightforward and one should find all issues
by compiling a --debug build and fixing all compiler errors and all
asserts in field.cc while running the test suite),
- New optional handler function introduced: reset()
This is called after every DML statement to make it easy for a handler to
statement specific cleanups.
(The only case it's not called is if force the file to be closed)
- handler::extra(HA_EXTRA_RESET) is removed. Code that was there before
should be moved to handler::reset()
- table->read_set contains a bitmap over all columns that are needed
in the query. read_row() and similar functions only needs to read these
columns
- table->write_set contains a bitmap over all columns that will be updated
in the query. write_row() and update_row() only needs to update these
columns.
The above bitmaps should now be up to date in all context
(including ALTER TABLE, filesort()).
The handler is informed of any changes to the bitmap after
fix_fields() by calling the virtual function
handler::column_bitmaps_signal(). If the handler does caching of
these bitmaps (instead of using table->read_set, table->write_set),
it should redo the caching in this code. as the signal() may be sent
several times, it's probably best to set a variable in the signal
and redo the caching on read_row() / write_row() if the variable was
set.
- Removed the read_set and write_set bitmap objects from the handler class
- Removed all column bit handling functions from the handler class.
(Now one instead uses the normal bitmap functions in my_bitmap.c instead
of handler dedicated bitmap functions)
- field->query_id is removed. One should instead instead check
table->read_set and table->write_set if a field is used in the query.
- handler::extra(HA_EXTRA_RETRIVE_ALL_COLS) and
handler::extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) are removed. One should now
instead use table->read_set to check for which columns to retrieve.
- If a handler needs to call Field->val() or Field->store() on columns
that are not used in the query, one should install a temporary
all-columns-used map while doing so. For this, we provide the following
functions:
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
field->val();
dbug_tmp_restore_column_map(table->read_set, old_map);
and similar for the write map:
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
field->val();
dbug_tmp_restore_column_map(table->write_set, old_map);
If this is not done, you will sooner or later hit a DBUG_ASSERT
in the field store() / val() functions.
(For not DBUG binaries, the dbug_tmp_restore_column_map() and
dbug_tmp_restore_column_map() are inline dummy functions and should
be optimized away be the compiler).
- If one needs to temporary set the column map for all binaries (and not
just to avoid the DBUG_ASSERT() in the Field::store() / Field::val()
methods) one should use the functions tmp_use_all_columns() and
tmp_restore_column_map() instead of the above dbug_ variants.
- All 'status' fields in the handler base class (like records,
data_file_length etc) are now stored in a 'stats' struct. This makes
it easier to know what status variables are provided by the base
handler. This requires some trivial variable names in the extra()
function.
- New virtual function handler::records(). This is called to optimize
COUNT(*) if (handler::table_flags() & HA_HAS_RECORDS()) is true.
(stats.records is not supposed to be an exact value. It's only has to
be 'reasonable enough' for the optimizer to be able to choose a good
optimization path).
- Non virtual handler::init() function added for caching of virtual
constants from engine.
- Removed has_transactions() virtual method. Now one should instead return
HA_NO_TRANSACTIONS in table_flags() if the table handler DOES NOT support
transactions.
- The 'xxxx_create_handler()' function now has a MEM_ROOT_root argument
that is to be used with 'new handler_name()' to allocate the handler
in the right area. The xxxx_create_handler() function is also
responsible for any initialization of the object before returning.
For example, one should change:
static handler *myisam_create_handler(TABLE_SHARE *table)
{
return new ha_myisam(table);
}
->
static handler *myisam_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root)
{
return new (mem_root) ha_myisam(table);
}
- New optional virtual function: use_hidden_primary_key().
This is called in case of an update/delete when
(table_flags() and HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) is defined
but we don't have a primary key. This allows the handler to take precisions
in remembering any hidden primary key to able to update/delete any
found row. The default handler marks all columns to be read.
- handler::table_flags() now returns a ulonglong (to allow for more flags).
- New/changed table_flags()
- HA_HAS_RECORDS Set if ::records() is supported
- HA_NO_TRANSACTIONS Set if engine doesn't support transactions
- HA_PRIMARY_KEY_REQUIRED_FOR_DELETE
Set if we should mark all primary key columns for
read when reading rows as part of a DELETE
statement. If there is no primary key,
all columns are marked for read.
- HA_PARTIAL_COLUMN_READ Set if engine will not read all columns in some
cases (based on table->read_set)
- HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS
Renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
- HA_DUPP_POS Renamed to HA_DUPLICATE_POS
- HA_REQUIRES_KEY_COLUMNS_FOR_DELETE
Set this if we should mark ALL key columns for
read when when reading rows as part of a DELETE
statement. In case of an update we will mark
all keys for read for which key part changed
value.
- HA_STATS_RECORDS_IS_EXACT
Set this if stats.records is exact.
(This saves us some extra records() calls
when optimizing COUNT(*))
- Removed table_flags()
- HA_NOT_EXACT_COUNT Now one should instead use HA_HAS_RECORDS if
handler::records() gives an exact count() and
HA_STATS_RECORDS_IS_EXACT if stats.records is exact.
- HA_READ_RND_SAME Removed (no one supported this one)
- Removed not needed functions ha_retrieve_all_cols() and ha_retrieve_all_pk()
- Renamed handler::dupp_pos to handler::dup_pos
- Removed not used variable handler::sortkey
Upper level handler changes:
- ha_reset() now does some overall checks and calls ::reset()
- ha_table_flags() added. This is a cached version of table_flags(). The
cache is updated on engine creation time and updated on open.
MySQL level changes (not obvious from the above):
- DBUG_ASSERT() added to check that column usage matches what is set
in the column usage bit maps. (This found a LOT of bugs in current
column marking code).
- In 5.1 before, all used columns was marked in read_set and only updated
columns was marked in write_set. Now we only mark columns for which we
need a value in read_set.
- Column bitmaps are created in open_binary_frm() and open_table_from_share().
(Before this was in table.cc)
- handler::table_flags() calls are replaced with handler::ha_table_flags()
- For calling field->val() you must have the corresponding bit set in
table->read_set. For calling field->store() you must have the
corresponding bit set in table->write_set. (There are asserts in
all store()/val() functions to catch wrong usage)
- thd->set_query_id is renamed to thd->mark_used_columns and instead
of setting this to an integer value, this has now the values:
MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE
Changed also all variables named 'set_query_id' to mark_used_columns.
- In filesort() we now inform the handler of exactly which columns are needed
doing the sort and choosing the rows.
- The TABLE_SHARE object has a 'all_set' column bitmap one can use
when one needs a column bitmap with all columns set.
(This is used for table->use_all_columns() and other places)
- The TABLE object has 3 column bitmaps:
- def_read_set Default bitmap for columns to be read
- def_write_set Default bitmap for columns to be written
- tmp_set Can be used as a temporary bitmap when needed.
The table object has also two pointer to bitmaps read_set and write_set
that the handler should use to find out which columns are used in which way.
- count() optimization now calls handler::records() instead of using
handler->stats.records (if (table_flags() & HA_HAS_RECORDS) is true).
- Added extra argument to Item::walk() to indicate if we should also
traverse sub queries.
- Added TABLE parameter to cp_buffer_from_ref()
- Don't close tables created with CREATE ... SELECT but keep them in
the table cache. (Faster usage of newly created tables).
New interfaces:
- table->clear_column_bitmaps() to initialize the bitmaps for tables
at start of new statements.
- table->column_bitmaps_set() to set up new column bitmaps and signal
the handler about this.
- table->column_bitmaps_set_no_signal() for some few cases where we need
to setup new column bitmaps but don't signal the handler (as the handler
has already been signaled about these before). Used for the momement
only in opt_range.cc when doing ROR scans.
- table->use_all_columns() to install a bitmap where all columns are marked
as use in the read and the write set.
- table->default_column_bitmaps() to install the normal read and write
column bitmaps, but not signaling the handler about this.
This is mainly used when creating TABLE instances.
- table->mark_columns_needed_for_delete(),
table->mark_columns_needed_for_delete() and
table->mark_columns_needed_for_insert() to allow us to put additional
columns in column usage maps if handler so requires.
(The handler indicates what it neads in handler->table_flags())
- table->prepare_for_position() to allow us to tell handler that it
needs to read primary key parts to be able to store them in
future table->position() calls.
(This replaces the table->file->ha_retrieve_all_pk function)
- table->mark_auto_increment_column() to tell handler are going to update
columns part of any auto_increment key.
- table->mark_columns_used_by_index() to mark all columns that is part of
an index. It will also send extra(HA_EXTRA_KEYREAD) to handler to allow
it to quickly know that it only needs to read colums that are part
of the key. (The handler can also use the column map for detecting this,
but simpler/faster handler can just monitor the extra() call).
- table->mark_columns_used_by_index_no_reset() to in addition to other columns,
also mark all columns that is used by the given key.
- table->restore_column_maps_after_mark_index() to restore to default
column maps after a call to table->mark_columns_used_by_index().
- New item function register_field_in_read_map(), for marking used columns
in table->read_map. Used by filesort() to mark all used columns
- Maintain in TABLE->merge_keys set of all keys that are used in query.
(Simplices some optimization loops)
- Maintain Field->part_of_key_not_clustered which is like Field->part_of_key
but the field in the clustered key is not assumed to be part of all index.
(used in opt_range.cc for faster loops)
- dbug_tmp_use_all_columns(), dbug_tmp_restore_column_map()
tmp_use_all_columns() and tmp_restore_column_map() functions to temporally
mark all columns as usable. The 'dbug_' version is primarily intended
inside a handler when it wants to just call Field:store() & Field::val()
functions, but don't need the column maps set for any other usage.
(ie:: bitmap_is_set() is never called)
- We can't use compare_records() to skip updates for handlers that returns
a partial column set and the read_set doesn't cover all columns in the
write set. The reason for this is that if we have a column marked only for
write we can't in the MySQL level know if the value changed or not.
The reason this worked before was that MySQL marked all to be written
columns as also to be read. The new 'optimal' bitmaps exposed this 'hidden
bug'.
- open_table_from_share() does not anymore setup temporary MEM_ROOT
object as a thread specific variable for the handler. Instead we
send the to-be-used MEMROOT to get_new_handler().
(Simpler, faster code)
Bugs fixed:
- Column marking was not done correctly in a lot of cases.
(ALTER TABLE, when using triggers, auto_increment fields etc)
(Could potentially result in wrong values inserted in table handlers
relying on that the old column maps or field->set_query_id was correct)
Especially when it comes to triggers, there may be cases where the
old code would cause lost/wrong values for NDB and/or InnoDB tables.
- Split thd->options flag OPTION_STATUS_NO_TRANS_UPDATE to two flags:
OPTION_STATUS_NO_TRANS_UPDATE and OPTION_KEEP_LOG.
This allowed me to remove some wrong warnings about:
"Some non-transactional changed tables couldn't be rolled back"
- Fixed handling of INSERT .. SELECT and CREATE ... SELECT that wrongly reset
(thd->options & OPTION_STATUS_NO_TRANS_UPDATE) which caused us to loose
some warnings about
"Some non-transactional changed tables couldn't be rolled back")
- Fixed use of uninitialized memory in ha_ndbcluster.cc::delete_table()
which could cause delete_table to report random failures.
- Fixed core dumps for some tests when running with --debug
- Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
(This has probably caused us to not properly remove temporary files after
crash)
- slow_logs was not properly initialized, which could maybe cause
extra/lost entries in slow log.
- If we get an duplicate row on insert, change column map to read and
write all columns while retrying the operation. This is required by
the definition of REPLACE and also ensures that fields that are only
part of UPDATE are properly handled. This fixed a bug in NDB and
REPLACE where REPLACE wrongly copied some column values from the replaced
row.
- For table handler that doesn't support NULL in keys, we would give an error
when creating a primary key with NULL fields, even after the fields has been
automaticly converted to NOT NULL.
- Creating a primary key on a SPATIAL key, would fail if field was not
declared as NOT NULL.
Cleanups:
- Removed not used condition argument to setup_tables
- Removed not needed item function reset_query_id_processor().
- Field->add_index is removed. Now this is instead maintained in
(field->flags & FIELD_IN_ADD_INDEX)
- Field->fieldnr is removed (use field->field_index instead)
- New argument to filesort() to indicate that it should return a set of
row pointers (not used columns). This allowed me to remove some references
to sql_command in filesort and should also enable us to return column
results in some cases where we couldn't before.
- Changed column bitmap handling in opt_range.cc to be aligned with TABLE
bitmap, which allowed me to use bitmap functions instead of looping over
all fields to create some needed bitmaps. (Faster and smaller code)
- Broke up found too long lines
- Moved some variable declaration at start of function for better code
readability.
- Removed some not used arguments from functions.
(setup_fields(), mysql_prepare_insert_check_table())
- setup_fields() now takes an enum instead of an int for marking columns
usage.
- For internal temporary tables, use handler::write_row(),
handler::delete_row() and handler::update_row() instead of
handler::ha_xxxx() for faster execution.
- Changed some constants to enum's and define's.
- Using separate column read and write sets allows for easier checking
of timestamp field was set by statement.
- Remove calls to free_io_cache() as this is now done automaticly in ha_reset()
- Don't build table->normalized_path as this is now identical to table->path
(after bar's fixes to convert filenames)
- Fixed some missed DBUG_PRINT(.."%lx") to use "0x%lx" to make it easier to
do comparision with the 'convert-dbug-for-diff' tool.
Things left to do in 5.1:
- We wrongly log failed CREATE TABLE ... SELECT in some cases when using
row based logging (as shown by testcase binlog_row_mix_innodb_myisam.result)
Mats has promised to look into this.
- Test that my fix for CREATE TABLE ... SELECT is indeed correct.
(I added several test cases for this, but in this case it's better that
someone else also tests this throughly).
Lars has promosed to do this.
BitKeeper/etc/ignore:
added mysys/test_bitmap
include/base64.h:
Removed my_global.h, as this must be included first in any program
include/heap.h:
Added heap_reset() (Required by new handler interface)
include/my_base.h:
Removed HA_EXTRA_RESET. MySQL will now call ::reset() instead of ::extra(HA_EXTRA_RESET).
HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIVE_PRIMARY key are deleted as the column bitmaps makes these unnecessary
include/my_bitmap.h:
Remove my_pthread.h (should be included at upper level)
Introduced my_bitmap_map typedef to make it the bitmap handling more like a black box
Added bitmap_is_overlapping(), bitmap_test_and_clear(), bitmap_copy() and bitmap_cmp()
Made bitmap_set_bit(), bitmap_flip_bit(), bitmap_clear_bit() return void
include/myisam.h:
Added mi_reset() (Required by new handler interface)
include/myisammrg.h:
Added myrg_reset() (Required by new handler interface)
include/mysql_com.h:
Added flag FIELD_IN_ADD_INDEX to be able to remove Field->add_index
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Added testing of CREATE ... SELECT in a mixed environment
(This found some bugs that Mats is going to fix shortly)
mysql-test/install_test_db.sh:
Simplify ldata usage
Added --tmpdir=. option to mysqld bootstrap (Removed some warnings when TMPDIR was wrongly set)
mysql-test/mysql-test-run.pl:
Added --tmpdir=. to bootstrap
mysql-test/mysql-test-run.sh:
Use copy instead of INSTALL_DB for master and slave databases.
(Speeds up startup time a lot!)
Remove snapshot directories at startup (removes some strange warnings)
mysql-test/r/binlog_row_mix_innodb_myisam.result:
Added testing of CREATE ... SELECT in a mixed environment
(This found some bugs that Mats is going to fix shortly)
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
Added testing of CREATE ... SELECT in a mixed environment
mysql-test/r/create.result:
Some extra tests of warnings and number of tables opened by CREATE ... SELECT
mysql-test/r/federated.result:
Drop some left over tables
Added testing of multiple table update and multiple table delete (with and without keys)
mysql-test/r/func_gconcat.result:
Enable some disabled tests (converted them slightly to be predictable)
mysql-test/r/func_time.result:
Added drop of test function
mysql-test/r/innodb_mysql.result:
Added tests for CREATE ... SELECT
mysql-test/r/insert.result:
More tests
Added testing of duplicate columns in insert
mysql-test/r/loaddata.result:
Added testing LOAD DATA ... SET ...
mysql-test/r/multi_update.result:
Test multi updates and deletes using primary key and without
mysql-test/r/ndb_index_unique.result:
Better error message
mysql-test/r/ndb_replace.result:
New correct result after fixing REPLACE handling with NDB
mysql-test/r/rpl_ddl.result:
Now we don't get these (wrong) warnings anymore
mysql-test/r/view_grant.result:
Drop used views
mysql-test/t/create.test:
Some extra tests of warnings and number of tables opened by CREATE ... SELECT
mysql-test/t/federated.test:
Drop some left over tables
Added testing of multiple table update and multiple table delete (with and without keys)
mysql-test/t/func_gconcat.test:
Enable some disabled tests (converted them slightly to be predictable)
mysql-test/t/func_time.test:
Added drop of test function
mysql-test/t/innodb_mysql.test:
Added tests for CREATE ... SELECT
mysql-test/t/insert.test:
More tests
Added testing of duplicate columns in insert
mysql-test/t/loaddata.test:
Added testing LOAD DATA ... SET ...
mysql-test/t/multi_update.test:
Test multi updates and deletes using primary key and without
mysql-test/t/view_grant.test:
Drop used views
mysql-test/valgrind.supp:
Added supression of not needed warnings when printing stack trace
mysys/base64.c:
Include my_global.h first
mysys/my_bitmap.c:
Added bitmap_is_overlapping(), bitmap_test_and_clear() and bitmap_copy()
Changed logic of bitmap handling to be a bit more efficent (Did this together with Mikael Ronström)
Now the 'extra, not used bits' in the bitmap are assumed to have a 'random value' and the bitmap functions are free to change them whenever needed.
Changed how mutex is allocated to make 'bitmap_free()' function simpler.
mysys/thr_lock.c:
Added 0x before thread pointers (for easier comparison of DBUG traces)
sql/event.cc:
Ensure 'use_all_columns()' is used for event tables
Don't print warning that event table is damaged if it doesn't exists.
sql/field.cc:
Added ASSERT_COLUMN_MARKED_FOR_WRITE in all store() methods and ASSERT_COLUMN_MARKED_FOR_READ in all val() methods to catch wrong setting if table->read_set and table->write_set
(Rest of changes are only indentation cleanups)
sql/field.h:
Removed Field->query_id (replaced by table->read_set and table->write_set)
Removed Field->fieldnr (use Field->field_index instead)
Removed Field->add_index (Use Field->flags instead)
Add Field->part_of_key_not_clustered (for usage in opt_range.cc)
sql/filesort.cc:
Added paramater sort_postion to filesort() to force sorting by position instead of storing all fields in the result set.
This allowed me to remove checking of sql_command.
Create a temporary column bitmap for fields that are used by the sorting process.
Use column bitmaps instead of query_id
sql/ha_berkeley.cc:
Update to 'newer' table handler interface
sql/ha_berkeley.h:
Update to 'newer' table handler interface
sql/ha_federated.cc:
Update to 'newer' table handler interface
Only read columns that are needed from remote server.
In case of eq ranges, don't generate two conditions in the WHERE clause
(this can still be optimized, but would require a bigger code change)
Use 'simpler to use' XXXX_LEN' macros
A bit simpler logic in ::write_row() when creating statements.
In update, only include test of fields actually read.
(This greatly simplifies the queries sent by the federated engine)
Similar changes done for delete_row()
sql/ha_federated.h:
Update to 'newer' table handler interface
Changed XXX_LEN macros to use sizeof(...)-1, to simplify usage in ha_federated.cc
Added HA_PRIMARY_KEY_REQUIRED_FOR_DELETE to tell MySQL to read all primary key columns in case of DELETE
sql/ha_heap.cc:
Update to 'newer' table handler interface
sql/ha_heap.h:
Update to 'newer' table handler interface
sql/ha_innodb.cc:
Update to 'newer' table handler interface
- Update innobase_create_handler() to new interface
- Removed HA_NOT_EXACT_COUNT (not needed)
- Renamed HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
- Prefixed base status variables with 'stats'
- Use table column bitmaps instead of ha_get_bit_in_read_set()
- Added ::reset(), with code from ::extra(HA_EXTRA_RESET)
- Removed HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIEVE_PRIMARY_KEY as
the table->read_set and table->write_set bitmaps now are accurate
sql/ha_innodb.h:
Update to 'newer' table handler interface
- table_flags are now ulonglong
- Added reset() method
- Removed not needed ha_retrieve_all_cols() and ha_retrieve_all_pk() columns.
- Made build_template() a class function to be able to easier access class variables
sql/ha_myisam.cc:
Update to 'newer' table handler interface
sql/ha_myisam.h:
Update to 'newer' table handler interface
sql/ha_myisammrg.cc:
Update to 'newer' table handler interface
sql/ha_myisammrg.h:
Update to 'newer' table handler interface
sql/ha_ndbcluster.cc:
Update to 'newer' table handler interface
Fixed use_blob_value() to be accurate
In ::complemented_read() we have to check both the read and write bitmap as the old code did mark all changed columns also in the read map
Correct dumping of field data with DBUG_DUMP
Prefix addresses in DBUG_PRINT with 0x
Fixed usage of not initialized memory
Update to use field->flags & FIELD_IN_ADD_INDEX instead of field->add_index.
sql/ha_ndbcluster.h:
Update to 'newer' table handler interface
sql/ha_ndbcluster_binlog.cc:
Mark usage of all columns in ndbcluster binlog tables
false -> FALSE, true -> TRUE
Use table->s->all_set instead of creating a temporary bitmap.
sql/ha_partition.cc:
Update to 'newer' table handler interface
Added memroot to initialise_partitions() and related functions to get faster memory allocation.
partition_create_handler() is now responsible for initialisation of the partition object
Some trivial optimizations and indentation fixes
Ensure that table_flags() are up to date
Removed documentation for removed HA_EXTRA flags
Fixed 'strange' usage of m_file[i] in new_handlers_from_part_info()that worked in current code 'by chance'
sql/ha_partition.h:
Update to 'newer' table handler interface
sql/handler.cc:
create_xxx handler now takes MEMROOT as an argument to simplify memory allocation.
Much simpler get_new_handler()
(Initialization of the object is now handled by the create method for the engine)
Moved all allocation of bitmap handling to the TABLE object (in table.cc)
Added column_bitmaps_signal() to signal column usage changes.
Changed binlog_log_row() to use the exiusting all_set bitmap in the table object.
Added ha_reset() function to test that the file object is ok at end of statement and call handler::reset()
Added use_hidden_primary_key() to signal handler that we we are going to read and update + delete the row and the handler should thus remember the position for the row
sql/handler.h:
Added HA_NO_TRANSACTIONS, HA_PARTIAL_COLUMN_READ, HA_REQUIRES_KEY_COLUMNS_FOR_DELETE,HA_PRIMARY_KEY_REQUIRED_FOR_DELETE and HA_HAS_RECORDS
Removed HA_NOT_EXACT_COUNT, HA_READ_RND_SAME
HA_DUPP_POS -> HA_DUPLICATE_POS
HA_NOT_EXACT_COUNT replaced by HA_STATS_RECORDS_IS_EXACT, HA_HAS_RECORDS and records()
HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION
Added future row type 'ROW_TYPE_PAGES'
Added MEM_ROOT to handlerton 'create' function
Added ha_statistics, a structure for all status variable in the base handler class.
Moved all status variables in the handler class into a stats structs to improve readability.
ha_table_flags() is now a cached (not virtual) version of table_flags()
reset() doesn't anymore call extra(HA_EXTRA_RESET) but is a function of it's own.
Renamed dupp_ref to dup_ref
Renamed not used handler::sortkey
Moved read_set and write_set to TABLE structure
handler::init() function added for cacheing of virtual constants from engine.
sql/item.cc:
Added register_field_in_read_map() for marking used columns in expression.
This is used by filesort() for creating an optimal column bitmap while retrieving columns for sorting.
Initalize value.cs_info.character_set_client to fix core dump bug with --debug
set_query_id -> mark_used_columns
Mark used columns in read_set OR write_set.
sql/item.h:
Removed reset_query_id_processor() as it's not needed anymore.
Added register_field_in_read_map()
Added extra argument to Item::walk() to indicate if we should also
traverse sub queries.
sql/item_cmpfunc.cc:
Temporary mark used columns to be read/writable
Update Item::walk to new interface
sql/item_cmpfunc.h:
Added extra argument to Item::walk() to indicate if we should also traverse sub queries.
sql/item_func.cc:
Update Item::walk() to new interface
table_flags() -> ha_table_flags()
sql/item_func.h:
Update Item::walk() to new interface
sql/item_row.cc:
Update Item::walk() to new interface
sql/item_row.h:
Update Item::walk() to new interface
sql/item_strfunc.h:
Update Item::walk() to new interface
sql/item_subselect.cc:
Added Item_subselect::walk()
(It was a bug it was missing before. Not sure what kind of bugs this could have caused)
sql/item_subselect.h:
Update Item::walk() to new interface
sql/item_sum.cc:
Update Item::walk() to new interface
Updates for new handler interace
sql/item_sum.h:
Update Item::walk() to new interface
sql/key.cc:
Updates for new handler interace
sql/log.cc:
Mark all columns used for log tables
Split options flag
Ensured that second argument to trans_register_ha is a bool
sql/log_event.cc:
Fixed comments to be withing 79 characters
Use OPTION_KEEP_LOG instead of OPTION_STATUS_NO_TRANS_UPDATE to remove wrong warnings
Updates for new handler interface
Use 0x%lx instead of %p (portability problem)
sql/mysql_priv.h:
Added OPTION_KEEP_LOG to indicate that we should replicate the binlog even on rollback
Removed not used 'conds' argument to setup_tables
sql/mysqld.cc:
Indentation fixes and removed old comment
sql/opt_range.cc:
Update to new handler and bitmap interface.
Fixed calls to cp_buffer_from_ref() and walk() (new argument).
Create new temporary bitmaps for ror scans.
(Needed because of handler changes and to get more accurate column bitmaps than before)
Remove not needed file->ha_reset() call before file->close().
Some trivial optimization and indentation fixes.
Use Field->part_of_key_not_clustered() to check if field is part of a key, instead of looping over all key parts.
Added flag 'in_ror_merged_scan' to allow ::get_next() to know that we need a special column bitmap to only fetch pointer to record.
This is needed because ror scan uses the same TABLE object but different file objects, which creates problem for the column bitmap handling.
(This is a temporary solution. A better one would be to allocate an own TABLE object for ROR scans)
Optimized bitmap handling in ror scans:
- Start bitmap at position 0, not 1
- Use same bitmap size as in TABLE
- Use table->read_set and table->write_set to create column bitmaps instead of looping over all fields in table
sql/opt_range.h:
Added 'in_ror_merged_scan' to indicate if we are doing a ROR scan
Added temporary column bitmaps used in ROR scans
sql/opt_sum.cc:
Added get_ext_record_count() which is used in COUNT() optimization if handler has HA_HAS_RECORDS
Note that we don't call this if handler has HA_STATS_RECORDS_IS_EXACT set.
sql/protocol.cc:
We need to mark columns as readable in ::store() as we sometimes return default value for fields to the user
sql/records.cc:
Updates for new handler interface
sql/set_var.cc:
Handle splitting OPTION_STATUS_NO_TRANS_UPDATE to two flags
sql/share/errmsg.txt:
Fixed wrong
sql/sp.cc:
Mark that we are using all columns for the proc table
Update call to setup_tables() to use new prototype
sql/sp_head.cc:
Removed QQ comment
sql/spatial.cc:
Removed wrong QQ comment
sql/sql_acl.cc:
Mark that we need all columns for acl tables
Supply memroot to some 'new' calls.
Indentation fixes
sql/sql_base.cc:
set_query_id removed
Ensure we call ha_reset() at end of each statement
Mark read columns in read_set and changed columns in write_set (Before all columns was marked in read set)
Fixed marking of some columns that was not proplerly marked before
Maintain in TABLE->merge_keys set of all keys that are used in some way
Removed not used 'conds' argument from setup_tables()
Remove not used setting of 'dupp_field' in insert_fields()
Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
(This has probably caused us to not properly remove temporary files after crash)
sql/sql_bitmap.h:
Added is_overlapping()
sql/sql_class.cc:
Slow_logs was not properly initialized, which could maybe cause extra/lost entries in slow log.
set_query_id -> mark_used_columns
Simpler variable usage in pack_row() (cleanup)
Moved some variable declartion at start of function for better code readability
sql/sql_class.h:
Added enum_mark_columns
Updated comments
Renamed dupp_field -> dup_field
Added virtual function 'can_rollback_data()' to select_insert() to be used in CREATE ... SELECT to optimize use of OPTION_STATUS_NO_TRANS_UPDATE.
(This fixes a bug in CREATE ... SELECT where we did give wrong warnings when using non transacational tables)
sql/sql_delete.cc:
Updates to new handler interface
Call table->mark_columns_needed_for_delete() to allow us to put additional columns in column usage maps if handler so requires.
Call table->prepare_for_position() to tell handler that we are going to call ha_position().
Removed call to free_io_cache(). (io_cache is now removed in ha_reset()).
Fixed calls to setup_tables()
sql/sql_do.cc:
Update call to setup_fields()
sql/sql_handler.cc:
Tell handler tables to always read all columns.
Use temporary column map when storing value in field for later index usage
sql/sql_help.cc:
Makr all used fields to be read
Update call to setup_fields()
sql/sql_insert.cc:
Tell handler we are going to update the auto_increment column
dupp_field -> dup_field
Set column usage bits for timestamp field.
Call table->mark_columns_needed_for_insert() and table->mark_auto_increment_column()
Removed not used argument from mysql_prepare_insert_check_table().
If we get an duplicate row on insert, change column map to read and write all columns while retrying the operatation.
This is required by the definition of REPLACE and also ensures that fields that are only part of UPDATE are properly handled.
This fixed a bug in NDB and REPLACE where REPLACE wrongly copied some column values from the replaced row.
Setup new bitmaps for delayed insert rows
Remove reseting of next_number_fields as it will be reset on next call to handler_insert()
Fixed usage of thd->options and OPTION_STATUS_NO_TRANS_UPDATE.
The issue was that one should not to reset this flag as it may be set by a previous statement.
The way it was now used caused us to loose some warnings and get other wrong warnings when using non transactional tables mixed with transactional.
I fixed it by introducing 'select_insert::can_rollback_data' to inform send_error() that the given statement can be rolled back (which in case of CREATE TABLE can always be done)
Don't close tables created with CREATE ... SELECT but keep them in the table cache.
Moved out MY_HOOKS from inside function (better readability)
sql/sql_load.cc:
Update to use new handler and column marking interface
Update using setup_tables()
sql/sql_olap.cc:
Update calls to setup_tables
Use enums instead of constants to setup_fields()
sql/sql_parse.cc:
Handle OPTION_KEEP_LOG:
- Set it on CREATE TEMPORARY TABLE / DROP TABLE
- Reset it when OPTION_STATUS_NO_TRANS_UPDATE is reset
- Don't set it for CREATE ... SELECT (this is handled in select_create class)
Remove reseting of OPTION_STATUS_NO_TRANS_UPDATE in begin_trans() as this should already be reset.
If in autocommit mode, reset OPTION_KEEP_LOG and OPTION_STATUS_NO_TRANS_UPDATE to not give warnings in future commands
sql/sql_partition.cc:
Update walk() usage
Trivial indentation fixes
sql/sql_plugin.cc:
Mark all columns as used for plugins
sql/sql_prepare.cc:
Added assert to find out hidden bugs in character_set_client (got an error in debug binary when this not set correctly)
Updates for new handler interface
Update calls to setup_fields()
sql/sql_repl.cc:
Indentation fixes
sql/sql_select.cc:
Update call to setup_tables() and setup_fields()
Remove some old disabled code
Update to new hadler interface
Indentation cleanups
Added column bitmaps for temporary tables.
Remove updating of the removed slots in the Field class
Added TABLE argument to cp_buffer_from_ref() (To be able to install temporary column maps)
For internal temporary tables, use handler::write_row(), handler::delete_row() and handler::update_row() instead of handler::ha_xxxx() for faster execution.
sql/sql_select.h:
Indentaition fixes.
Install temporary column usage maps when needed
Added TABLE element to cp_buffer_from_ref()
sql/sql_show.cc:
Update to new handler interface
Mark all columns used for internal tables.
Style fixes.
Added support for 'future' ROW_TYPE_PAGES.
Don't allocate TMP_TABLE_PARAM with calloc. The 'init()' function will initialize the structure properly.
sql/sql_table.cc:
Update to new handler interface
Simple my_snprintf -> strmake()
Changed some constants to defines
Don't test for NULL in primary key (as we a couple of line above force the PRIMARY KEY to be NOT NULL)
Change field->add_index to use field->flags & FIELD_IN_ADD_INDEX
Mark all columns as used for ALTER TABLE
Style fixes
Update call to filesort()
sql/sql_trigger.h:
Added friend functions to be able to test if triggers exists for table we are going to insert/update or delete in.
sql/sql_udf.cc:
Mark all columns as used for udf system table.
sql/sql_union.cc:
Update call to walk()
Update to new handler interface
sql/sql_update.cc:
Remove query_id argument from compare_record()
Use column bitmaps instead of query_id.
We can't use compare_records() to skip updates for handlers that returns a partial column set and the read_set doesn't cover all columns in the write set, because compare_record() can't in this case know if a not read column changed value.
Update call to setup_fields()
Using separate column read and write sets allows for easier checking of timestamp field was set by statement.
Removed call to free_io_cache() as this is now done in ha_reset()
Call table->mark_columns_needed_for_update() and table->prepare_for_position()
Style fixes
sql/sql_view.cc:
Style fixes
sql/table.cc:
Remove implicitely include 'errno.h'
Remove code for building normalized path, as this is now identical to 'path'
Remove field->fieldnr
Added update of field->part_of_key_not_clustered()
Create column bitmaps in TABLE and TABLE_SHARE
Don't setup a temporary MEM_ROOT object as a thread specific variable for the handler. Instead we send the to-be-used MEMROOT to get_new_handler()
Update to new handler interface
Update call to walk()
Added new functions:
- st_table::clear_column_bitmaps()
- st_table::prepare_for_position()
- st_table::mark_columns_used_by_index()
- st_table::restore_column_maps_after_mark_index()
- st_table::mark_columns_used_by_index_no_reset()
- st_table::mark_auto_increment_column()
- st_table::mark_columns_needed_for_delete()
- st_table::mark_columns_needed_for_update()
- st_table::mark_columns_needed_for_insert()
sql/table.h:
Moved column usage bitmaps from handler to TABLE
Added to TABLE_SHARE all_set and column_bitmap_size
Added to TABLE merge_keys, bitmap_init_values, def_read_set, def_write_set, tmp_set, read_set and write_set.
Declared all new table column bitmap functions
Added TABLE functions column_bitmaps_set(), column_bitmaps_set_no_signal(), use_all_columns() and default_column_bitmaps()
Added functions: tmp_use_all_columns() and tmp_restore_column_map() to temporarly switch column bitmaps
Added functions: dbug_tmp_use_all_columns() and dbug_tmp_restore_column_map() to temporarly switch column bitmaps to avoid asserts in Field::store() and Field::val().
sql/tztime.cc:
Mark all columns as used for timezone tables
storage/archive/ha_archive.cc:
Update to new handler interface
storage/archive/ha_archive.h:
Update to new handler interface
storage/blackhole/ha_blackhole.cc:
Update to new handler interface
storage/blackhole/ha_blackhole.h:
Update to new handler interface
removed not needed flag HA_DUPP_POS
storage/csv/ha_tina.cc:
Update to new handler interface
storage/csv/ha_tina.h:
Update to new handler interface
storage/example/ha_example.cc:
Update to new handler interface
storage/example/ha_example.h:
Update to new handler interface
storage/heap/hp_extra.c:
Added heap_reset() (Required by new handler interface)
storage/heap/hp_test2.c:
Use heap_reset()
storage/myisam/ft_boolean_search.c:
Fixed compiler warning
storage/myisam/mi_extra.c:
Added mi_reset() (Required by new handler interface)
storage/myisam/mi_search.c:
Fixed DBUG_PRINT messages to use 0x%lx instead of %lx
storage/myisam/mi_test2.c:
Use mi_reset()
storage/myisam/myisampack.c:
Use mi_reset()
storage/myisammrg/myrg_extra.c:
Added myrg_reset() (Required by new handler interface)
unittest/mysys/base64.t.c:
Include my_global.h
Don't include implictely include file 'stdlib.h'
2006-06-04 17:52:22 +02:00
|
|
|
if (old_map)
|
|
|
|
dbug_tmp_restore_column_map(table->read_set, old_map);
|
|
|
|
#endif
|
|
|
|
|
2020-07-24 04:46:40 +02:00
|
|
|
return store_string_aux(str.ptr(), str.length(), str.charset(), tocs);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
wl#173 - temporal types with sub-second resolution
and collateral changes.
* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double
client/mysqlbinlog.cc:
remove unneded casts
include/my_sys.h:
introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
pack_time/unpack_time, etc.
convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
str_to_time() is gone. str_to_datetime() does it now.
my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
time is not equal to datetime anymore
mysql-test/r/distinct.result:
a test for an old MySQL bug
mysql-test/r/explain.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
invalid datetime is not compared with as a string
mysql-test/r/select.result:
NO_ZERO_IN_DATE, etc only affect storage - according to the manual
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
test for an old MySQL bug
mysql-test/t/func_time.test:
+- INTERVAL now works with TIME values
mysql-test/t/select.test:
typo
mysql-test/t/subselect.test:
only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
old timestamp(X) is no longer supported
mysys/my_getsystime.c:
functions to get the time with microsecond precision
mysys/my_init.c:
move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
no need to make these variables extern
mysys/my_static.h:
no need to make these variables extern
scripts/mysql_system_tables.sql:
old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
old timestamp(X) is no longer supported
sql-common/my_time.c:
* call str_to_time from str_to_datetime, as appropriate
* date/time to string conversions take precision as an argument
* number_to_time()
* TIME_to_double()
* pack_time() and unpack_time()
sql/event_data_objects.cc:
cast is not needed
my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
avoid dangerous downcast (because the pointer is
not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
avoid silly double-work for cond_wait
(having an endpoint of wait, subtract the current time to get the timeout,
and use set_timespec() macro to fill in struct timespec, by adding the current
time to the timeout)
sql/field.cc:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
TIME_RESULT, cmp_time()
sql/item.cc:
* numbers aren't quoted in EXPLAIN EXTENDED
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_param::field_type() is set correctly
* Item_datetime, for a datetime constant
* time to anything is compared as a time
* Item_cache::print() prints the value is available
* bug fixed in Item_cache_int::val_str()
sql/item.h:
* Item::print_value(), to be used from Item_xxx::print() when needed
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_datetime, for a datetime constant
* better default for cast_to_int_type()
* Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
* get_year_value, get_time_value are gone. get_datetime_value does it all
* get_value_a_func, get_value_b_func are gone
* can_compare_as_dates() is gone too, TIME_RESULT is used instead
* cmp_type() instead or result_type() when doing a comparison
* compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
greatly simplified Arg_comparator
sql/item_create.cc:
* fix a bug in error messages in CAST
sql/item_func.cc:
Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
overwrite the default cmp_type() for Item_row,
as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
rewrite make_datetime to support precision argument
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
replication of NOW(6)
sql/log_event.h:
replication of NOW(6)
sql/mysql_priv.h:
Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
make_truncated_value_warning() that uses it.
sql/mysqld.cc:
datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
small cleanup
sql/set_var.cc:
SET TIMESTAMP=double
sql/set_var.h:
@@TIMESTAMP is a double
sql/share/errmsg.txt:
precision and scale are unsigned
sql/slave.cc:
replication of NOW(6)
sql/sp_head.cc:
cleanup
sql/sql_class.cc:
support for NOW(6)
sql/sql_class.h:
support for NOW(6)
sql/sql_insert.cc:
support for NOW(6)
sql/sql_select.cc:
use item->cmp_type().
move a comment where it belongs
sql/sql_show.cc:
new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
warnings
tests/mysql_client_test.c:
old timestamp(X) does not work anymore
datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
|
|
|
bool Protocol_text::store(MYSQL_TIME *tm, int decimals)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_DATETIME));
|
2002-12-14 16:43:01 +01:00
|
|
|
field_pos++;
|
2002-12-11 08:17:51 +01:00
|
|
|
#endif
|
wl#173 - temporal types with sub-second resolution
and collateral changes.
* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double
client/mysqlbinlog.cc:
remove unneded casts
include/my_sys.h:
introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
pack_time/unpack_time, etc.
convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
str_to_time() is gone. str_to_datetime() does it now.
my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
time is not equal to datetime anymore
mysql-test/r/distinct.result:
a test for an old MySQL bug
mysql-test/r/explain.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
invalid datetime is not compared with as a string
mysql-test/r/select.result:
NO_ZERO_IN_DATE, etc only affect storage - according to the manual
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
test for an old MySQL bug
mysql-test/t/func_time.test:
+- INTERVAL now works with TIME values
mysql-test/t/select.test:
typo
mysql-test/t/subselect.test:
only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
old timestamp(X) is no longer supported
mysys/my_getsystime.c:
functions to get the time with microsecond precision
mysys/my_init.c:
move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
no need to make these variables extern
mysys/my_static.h:
no need to make these variables extern
scripts/mysql_system_tables.sql:
old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
old timestamp(X) is no longer supported
sql-common/my_time.c:
* call str_to_time from str_to_datetime, as appropriate
* date/time to string conversions take precision as an argument
* number_to_time()
* TIME_to_double()
* pack_time() and unpack_time()
sql/event_data_objects.cc:
cast is not needed
my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
avoid dangerous downcast (because the pointer is
not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
avoid silly double-work for cond_wait
(having an endpoint of wait, subtract the current time to get the timeout,
and use set_timespec() macro to fill in struct timespec, by adding the current
time to the timeout)
sql/field.cc:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
TIME_RESULT, cmp_time()
sql/item.cc:
* numbers aren't quoted in EXPLAIN EXTENDED
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_param::field_type() is set correctly
* Item_datetime, for a datetime constant
* time to anything is compared as a time
* Item_cache::print() prints the value is available
* bug fixed in Item_cache_int::val_str()
sql/item.h:
* Item::print_value(), to be used from Item_xxx::print() when needed
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_datetime, for a datetime constant
* better default for cast_to_int_type()
* Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
* get_year_value, get_time_value are gone. get_datetime_value does it all
* get_value_a_func, get_value_b_func are gone
* can_compare_as_dates() is gone too, TIME_RESULT is used instead
* cmp_type() instead or result_type() when doing a comparison
* compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
greatly simplified Arg_comparator
sql/item_create.cc:
* fix a bug in error messages in CAST
sql/item_func.cc:
Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
overwrite the default cmp_type() for Item_row,
as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
rewrite make_datetime to support precision argument
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
replication of NOW(6)
sql/log_event.h:
replication of NOW(6)
sql/mysql_priv.h:
Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
make_truncated_value_warning() that uses it.
sql/mysqld.cc:
datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
small cleanup
sql/set_var.cc:
SET TIMESTAMP=double
sql/set_var.h:
@@TIMESTAMP is a double
sql/share/errmsg.txt:
precision and scale are unsigned
sql/slave.cc:
replication of NOW(6)
sql/sp_head.cc:
cleanup
sql/sql_class.cc:
support for NOW(6)
sql/sql_class.h:
support for NOW(6)
sql/sql_insert.cc:
support for NOW(6)
sql/sql_select.cc:
use item->cmp_type().
move a comment where it belongs
sql/sql_show.cc:
new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
warnings
tests/mysql_client_test.c:
old timestamp(X) does not work anymore
datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
|
|
|
char buff[MAX_DATE_STRING_REP_LENGTH];
|
|
|
|
uint length= my_datetime_to_str(tm, buff, decimals);
|
2020-08-09 12:25:22 +02:00
|
|
|
return store_numeric_string_aux(buff, length);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-03-23 21:08:31 +01:00
|
|
|
bool Protocol_text::store_date(MYSQL_TIME *tm)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_DATE));
|
2003-03-15 11:56:03 +01:00
|
|
|
field_pos++;
|
2002-12-11 08:17:51 +01:00
|
|
|
#endif
|
2004-10-15 22:12:59 +02:00
|
|
|
char buff[MAX_DATE_STRING_REP_LENGTH];
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
size_t length= my_date_to_str(tm, buff);
|
2020-08-09 12:25:22 +02:00
|
|
|
return store_numeric_string_aux(buff, length);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
wl#173 - temporal types with sub-second resolution
and collateral changes.
* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double
client/mysqlbinlog.cc:
remove unneded casts
include/my_sys.h:
introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
pack_time/unpack_time, etc.
convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
str_to_time() is gone. str_to_datetime() does it now.
my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
time is not equal to datetime anymore
mysql-test/r/distinct.result:
a test for an old MySQL bug
mysql-test/r/explain.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
invalid datetime is not compared with as a string
mysql-test/r/select.result:
NO_ZERO_IN_DATE, etc only affect storage - according to the manual
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
test for an old MySQL bug
mysql-test/t/func_time.test:
+- INTERVAL now works with TIME values
mysql-test/t/select.test:
typo
mysql-test/t/subselect.test:
only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
old timestamp(X) is no longer supported
mysys/my_getsystime.c:
functions to get the time with microsecond precision
mysys/my_init.c:
move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
no need to make these variables extern
mysys/my_static.h:
no need to make these variables extern
scripts/mysql_system_tables.sql:
old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
old timestamp(X) is no longer supported
sql-common/my_time.c:
* call str_to_time from str_to_datetime, as appropriate
* date/time to string conversions take precision as an argument
* number_to_time()
* TIME_to_double()
* pack_time() and unpack_time()
sql/event_data_objects.cc:
cast is not needed
my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
avoid dangerous downcast (because the pointer is
not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
avoid silly double-work for cond_wait
(having an endpoint of wait, subtract the current time to get the timeout,
and use set_timespec() macro to fill in struct timespec, by adding the current
time to the timeout)
sql/field.cc:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
TIME_RESULT, cmp_time()
sql/item.cc:
* numbers aren't quoted in EXPLAIN EXTENDED
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_param::field_type() is set correctly
* Item_datetime, for a datetime constant
* time to anything is compared as a time
* Item_cache::print() prints the value is available
* bug fixed in Item_cache_int::val_str()
sql/item.h:
* Item::print_value(), to be used from Item_xxx::print() when needed
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_datetime, for a datetime constant
* better default for cast_to_int_type()
* Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
* get_year_value, get_time_value are gone. get_datetime_value does it all
* get_value_a_func, get_value_b_func are gone
* can_compare_as_dates() is gone too, TIME_RESULT is used instead
* cmp_type() instead or result_type() when doing a comparison
* compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
greatly simplified Arg_comparator
sql/item_create.cc:
* fix a bug in error messages in CAST
sql/item_func.cc:
Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
overwrite the default cmp_type() for Item_row,
as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
rewrite make_datetime to support precision argument
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
replication of NOW(6)
sql/log_event.h:
replication of NOW(6)
sql/mysql_priv.h:
Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
make_truncated_value_warning() that uses it.
sql/mysqld.cc:
datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
small cleanup
sql/set_var.cc:
SET TIMESTAMP=double
sql/set_var.h:
@@TIMESTAMP is a double
sql/share/errmsg.txt:
precision and scale are unsigned
sql/slave.cc:
replication of NOW(6)
sql/sp_head.cc:
cleanup
sql/sql_class.cc:
support for NOW(6)
sql/sql_class.h:
support for NOW(6)
sql/sql_insert.cc:
support for NOW(6)
sql/sql_select.cc:
use item->cmp_type().
move a comment where it belongs
sql/sql_show.cc:
new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
warnings
tests/mysql_client_test.c:
old timestamp(X) does not work anymore
datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
|
|
|
bool Protocol_text::store_time(MYSQL_TIME *tm, int decimals)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
DBUG_ASSERT(valid_handler(field_pos, PROTOCOL_SEND_TIME));
|
2003-03-15 11:56:03 +01:00
|
|
|
field_pos++;
|
2002-12-11 08:17:51 +01:00
|
|
|
#endif
|
wl#173 - temporal types with sub-second resolution
and collateral changes.
* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double
client/mysqlbinlog.cc:
remove unneded casts
include/my_sys.h:
introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
pack_time/unpack_time, etc.
convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
str_to_time() is gone. str_to_datetime() does it now.
my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
time is not equal to datetime anymore
mysql-test/r/distinct.result:
a test for an old MySQL bug
mysql-test/r/explain.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
invalid datetime is not compared with as a string
mysql-test/r/select.result:
NO_ZERO_IN_DATE, etc only affect storage - according to the manual
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
test for an old MySQL bug
mysql-test/t/func_time.test:
+- INTERVAL now works with TIME values
mysql-test/t/select.test:
typo
mysql-test/t/subselect.test:
only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
old timestamp(X) is no longer supported
mysys/my_getsystime.c:
functions to get the time with microsecond precision
mysys/my_init.c:
move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
no need to make these variables extern
mysys/my_static.h:
no need to make these variables extern
scripts/mysql_system_tables.sql:
old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
old timestamp(X) is no longer supported
sql-common/my_time.c:
* call str_to_time from str_to_datetime, as appropriate
* date/time to string conversions take precision as an argument
* number_to_time()
* TIME_to_double()
* pack_time() and unpack_time()
sql/event_data_objects.cc:
cast is not needed
my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
avoid dangerous downcast (because the pointer is
not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
avoid silly double-work for cond_wait
(having an endpoint of wait, subtract the current time to get the timeout,
and use set_timespec() macro to fill in struct timespec, by adding the current
time to the timeout)
sql/field.cc:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
TIME_RESULT, cmp_time()
sql/item.cc:
* numbers aren't quoted in EXPLAIN EXTENDED
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_param::field_type() is set correctly
* Item_datetime, for a datetime constant
* time to anything is compared as a time
* Item_cache::print() prints the value is available
* bug fixed in Item_cache_int::val_str()
sql/item.h:
* Item::print_value(), to be used from Item_xxx::print() when needed
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_datetime, for a datetime constant
* better default for cast_to_int_type()
* Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
* get_year_value, get_time_value are gone. get_datetime_value does it all
* get_value_a_func, get_value_b_func are gone
* can_compare_as_dates() is gone too, TIME_RESULT is used instead
* cmp_type() instead or result_type() when doing a comparison
* compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
greatly simplified Arg_comparator
sql/item_create.cc:
* fix a bug in error messages in CAST
sql/item_func.cc:
Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
overwrite the default cmp_type() for Item_row,
as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
rewrite make_datetime to support precision argument
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
replication of NOW(6)
sql/log_event.h:
replication of NOW(6)
sql/mysql_priv.h:
Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
make_truncated_value_warning() that uses it.
sql/mysqld.cc:
datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
small cleanup
sql/set_var.cc:
SET TIMESTAMP=double
sql/set_var.h:
@@TIMESTAMP is a double
sql/share/errmsg.txt:
precision and scale are unsigned
sql/slave.cc:
replication of NOW(6)
sql/sp_head.cc:
cleanup
sql/sql_class.cc:
support for NOW(6)
sql/sql_class.h:
support for NOW(6)
sql/sql_insert.cc:
support for NOW(6)
sql/sql_select.cc:
use item->cmp_type().
move a comment where it belongs
sql/sql_show.cc:
new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
warnings
tests/mysql_client_test.c:
old timestamp(X) does not work anymore
datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
|
|
|
char buff[MAX_DATE_STRING_REP_LENGTH];
|
|
|
|
uint length= my_time_to_str(tm, buff, decimals);
|
2020-08-09 12:25:22 +02:00
|
|
|
return store_numeric_string_aux(buff, length);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
/**
|
|
|
|
Assign OUT-parameters to user variables.
|
|
|
|
|
|
|
|
@param sp_params List of PS/SP parameters (both input and output).
|
|
|
|
|
|
|
|
@return Error status.
|
|
|
|
@retval FALSE Success.
|
|
|
|
@retval TRUE Error.
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool Protocol_text::send_out_parameters(List<Item_param> *sp_params)
|
|
|
|
{
|
2019-03-03 04:20:15 +01:00
|
|
|
DBUG_ASSERT(sp_params->elements == thd->lex->prepared_stmt.param_count());
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
|
|
|
|
List_iterator_fast<Item_param> item_param_it(*sp_params);
|
2019-03-03 04:20:15 +01:00
|
|
|
List_iterator_fast<Item> param_it(thd->lex->prepared_stmt.params());
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
Item_param *item_param= item_param_it++;
|
2016-10-08 09:50:18 +02:00
|
|
|
Item *param= param_it++;
|
|
|
|
Settable_routine_parameter *sparam;
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
|
2016-10-08 09:50:18 +02:00
|
|
|
if (!item_param || !param)
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
if (!item_param->get_out_param_info())
|
|
|
|
continue; // It's an IN-parameter.
|
|
|
|
|
2016-10-08 09:50:18 +02:00
|
|
|
if (!(sparam= param->get_settable_routine_parameter()))
|
|
|
|
{
|
|
|
|
DBUG_ASSERT(0);
|
|
|
|
continue;
|
|
|
|
}
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
|
MDEV-14454 Binary protocol returns wrong collation ID for SP OUT parameters
Item_param::set_value() did not set Item::collation and
Item_param::str_value_ptr.str_charset properly. So both
metadata and data for OUT parameters were sent in a wrong
way to the client.
This patch removes the old implementation of Item_param::set_value()
and rewrites it using Type_handler::Item_param_set_from_value(),
so now setting IN and OUT parameters share the a lot of code.
1. Item_param::set_str() now:
- accepts two additional parameters fromcs, tocs
- sets str_value_ptr, to make sure it's always in sync with str_value,
even without Item_param::convert_str_value()
- does collation.set(tocs, DERIVATION_COERCIBLE),
to make sure that DTCollation is valid even without
Item_param::convert_str_value()
2. Item_param::set_value(), which is used to set OUT parameters,
now reuses Type_handler::Item_param_set_from_value().
3. Cleanup: moving Item_param::str_value_ptr to private,
as it's not needed outside.
4. Cleanup: adding a new virtual method
Settable_routine_parameter::get_item_param()
and using it a few new DBUG_ASSERTs, where
Item_param cannot appear.
After this change:
1. Assigning of IN parameters works as before:
a. Item_param::set_str() is called and sets the value as a binary string
b. The original value is sent to the query used for binary/general logging
c. Item_param::convert_str_value() converts the value from the client
character set to the connection character set
2. Assigning of OUT parameters works in the new way:
a. Item_param::set_str() and sets the value
using the source Item's collation, so both Item::collation
and Item_param::str_value_ptr.str_charset are properly set.
b. Protocol_binary::send_out_parameters() sends the
value to the client correctly:
- Protocol::send_result_set_metadata() uses Item::collation.collation
(which is now properly set), to detect if conversion is needed,
and sends a correct collation ID.
- Protocol::send_result_set_row() calls Type_handler::Item_send_str(),
which uses Item_param::str_value_ptr.str_charset
(which is now properly set) to actually perform the conversion.
2017-11-21 13:02:26 +01:00
|
|
|
DBUG_ASSERT(sparam->get_item_param() == NULL);
|
2016-10-08 09:50:18 +02:00
|
|
|
sparam->set_value(thd, thd->spcont, reinterpret_cast<Item **>(&item_param));
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
2002-12-11 08:17:51 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
Functions to handle the binary protocol used with prepared statements
|
2003-01-03 12:52:53 +01:00
|
|
|
|
|
|
|
Data format:
|
|
|
|
|
2003-02-04 02:19:19 +01:00
|
|
|
[ok:1] reserved ok packet
|
|
|
|
[null_field:(field_count+7+2)/8] reserved to send null data. The size is
|
|
|
|
calculated using:
|
|
|
|
bit_fields= (field_count+7+2)/8;
|
|
|
|
2 bits are reserved for identifying type
|
|
|
|
of package.
|
|
|
|
[[length]data] data field (the length applies only for
|
|
|
|
string/binary/time/timestamp fields and
|
|
|
|
rest of them are not sent as they have
|
|
|
|
the default length that client understands
|
|
|
|
based on the field type
|
|
|
|
[..]..[[length]data] data
|
2002-12-11 08:17:51 +01:00
|
|
|
****************************************************************************/
|
|
|
|
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
bool Protocol_binary::prepare_for_send(uint num_columns)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
Protocol::prepare_for_send(num_columns);
|
2003-01-03 12:52:53 +01:00
|
|
|
bit_fields= (field_count+9)/8;
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
return packet->alloc(bit_fields+1);
|
|
|
|
|
2002-12-11 08:17:51 +01:00
|
|
|
/* prepare_for_resend will be called after this one */
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
void Protocol_binary::prepare_for_resend()
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2003-01-03 12:52:53 +01:00
|
|
|
packet->length(bit_fields+1);
|
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
BitKeeper/etc/ignore:
added libmysqld/ha_ndbcluster_cond.cc
---
added debian/defs.mk debian/control
client/completion_hash.cc:
Remove not needed casts
client/my_readline.h:
Remove some old types
client/mysql.cc:
Simplify types
client/mysql_upgrade.c:
Remove some old types
Update call to dirname_part
client/mysqladmin.cc:
Remove some old types
client/mysqlbinlog.cc:
Remove some old types
Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
Remove some old types
client/mysqldump.c:
Remove some old types
Remove some not needed casts
Change some string lengths to size_t
client/mysqlimport.c:
Remove some old types
client/mysqlshow.c:
Remove some old types
client/mysqlslap.c:
Remove some old types
Remove some not needed casts
client/mysqltest.c:
Removed some old types
Removed some not needed casts
Updated hash-get-key function arguments
Updated parameters to dirname_part()
client/readline.cc:
Removed some old types
Removed some not needed casts
Changed some string lengths to use size_t
client/sql_string.cc:
Removed some old types
dbug/dbug.c:
Removed some old types
Changed some string lengths to use size_t
Changed some prototypes to avoid casts
extra/comp_err.c:
Removed some old types
extra/innochecksum.c:
Removed some old types
extra/my_print_defaults.c:
Removed some old types
extra/mysql_waitpid.c:
Removed some old types
extra/perror.c:
Removed some old types
extra/replace.c:
Removed some old types
Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
Removed some old types
extra/resolveip.c:
Removed some old types
include/config-win.h:
Removed some old types
include/decimal.h:
Changed binary strings to be uchar* instead of char*
include/ft_global.h:
Removed some old types
include/hash.h:
Removed some old types
include/heap.h:
Removed some old types
Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
Removed some old types
include/m_ctype.h:
Removed some old types
Changed some string lengths to use size_t
Changed character length functions to return uint
unsigned char -> uchar
include/m_string.h:
Removed some old types
Changed some string lengths to use size_t
include/my_alloc.h:
Changed some string lengths to use size_t
include/my_base.h:
Removed some old types
include/my_dbug.h:
Removed some old types
Changed some string lengths to use size_t
Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
Removed some old types
include/my_global.h:
Removed old types:
my_size_t -> size_t
byte -> uchar
gptr -> uchar *
include/my_list.h:
Removed some old types
include/my_nosys.h:
Removed some old types
include/my_pthread.h:
Removed some old types
include/my_sys.h:
Removed some old types
Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
Changed some string lengths to use size_t
my_malloc() / my_free() now uses void *
Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
Removed some old types
include/my_trie.h:
Removed some old types
include/my_user.h:
Changed some string lengths to use size_t
include/my_vle.h:
Removed some old types
include/my_xml.h:
Removed some old types
Changed some string lengths to use size_t
include/myisam.h:
Removed some old types
include/myisammrg.h:
Removed some old types
include/mysql.h:
Removed some old types
Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
include/queues.h:
Removed some old types
include/sql_common.h:
Removed some old types
include/sslopt-longopts.h:
Removed some old types
include/violite.h:
Removed some old types
Changed some string lengths to use size_t
libmysql/client_settings.h:
Removed some old types
libmysql/libmysql.c:
Removed some old types
libmysql/manager.c:
Removed some old types
libmysqld/emb_qcache.cc:
Removed some old types
libmysqld/emb_qcache.h:
Removed some old types
libmysqld/lib_sql.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
true -> TRUE, false -> FALSE
mysys/array.c:
Removed some old types
mysys/charset.c:
Changed some string lengths to use size_t
mysys/checksum.c:
Include zlib to get definition for crc32
Removed some old types
mysys/default.c:
Removed some old types
Changed some string lengths to use size_t
mysys/default_modify.c:
Changed some string lengths to use size_t
Removed some not needed casts
mysys/hash.c:
Removed some old types
Changed some string lengths to use size_t
Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
Removed some old types
mysys/mf_cache.c:
Changed some string lengths to use size_t
mysys/mf_dirname.c:
Removed some old types
Changed some string lengths to use size_t
Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
Removed some old types
Updated parameters to dirname_part()
mysys/mf_format.c:
Removed some old types
Changed some string lengths to use size_t
mysys/mf_getdate.c:
Removed some old types
mysys/mf_iocache.c:
Removed some old types
Changed some string lengths to use size_t
Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
Removed some old types
Changed some string lengths to use size_t
Clean up comments
Removed not needed indentation
mysys/mf_keycache.c:
Removed some old types
mysys/mf_keycaches.c:
Removed some old types
mysys/mf_loadpath.c:
Removed some old types
mysys/mf_pack.c:
Removed some old types
Changed some string lengths to use size_t
Removed some not needed casts
Removed very old VMS code
Updated parameters to dirname_part()
Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
Removed some old types
mysys/mf_radix.c:
Removed some old types
mysys/mf_same.c:
Removed some old types
mysys/mf_sort.c:
Removed some old types
mysys/mf_soundex.c:
Removed some old types
mysys/mf_strip.c:
Removed some old types
mysys/mf_tempdir.c:
Removed some old types
mysys/mf_unixpath.c:
Removed some old types
mysys/mf_wfile.c:
Removed some old types
mysys/mulalloc.c:
Removed some old types
mysys/my_alloc.c:
Removed some old types
Changed some string lengths to use size_t
Use void* as type for allocated memory area
Removed some not needed casts
Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
More comments
Removed some old types
Changed string lengths to use size_t
Changed arguments to my_uncompress() to make them easier to understand
Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
Changed some string lengths to use size_t
mysys/my_create.c:
Removed some old types
mysys/my_div.c:
Removed some old types
mysys/my_error.c:
Removed some old types
mysys/my_fopen.c:
Removed some old types
mysys/my_fstream.c:
Removed some old types
Changed some string lengths to use size_t
writen -> written
mysys/my_getopt.c:
Removed some old types
mysys/my_getwd.c:
Removed some old types
More comments
mysys/my_init.c:
Removed some old types
mysys/my_largepage.c:
Removed some old types
Changed some string lengths to use size_t
mysys/my_lib.c:
Removed some old types
mysys/my_lockmem.c:
Removed some old types
mysys/my_malloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/my_memmem.c:
Indentation cleanup
mysys/my_once.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
Removed some old types
mysys/my_pread.c:
Removed some old types
Changed all functions to use size_t
Added comment for how my_pread() / my_pwrite() are supposed to work.
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.
(If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
Removed some old types
Changed all functions to use size_t
mysys/my_read.c:
Removed some old types
Changed all functions to use size_t
mysys/my_realloc.c:
Removed some old types
Use void* as type for allocated memory area
Changed all functions to use size_t
mysys/my_static.c:
Removed some old types
mysys/my_static.h:
Removed some old types
mysys/my_vle.c:
Removed some old types
mysys/my_wincond.c:
Removed some old types
mysys/my_windac.c:
Removed some old types
mysys/my_write.c:
Removed some old types
Changed all functions to use size_t
mysys/ptr_cmp.c:
Removed some old types
Changed all functions to use size_t
mysys/queues.c:
Removed some old types
mysys/safemalloc.c:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed all functions to use size_t
mysys/string.c:
Removed some old types
Changed all functions to use size_t
mysys/testhash.c:
Removed some old types
mysys/thr_alarm.c:
Removed some old types
mysys/thr_lock.c:
Removed some old types
mysys/tree.c:
Removed some old types
mysys/trie.c:
Removed some old types
mysys/typelib.c:
Removed some old types
plugin/daemon_example/daemon_example.cc:
Removed some old types
regex/reginit.c:
Removed some old types
server-tools/instance-manager/buffer.cc:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
Removed some old types
Changed some string lengths to use size_t
Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
Changed buffer to be of type uchar*
Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
Removed some old types
server-tools/instance-manager/parse.cc:
Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
Removed some old types
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
Removed some old types
Changed some string lengths to use size_t
sql/derror.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/discover.cc:
Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
Removed some old types
Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
Changed some buffers to be uchar* to avoid casts
Added missing casts for sprintf()
sql/event_queue.cc:
Removed some old types
sql/field.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
Removed some old types
Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes).
Changed some string lengths to use size_t
Removed some not needed casts
Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
Removed some old types
Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
Removed some old types
Changed memory buffers to be uchar*
Changed some string lengths to use size_t
Removed a lot of casts
Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
Added required cast
sql/ha_ndbcluster.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Added required casts
Removed some not needed casts
sql/ha_ndbcluster.h:
Removed some old types
sql/ha_ndbcluster_binlog.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
Changed some string lengths to use size_t
Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
Removed some old types
sql/ha_ndbcluster_cond.cc:
Removed some old types
Removed some not needed casts
sql/ha_ndbcluster_cond.h:
Removed some old types
sql/ha_partition.cc:
Removed some old types
Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
Removed some old types
sql/handler.cc:
Removed some old types
Changed some string lengths to use size_t
sql/handler.h:
Removed some old types
Changed some string lengths to use size_t
Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
Removed some old types
Changed all functions to use size_t
sql/hostname.cc:
Removed some old types
sql/item.cc:
Removed some old types
Changed some string lengths to use size_t
Use strmake() instead of memdup() to create a null terminated string.
Updated calls to new Field()
sql/item.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
Removed some old types
sql/item_create.cc:
Removed some old types
sql/item_func.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added test for failing alloc() in init_result_field()
Remove old confusing comment
Fixed compiler warning
sql/item_func.h:
Removed some old types
sql/item_row.cc:
Removed some old types
sql/item_row.h:
Removed some old types
sql/item_strfunc.cc:
Include zlib (needed becasue we call crc32)
Removed some old types
sql/item_strfunc.h:
Removed some old types
Changed some types to match new function prototypes
sql/item_subselect.cc:
Removed some old types
sql/item_subselect.h:
Removed some old types
sql/item_sum.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/item_sum.h:
Removed some old types
sql/item_timefunc.cc:
Removed some old types
Changed some string lengths to use size_t
sql/item_timefunc.h:
Removed some old types
sql/item_xmlfunc.cc:
Changed some string lengths to use size_t
sql/item_xmlfunc.h:
Removed some old types
sql/key.cc:
Removed some old types
Removed some not needed casts
sql/lock.cc:
Removed some old types
Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Changed usage of pwrite() to not assume it holds the cursor position for the file
Made usage of my_read() safer
sql/log_event.cc:
Removed some old types
Added checking of return value of malloc() in pack_info()
Changed some buffers to be uchar* to avoid casts
Removed some 'const' to avoid casts
Added missing casts for alloc() and sprintf()
Added required casts
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/log_event_old.h:
Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
Removed some old types
sql/my_decimal.cc:
Changed memory area to use uchar*
sql/my_decimal.h:
Changed memory area to use uchar*
sql/mysql_priv.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Changed some string lengths to use size_t
Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
Removed some old types
sql/net_serv.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Ensure that vio_read()/vio_write() return values are stored in a size_t variable
Removed some not needed casts
sql/opt_range.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/opt_range.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
Removed some old types
Removed some not needed casts
sql/parse_file.cc:
Removed some old types
Changed some string lengths to use size_t
Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
Removed some old types
sql/partition_info.cc:
Removed some old types
Added missing casts for alloc()
Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/protocol.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/records.cc:
Removed some old types
sql/repl_failsafe.cc:
Removed some old types
Changed some string lengths to use size_t
Added required casts
sql/rpl_filter.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some string lengths to use size_t
sql/rpl_filter.h:
Changed some string lengths to use size_t
sql/rpl_injector.h:
Removed some old types
sql/rpl_record.cc:
Removed some old types
Removed some not needed casts
Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/rpl_record_old.h:
Removed some old types
Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
Removed some old types
sql/rpl_tblmap.cc:
Removed some old types
sql/rpl_tblmap.h:
Removed some old types
sql/rpl_utility.cc:
Removed some old types
sql/rpl_utility.h:
Removed some old types
Changed type of 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
sql/set_var.cc:
Removed some old types
Updated parameters to dirname_part()
sql/set_var.h:
Removed some old types
sql/slave.cc:
Removed some old types
Changed some string lengths to use size_t
sql/slave.h:
Removed some old types
sql/sp.cc:
Removed some old types
Added missing casts for printf()
sql/sp.h:
Removed some old types
Updated hash-get-key function arguments
sql/sp_cache.cc:
Removed some old types
Added missing casts for printf()
Updated hash-get-key function arguments
sql/sp_head.cc:
Removed some old types
Added missing casts for alloc() and printf()
Added required casts
Updated hash-get-key function arguments
sql/sp_head.h:
Removed some old types
sql/sp_pcontext.cc:
Removed some old types
sql/sp_pcontext.h:
Removed some old types
sql/sql_acl.cc:
Removed some old types
Changed some string lengths to use size_t
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added required casts
sql/sql_analyse.cc:
Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
Removed some old types
sql/sql_base.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_binlog.cc:
Removed some old types
Added missing casts for printf()
sql/sql_cache.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
Changed some string lengths to use size_t
sql/sql_cache.h:
Removed some old types
Removed reference to not existing function cache_key()
Updated hash-get-key function arguments
sql/sql_class.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc()
Updated hash-get-key function arguments
Moved THD::max_row_length() to table.cc (as it's not depending on THD)
Removed some not needed casts
sql/sql_class.h:
Removed some old types
Changed malloc(), free() and related functions to use void *
Removed some not needed casts
Changed some string lengths to use size_t
Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
Removed some old types
Added required casts
sql/sql_db.cc:
Removed some old types
Removed some not needed casts
Added some cast to my_multi_malloc() arguments for safety
Added missing casts for alloc()
sql/sql_delete.cc:
Removed some old types
sql/sql_handler.cc:
Removed some old types
Updated hash-get-key function arguments
Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_insert.cc:
Removed some old types
Added missing casts for alloc() and printf()
sql/sql_lex.cc:
Removed some old types
sql/sql_lex.h:
Removed some old types
Removed some not needed casts
sql/sql_list.h:
Removed some old types
Removed some not needed casts
sql/sql_load.cc:
Removed some old types
Removed compiler warning
sql/sql_manager.cc:
Removed some old types
sql/sql_map.cc:
Removed some old types
sql/sql_map.h:
Removed some old types
sql/sql_olap.cc:
Removed some old types
sql/sql_parse.cc:
Removed some old types
Trivial move of code lines to make things more readable
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/sql_partition.cc:
Removed some old types
Removed compiler warnings about not used functions
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_partition.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
Removed some old types
Added missing casts for alloc()
Updated hash-get-key function arguments
sql/sql_prepare.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Added missing casts for alloc() and printf()
sql-common/client.c:
Removed some old types
Changed some memory areas to use uchar*
sql-common/my_user.c:
Changed some string lengths to use size_t
sql-common/pack.c:
Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
Added required casts
Changed some buffers to be uchar* to avoid casts
Changed some string lengths to use size_t
sql/sql_select.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some old types
sql/sql_select.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_show.cc:
Removed some old types
Added missing casts for alloc()
Removed some not needed casts
sql/sql_string.cc:
Removed some old types
Added required casts
sql/sql_table.cc:
Removed some old types
Removed compiler warning about not used variable
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
sql/sql_test.cc:
Removed some old types
sql/sql_trigger.cc:
Removed some old types
Added missing casts for alloc()
sql/sql_udf.cc:
Removed some old types
Updated hash-get-key function arguments
sql/sql_union.cc:
Removed some old types
sql/sql_update.cc:
Removed some old types
Removed some not needed casts
sql/sql_view.cc:
Removed some old types
sql/sql_yacc.yy:
Removed some old types
Changed some string lengths to use size_t
Added missing casts for alloc()
sql/stacktrace.c:
Removed some old types
sql/stacktrace.h:
Removed some old types
sql/structs.h:
Removed some old types
sql/table.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
Removed setting of LEX_STRING() arguments in declaration
Added required casts
More function comments
Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
Removed some old types
Changed some string lengths to use size_t
sql/thr_malloc.cc:
Use void* as type for allocated memory area
Changed all functions to use size_t
sql/tzfile.h:
Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
Changed some buffers to be uchar* to avoid casts
Updated hash-get-key function arguments
Added missing casts for alloc()
Removed some not needed casts
sql/uniques.cc:
Removed some old types
Removed some not needed casts
sql/unireg.cc:
Removed some old types
Changed some buffers to be uchar* to avoid casts
Removed some not needed casts
Added missing casts for alloc()
storage/archive/archive_reader.c:
Removed some old types
storage/archive/azio.c:
Removed some old types
Removed some not needed casts
storage/archive/ha_archive.cc:
Removed some old types
Changed type for 'frmblob' in archive_discover() to match handler
Updated hash-get-key function arguments
Removed some not needed casts
storage/archive/ha_archive.h:
Removed some old types
storage/blackhole/ha_blackhole.cc:
Removed some old types
storage/blackhole/ha_blackhole.h:
Removed some old types
storage/csv/ha_tina.cc:
Removed some old types
Updated hash-get-key function arguments
Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
Removed some old types
Removed some not needed casts
storage/csv/transparent_file.cc:
Removed some old types
Changed type of 'bytes_read' to be able to detect read errors
Fixed indentation
storage/csv/transparent_file.h:
Removed some old types
storage/example/ha_example.cc:
Removed some old types
Updated hash-get-key function arguments
storage/example/ha_example.h:
Removed some old types
storage/federated/ha_federated.cc:
Removed some old types
Updated hash-get-key function arguments
Removed some not needed casts
storage/federated/ha_federated.h:
Removed some old types
storage/heap/_check.c:
Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
Removed some old types
storage/heap/ha_heap.cc:
Removed some old types
storage/heap/ha_heap.h:
Removed some old types
storage/heap/heapdef.h:
Removed some old types
storage/heap/hp_block.c:
Removed some old types
Changed some string lengths to use size_t
storage/heap/hp_clear.c:
Removed some old types
storage/heap/hp_close.c:
Removed some old types
storage/heap/hp_create.c:
Removed some old types
storage/heap/hp_delete.c:
Removed some old types
storage/heap/hp_hash.c:
Removed some old types
storage/heap/hp_info.c:
Removed some old types
storage/heap/hp_open.c:
Removed some old types
storage/heap/hp_rfirst.c:
Removed some old types
storage/heap/hp_rkey.c:
Removed some old types
storage/heap/hp_rlast.c:
Removed some old types
storage/heap/hp_rnext.c:
Removed some old types
storage/heap/hp_rprev.c:
Removed some old types
storage/heap/hp_rrnd.c:
Removed some old types
storage/heap/hp_rsame.c:
Removed some old types
storage/heap/hp_scan.c:
Removed some old types
storage/heap/hp_test1.c:
Removed some old types
storage/heap/hp_test2.c:
Removed some old types
storage/heap/hp_update.c:
Removed some old types
storage/heap/hp_write.c:
Removed some old types
Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
Removed some old types
Updated hash-get-key function arguments
Added missing casts for alloc() and printf()
Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
Removed some old types
storage/myisam/ft_boolean_search.c:
Removed some old types
storage/myisam/ft_nlq_search.c:
Removed some old types
storage/myisam/ft_parser.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
Removed some old types
storage/myisam/ft_stopwords.c:
Removed some old types
storage/myisam/ft_update.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
Removed some old types
storage/myisam/ha_myisam.cc:
Removed some old types
storage/myisam/ha_myisam.h:
Removed some old types
storage/myisam/mi_cache.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
Removed some old types
storage/myisam/mi_checksum.c:
Removed some old types
storage/myisam/mi_close.c:
Removed some old types
storage/myisam/mi_create.c:
Removed some old types
storage/myisam/mi_delete.c:
Removed some old types
storage/myisam/mi_delete_all.c:
Removed some old types
storage/myisam/mi_dynrec.c:
Removed some old types
storage/myisam/mi_extra.c:
Removed some old types
storage/myisam/mi_key.c:
Removed some old types
storage/myisam/mi_locking.c:
Removed some old types
storage/myisam/mi_log.c:
Removed some old types
storage/myisam/mi_open.c:
Removed some old types
Removed some not needed casts
Check argument of my_write()/my_pwrite() in functions returning int
Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
Removed some old types
Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
Removed some old types
storage/myisam/mi_preload.c:
Removed some old types
storage/myisam/mi_range.c:
Removed some old types
storage/myisam/mi_rfirst.c:
Removed some old types
storage/myisam/mi_rkey.c:
Removed some old types
storage/myisam/mi_rlast.c:
Removed some old types
storage/myisam/mi_rnext.c:
Removed some old types
storage/myisam/mi_rnext_same.c:
Removed some old types
storage/myisam/mi_rprev.c:
Removed some old types
storage/myisam/mi_rrnd.c:
Removed some old types
storage/myisam/mi_rsame.c:
Removed some old types
storage/myisam/mi_rsamepos.c:
Removed some old types
storage/myisam/mi_scan.c:
Removed some old types
storage/myisam/mi_search.c:
Removed some old types
storage/myisam/mi_static.c:
Removed some old types
storage/myisam/mi_statrec.c:
Removed some old types
storage/myisam/mi_test1.c:
Removed some old types
storage/myisam/mi_test2.c:
Removed some old types
storage/myisam/mi_test3.c:
Removed some old types
storage/myisam/mi_unique.c:
Removed some old types
storage/myisam/mi_update.c:
Removed some old types
storage/myisam/mi_write.c:
Removed some old types
storage/myisam/myisam_ftdump.c:
Removed some old types
storage/myisam/myisamchk.c:
Removed some old types
storage/myisam/myisamdef.h:
Removed some old types
storage/myisam/myisamlog.c:
Removed some old types
Indentation fix
storage/myisam/myisampack.c:
Removed some old types
storage/myisam/rt_index.c:
Removed some old types
storage/myisam/rt_split.c:
Removed some old types
storage/myisam/sort.c:
Removed some old types
storage/myisam/sp_defs.h:
Removed some old types
storage/myisam/sp_key.c:
Removed some old types
storage/myisammrg/ha_myisammrg.cc:
Removed some old types
storage/myisammrg/ha_myisammrg.h:
Removed some old types
storage/myisammrg/myrg_close.c:
Removed some old types
storage/myisammrg/myrg_def.h:
Removed some old types
storage/myisammrg/myrg_delete.c:
Removed some old types
storage/myisammrg/myrg_open.c:
Removed some old types
Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
Removed some old types
storage/myisammrg/myrg_rfirst.c:
Removed some old types
storage/myisammrg/myrg_rkey.c:
Removed some old types
storage/myisammrg/myrg_rlast.c:
Removed some old types
storage/myisammrg/myrg_rnext.c:
Removed some old types
storage/myisammrg/myrg_rnext_same.c:
Removed some old types
storage/myisammrg/myrg_rprev.c:
Removed some old types
storage/myisammrg/myrg_rrnd.c:
Removed some old types
storage/myisammrg/myrg_rsame.c:
Removed some old types
storage/myisammrg/myrg_update.c:
Removed some old types
storage/myisammrg/myrg_write.c:
Removed some old types
storage/ndb/include/util/ndb_opts.h:
Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
Removed some old types
storage/ndb/src/mgmclient/main.cpp:
Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
Removed some old types
Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Added required casts
storage/ndb/tools/delete_all.cpp:
Removed some old types
storage/ndb/tools/desc.cpp:
Removed some old types
storage/ndb/tools/drop_index.cpp:
Removed some old types
storage/ndb/tools/drop_tab.cpp:
Removed some old types
storage/ndb/tools/listTables.cpp:
Removed some old types
storage/ndb/tools/ndb_config.cpp:
Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
Removed some old types
storage/ndb/tools/select_all.cpp:
Removed some old types
storage/ndb/tools/select_count.cpp:
Removed some old types
storage/ndb/tools/waiter.cpp:
Removed some old types
strings/bchange.c:
Changed function to use uchar * and size_t
strings/bcmp.c:
Changed function to use uchar * and size_t
strings/bmove512.c:
Changed function to use uchar * and size_t
strings/bmove_upp.c:
Changed function to use uchar * and size_t
strings/ctype-big5.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-bin.c:
Changed functions to use size_t
strings/ctype-cp932.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-czech.c:
Fixed indentation
Changed functions to use size_t
strings/ctype-euc_kr.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-eucjpms.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-gb2312.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-gbk.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-latin1.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-mb.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-simple.c:
Changed functions to use size_t
Simpler loops for caseup/casedown
unsigned int -> uint
unsigned char -> uchar
strings/ctype-sjis.c:
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-tis620.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-uca.c:
Changed functions to use size_t
unsigned char -> uchar
strings/ctype-ucs2.c:
Moved inclusion of stdarg.h to other includes
usigned char -> uchar
Changed functions to use size_t
Changed character length functions to return uint
strings/ctype-ujis.c:
Changed functions to use size_t
Changed character length functions to return uint
unsigned char -> uchar
strings/ctype-utf8.c:
Changed functions to use size_t
unsigned char -> uchar
Indentation fixes
strings/ctype-win1250ch.c:
Indentation fixes
Changed functions to use size_t
strings/ctype.c:
Changed functions to use size_t
strings/decimal.c:
Changed type for memory argument to uchar *
strings/do_ctype.c:
Indentation fixes
strings/my_strtoll10.c:
unsigned char -> uchar
strings/my_vsnprintf.c:
Changed functions to use size_t
strings/r_strinstr.c:
Removed some old types
Changed functions to use size_t
strings/str_test.c:
Removed some old types
strings/strappend.c:
Changed functions to use size_t
strings/strcont.c:
Removed some old types
strings/strfill.c:
Removed some old types
strings/strinstr.c:
Changed functions to use size_t
strings/strlen.c:
Changed functions to use size_t
strings/strmake.c:
Changed functions to use size_t
strings/strnlen.c:
Changed functions to use size_t
strings/strnmov.c:
Changed functions to use size_t
strings/strto.c:
unsigned char -> uchar
strings/strtod.c:
Changed functions to use size_t
strings/strxnmov.c:
Changed functions to use size_t
strings/xml.c:
Changed functions to use size_t
Indentation fixes
tests/mysql_client_test.c:
Removed some old types
tests/thread_test.c:
Removed some old types
vio/test-ssl.c:
Removed some old types
vio/test-sslclient.c:
Removed some old types
vio/test-sslserver.c:
Removed some old types
vio/vio.c:
Removed some old types
vio/vio_priv.h:
Removed some old types
Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viossl.c:
Changed vio_read()/vio_write() to work with size_t
Indentation fixes
vio/viosslfactories.c:
Removed some old types
vio/viotest-ssl.c:
Removed some old types
win/README:
More explanations
2007-05-10 11:59:39 +02:00
|
|
|
bzero((uchar*) packet->ptr(), 1+bit_fields);
|
2002-12-11 08:17:51 +01:00
|
|
|
field_pos=0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-07-14 09:06:27 +02:00
|
|
|
bool Protocol_binary::store_str(const char *from, size_t length,
|
2020-07-24 04:46:40 +02:00
|
|
|
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
|
2003-04-07 10:52:48 +02:00
|
|
|
{
|
|
|
|
field_pos++;
|
2020-07-24 04:46:40 +02:00
|
|
|
return store_string_aux(from, length, fromcs, tocs);
|
2003-04-07 10:52:48 +02:00
|
|
|
}
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_binary::store_null()
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2003-01-03 12:52:53 +01:00
|
|
|
uint offset= (field_pos+2)/8+1, bit= (1 << ((field_pos+2) & 7));
|
2002-12-11 08:17:51 +01:00
|
|
|
/* Room for this as it's allocated in prepare_for_send */
|
|
|
|
char *to= (char*) packet->ptr()+offset;
|
|
|
|
*to= (char) ((uchar) *to | (uchar) bit);
|
|
|
|
field_pos++;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_binary::store_tiny(longlong from)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
char buff[1];
|
|
|
|
field_pos++;
|
|
|
|
buff[0]= (uchar) from;
|
2004-06-09 01:21:50 +02:00
|
|
|
return packet->append(buff, sizeof(buff), PACKET_BUFFER_EXTRA_ALLOC);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_binary::store_short(longlong from)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
field_pos++;
|
2004-06-09 01:21:50 +02:00
|
|
|
char *to= packet->prep_append(2, PACKET_BUFFER_EXTRA_ALLOC);
|
2002-12-11 08:17:51 +01:00
|
|
|
if (!to)
|
|
|
|
return 1;
|
|
|
|
int2store(to, (int) from);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_binary::store_long(longlong from)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
field_pos++;
|
2004-06-09 01:21:50 +02:00
|
|
|
char *to= packet->prep_append(4, PACKET_BUFFER_EXTRA_ALLOC);
|
2002-12-11 08:17:51 +01:00
|
|
|
if (!to)
|
|
|
|
return 1;
|
|
|
|
int4store(to, from);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_binary::store_longlong(longlong from, bool unsigned_flag)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
field_pos++;
|
2004-06-09 01:21:50 +02:00
|
|
|
char *to= packet->prep_append(8, PACKET_BUFFER_EXTRA_ALLOC);
|
2002-12-11 08:17:51 +01:00
|
|
|
if (!to)
|
|
|
|
return 1;
|
|
|
|
int8store(to, from);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_binary::store_decimal(const my_decimal *d)
|
2005-02-08 23:50:45 +01:00
|
|
|
{
|
2005-11-22 23:50:37 +01:00
|
|
|
#ifndef DBUG_OFF
|
2019-04-01 18:29:45 +02:00
|
|
|
DBUG_ASSERT(0); // This method is not used yet
|
2005-02-08 23:50:45 +01:00
|
|
|
#endif
|
2018-08-07 08:48:42 +02:00
|
|
|
StringBuffer<DECIMAL_MAX_STR_LENGTH> str;
|
|
|
|
(void) d->to_string(&str);
|
2020-07-14 09:06:27 +02:00
|
|
|
return store_str(str.ptr(), str.length(), str.charset(),
|
|
|
|
thd->variables.character_set_results);
|
2005-02-08 23:50:45 +01:00
|
|
|
}
|
2002-12-11 08:17:51 +01:00
|
|
|
|
2020-07-23 12:48:04 +02:00
|
|
|
bool Protocol_binary::store_float(float from, uint32 decimals)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
field_pos++;
|
2004-06-09 01:21:50 +02:00
|
|
|
char *to= packet->prep_append(4, PACKET_BUFFER_EXTRA_ALLOC);
|
2002-12-11 08:17:51 +01:00
|
|
|
if (!to)
|
|
|
|
return 1;
|
|
|
|
float4store(to, from);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-07-23 12:48:04 +02:00
|
|
|
bool Protocol_binary::store_double(double from, uint32 decimals)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
field_pos++;
|
2004-06-09 01:21:50 +02:00
|
|
|
char *to= packet->prep_append(8, PACKET_BUFFER_EXTRA_ALLOC);
|
2002-12-11 08:17:51 +01:00
|
|
|
if (!to)
|
|
|
|
return 1;
|
|
|
|
float8store(to, from);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-01-30 22:48:05 +01:00
|
|
|
bool Protocol_binary::store(Field *field)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
/*
|
2003-02-04 02:19:19 +01:00
|
|
|
We should not increment field_pos here as send_binary() will call another
|
2002-12-11 08:17:51 +01:00
|
|
|
protocol function to do this for us
|
|
|
|
*/
|
|
|
|
if (field->is_null())
|
|
|
|
return store_null();
|
|
|
|
return field->send_binary(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
wl#173 - temporal types with sub-second resolution
and collateral changes.
* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double
client/mysqlbinlog.cc:
remove unneded casts
include/my_sys.h:
introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
pack_time/unpack_time, etc.
convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
str_to_time() is gone. str_to_datetime() does it now.
my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
time is not equal to datetime anymore
mysql-test/r/distinct.result:
a test for an old MySQL bug
mysql-test/r/explain.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
invalid datetime is not compared with as a string
mysql-test/r/select.result:
NO_ZERO_IN_DATE, etc only affect storage - according to the manual
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
test for an old MySQL bug
mysql-test/t/func_time.test:
+- INTERVAL now works with TIME values
mysql-test/t/select.test:
typo
mysql-test/t/subselect.test:
only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
old timestamp(X) is no longer supported
mysys/my_getsystime.c:
functions to get the time with microsecond precision
mysys/my_init.c:
move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
no need to make these variables extern
mysys/my_static.h:
no need to make these variables extern
scripts/mysql_system_tables.sql:
old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
old timestamp(X) is no longer supported
sql-common/my_time.c:
* call str_to_time from str_to_datetime, as appropriate
* date/time to string conversions take precision as an argument
* number_to_time()
* TIME_to_double()
* pack_time() and unpack_time()
sql/event_data_objects.cc:
cast is not needed
my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
avoid dangerous downcast (because the pointer is
not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
avoid silly double-work for cond_wait
(having an endpoint of wait, subtract the current time to get the timeout,
and use set_timespec() macro to fill in struct timespec, by adding the current
time to the timeout)
sql/field.cc:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
TIME_RESULT, cmp_time()
sql/item.cc:
* numbers aren't quoted in EXPLAIN EXTENDED
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_param::field_type() is set correctly
* Item_datetime, for a datetime constant
* time to anything is compared as a time
* Item_cache::print() prints the value is available
* bug fixed in Item_cache_int::val_str()
sql/item.h:
* Item::print_value(), to be used from Item_xxx::print() when needed
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_datetime, for a datetime constant
* better default for cast_to_int_type()
* Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
* get_year_value, get_time_value are gone. get_datetime_value does it all
* get_value_a_func, get_value_b_func are gone
* can_compare_as_dates() is gone too, TIME_RESULT is used instead
* cmp_type() instead or result_type() when doing a comparison
* compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
greatly simplified Arg_comparator
sql/item_create.cc:
* fix a bug in error messages in CAST
sql/item_func.cc:
Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
overwrite the default cmp_type() for Item_row,
as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
rewrite make_datetime to support precision argument
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
replication of NOW(6)
sql/log_event.h:
replication of NOW(6)
sql/mysql_priv.h:
Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
make_truncated_value_warning() that uses it.
sql/mysqld.cc:
datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
small cleanup
sql/set_var.cc:
SET TIMESTAMP=double
sql/set_var.h:
@@TIMESTAMP is a double
sql/share/errmsg.txt:
precision and scale are unsigned
sql/slave.cc:
replication of NOW(6)
sql/sp_head.cc:
cleanup
sql/sql_class.cc:
support for NOW(6)
sql/sql_class.h:
support for NOW(6)
sql/sql_insert.cc:
support for NOW(6)
sql/sql_select.cc:
use item->cmp_type().
move a comment where it belongs
sql/sql_show.cc:
new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
warnings
tests/mysql_client_test.c:
old timestamp(X) does not work anymore
datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
|
|
|
bool Protocol_binary::store(MYSQL_TIME *tm, int decimals)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
char buff[12],*pos;
|
|
|
|
uint length;
|
|
|
|
field_pos++;
|
|
|
|
pos= buff+1;
|
2003-03-15 11:56:03 +01:00
|
|
|
|
2002-12-11 08:17:51 +01:00
|
|
|
int2store(pos, tm->year);
|
2003-01-04 08:37:16 +01:00
|
|
|
pos[2]= (uchar) tm->month;
|
|
|
|
pos[3]= (uchar) tm->day;
|
|
|
|
pos[4]= (uchar) tm->hour;
|
|
|
|
pos[5]= (uchar) tm->minute;
|
|
|
|
pos[6]= (uchar) tm->second;
|
wl#173 - temporal types with sub-second resolution
and collateral changes.
* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double
client/mysqlbinlog.cc:
remove unneded casts
include/my_sys.h:
introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
pack_time/unpack_time, etc.
convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
str_to_time() is gone. str_to_datetime() does it now.
my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
time is not equal to datetime anymore
mysql-test/r/distinct.result:
a test for an old MySQL bug
mysql-test/r/explain.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
invalid datetime is not compared with as a string
mysql-test/r/select.result:
NO_ZERO_IN_DATE, etc only affect storage - according to the manual
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
test for an old MySQL bug
mysql-test/t/func_time.test:
+- INTERVAL now works with TIME values
mysql-test/t/select.test:
typo
mysql-test/t/subselect.test:
only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
old timestamp(X) is no longer supported
mysys/my_getsystime.c:
functions to get the time with microsecond precision
mysys/my_init.c:
move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
no need to make these variables extern
mysys/my_static.h:
no need to make these variables extern
scripts/mysql_system_tables.sql:
old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
old timestamp(X) is no longer supported
sql-common/my_time.c:
* call str_to_time from str_to_datetime, as appropriate
* date/time to string conversions take precision as an argument
* number_to_time()
* TIME_to_double()
* pack_time() and unpack_time()
sql/event_data_objects.cc:
cast is not needed
my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
avoid dangerous downcast (because the pointer is
not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
avoid silly double-work for cond_wait
(having an endpoint of wait, subtract the current time to get the timeout,
and use set_timespec() macro to fill in struct timespec, by adding the current
time to the timeout)
sql/field.cc:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
TIME_RESULT, cmp_time()
sql/item.cc:
* numbers aren't quoted in EXPLAIN EXTENDED
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_param::field_type() is set correctly
* Item_datetime, for a datetime constant
* time to anything is compared as a time
* Item_cache::print() prints the value is available
* bug fixed in Item_cache_int::val_str()
sql/item.h:
* Item::print_value(), to be used from Item_xxx::print() when needed
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_datetime, for a datetime constant
* better default for cast_to_int_type()
* Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
* get_year_value, get_time_value are gone. get_datetime_value does it all
* get_value_a_func, get_value_b_func are gone
* can_compare_as_dates() is gone too, TIME_RESULT is used instead
* cmp_type() instead or result_type() when doing a comparison
* compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
greatly simplified Arg_comparator
sql/item_create.cc:
* fix a bug in error messages in CAST
sql/item_func.cc:
Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
overwrite the default cmp_type() for Item_row,
as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
rewrite make_datetime to support precision argument
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
replication of NOW(6)
sql/log_event.h:
replication of NOW(6)
sql/mysql_priv.h:
Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
make_truncated_value_warning() that uses it.
sql/mysqld.cc:
datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
small cleanup
sql/set_var.cc:
SET TIMESTAMP=double
sql/set_var.h:
@@TIMESTAMP is a double
sql/share/errmsg.txt:
precision and scale are unsigned
sql/slave.cc:
replication of NOW(6)
sql/sp_head.cc:
cleanup
sql/sql_class.cc:
support for NOW(6)
sql/sql_class.h:
support for NOW(6)
sql/sql_insert.cc:
support for NOW(6)
sql/sql_select.cc:
use item->cmp_type().
move a comment where it belongs
sql/sql_show.cc:
new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
warnings
tests/mysql_client_test.c:
old timestamp(X) does not work anymore
datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
|
|
|
DBUG_ASSERT(decimals == AUTO_SEC_PART_DIGITS ||
|
2011-05-19 19:01:46 +02:00
|
|
|
(decimals >= 0 && decimals <= TIME_SECOND_PART_DIGITS));
|
wl#173 - temporal types with sub-second resolution
and collateral changes.
* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double
client/mysqlbinlog.cc:
remove unneded casts
include/my_sys.h:
introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
pack_time/unpack_time, etc.
convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
str_to_time() is gone. str_to_datetime() does it now.
my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
time is not equal to datetime anymore
mysql-test/r/distinct.result:
a test for an old MySQL bug
mysql-test/r/explain.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
invalid datetime is not compared with as a string
mysql-test/r/select.result:
NO_ZERO_IN_DATE, etc only affect storage - according to the manual
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
test for an old MySQL bug
mysql-test/t/func_time.test:
+- INTERVAL now works with TIME values
mysql-test/t/select.test:
typo
mysql-test/t/subselect.test:
only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
old timestamp(X) is no longer supported
mysys/my_getsystime.c:
functions to get the time with microsecond precision
mysys/my_init.c:
move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
no need to make these variables extern
mysys/my_static.h:
no need to make these variables extern
scripts/mysql_system_tables.sql:
old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
old timestamp(X) is no longer supported
sql-common/my_time.c:
* call str_to_time from str_to_datetime, as appropriate
* date/time to string conversions take precision as an argument
* number_to_time()
* TIME_to_double()
* pack_time() and unpack_time()
sql/event_data_objects.cc:
cast is not needed
my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
avoid dangerous downcast (because the pointer is
not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
avoid silly double-work for cond_wait
(having an endpoint of wait, subtract the current time to get the timeout,
and use set_timespec() macro to fill in struct timespec, by adding the current
time to the timeout)
sql/field.cc:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
TIME_RESULT, cmp_time()
sql/item.cc:
* numbers aren't quoted in EXPLAIN EXTENDED
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_param::field_type() is set correctly
* Item_datetime, for a datetime constant
* time to anything is compared as a time
* Item_cache::print() prints the value is available
* bug fixed in Item_cache_int::val_str()
sql/item.h:
* Item::print_value(), to be used from Item_xxx::print() when needed
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_datetime, for a datetime constant
* better default for cast_to_int_type()
* Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
* get_year_value, get_time_value are gone. get_datetime_value does it all
* get_value_a_func, get_value_b_func are gone
* can_compare_as_dates() is gone too, TIME_RESULT is used instead
* cmp_type() instead or result_type() when doing a comparison
* compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
greatly simplified Arg_comparator
sql/item_create.cc:
* fix a bug in error messages in CAST
sql/item_func.cc:
Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
overwrite the default cmp_type() for Item_row,
as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
rewrite make_datetime to support precision argument
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
replication of NOW(6)
sql/log_event.h:
replication of NOW(6)
sql/mysql_priv.h:
Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
make_truncated_value_warning() that uses it.
sql/mysqld.cc:
datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
small cleanup
sql/set_var.cc:
SET TIMESTAMP=double
sql/set_var.h:
@@TIMESTAMP is a double
sql/share/errmsg.txt:
precision and scale are unsigned
sql/slave.cc:
replication of NOW(6)
sql/sp_head.cc:
cleanup
sql/sql_class.cc:
support for NOW(6)
sql/sql_class.h:
support for NOW(6)
sql/sql_insert.cc:
support for NOW(6)
sql/sql_select.cc:
use item->cmp_type().
move a comment where it belongs
sql/sql_show.cc:
new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
warnings
tests/mysql_client_test.c:
old timestamp(X) does not work anymore
datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
|
|
|
if (decimals != AUTO_SEC_PART_DIGITS)
|
2020-07-28 15:32:19 +02:00
|
|
|
my_datetime_trunc(tm, decimals);
|
2002-12-11 08:17:51 +01:00
|
|
|
int4store(pos+7, tm->second_part);
|
|
|
|
if (tm->second_part)
|
|
|
|
length=11;
|
|
|
|
else if (tm->hour || tm->minute || tm->second)
|
|
|
|
length=7;
|
|
|
|
else if (tm->year || tm->month || tm->day)
|
|
|
|
length=4;
|
|
|
|
else
|
|
|
|
length=0;
|
|
|
|
buff[0]=(char) length; // Length is stored first
|
2004-06-09 01:21:50 +02:00
|
|
|
return packet->append(buff, length+1, PACKET_BUFFER_EXTRA_ALLOC);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
2007-03-23 21:08:31 +01:00
|
|
|
bool Protocol_binary::store_date(MYSQL_TIME *tm)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
|
|
|
tm->hour= tm->minute= tm->second=0;
|
|
|
|
tm->second_part= 0;
|
wl#173 - temporal types with sub-second resolution
and collateral changes.
* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double
client/mysqlbinlog.cc:
remove unneded casts
include/my_sys.h:
introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
pack_time/unpack_time, etc.
convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
str_to_time() is gone. str_to_datetime() does it now.
my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
time is not equal to datetime anymore
mysql-test/r/distinct.result:
a test for an old MySQL bug
mysql-test/r/explain.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
invalid datetime is not compared with as a string
mysql-test/r/select.result:
NO_ZERO_IN_DATE, etc only affect storage - according to the manual
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
test for an old MySQL bug
mysql-test/t/func_time.test:
+- INTERVAL now works with TIME values
mysql-test/t/select.test:
typo
mysql-test/t/subselect.test:
only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
old timestamp(X) is no longer supported
mysys/my_getsystime.c:
functions to get the time with microsecond precision
mysys/my_init.c:
move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
no need to make these variables extern
mysys/my_static.h:
no need to make these variables extern
scripts/mysql_system_tables.sql:
old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
old timestamp(X) is no longer supported
sql-common/my_time.c:
* call str_to_time from str_to_datetime, as appropriate
* date/time to string conversions take precision as an argument
* number_to_time()
* TIME_to_double()
* pack_time() and unpack_time()
sql/event_data_objects.cc:
cast is not needed
my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
avoid dangerous downcast (because the pointer is
not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
avoid silly double-work for cond_wait
(having an endpoint of wait, subtract the current time to get the timeout,
and use set_timespec() macro to fill in struct timespec, by adding the current
time to the timeout)
sql/field.cc:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
TIME_RESULT, cmp_time()
sql/item.cc:
* numbers aren't quoted in EXPLAIN EXTENDED
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_param::field_type() is set correctly
* Item_datetime, for a datetime constant
* time to anything is compared as a time
* Item_cache::print() prints the value is available
* bug fixed in Item_cache_int::val_str()
sql/item.h:
* Item::print_value(), to be used from Item_xxx::print() when needed
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_datetime, for a datetime constant
* better default for cast_to_int_type()
* Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
* get_year_value, get_time_value are gone. get_datetime_value does it all
* get_value_a_func, get_value_b_func are gone
* can_compare_as_dates() is gone too, TIME_RESULT is used instead
* cmp_type() instead or result_type() when doing a comparison
* compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
greatly simplified Arg_comparator
sql/item_create.cc:
* fix a bug in error messages in CAST
sql/item_func.cc:
Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
overwrite the default cmp_type() for Item_row,
as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
rewrite make_datetime to support precision argument
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
replication of NOW(6)
sql/log_event.h:
replication of NOW(6)
sql/mysql_priv.h:
Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
make_truncated_value_warning() that uses it.
sql/mysqld.cc:
datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
small cleanup
sql/set_var.cc:
SET TIMESTAMP=double
sql/set_var.h:
@@TIMESTAMP is a double
sql/share/errmsg.txt:
precision and scale are unsigned
sql/slave.cc:
replication of NOW(6)
sql/sp_head.cc:
cleanup
sql/sql_class.cc:
support for NOW(6)
sql/sql_class.h:
support for NOW(6)
sql/sql_insert.cc:
support for NOW(6)
sql/sql_select.cc:
use item->cmp_type().
move a comment where it belongs
sql/sql_show.cc:
new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
warnings
tests/mysql_client_test.c:
old timestamp(X) does not work anymore
datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
|
|
|
return Protocol_binary::store(tm, 0);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
wl#173 - temporal types with sub-second resolution
and collateral changes.
* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double
client/mysqlbinlog.cc:
remove unneded casts
include/my_sys.h:
introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
pack_time/unpack_time, etc.
convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
str_to_time() is gone. str_to_datetime() does it now.
my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
time is not equal to datetime anymore
mysql-test/r/distinct.result:
a test for an old MySQL bug
mysql-test/r/explain.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
invalid datetime is not compared with as a string
mysql-test/r/select.result:
NO_ZERO_IN_DATE, etc only affect storage - according to the manual
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
test for an old MySQL bug
mysql-test/t/func_time.test:
+- INTERVAL now works with TIME values
mysql-test/t/select.test:
typo
mysql-test/t/subselect.test:
only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
old timestamp(X) is no longer supported
mysys/my_getsystime.c:
functions to get the time with microsecond precision
mysys/my_init.c:
move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
no need to make these variables extern
mysys/my_static.h:
no need to make these variables extern
scripts/mysql_system_tables.sql:
old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
old timestamp(X) is no longer supported
sql-common/my_time.c:
* call str_to_time from str_to_datetime, as appropriate
* date/time to string conversions take precision as an argument
* number_to_time()
* TIME_to_double()
* pack_time() and unpack_time()
sql/event_data_objects.cc:
cast is not needed
my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
avoid dangerous downcast (because the pointer is
not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
avoid silly double-work for cond_wait
(having an endpoint of wait, subtract the current time to get the timeout,
and use set_timespec() macro to fill in struct timespec, by adding the current
time to the timeout)
sql/field.cc:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
TIME_RESULT, cmp_time()
sql/item.cc:
* numbers aren't quoted in EXPLAIN EXTENDED
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_param::field_type() is set correctly
* Item_datetime, for a datetime constant
* time to anything is compared as a time
* Item_cache::print() prints the value is available
* bug fixed in Item_cache_int::val_str()
sql/item.h:
* Item::print_value(), to be used from Item_xxx::print() when needed
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_datetime, for a datetime constant
* better default for cast_to_int_type()
* Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
* get_year_value, get_time_value are gone. get_datetime_value does it all
* get_value_a_func, get_value_b_func are gone
* can_compare_as_dates() is gone too, TIME_RESULT is used instead
* cmp_type() instead or result_type() when doing a comparison
* compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
greatly simplified Arg_comparator
sql/item_create.cc:
* fix a bug in error messages in CAST
sql/item_func.cc:
Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
overwrite the default cmp_type() for Item_row,
as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
rewrite make_datetime to support precision argument
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
replication of NOW(6)
sql/log_event.h:
replication of NOW(6)
sql/mysql_priv.h:
Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
make_truncated_value_warning() that uses it.
sql/mysqld.cc:
datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
small cleanup
sql/set_var.cc:
SET TIMESTAMP=double
sql/set_var.h:
@@TIMESTAMP is a double
sql/share/errmsg.txt:
precision and scale are unsigned
sql/slave.cc:
replication of NOW(6)
sql/sp_head.cc:
cleanup
sql/sql_class.cc:
support for NOW(6)
sql/sql_class.h:
support for NOW(6)
sql/sql_insert.cc:
support for NOW(6)
sql/sql_select.cc:
use item->cmp_type().
move a comment where it belongs
sql/sql_show.cc:
new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
warnings
tests/mysql_client_test.c:
old timestamp(X) does not work anymore
datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
|
|
|
bool Protocol_binary::store_time(MYSQL_TIME *tm, int decimals)
|
2002-12-11 08:17:51 +01:00
|
|
|
{
|
2004-06-09 01:21:50 +02:00
|
|
|
char buff[13], *pos;
|
2002-12-11 08:17:51 +01:00
|
|
|
uint length;
|
|
|
|
field_pos++;
|
|
|
|
pos= buff+1;
|
|
|
|
pos[0]= tm->neg ? 1 : 0;
|
2004-10-26 18:30:01 +02:00
|
|
|
if (tm->hour >= 24)
|
|
|
|
{
|
|
|
|
uint days= tm->hour/24;
|
|
|
|
tm->hour-= days*24;
|
|
|
|
tm->day+= days;
|
|
|
|
}
|
2003-03-15 11:56:03 +01:00
|
|
|
int4store(pos+1, tm->day);
|
2003-01-04 08:37:16 +01:00
|
|
|
pos[5]= (uchar) tm->hour;
|
|
|
|
pos[6]= (uchar) tm->minute;
|
|
|
|
pos[7]= (uchar) tm->second;
|
wl#173 - temporal types with sub-second resolution
and collateral changes.
* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double
client/mysqlbinlog.cc:
remove unneded casts
include/my_sys.h:
introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
pack_time/unpack_time, etc.
convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
str_to_time() is gone. str_to_datetime() does it now.
my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
time is not equal to datetime anymore
mysql-test/r/distinct.result:
a test for an old MySQL bug
mysql-test/r/explain.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
invalid datetime is not compared with as a string
mysql-test/r/select.result:
NO_ZERO_IN_DATE, etc only affect storage - according to the manual
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
test for an old MySQL bug
mysql-test/t/func_time.test:
+- INTERVAL now works with TIME values
mysql-test/t/select.test:
typo
mysql-test/t/subselect.test:
only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
old timestamp(X) is no longer supported
mysys/my_getsystime.c:
functions to get the time with microsecond precision
mysys/my_init.c:
move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
no need to make these variables extern
mysys/my_static.h:
no need to make these variables extern
scripts/mysql_system_tables.sql:
old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
old timestamp(X) is no longer supported
sql-common/my_time.c:
* call str_to_time from str_to_datetime, as appropriate
* date/time to string conversions take precision as an argument
* number_to_time()
* TIME_to_double()
* pack_time() and unpack_time()
sql/event_data_objects.cc:
cast is not needed
my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
avoid dangerous downcast (because the pointer is
not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
avoid silly double-work for cond_wait
(having an endpoint of wait, subtract the current time to get the timeout,
and use set_timespec() macro to fill in struct timespec, by adding the current
time to the timeout)
sql/field.cc:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
TIME_RESULT, cmp_time()
sql/item.cc:
* numbers aren't quoted in EXPLAIN EXTENDED
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_param::field_type() is set correctly
* Item_datetime, for a datetime constant
* time to anything is compared as a time
* Item_cache::print() prints the value is available
* bug fixed in Item_cache_int::val_str()
sql/item.h:
* Item::print_value(), to be used from Item_xxx::print() when needed
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_datetime, for a datetime constant
* better default for cast_to_int_type()
* Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
* get_year_value, get_time_value are gone. get_datetime_value does it all
* get_value_a_func, get_value_b_func are gone
* can_compare_as_dates() is gone too, TIME_RESULT is used instead
* cmp_type() instead or result_type() when doing a comparison
* compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
greatly simplified Arg_comparator
sql/item_create.cc:
* fix a bug in error messages in CAST
sql/item_func.cc:
Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
overwrite the default cmp_type() for Item_row,
as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
rewrite make_datetime to support precision argument
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
replication of NOW(6)
sql/log_event.h:
replication of NOW(6)
sql/mysql_priv.h:
Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
make_truncated_value_warning() that uses it.
sql/mysqld.cc:
datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
small cleanup
sql/set_var.cc:
SET TIMESTAMP=double
sql/set_var.h:
@@TIMESTAMP is a double
sql/share/errmsg.txt:
precision and scale are unsigned
sql/slave.cc:
replication of NOW(6)
sql/sp_head.cc:
cleanup
sql/sql_class.cc:
support for NOW(6)
sql/sql_class.h:
support for NOW(6)
sql/sql_insert.cc:
support for NOW(6)
sql/sql_select.cc:
use item->cmp_type().
move a comment where it belongs
sql/sql_show.cc:
new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
warnings
tests/mysql_client_test.c:
old timestamp(X) does not work anymore
datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
|
|
|
DBUG_ASSERT(decimals == AUTO_SEC_PART_DIGITS ||
|
2011-05-19 19:01:46 +02:00
|
|
|
(decimals >= 0 && decimals <= TIME_SECOND_PART_DIGITS));
|
wl#173 - temporal types with sub-second resolution
and collateral changes.
* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double
client/mysqlbinlog.cc:
remove unneded casts
include/my_sys.h:
introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
pack_time/unpack_time, etc.
convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
str_to_time() is gone. str_to_datetime() does it now.
my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
time is not equal to datetime anymore
mysql-test/r/distinct.result:
a test for an old MySQL bug
mysql-test/r/explain.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
invalid datetime is not compared with as a string
mysql-test/r/select.result:
NO_ZERO_IN_DATE, etc only affect storage - according to the manual
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
test for an old MySQL bug
mysql-test/t/func_time.test:
+- INTERVAL now works with TIME values
mysql-test/t/select.test:
typo
mysql-test/t/subselect.test:
only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
old timestamp(X) is no longer supported
mysys/my_getsystime.c:
functions to get the time with microsecond precision
mysys/my_init.c:
move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
no need to make these variables extern
mysys/my_static.h:
no need to make these variables extern
scripts/mysql_system_tables.sql:
old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
old timestamp(X) is no longer supported
sql-common/my_time.c:
* call str_to_time from str_to_datetime, as appropriate
* date/time to string conversions take precision as an argument
* number_to_time()
* TIME_to_double()
* pack_time() and unpack_time()
sql/event_data_objects.cc:
cast is not needed
my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
avoid dangerous downcast (because the pointer is
not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
avoid silly double-work for cond_wait
(having an endpoint of wait, subtract the current time to get the timeout,
and use set_timespec() macro to fill in struct timespec, by adding the current
time to the timeout)
sql/field.cc:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
* remove virtual Field::get_time(), everyone should use only Field::get_date()
* remove lots of #ifdef WORDS_BIGENDIAN
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
TIME_RESULT, cmp_time()
sql/item.cc:
* numbers aren't quoted in EXPLAIN EXTENDED
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_param::field_type() is set correctly
* Item_datetime, for a datetime constant
* time to anything is compared as a time
* Item_cache::print() prints the value is available
* bug fixed in Item_cache_int::val_str()
sql/item.h:
* Item::print_value(), to be used from Item_xxx::print() when needed
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* virtual Item::get_time() is gone
* Item_datetime, for a datetime constant
* better default for cast_to_int_type()
* Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
* get_year_value, get_time_value are gone. get_datetime_value does it all
* get_value_a_func, get_value_b_func are gone
* can_compare_as_dates() is gone too, TIME_RESULT is used instead
* cmp_type() instead or result_type() when doing a comparison
* compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
* Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
greatly simplified Arg_comparator
sql/item_create.cc:
* fix a bug in error messages in CAST
sql/item_func.cc:
Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
overwrite the default cmp_type() for Item_row,
as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
rewrite make_datetime to support precision argument
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
SEC_TO_TIME is real function, not integer.
many functions that returned temporal values had duplicate code in val_* methods,
some of them did not have get_date() which resulted in unnecessary date->str->date conversions.
Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
replication of NOW(6)
sql/log_event.h:
replication of NOW(6)
sql/mysql_priv.h:
Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
make_truncated_value_warning() that uses it.
sql/mysqld.cc:
datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
small cleanup
sql/set_var.cc:
SET TIMESTAMP=double
sql/set_var.h:
@@TIMESTAMP is a double
sql/share/errmsg.txt:
precision and scale are unsigned
sql/slave.cc:
replication of NOW(6)
sql/sp_head.cc:
cleanup
sql/sql_class.cc:
support for NOW(6)
sql/sql_class.h:
support for NOW(6)
sql/sql_insert.cc:
support for NOW(6)
sql/sql_select.cc:
use item->cmp_type().
move a comment where it belongs
sql/sql_show.cc:
new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
warnings
tests/mysql_client_test.c:
old timestamp(X) does not work anymore
datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
|
|
|
if (decimals != AUTO_SEC_PART_DIGITS)
|
2013-07-10 09:49:17 +02:00
|
|
|
my_time_trunc(tm, decimals);
|
2003-01-04 08:37:16 +01:00
|
|
|
int4store(pos+8, tm->second_part);
|
2002-12-11 08:17:51 +01:00
|
|
|
if (tm->second_part)
|
2004-06-09 01:21:50 +02:00
|
|
|
length=12;
|
2002-12-11 08:17:51 +01:00
|
|
|
else if (tm->hour || tm->minute || tm->second || tm->day)
|
2003-01-04 08:37:16 +01:00
|
|
|
length=8;
|
2002-12-11 08:17:51 +01:00
|
|
|
else
|
|
|
|
length=0;
|
|
|
|
buff[0]=(char) length; // Length is stored first
|
2004-06-09 01:21:50 +02:00
|
|
|
return packet->append(buff, length+1, PACKET_BUFFER_EXTRA_ALLOC);
|
2002-12-11 08:17:51 +01:00
|
|
|
}
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Send a result set with OUT-parameter values by means of PS-protocol.
|
|
|
|
|
|
|
|
@param sp_params List of PS/SP parameters (both input and output).
|
|
|
|
|
|
|
|
@return Error status.
|
|
|
|
@retval FALSE Success.
|
|
|
|
@retval TRUE Error.
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool Protocol_binary::send_out_parameters(List<Item_param> *sp_params)
|
|
|
|
{
|
2016-04-15 20:40:25 +02:00
|
|
|
bool ret;
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
if (!(thd->client_capabilities & CLIENT_PS_MULTI_RESULTS))
|
|
|
|
{
|
|
|
|
/* The client does not support OUT-parameters. */
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Item> out_param_lst;
|
|
|
|
|
|
|
|
{
|
|
|
|
List_iterator_fast<Item_param> item_param_it(*sp_params);
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
Item_param *item_param= item_param_it++;
|
|
|
|
|
|
|
|
if (!item_param)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (!item_param->get_out_param_info())
|
|
|
|
continue; // It's an IN-parameter.
|
|
|
|
|
2015-08-24 13:42:07 +02:00
|
|
|
if (out_param_lst.push_back(item_param, thd->mem_root))
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!out_param_lst.elements)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/*
|
|
|
|
We have to set SERVER_PS_OUT_PARAMS in THD::server_status, because it
|
|
|
|
is used in send_result_set_metadata().
|
|
|
|
*/
|
|
|
|
|
|
|
|
thd->server_status|= SERVER_PS_OUT_PARAMS | SERVER_MORE_RESULTS_EXISTS;
|
|
|
|
|
|
|
|
/* Send meta-data. */
|
|
|
|
if (send_result_set_metadata(&out_param_lst, SEND_NUM_ROWS | SEND_EOF))
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* Send data. */
|
|
|
|
|
|
|
|
prepare_for_resend();
|
|
|
|
|
|
|
|
if (send_result_set_row(&out_param_lst))
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
if (write())
|
|
|
|
return TRUE;
|
|
|
|
|
2016-04-15 20:40:25 +02:00
|
|
|
ret= net_send_eof(thd, thd->server_status, 0);
|
2013-06-12 22:12:09 +02:00
|
|
|
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
/*
|
2017-01-24 19:20:30 +01:00
|
|
|
Reset server_status:
|
|
|
|
- SERVER_MORE_RESULTS_EXISTS bit, because this is the last packet for sure.
|
|
|
|
- Restore SERVER_PS_OUT_PARAMS status.
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
*/
|
2017-01-24 19:20:30 +01:00
|
|
|
thd->server_status&= ~(SERVER_PS_OUT_PARAMS | SERVER_MORE_RESULTS_EXISTS);
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
|
2016-04-15 20:40:25 +02:00
|
|
|
return ret ? FALSE : TRUE;
|
Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1,
2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
some other minor revisions.
This patch implements:
WL#4264 "Backup: Stabilize Service Interface" -- all the
server prerequisites except si_objects.{h,cc} themselves (they can
be just copied over, when needed).
WL#4435: Support OUT-parameters in prepared statements.
(and all issues in the initial patches for these two
tasks, that were discovered in pushbuild and during testing).
Bug#39519: mysql_stmt_close() should flush all data
associated with the statement.
After execution of a prepared statement, send OUT parameters of the invoked
stored procedure, if any, to the client.
When using the binary protocol, send the parameters in an additional result
set over the wire. When using the text protocol, assign out parameters to
the user variables from the CALL(@var1, @var2, ...) specification.
The following refactoring has been made:
- Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
- A new Protocol::send_result_set_row() was introduced to incapsulate
common functionality for sending row data.
- Signature of Protocol::prepare_for_send() was changed: this operation
does not need a list of items, the number of items is fully sufficient.
The following backward incompatible changes have been made:
- CLIENT_MULTI_RESULTS is now enabled by default in the client;
- CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
include/mysql.h:
Add a new flag to MYSQL_METHODS::flush_use_result
function pointer. This flag determines if all results
should be flushed or only the first one:
- if flush_all_results is TRUE, then cli_flush_use_result()
will read/flush all pending results. I.e. it will read
all packets while server status attribute indicates that
there are more results. This is a new semantic, required
to fix the bug.
- if flush_all_results is FALSE, the old sematic
is preserved -- i.e. cli_flush_use_result() reads data
until first EOF-packet.
include/mysql.h.pp:
Update the ABI with new calls (compatible changes).
include/mysql_com.h:
Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
libmysql/libmysql.c:
Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
Fix a minor bug in alloc_fields() -- not all members were copied over,
and some only shallow-copied (catalog).
Flush all results in mysql_stmt_close() (Bug#39519).
libmysqld/lib_sql.cc:
Rename send_fields() -> send_result_set_metadata().
Refactoring: change prepare_for_send() so that it accepts only
what it really needs -- a number of elements in the list.
mysql-test/r/ps.result:
Update results: WL#4435.
mysql-test/t/ps.test:
WL#4435: A test case for an SQL-part of the problem.
sql-common/client.c:
Bug#39519.
Implement new functionality in cli_flush_use_result():
if flush_all_delete is TRUE, then it should read/flush
all pending results.
sql/Makefile.am:
Add a new header sql_prepare.h to the list
of build headers.
sql/events.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/mysql_priv.h:
Move sql_prepare.cc-specific declarations to a new
header - sql_prepare.h.
sql/procedure.h:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/protocol.cc:
Move the logic responsible for sending of one result
set row to the Protocol class. Define a template
for end-of-statement action.
Refactoring: change prepare_for_send() so that it accepts
only what it really needs -- a number of elements in the list.
Rename send_fields() to send_result_set_metadata().
sql/protocol.h:
Update with new declarations (WL#4435).
Rename send_fields() -> send_result_set_metadata().
prepare_for_send() only needs the number of columns to send,
and doesn't use the item list - update signature to require
only what's needed.
Add a new protocol type -- Protocol_local.
sql/repl_failsafe.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/slave.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_acl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_base.cc:
Include sql_prepare.h (for Reprepare_observer).
sql/sql_cache.cc:
Extend the query cache flags block to be able
to store a numeric id for the result format,
not just a flag binary/non-binary.
sql/sql_class.cc:
Update to use the rename of Protocol::send_fields()
to Protocol::send_result_set_metadata().
Use Protocol::send_one_result_set_row().
sql/sql_class.h:
Move the declaration of Reprepare_observer to the
new header - sql_prepare.h.
Update to the new signature of class Protocol::send_fields().
sql/sql_connect.cc:
Use a protocol template method instead of
raw NET layer API at the end of a statement.
sql/sql_cursor.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_error.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_handler.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
Use new method Protocol::send_one_result_set_row().
sql/sql_help.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_lex.cc:
Initialize multi_statements variable.
Add a handy constant for empty lex
string.
sql/sql_lex.h:
Add a separate member for a standalone
parsing option - multi-statements support.
sql/sql_list.cc:
sql_list.h is a standalone header now,
no need to include mysql_priv.h.
sql/sql_list.h:
Make sql_list.h a stand-alone header.
sql/sql_parse.cc:
Include sql_prepare.h for prepared
statements- related declarations.
Use a new Protocol template method to end
each statement (send OK, EOF or ERROR to
the client).
sql/sql_prepare.cc:
Implement Execute Direct API (WL#4264),
currently unused. It will be used by the service
interface (Backup).
Use a new header - sql_prepare.h.
Add support for OUT parameters in the
binary and text protocol (prepared statements
only).
sql/sql_prepare.h:
Add a new header to contain (for now)
all prepared statement- external
related declarations.
sql/sql_profile.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_repl.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_select.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_show.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_string.h:
Add a way to convert a String to LEX_STRING.
sql/sql_table.cc:
Rename: Protocol::send_fields() ->
Protocol::send_result_set_metadata().
sql/sql_update.cc:
Remove an extraneous my_error(). The error
is already reported in update_non_unique_table_error().
sql/sql_yacc.yy:
Support for multi-statements is an independent
property of parsing, not derived from
the protocol type.
tests/mysql_client_test.c:
Add tests for WL#4435 (binary protocol).
2009-10-21 22:02:06 +02:00
|
|
|
}
|