summaryrefslogtreecommitdiff
path: root/sql-common
Commit message (Collapse)AuthorAgeFilesLines
* Bug#47571: idle named pipe connection is unkillableVladislav Vaintroub2009-11-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | Bug#31621: Windows server hanging during shutdown using named pipes and idle connection Problem: when idle pipe connection is forcefully closed with KILL statement or when the server goes down, thread that is closing connection would hang infinitely in CloseHandle(). The reason for the hang is that named pipe operations are performed synchronously. In this mode all IOs on pipe are serialized, that is CloseHandle() will not abort ReadFile() in another thread, but wait for ReadFile() to complete. The fix implements asynchrnous mode for named pipes, where operation of file are not synchronized. Read/Write operation would fire an async IO and wait for either IO completion or timeout. Note, that with this patch timeouts are properly handled for named pipes. Post-review: Win32 timeout code has been fixed for named pipes and shared memory. We do not store pointer to NET in vio structure, only the read and write timeouts.
* Merge from 5.0Staale Smedseng2009-09-171-2/+1
|\
| * Bug #43414 Parenthesis (and other) warnings compiling MySQLStaale Smedseng2009-09-171-2/+1
| | | | | | | | | | | | | | | | with gcc 4.3.2 This is the fifth patch cleaning up more GCC warnings about variables used before initialized using the new macro UNINIT_VAR().
* | Post fix patch for bug#20577 and bug#46362.Mattias Jonsson2009-09-011-2/+3
| | | | | | | | On 64-bits machines the calculation gets the wrong types and results in very large numbers. Fixed by explicitly cast month to (int)
* | manual mergeTatiana A. Nurnberg2009-08-311-0/+9
|\ \ | |/
| * Bug#35132: MySQLadmin --wait ping always crashes on Windows systemsTatiana A. Nurnberg2009-08-311-0/+9
| | | | | | | | | | | | | | | | Failing to connect would release parts of the MYSQL struct. We would then proceed to try again to connect without re- initializing the struct. We prevent the unwanted freeing of data we'll still need now.
* | Merge from 5.0 for 43414Staale Smedseng2009-08-282-4/+2
|\ \ | |/
| * Bug #43414 Parenthesis (and other) warnings compiling MySQLStaale Smedseng2009-08-282-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with gcc 4.3.2 This patch fixes a number of GCC warnings about variables used before initialized. A new macro UNINIT_VAR() is introduced for use in the variable declaration, and LINT_INIT() usage will be gradually deprecated. (A workaround is used for g++, pending a patch for a g++ bug.) GCC warnings for unused results (attribute warn_unused_result) for a number of system calls (present at least in later Ubuntus, where the usual void cast trick doesn't work) are also fixed.
* | Manual merge between bug#46362 and bug#20577.Mattias Jonsson2009-08-281-3/+1
|\ \
| * | Bug#46362: Endpoint should be set to false for TO_DAYS(DATE)Mattias Jonsson2009-08-261-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were a problem since pruning uses the field for comparison (while evaluate_join_record uses longlong), resulting in pruning failures when comparing DATE to DATETIME. Fix was to always comparing DATE vs DATETIME as DATETIME, by adding ' 00:00:00' to the DATE string. And adding optimization for comparing with 23:59:59, so that DATETIME_col > '2001-02-03 23:59:59' -> TO_DAYS(DATETIME_col) > TO_DAYS('2001-02-03 23:59:59') instead of '>='.
* | | Merge from mysql-5.0-bugteam.Davi Arnaut2009-08-131-0/+3
|\ \ \ | |/ / |/| / | |/
| * Bug#46013: rpl_extraColmaster_myisam fails on pb2Davi Arnaut2009-08-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#45243: crash on win in sql thread clear_tables_to_lock() -> free() Bug#45242: crash on win in mysql_close() -> free() Bug#45238: rpl_slave_skip, rpl_change_master failed (lost connection) for STOP SLAVE Bug#46030: rpl_truncate_3innodb causes server crash on windows Bug#46014: rpl_stm_reset_slave crashes the server sporadically in pb2 When killing a user session on the server, it's necessary to interrupt (notify) the thread associated with the session that the connection is being killed so that the thread is woken up if waiting for I/O. On a few platforms (Mac, Windows and HP-UX) where the SIGNAL_WITH_VIO_CLOSE flag is defined, this interruption procedure is to asynchronously close the underlying socket of the connection. In order to enable this schema, each connection serving thread registers its VIO (I/O interface) so that other threads can access it and close the connection. But only the owner thread of the VIO might delete it as to guarantee that other threads won't see freed memory (the thread unregisters the VIO before deleting it). A side note: closing the socket introduces a harmless race that might cause a thread attempt to read from a closed socket, but this is deemed acceptable. The problem is that this infrastructure was meant to only be used by server threads, but the slave I/O thread was registering the VIO of a mysql handle (a client API structure that represents a connection to another server instance) as a active connection of the thread. But under some circumstances such as network failures, the client API might destroy the VIO associated with a handle at will, yet the VIO wouldn't be properly unregistered. This could lead to accesses to freed data if a thread attempted to kill a slave I/O thread whose connection was already broken. There was a attempt to work around this by checking whether the socket was being interrupted, but this hack didn't work as intended due to the aforementioned race -- attempting to read from the socket would yield a "bad file descriptor" error. The solution is to add a hook to the client API that is called from the client code before the VIO of a handle is deleted. This hook allows the slave I/O thread to detach the active vio so it does not point to freed memory.
* | Bug#45017: Failure to connect if hostname maps to multiple addressesDavi Arnaut2009-07-301-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that the C API function mysql_real_connect only attempts to connect to the first IP address returned for a hostname. This can be a problem if a hostname maps to multiple IP address and the server is not bound to the first one that is returned. The solution is to augment mysql_real_connect so that it attempts to connect to all IPv4 addresses that a domain name maps to. The function goes over the list of address until a successful connection is established. No test case is provided as its not possible to test this automatically with the current testing infrastructure.
* | Merge from mysql-5.0-bugteam.Davi Arnaut2009-06-101-4/+16
|\ \ | |/
| * Bug#41190: shared memory connections do not work in Vista, if server started ↵Davi Arnaut2009-06-101-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from cmdline Backport to MySQL 5.0/1 fix by Vladislav Vaintroub: In Vista and later and also in when using terminal services, when server is started from command line, client cannot connect to it via shared memory protocol. This is a regression introduced when Bug#24731 was fixed. The reason is that client is trying to attach to shared memory using global kernel object namespace (all kernel objects are prefixed with Global\). However, server started from the command line in Vista and later will create shared memory and events using current session namespace. Thus, client is unable to find the server and connection fails. The fix for the client is to first try to find server using "local" names (omitting Global\ prefix) and only if server is not found, trying global namespace.
* | Adding missing forward declaration for bug 43560Staale Smedseng2009-05-201-1/+2
| |
* | Recommit of bug 43560 after merge with mysql-5.1-bugteamStaale Smedseng2009-05-201-24/+44
| |
* | auto-mergeIgnacio Galarza2009-03-191-1/+1
|\ \
| * | Fix for bug #40552: Race condition around default_directories Alexey Kopytov2009-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in load_defaults() load_defaults(), my_search_option_files() and my_print_default_files() utilized a global variable containing a pointer to thread local memory. This could lead to race conditions when those functions were called with high concurrency. Fixed by changing the interface of the said functions to avoid the necessity for using a global variable. Since we cannot change load_defaults() prototype for API compatibility reasons, it was renamed my_load_defaults(). Now load_defaults() is a thread-unsafe wrapper around a thread-safe version, my_load_defaults().
* | | auto-mergeIgnacio Galarza2009-03-171-1/+12
|\ \ \ | |/ /
| * | Bug#42146 - DATETIME fractional seconds parse errorTatiana A. Nurnberg2009-02-131-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#38435 - LONG Microseconds cause MySQL to fail a CAST to DATETIME or DATE Parsing of optional microsecond part in datetime did not fail gracefully when field width was larger than the allowed six places. Now handles up to the correct six places, and disregards any extra digits without messing up what we've already got.
* | | Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-132-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
| * Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-102-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
* | auto-mergeTatiana A. Nurnberg2009-01-091-6/+7
|\ \ | |/
| * Bug#41470: DATE_FORMAT() crashes the complete server with a valid dateTatiana A. Nurnberg2009-01-081-6/+7
| | | | | | | | | | | | | | Passing dubious "year zero" in non-zero date (not "0000-00-00") could lead to negative value for year internally, while variable was unsigned. This led to Really Bad Things further down the line. Now doing calculations with signed type for year internally.
| * Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug26294/my50-bug26294cmiller@zippy.cornsilk.net2008-04-031-3/+3
| |\ | | | | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-build
| * | fixed warnings and compile errors from the fix for bug 26243gkodinov/kgeorge@macbook.gmz2008-03-291-1/+1
| | |
| * | Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0anozdrin/alik@quad.opbmk2008-03-181-3/+7
| |\ \ | | | | | | | | | | | | into quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0-rt-merged
* | \ \ Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug26294/my51-bug26294cmiller@zippy.cornsilk.net2008-04-031-3/+3
|\ \ \ \ | | | | | | | | | | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-build
| * \ \ \ Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug26294/my50-bug26294cmiller@zippy.cornsilk.net2008-04-031-3/+3
| |\ \ \ \ | | | |_|/ | | |/| | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/bug26294/my51-bug26294
| | * | | Bug#26294: library name conflict between MySQL 4.x, 5.0 and Qt 3.3cmiller@zippy.cornsilk.net2008-04-031-3/+3
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | When linking with some external programs, "multiple definition of `init_time'" Rename init_time() to my_init_time() to avoid collision with other libraries (particularly libmng).
* | | | Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1anozdrin/alik@quad.opbmk2008-03-181-4/+24
|\ \ \ \ | |/ / / |/| | | | | | | into quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1-rt-merged
| * | | Merge buzz.(none):/home/davi/mysql-5.0-runtimedavi@buzz.(none)2008-03-171-3/+7
| |\ \ \ | | | |/ | | |/| | | | | into buzz.(none):/home/davi/mysql-5.1-runtime
| | * | Bug#35103 mysql_client_test::test_bug29948 causes sporadic failuresdavi@mysql.com/endora.local2008-03-141-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that the COM_STMT_SEND_LONG_DATA was sending a response packet if the prepared statement wasn't found in the server (due to reconnection). The commands COM_STMT_SEND_LONG_DATA and COM_STMT_CLOSE should not send any packets, even error packets should not be sent since they are not expected by the client API. The solution is to clear generated during the execution of the aforementioned commands and to skip resend of prepared statement commands. Another fix is that if the connection breaks during the send of prepared statement command, the command is not sent again since the prepared statement is no longer in the server.
| * | | A fix for Bug#35289: Too many connections -- wrong SQL stateanozdrin/alik@quad.2008-03-141-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in some case. ER_CON_COUNT_ERROR is defined with SQL state 08004. However, this SQL state is not always returned. This error can be thrown in two cases: 1. when an ordinary user (a user w/o SUPER privilege) is connecting, and the number of active user connections is equal or greater than max_connections. 2. when a user is connecting and the number of active user connections is already (max_connections + 1) -- that means that no more connections will be accepted regardless of the user credentials. In the 1-st case, SQL state is correct. The bug happens in the 2-nd case -- on UNIX the client gets 00000 SQL state, which is absolutely wrong (00000 means "not error SQL state); on Windows the client accidentally gets HY000 (which means "unknown SQL state). The cause of the problem is that the server rejects extra connection prior to read a packet with client capabilities. Thus, the server does not know if the client supports SQL states or not (if the client supports 4.1 protocol or not). So, the server supposes the worst and does not send SQL state at all. The difference in behavior on UNIX and Windows occurs because on Windows CLI_MYSQL_REAL_CONNECT() invokes create_shared_memory(), which returns an error (in default configuration, where shared memory is not configured). Then, the client does not reset this error, so when the connection is rejected, SQL state is HY000 (from the error from create_shared_memory()). The bug appeared after test case for Bug#33507 -- before that, this behavior just had not been tested. The fix is to 1) reset the error after create_shared_memory(); 2) set SQL state to 'unknown error' if it was not received from the server. A separate test case is not required, since the behavior is already tested in connect.test. Note for doc-team: the manual should be updated to say that under some circumstances, 'Too many connections' has HY000 SQL state.
* | | | Merge kaamos.(none):/data/src/mysql-5.1kaa@kaamos.(none)2008-03-121-7/+21
|\ \ \ \ | |/ / / |/| | | | | | | into kaamos.(none):/data/src/opt/mysql-5.1-opt
| * | | Merge bk@192.168.21.1:mysql-5.1-optholyfoot/hf@hfmain.(none)2008-02-271-7/+21
| |\ \ \ | | | | | | | | | | | | | | | into mysql.com:/home/hf/work/25097/my51-25097
| | * \ \ Merge mysql.com:/home/hf/work/25097/my50-25097holyfoot/hf@hfmain.(none)2008-02-271-7/+21
| | |\ \ \ | | | | |/ | | | |/| | | | | | into mysql.com:/home/hf/work/25097/my51-25097
| | | * | Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.holyfoot/hf@mysql.com/hfmain.(none)2008-02-271-6/+21
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | There was no way to return an error from the client library if no MYSQL connections was established. So here i added variables to store that king of errors and made functions like mysql_error(NULL) to return these.
| | | * Merge mysql.com:/home/gluh/MySQL/Merge/5.0gluh@eagle.(none)2007-12-131-1/+8
| | | |\ | | | | | | | | | | | | | | | into mysql.com:/home/gluh/MySQL/Merge/5.0-opt
| | | | * Merge mysql.com:/misc/mysql/mysql-5.0-opttnurnberg@white.intern.koehntopp.de2007-11-171-1/+8
| | | | |\ | | | | | | | | | | | | | | | | | | into mysql.com:/misc/mysql/32180/50-32180
* | | | | | Bug#34655 Compile errordavi@mysql.com/endora.local2008-02-281-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename client_last_error to last_error and client_last_errno to last_errno to not break connectors which use the internal net structure for error handling.
* | | | | | Fix for Bug#29605andrey@whirlpool.hristov.com2008-02-221-1/+9
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --local-infile=0 checks can be bypassed by sending a FETCH LOCAL FILE response Add a check for CLIENT_LOCAL_FILES before sending a local file. Beware, that all binary distributions enable sending of local files and it's up to the programs which use libmysql to disable it, if they don't use this functionality. Otherwise they are not safe.
* | | | | Merge bk-internal.mysql.com:/home/bk/mysql-5.1kostja@dipika.(none)2008-02-081-1/+7
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | into dipika.(none):/opt/local/work/mysql-5.1-runtime
| * | | | | Bug#32633 Can not create any routine if SQL_MODE=no_engine_substitutiondavi@mysql.com/endora.local2008-02-071-1/+7
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that one can not create a stored routine if sql_mode contains NO_ENGINE_SUBSTITUTION or PAD_CHAR_TO_FULL_LENGTH. Also when a event is created, the mode is silently lost if sql_mode contains one of the aforementioned. This was happening because the table definitions which stored sql_mode values weren't being updated to accept new values of sql_mode. The solution is to update, in a backwards compatible manner, the various table definitions (columns) that store the sql_mode value to take into account the new possible values. One incompatible change is that if a event that is being created can't be stored to the mysql.event table, an error will be raised. The tests case also ensure that new SQL modes will be added to the mysql.proc and mysql.event tables, otherwise the tests will fail.
* | | | | Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rplmkindahl@dl145h.mysql.com2008-01-301-2/+2
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge
| * | | | Post-merge changes.mkindahl@dl145h.mysql.com2008-01-301-2/+2
| | | | |
* | | | | Merge station.:/mnt/raid/alik/MySQL/devel/5.1anozdrin/alik@station.2007-12-141-1/+8
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | into station.:/mnt/raid/alik/MySQL/devel/5.1-rt
| * \ \ \ \ Merge mysql.com:/home/gluh/MySQL/Merge/5.1gluh@eagle.(none)2007-12-131-1/+8
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | 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/+8
| | |\ \ \ \ \ | | | |/ / / / | | |/| | | | | | | | | | | into mysql.com:/misc/mysql/32180/51-32180