summaryrefslogtreecommitdiff
path: root/libmysql/libmysql.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug#14840488 VALGRIND ERRORS IN MYSQL_CLIENT_TESTTor Didriksen2012-11-011-1/+1
| | | | | Add missing DBUG_RETURNs, otherwise the debug-stack gets messed up, and _db_enter_ and _db_exit_ will access data outside the current stack frame.
* Bug #13708485: malformed resultset packet crashes clientGeorgi Kodinov2012-06-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Several fixes : * sql-common/client.c Added a validity check of the fields metadata packet sent by the server. Now libmysql will check if the length of the data sent by the server matches what's expected by the protocol before using the data. * client/mysqltest.cc Fixed the error handling code in mysqltest to avoid sending new commands when the reading the result set failed (and there are unread data in the pipe). * sql_common.h + libmysql/libmysql.c + sql-common/client.c unpack_fields() now generates a proper error when it fails. Added a new argument to this function to support the error generation. * sql/protocol.cc Added a debug trigger to cause the server to send a NULL insted of the packet expected by the client for testing purposes.
* Updated/added copyright headersKent Boortz2011-06-301-2/+2
|\
| * Updated/added copyright headersKent Boortz2011-06-301-2/+3
| |
* | Merge from mysql-5.0-bugteam.Alexander Nozdrin2010-11-241-2/+1
|\ \ | |/
| * A follow-up for Bug#58340 (Remove Server GPL EXCEPTIONS-CLIENT file) -- ↵Alexander Nozdrin2010-11-241-2/+1
| | | | | | | | | | remove all EXCEPTIONS-CLIENT from all the places.
* | Bug#58057: 5.1 libmysql/libmysql.c unused variable/compile failureDavi Arnaut2010-11-101-2/+2
| | | | | | | | | | | | | | | | | | | | Bug#57995: Compiler flag change build error on OSX 10.4: my_getncpus.c Bug#57996: Compiler flag change build error on OSX 10.5 : bind.c Bug#57994: Compiler flag change build error : my_redel.c Bug#57993: Compiler flag change build error on FreeBsd 7.0 : regexec.c Bug#57992: Compiler flag change build error on FreeBsd : mf_keycache.c Bug#57997: Compiler flag change build error on OSX 10.6: debug_sync.cc Fix assorted compiler generated warnings.
* | Fixed bug #47485 - mysql_store_result returns a not NULL result setDmitry Shulga2010-09-071-2/+4
| | | | | | for a prepared statement.
* | Fix what is probably the result of a bad merge. No functional change.Davi Arnaut2010-07-061-0/+1
| |
* | Bug#53445: Build with -Wall and fix warnings that it generatesDavi Arnaut2010-07-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apart strict-aliasing warnings, fix the remaining warnings generated by GCC 4.4.4 -Wall and -Wextra flags. One major source of warnings was the in-house function my_bcmp which (unconventionally) took pointers to unsigned characters as the byte sequences to be compared. Since my_bcmp and bcmp are deprecated functions whose only difference with memcmp is the return value, every use of the function is replaced with memcmp as the special return value wasn't actually being used by any caller. There were also various other warnings, mostly due to type mismatches, missing return values, missing prototypes, dead code (unreachable) and ignored return values.
* | Automerge.Alexey Kopytov2010-07-011-1/+1
|\ \
| * | Bug#54667: Unnecessary signal handler redefinitionAlexey Kopytov2010-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | | POSIX requires that a signal handler defined with sigaction() is not reset on delivering a signal unless SA_NODEFER or SA_RESETHAND is set. It is therefore unnecessary to redefine the handler on signal delivery on platforms where sigaction() is used without those flags.
* | | Bug #53899 Wrong mysql_stmt_errno() after connection loss withStaale Smedseng2010-06-301-4/+24
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | automatic reconnect A client with automatic reconnect enabled will see the error message "Lost connection to MySQL server during query" if the connection is lost between mysql_stmt_prepare() and mysql_stmt_execute(). The mysql_stmt_errno() number, however, is 0 -- not the corresponding value 2013. This patch checks for the case where the prepared statement has been pruned due to a connection loss (i.e., stmt->mysql has been set to NULL) during a call to cli_advanced_command(), and avoids changing the last_errno to the result of the last reconnect attempt.
* | Bug #45058 init_available_charsets uses double checked lockingStaale Smedseng2010-02-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | A client doing multiple mysql_library_init() and mysql_library_end() calls over the lifetime of the process may experience lost character set data, potentially even a SIGSEGV. This patch reinstates the reloading of character set data when a mysql_library_init() is done after a mysql_library_end().
* | Manual merge.Davi Arnaut2009-12-181-2/+5
|\ \ | |/
| * Bug#48983: Bad strmake calls (length one too long)Davi Arnaut2009-12-171-2/+5
| | | | | | | | | | | | | | | | The problem is a somewhat common misusage of the strmake function. The strmake(dst, src, len) function writes at most /len/ bytes to the string pointed to by src, not including the trailing null byte. Hence, if /len/ is the exact length of the destination buffer, a one byte buffer overflow can occur if the length of the source string is equal to or greater than /len/.
* | Merge approved bug fixJim Winstead2009-12-161-2/+2
|\ \
| * | Fix C99 aliasing violation due to mismatched types that were papered overJim Winstead2009-11-231-2/+2
| | | | | | | | | | | | with a cast. (Bug #48284)
* | | Bug #45058 init_available_charsets uses double checked lockingStaale Smedseng2009-12-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As documented in the bug report, the double checked locking pattern has inherent issues, and cannot guarantee correct initialization. This patch replaces the logic in init_available_charsets() with the use of pthread_once(3). A wrapper function, my_pthread_once(), is introduced and is used in lieu of direct calls to init_available_charsets(). Related defines MY_PTHREAD_ONCE_* are also introduced. For the Windows platform, the implementation in lp:sysbench is ported. For single-thread use, a simple define calls the function and sets the pthread_once control variable. Charset initialization is modified to use my_pthread_once().
* | | Post-merge fix for bug 41728: revert fix that was pushed in mistake to 5.1 ↵Davi Arnaut2009-11-241-14/+0
|/ / | | | | | | and up.
* | Automerge.Davi Arnaut2009-11-031-6/+8
|\ \ | |/
| * Fix compiler warnings -- tag unused parameters.Davi Arnaut2009-11-031-6/+8
| |
* | Automerge.Davi Arnaut2009-11-021-0/+12
|\ \ | |/
| * Bug#41728: Dropped symbol but no soname changeDavi Arnaut2009-09-291-0/+12
| | | | | | | | | | | | | | | | | | | | Restore a stub of the removed mysql_odbc_escape_string function to fix a ABI breakage. The function was intended to be private and used only by Connector/ODBC, but, unfortunately, it was exported as part of the ABI. Nonetheless, only a stub is restored as the original function is inherently broken and shouldn't be used. This restoration only applies to MySQL 5.0. This will be addressed differently in later versions -- reworked library versioning.
* | Merge from 5.0 for 43414Staale Smedseng2009-08-281-2/+1
|\ \ | |/
| * Bug #43414 Parenthesis (and other) warnings compiling MySQLStaale Smedseng2009-08-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * auto-mergeIgnacio Galarza2009-03-191-2/+2
| |\
* | \ auto-mergeIgnacio Galarza2009-03-171-2/+2
|\ \ \
| * \ \ Merge into dev tree.Alexey Kopytov2009-02-101-2/+2
| |\ \ \ | | | |/ | | |/|
| | * | Fix for bug #21205: Different number of digits for float/double/real in ↵Alexey Kopytov2009-01-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --ps-protocol Various parts of code used different 'precision' arguments for sprintf("%g") when converting floating point numbers to a string. This led to differences in results in some cases depending on whether the text-based or prepared statements protocol is used for a query. Fixed by changing arguments to sprintf("%g") to always be 15 (DBL_DIG) so that results are consistent regardless of the protocol. This patch will be null-merged to 6.0 as the problem does not exists there (fixed by the patch for WL#2934).
* | | | Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-131-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-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
| * fixed warnings and compile errors from the fix for bug 26243gkodinov/kgeorge@macbook.gmz2008-03-291-1/+1
| |
| * Merge amd64.(none):/src/mysql-5.0-bugteamiggy@amd64.(none)2008-03-281-4/+0
| |\ | | | | | | | | | into amd64.(none):/src/bug26243/my50-bug26243
| | * Bug#26243 mysql command line crash after control-ciggy@amd64.(none)2008-03-281-4/+0
| | | | | | | | | | | | | | | - Backported the 5.1 DBUG to 5.0. - Avoid memory cleanup race on Windows client for CTRL-C
| * | Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0anozdrin/alik@quad.opbmk2008-03-181-5/+12
| |\ \ | | |/ | |/| | | | into quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0-rt-merged
* | | Bug#38522: 5 seconds delay when closing application using embedded serverVladislav Vaintroub2008-12-041-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem here is that embedded server starts handle_thread manager thread on mysql_library_init() does not stop it on mysql_library_end(). At shutdown, my_thread_global_end() waits for thread count to become 0, but since we did not stop the thread it will give up after 5 seconds. Solution is to move shutdown for handle_manager thread from kill_server() (mysqld specific) to clean_up() that is used by both embedded and mysqld. This patch also contains some refactorings - to avoid duplicate code, start_handle_manager() and stop_handle_manager() functions are introduced. Unused variables are eliminated. handle_manager does not rely on global variable abort_loop anymore to stop (abort_loop is not set for embedded). Note: Specifically on Windows and when using DBUG version of libmysqld, the complete solution requires removing obsolete code my_thread_init() from my_thread_var(). This has a side effect that a DBUG statement after my_thread_end() can cause thread counter to be incremented, and embedded will hang for some seconds. Or worse, my_thread_init() will crash if critical sections have been deleted by the global cleanup routine that runs in a different thread. This patch also fixes and revert prior changes for Bug#38293 "Libmysqld crash in mysql_library_init if language file missing". Root cause of the crash observed in Bug#38293 was bug in my_thread_init() described above
* | | Bug#27430 "Crash in subquery code when in PS and table DDL changed afterkostja@bodhi.(none)2008-05-201-43/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PREPARE", review fixes: - make the patch follow the specification of WL#4166 and remove the new error that was originally introduced. Now the client never gets an error from reprepare, unless it failed. I.e. even if the statement at hand returns a completely different result set, this is not considered a server error. The C API library, that can not handle this situation, was modified to return a client error. Added additional test coverage.
* | | Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1anozdrin/alik@quad.opbmk2008-03-181-5/+12
|\ \ \ | | | | | | | | | | | | into quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1-rt-merged
| * | | Post-merge fixes for Bug 35103davi@buzz.(none)2008-03-171-1/+1
| | | |
| * | | Merge buzz.(none):/home/davi/mysql-5.0-runtimedavi@buzz.(none)2008-03-171-5/+12
| |\ \ \ | | | |/ | | |/| | | | | 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-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge kaamos.(none):/data/src/mysql-5.1kaa@kaamos.(none)2008-03-121-1/+1
|\ \ \ \ | |/ / / |/| | | | | | | into kaamos.(none):/data/src/opt/mysql-5.1-opt
| * | | Merge mysql.com:/home/hf/work/25097/my50-25097holyfoot/hf@hfmain.(none)2008-02-271-1/+1
| |\ \ \ | | | |/ | | |/| | | | | 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-1/+1
| | |/ | | | | | | | | | | | | | | | | | | 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.
* | | Bug#34655 Compile errordavi@mysql.com/endora.local2008-02-281-18/+18
| | | | | | | | | | | | | | | 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 server bug experienced in Maria (wrong "Truncated incorrect <var_name>guilhem@gbichot4.local2008-02-181-2/+2
|/ / | | | | | | | | | | | | | | value" error even though the value was correct): a C function in my_getopt.c was taking bool* in parameter and was called from C++ sql_plugin.cc, but on some Mac OS X sizeof(bool) is 1 in C and 4 in C++, giving funny mismatches. Fixed, all other occurences of bool in C are removed, future ones are blocked by a "C-bool-catcher" in my_global.h (use my_bool).
* | Bug#12713 "Error in a stored function called from a SELECT doesn't kostja@bodhi.(none)2007-12-121-18/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 mysql.com:/Users/davi/mysql/bugs/29592-5.0davi@endora.local2007-11-261-72/+0
|\ \ | |/ | | | | into mysql.com:/Users/davi/mysql/bugs/29592-5.1
| * Bug#29592 SQL Injection issuedavi@mysql.com/endora.local2007-11-261-72/+0
| | | | | | | | | | | | | | Remove the mysql_odbc_escape_string() function. The function has multi-byte character escaping issues, doesn't honor the NO_BACKSLASH_ESCAPES mode and is not used anymore by the Connector/ODBC as of 3.51.17.