summaryrefslogtreecommitdiff
path: root/include/sql_common.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
|\
| * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| |\
| | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | * Update wrong zip-code
* | | Merge 10.1 into 10.2Marko Mäkelä2018-08-021-2/+2
|\ \ \ | |/ /
| * | Merge 5.5 into 10.0Marko Mäkelä2018-07-301-1/+1
| |\ \ | | |/
| | * Merge remote-tracking branch 'mysql/5.5' into 5.5Oleksandr Byelkin2018-07-291-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do not accept: 1. We did not have this problem (fixed earlier and better) d982e717aba67227ec40761a21a4211db91aa0e2 Bug#27510150: MYSQLDUMP FAILS FOR SPECIFIC --WHERE CLAUSES 2. We do not have such options (an DBUG_ASSERT put just in case) bbc2e37fe4e0ca3a7cfa1437a763dc43829e98e2 Bug#27759871: BACKRONYM ISSUE IS STILL IN MYSQL 5.7 3. Serg fixed it in other way in this release: e48d775c6f066add457fa8cfb2ebc4d5ff0c7613 Bug#27980823: HEAP OVERFLOW VULNERABILITIES IN MYSQL CLIENT LIBRARY
| | | * Bug#27759871: BACKRONYM ISSUE IS STILL IN MYSQL 5.7Arun Kuruvila2018-05-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description:- Client applications establishes connection to server, which does not support SSL, via TCP even when SSL is enforced via MYSQL_OPT_SSL_MODE or MYSQL_OPT_SSL_ENFORCE or MYSQL_OPT_SSL_VERIFY_SERVER_CERT. Analysis:- There exist no error handling for catching client applications which enforces SSL connection to connect to a server which does not support SSL. Fix:- Error handling is done to catch above mentioned scenarios.
| * | | Merge branch '5.5' into 10.0Sergei Golubchik2018-04-201-1/+1
| |\ \ \ | | |/ /
| | * | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2018-04-191-1/+1
| | |\ \ | | | |/
| | | * Bug#26585560 - MYSQL DAEMON SHOULD CREATE ITS PID FILE ASShishir Jaiswal2017-12-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ROOT DESCRIPTION =========== If the .pid file is created at a world-writable location, it can be compromised by replacing the server's pid with another running server's (or some other non-mysql process) PID causing abnormal behaviour. ANALYSIS ======== In such a case, user should be warned that .pid file is being created at a world-writable location. FIX === A new function is_file_or_dir_world_writable() is defined and it is called in create_pid_file() before .pid file creation. If the location is world-writable, a relevant warning is thrown. NOTE ==== 1. PID file is always created with permission bit 0664, so for outside world its read-only. 2. Ignoring the case when permission is denied to get the dir stats since the .pid file creation would fail anyway in such a case.
| | | * BUG#25575605: SETTING --SSL-MODE=REQUIRED SENDS CREDENTIALS BEFORE VERIFYING ↵Ramil Kalimullin2017-03-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SSL CONNECTION MYSQL_OPT_SSL_MODE option introduced. It is set in case of --ssl-mode=REQUIRED and permits only SSL connection.
| | | * Bug #12998841: libmysql divulges plaintext password upon request in 5.5Georgi Kodinov2012-07-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Clear text password client plugin disabled by default. 2. Added an environment variable LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN, that when set to something starting with '1', 'Y' or 'y' will enable the clear text plugin for all connections. 3. Added a new mysql_options() option : MYSQL_ENABLE_CLEARTEXT_PLUGIN that takes an my_bool argument. When the value of the argument is non-zero the clear text plugin is enabled for this connection only. 4. Added an enable-cleartext-plugin config file option that takes a numeric argument. If the numeric value of the numeric argument is non-zero the clear text plugin is enabled for the connection 5. Added a boolean command line option "--enable_cleartext_plugin" to mysql, mysqlslap and mysqladmin. When specified it will call mysql_options with the effect of #3 6. Added a new CLEARTEXT option to the connect command in mysqltest. When specified it will enable the cleartext plugin for usage. 7. Added test cases and updated existing ones that need the clear text plugin.
| | | * merge bug#13708485 5.1->5.5Georgi Kodinov2012-06-291-3/+4
| | | |\
| | | | * Bug #13708485: malformed resultset packet crashes clientGeorgi Kodinov2012-06-281-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | | |\ \ | | | | |/
| | | * | WL#1054: Pluggable authentication supportGeorgi Kodinov2010-08-091-2/+61
| | | | | | | | | | | | | | | | | | | | Merged the implementation to a new base tree.
| | | * | WL#5016: Fix header file include guardsMats Kindahl2009-09-231-0/+4
| | | |/ | | | | | | | | | | | | Adding header include file guards to files that are missing such.
| | | * Merge mysql.com:/home/hf/work/25097/my50-25097holyfoot/hf@hfmain.(none)2008-02-271-0/+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-0/+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.
| | | * | Cleanup: use helper functions to set an error in MYSQL or MYSQL_STMT.kostja@bodhi.(none)2007-10-311-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No functionality added or changed. This is a pre-requisite for the fix for Bug#12713 Error in a stored function called from a SELECT doesn't cause ROLLBACK of statem Address post-review comments.
| | | * | WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-3/+3
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
| | | * my_strtoll10-x86.s:kent@mysql.com/kent-amd64.(none)2006-12-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Corrected spelling in copyright text Makefile.am: Don't update the files from BitKeeper Many files: Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header Adjusted year(s) in copyright header Many files: Added GPL copyright text Removed files: Docs/Support/colspec-fix.pl Docs/Support/docbook-fixup.pl Docs/Support/docbook-prefix.pl Docs/Support/docbook-split Docs/Support/make-docbook Docs/Support/make-makefile Docs/Support/test-make-manual Docs/Support/test-make-manual-de Docs/Support/xwf
| | | * Many files:kent@mysql.com/kent-amd64.(none)2006-12-231-2/+1
| | | | | | | | | | | | | | | | Changed header to GPL version 2 only
| | | * Merge bk-internal.mysql.com:/home/bk/mysql-5.0kostja@bodhi.local2006-08-021-1/+1
| | | |\ | | | | | | | | | | | | | | | into bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
| | | | * A fix and a test case for Bug#15752 "Lost connection to MySQL server kostja@bodhi.local2006-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when calling a SP from C API" The bug was caused by lack of checks for misuse in mysql_real_query. A stored procedure always returns at least one result, which is the status of execution of the procedure itself. This result, or so-called OK packet, is similar to a result returned by INSERT/UPDATE/CREATE operations: it contains the overall status of execution, the number of affected rows and the number of warnings. The client test program attached to the bug did not read this result and ivnoked the next query. In turn, libmysql had no check for such scenario and mysql_real_query was simply trying to send that query without reading the pending response, thus messing up the communication protocol. The fix is to return an error from mysql_real_query when it's called prior to retrieval of all pending results.
| | | * | Merge bk@192.168.21.1:mysql-4.1holyfoot/hf@mysql.com/deer.(none)2006-07-131-1/+2
| | | |\ \ | | | | |/ | | | |/| | | | | | into mysql.com:/home/hf/work/mysql-4.1.16017
| | | | * bug #16017 (memory leaks in embedded server)holyfoot@deer.(none)2006-06-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There actually was 3 different problems - hash_user_connections wasn't cleaned one strdupped database name wasn't freed and stmt->mem_root wasn't cleaned as it was replased with mysql->field_alloc for result For the last one - i made the library using stmt's fields to store result if it's the case.
| | | * | bug #20318 (ctype_ucs2_def test fails with embedded)holyfoot@deer.(none)2006-06-191-0/+1
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there was two problems about charsets in embedded server 1. mysys/charset.c - defined there default_charset_info variable is modified by both server and client code (particularly when --default-charset option is handled) In embedded server we get two codelines modifying one variable. I created separate default_client_charset_info for client code 2. mysql->charset and mysql->options.charset initialization isn't properly done for embedded server - necessary calls added
| | | * Remove stale declaration, fix a typo in comment.konstantin@mysql.com2004-10-151-1/+0
| | | |
| | | * Fixes for bugs in embedded library:hf@deer.(none)2004-07-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #4700 (Unsigned value returned as signed) just no appropriate checking #4701 (Errors returned earlier than expected) all errors returned from send_command() #4702 (Result isn't freed properly if there's no retrieval) flush_use_result has only 'client' version and should be made 'virtual'
| | | * Intermediate commit of client library (cleanups + fixes of 3 items from konstantin@mysql.com2004-03-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | flaws list) TODO: * verify that no sequence of API calls produces SIGSEGV. That is, verify that mysql_stmt_init -> mysql_stmt_fetch is OK, or mysql_stmt_prepare -> mysql_stmt_fetch_column is OK and sets meaningful error. * remove alloc_stmt_fields call * revise stmt->state codes and statement states. * there are other items in prepared statements 'to fix' document. Done: - cleanups and comments - revision of prepared statement error codes. - mysql_stmt_prepare is now can always be called (that is, you can reprepare a statement) - new implementation of mysql_stmt_close and fetch cancellation
| | | * fix to make client.c compile on windowskonstantin@oak.local2004-03-121-0/+1
| | | |
| | | * Added missing SSL library (Should be in source distribution)monty@mysql.com2003-11-281-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed compiler warnings (a lot of hidden variables detected by the Forte compiler) Added a lot of 'version_xxx' strings to 'show variables' Prevent copying of TMP_TABLE_PARAM (This caused core dump bug on Solaris) Fixed problem with printing sub selects to debug log
| | | * Merge key cache structures to onemonty@mysql.com2003-11-201-1/+1
| | | | | | | | | | | | | | | | Fixed compiler warnings (IRIX C compiler and VC++)
| | | * SCRUMhf@deer.(none)2003-09-171-0/+7
| | | | | | | | | | | | | | | | prepared statements in embedded library
| | | * SCRUMhf@deer.(none)2003-09-161-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prepared statements in embedded server Several changes in library code with two goals: to make mysql_prepare_stmt working in embedded server to get rid of #define mysql_interface_func mysql->methods->interface_func in user's interface
| | | * SCRUM - adding client into embedded serverhf@deer.(none)2003-07-231-1/+0
| | | | | | | | | | | | | | | | | | | | error handling fixed fetch_lengths made to work differently in embedded and client cases
| | | * SCRUMhf@deer.(none)2003-06-171-4/+0
| | | |\ | | | | | | | | | | | | | | | | | | | | merged conflicts about my previous commit it seems there are some errors left - gonna check...
| | | | * Cleanup after split of libmysql.c to client.c and libmysql.c. A 4.1 ↵monty@narttu.mysql.fi2003-06-141-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master/slave will now use the 4.1 protocol Fixed wrong value for SQLSTATE_LENGTH Added CLIENT_REMEMBER_OPTIONS to mysql_real_connect() Changed mysql_port and mysql_unix_port to mysqld_xxxx
| | | * | SCRUMhf@deer.(none)2003-06-171-3/+2
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | client capabilities included into libmysqld some API methods became "virtual" lots of duplicated code removed IMHO all the above made library's code way more pleasant to look at, didn't it?
| | | * After merge fixesmonty@narttu.mysql.fi2003-06-051-0/+1
| | | |
| | | * SCRUM:hf@deer.(none)2003-06-031-4/+0
| | | | | | | | | | | | | | | | splittiln common client's parts
| | | * SCRUM:hf@deer.(none)2003-05-311-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here is another pack of changes about gathering common client code in sql-common/client.c. Now i symlink the client.c from sql/ and libmysql/. These directories have client_settings.h files to be included to client.c. It contains defines and declarations to compile client.c in appropriate manner. Also i've added include/sql_common.h, containing declarations of what is exported from client.c I removed as many #ifdef-s from client.c as i dared to. I think it's better push it with some extra #ifdef-s now (of course, if everythihg besides it is ok) so other people can check the code.
* | | fix the ABI and stop slave hang problemvinchen2016-10-211-0/+1
| | |
* | | After-review changesSergei Golubchik2016-09-121-0/+2
| | | | | | | | | | | | | | | | | | * remove redundant code * fix tests * move declarations and defines where they belong
* | | MDEV-9293 - Use MariaDB's Connector/C in serverVladislav Vaintroub2016-08-251-1/+4
| | |
* | | Revert "MDEV-9293 Connector/C integration"Vladislav Vaintroub2016-08-191-5/+1
| | | | | | | | | | | | This reverts commit 7b89b9f5108c80f4f270da922d7e6c182a663719.
* | | MDEV-9293 Connector/C integrationVladislav Vaintroub2016-08-191-1/+5
|/ /
* | Do the partial merge of WL#5602 correctly:Sergei Golubchik2013-12-091-1/+0
| | | | | | | | | | | | Remove unused code (that should not have been merged) Add protocol extension (that should have been merged) Fix bugs (see pack.c)
* | Client attributesunknown2013-10-031-0/+3
| |