summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
Commit message (Collapse)AuthorAgeFilesLines
* Updated/added copyright headersKent Boortz2011-06-301-2/+3
|\
| * Updated/added copyright headersKent Boortz2011-06-301-2/+3
| |
| * auto-mergeIgnacio Galarza2009-03-191-6/+17
| |\
| | * fixed a typoGeorgi Kodinov2009-03-091-1/+1
| | |
| | * fixed a win32 compile warningGeorgi Kodinov2009-03-091-1/+2
| | |
| * | Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-101-3/+3
| | | | | | | | | | | | | | | - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
* | | Merge 5.1-bugteam -> 5.1-bug-42496Dmitry Shulga2010-07-231-15/+9
|\ \ \
| * | | Bug#45288: pb2 returns a lot of compilation warnings on linuxDavi Arnaut2010-07-091-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although the C standard mandates that sprintf return the number of bytes written, some very ancient systems (i.e. SunOS 4) returned a pointer to the buffer instead. Since these systems are not supported anymore and are hopefully long dead by now, simply remove the portability wrapper that dealt with this discrepancy. The autoconf check was causing trouble with GCC.
* | | | Fixed bug #42496 - the server could crash on a debug assert after a failureDmitry Shulga2010-07-211-4/+11
|/ / / | | | | | | to write into a closed socket
* | | Bug #52304 valgrind does not like to print un-inited string in ↵Andrei Elkin2010-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Protocol_text::store() The reason of the failure was apparent flaw in that a pointer to an uninitialized buffer was passed to DBUG_PRINT of Protocol_text::store(). Fixed with splitting the print-out into two branches: one with length zero of the problematic arg and the rest.
* | | Bug #49829 Many "hides virtual function" warnings withStaale Smedseng2010-03-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SunStudio SunStudio compilers of late warn about methods that might hide methods in base classes due to the use of overloading combined with overriding. SunStudio also warns about variables defined in local socpe or method arguments that have the same name as a member attribute of the class. This patch renames methods that might hide base class methods, to make it easier both for humans and compilers to see what is actually called. It also renames variables in local scope.
* | | Bug#44521 Executing a stored procedure as a prepared statement can sometimes ↵Kristofer Pettersson2009-07-291-40/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | merged 5.0-bugteam -> 5.1-bugteam.Georgi Kodinov2009-02-271-1/+2
|\ \ \ | | |/ | |/| | | | Fixed a warning in 5.1 caused by missing type cast.
* | | Auto-mergeRamil Kalimullin2009-02-261-6/+16
|\ \ \ | |/ /
| * | Fix for bug#19829:make test Failed in mysql_client_testRamil Kalimullin2009-02-261-6/+16
| |/ | | | | | | | | | | | | | | | | | | | | | | *with --with-charset=utf8* Problem: wrong LONG TEXT field length is sent to a client when multibyte server character set used. Fix: always limit field length sent to a client to 2^32, as we store it in 4 byte slot. Note: mysql_client_test changed accordingly.
| * Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opttnurnberg@white.intern.koehntopp.de2007-12-011-1/+4
| |\ | | | | | | | | | into mysql.com:/misc/mysql/32707/50-32707
* | | Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains thatMattias Jonsson2008-08-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | partition is corrupt The main problem was that ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION took another code path (over mysql_alter_table instead of mysql_admin_table) which differs in two ways: 1) alter table opens the tables in a different way than admin tables do resulting in returning with error before it tried the command 2) alter table does not start to send any diagnostic rows to the client which the lower admin functions continue to use -> resulting in assertion crash The fix: Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION to use the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE t. Adding check in mysql_admin_table to setup the partition list for which partitions that should be used. Partitioned tables will still not work with REPAIR TABLE/PARTITION USE_FRM, since that requires moving partitions to tables, REPAIR TABLE t USE_FRM, and check that the data still fulfills the partitioning function and then move the table back to being a partition. NOTE: I have removed the following functions from the handler interface: analyze_partitions, check_partitions, optimize_partitions, repair_partitions Since they are not longer needed. THIS ALTERS THE STORAGE ENGINE API
* | | Rename send_ok to my_ok. Similarly to my_error, it only records the status,kostja@dipika.(none)2008-02-191-5/+3
| | | | | | | | | | | | does not send it to the client.
* | | Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maintserg@janus.mylan2007-12-201-80/+164
|\ \ \ | | | | | | | | | | | | into janus.mylan:/usr/home/serg/Abk/mysql-5.1
| * \ \ Merge station.:/mnt/raid/alik/MySQL/devel/5.1anozdrin/alik@station.2007-12-141-3/+7
| |\ \ \ | | | | | | | | | | | | | | | into station.:/mnt/raid/alik/MySQL/devel/5.1-rt
| | * \ \ Merge mysql.com:/home/gluh/MySQL/Merge/5.1gluh@eagle.(none)2007-12-131-3/+7
| | |\ \ \ | | | | | | | | | | | | | | | | | | into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
| | | * \ \ Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opttnurnberg@white.intern.koehntopp.de2007-12-011-1/+4
| | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | into mysql.com:/misc/mysql/32707/51-32707
| | | | * \ \ Merge mysql.com:/misc/mysql/32707/50-32707tnurnberg@white.intern.koehntopp.de2007-11-301-1/+4
| | | | |\ \ \ | | | | | | |/ | | | | | |/| | | | | | | | into mysql.com:/misc/mysql/32707/51-32707
| | | | | * | Merge mysql.com:/misc/mysql/32707/41-32707tnurnberg@white.intern.koehntopp.de2007-11-301-1/+4
| | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/misc/mysql/32707/50-32707
| | | | | | * | Bug#32707: misdimensioned buffer in protocol layertnurnberg@mysql.com/white.intern.koehntopp.de2007-11-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Miscalculation in protocol-layer: size buffer correctly so even really long error messages cannot overflow our buffer.
| | | * | | | | Merge mysql.com:/home/hf/work/mrg/my50-mrgholyfoot/hf@hfmain.(none)2007-12-011-2/+3
| | | |\ \ \ \ \ | | | | |/ / / / | | | |/| | | / | | | | | |_|/ | | | | |/| | into mysql.com:/home/hf/work/mrg/my51-mrg
| | | | * | | Bug #32624 Error with multi queries in MySQL embedded server 5.1.22.holyfoot/hf@mysql.com/hfmain.(none)2007-11-291-2/+3
| | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | server status wasn't properly sent to the client after the error by the embedded server. Wasn't noticed before as one usually stopped retrieving results after he gets an error.
| * | | | | Fix a compilation error.kostja@bodhi.(none)2007-12-131-1/+0
| | | | | |
| * | | | | Bug#12713 "Error in a stored function called from a SELECT doesn't kostja@bodhi.(none)2007-12-121-72/+155
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
* | | | | Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maintcmiller@zippy.cornsilk.net2007-12-141-100/+94
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
| * | | | Doxygenized comments.cmiller@zippy.cornsilk.net2007-10-111-110/+108
| | | | |
* | | | | A patch for BUG#32148: killing a query may be ineffective.anozdrin/alik@ibm.2007-11-301-0/+6
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that THD::killed was reset after a command was read from the socket, but before it was actually handled. That lead to a race: if another KILL statement was issued for this connection in the middle of reading from the socket and processing a command, THD::killed state would be cleaned. The fix is to move this cleanup into net_send_error() function. A sample test case exists in binlog_killed.test: - connection 1: start a new transaction on table t1; - connection 2: send query to the server (w/o waiting for the result) to update data in table t1 -- this query will be blocked since there is unfinished transaction; - connection 1: kill query in connection 2 and finish the transaction; - connection 2: get result of the previous query -- it should be the "query-killed" error. This test however contains race condition, which can not be fixed with the current protocol: there is no way to guarantee, that the server will receive and start processing the query in connection 2 (which is intended to get blocked) before the KILL command (sent in the connection 1) will arrive. In other words, there is no way to ensure that the following sequence will not happen: - connection 1: start a new transaction on table t1; - connection 1: kill query in connection 2 and finish the transaction; - connection 2: send query to the server (w/o waiting for the result) to update data in table t1 -- this query will be blocked since there is unfinished transaction; - connection 2: get result of the previous query -- the query will succeed. So, there is no test case for this bug, since it's impossible to write a reliable test case under the current circumstances.
* | | | Remove net_printf_error(). Do not talk to network directly inkostja@bodhi.(none)2007-11-011-119/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | check_user()/check_connection()/check_for_max_user_connections(). This is a pre-requisite patch for the fix for Bug#12713 "Error in a stored function called from a SELECT doesn't cause ROLLBACK of statem" Implement review comments.
* | | | Merge lambda.weblab:/home/malff/TREE/mysql-5.1-basemalff@lambda.weblab2007-10-291-0/+1
|\ \ \ \ | | | | | | | | | | | | | | | into lambda.weblab:/home/malff/TREE/mysql-5.1-rt-merge
| * \ \ \ Merge mysql.com:/home/gluh/MySQL/Merge/5.1gluh@eagle.(none)2007-10-231-0/+1
| |\ \ \ \ | | | | | | | | | | | | | | | | | | into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
| | * \ \ \ Merge sunlight.local:/local_work/27216-bug-5.0-opt-mysqlevgen@sunlight.local2007-09-241-0/+1
| | |\ \ \ \ | | | |/ / / | | |/| / / | | | |/ / into sunlight.local:/local_work/merge-5.1-opt-mysql
| | | * | Bug#27216: functions with parameters of different date types may return wrongevgen@sunlight.local2007-09-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | type of the result. There are several functions that accept parameters of different types. The result field type of such functions was determined based on the aggregated result type of its arguments. As the DATE and the DATETIME types are represented by the STRING type, the result field type of the affected functions was always STRING for DATE/DATETIME arguments. The affected functions are COALESCE, IF, IFNULL, CASE, LEAST/GREATEST, CASE. Now the affected functions aggregate the field types of their arguments rather than their result types and return the result of aggregation as their result field type. The cached_field_type member variable is added to the number of classes to hold the aggregated result field type. The str_to_date() function's result field type now defaults to the MYSQL_TYPE_DATETIME. The agg_field_type() function is added. It aggregates field types with help of the Field::field_type_merge() function. The create_table_from_items() function now uses the item->tmp_table_field_from_field_type() function to get the proper field when the item is a function with a STRING result type.
| | | * | Backport of TIME->MYSQL_TIME / Y2K fixsetmsvensson@pilot.blaudden2007-05-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made year 2000 handling more uniform Removed year 2000 handling out from calc_days() The above removes some bugs in date/datetimes with year between 0 and 200 Now we get a note when we insert a datetime value into a date column For default values to CREATE, don't give errors for warning level NOTE Fixed some compiler failures Added library ws2_32 for windows compilation (needed if we want to compile with IOCP support) Removed duplicate typedef TIME and replaced it with MYSQL_TIME Better (more complete) fix for: Bug#21103 "DATE column not compared as DATE" Fixed properly Bug#18997 "DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value" Fixed Bug#23093 "Implicit conversion of 9912101 to date does not match cast(9912101 as date)"
* | | | | Rename: query_error -> is_slave_error.kostja@bodhi.(none)2007-10-201-2/+2
|/ / / / | | | | | | | | | | | | Add comments.
* | | | Remove an unused variable that was there since the first implementationkostja@bodhi.(none)2007-10-151-1/+1
|/ / / | | | | | | | | | of the stored procedure cursors (materialized on disk).
* | | WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-55/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* | | Removed not used define YY_MAGIC_BELOWmonty@mysql.com/narttu.mysql.fi2007-03-231-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made year 2000 handling more uniform Removed year 2000 handling out from calc_days() The above removes some bugs in date/datetimes with year between 0 and 200 Now we get a note when we insert a datetime value into a date column For default values to CREATE, don't give errors for warning level NOTE Fixed some compiler failures Added library ws2_32 for windows compilation (needed if we want to compile with IOCP support) Removed duplicate typedef TIME and replaced it with MYSQL_TIME Better (more complete) fix for: Bug#21103 "DATE column not compared as DATE" Fixed properly Bug#18997 "DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value" Fixed Bug#23093 "Implicit conversion of 9912101 to date does not match cast(9912101 as date)"
* | | Fix for BUG#735 "Prepared Statements: there is no support for Queryguilhem@gbichot3.local2007-03-091-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cache". WL#1569 "Prepared Statements: implement support of Query Cache". Prepared SELECTs did not look up in the query cache, and their results were not stored in the query cache. This made them slower than non-prepared SELECTs in some cases. The fix is to re-use the expanded query (the prepared query where "?" placeholders are replaced by their values, at execution time) for searching/storing in the query cache. It works fine for statements prepared via mysql_stmt_prepare(), which are the most commonly used and were the scope of this bugfix and WL. It works less fine for statements prepared via the SQL command PREPARE...FROM, which are still not using the query cache if they have at least one parameter (because then the expanded query contains names of user variables, and user variables don't work with the query cache, even in non-prepared queries). Note that results from prepared SELECTs, which are in the binary protocol, and results from normal SELECTs, which are in the text protocol, ignore each other in the query cache, because a result in the binary protocol should never be served to a SELECT expecting the text protocol and vice-versa. Note, after this patch, bug 25843 starts applying to query cache ("changing default database between PREPARE and EXECUTE of statement breaks binlog"), we need to fix it.
* | | manual mergeguilhem@gbichot3.local2007-03-091-34/+34
|\ \ \
| * | | Mechanical class renaming:guilhem@gbichot3.local2007-01-301-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Protocol_simple->Protocol_text; Protocol_prep->Protocol_binary and also THD::protocol_simple->THD::protocol_text, THD::protocol_prep->THD::protocol_binary. Reason: the binary protocol is not bound to be used only with prepared statements long term (see WL#3559 "Decouple binary protocol from prepared statements"). Renaming now is pressing because the fix for BUG#735 "Prepared Statements: there is no support for Query Cache" will introduce a new member in class Query_cache_flags telling about the protocol's nature. Other reason: "simple" is less accurate than "text". Future patches for BUG#735 will rely on this cset.
* | | | After merge fixesmonty@mysql.com/narttu.mysql.fi2007-01-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed a lot of compiler warnings Removed not used variables, functions and labels Initialize some variables that could be used unitialized (fatal bugs) %ll -> %l
* | | | Merge mysql.com:/home/my/mysql-5.0monty@narttu.mysql.fi2007-01-271-1/+3
|\ \ \ \ | |/ / / |/| / / | |/ / | | | into mysql.com:/home/my/mysql-5.1 Merge of 'remove compiler warnings when using -Wshadow'
| * | Merge bk-internal.mysql.com:/home/bk/mysql-5.0monty@mysql.com/narttu.mysql.fi2007-01-221-1/+3
| |\ \ | | | | | | | | | | | | into mysql.com:/home/my/mysql-5.0
| | * | Fixed compiler warnings detected by option -Wshadow and -Wunused:monty@mysql.com/narttu.mysql.fi2006-12-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Removed not used variables and functions - Added #ifdef around code that is not used - Renamed variables and functions to avoid conflicts - Removed some not used arguments Fixed some class/struct warnings in ndb Added define IS_LONGDATA() to simplify code in libmysql.c I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
* | | | Merge mysql.com:/home/kent/bk/main/mysql-5.0kent@kent-amd64.(none)2006-12-231-2/+1
|\ \ \ \ | |/ / / | | | | | | | | into mysql.com:/home/kent/bk/main/mysql-5.1