summaryrefslogtreecommitdiff
path: root/libmysqld
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-10-022-6/+6
|\
| * MDEV-13384 - misc Windows warnings fixedVladislav Vaintroub2017-09-281-1/+1
| |
| * MDEV-13844 : Fix Windows warnings. Fix DBUG_PRINT.Vladislav Vaintroub2017-09-282-5/+5
| | | | | | | | | | | | | | | | | | | | | | - Fix win64 pointer truncation warnings (usually coming from misusing 0x%lx and long cast in DBUG) - Also fix printf-format warnings Make the above mentioned warnings fatal. - fix pthread_join on Windows to set return value.
* | Merge 10.2 into bb-10.2-extMarko Mäkelä2017-09-201-9/+0
|\ \ | |/
| * Merge branch '10.1' into 10.2Vicențiu Ciorbaru2017-09-191-9/+0
| |\
| | * Merge branch '10.0' into 10.1Vicențiu Ciorbaru2017-09-191-9/+0
| | |\
| | | * Build improvements and cleanups.Vladislav Vaintroub2017-09-081-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - the probably ultimate fix for dependencies on VS - remove some GET_TARGET_PROPERTY(LOCATION ...), they are deprecated in cmake 3.9 - simplify signing targets on Windows. - remove INSTALL_DEBUG_TARGET, we do not mix binaries from different builds in the same package
| | | * Merge branch '5.5' into 10.0Sergei Golubchik2016-07-121-0/+6
| | | |\
| | | | * MDEV-10318 : Fix crash in embedded, in case prepared statement has parameter ↵Vladislav Vaintroub2016-07-111-0/+6
| | | | | | | | | | | | | | | | | | | | placeholders, but does not bind parameters
* | | | | Merge branch '10.2' into bb-10.2-extSergei Golubchik2017-08-253-6/+4
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-08-172-5/+3
| |\ \ \ \ | | |/ / /
| | * | | MDEV-13179 main.errors fails with wrong errnoMonty2017-08-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that the introduction of max-thread-mem-used can cause an allocation error very early, even before mysql_parse() is called. As mysql_parse() calls thd->reset_for_next_command(), which called clear_error(), the error number was lost. Fixed by adding an option to have unique messages for each KILL signal and change max-thread-mem-used to use this new feature. This removes a lot of problems with the original approach, where one could get errors signaled silenty almost any time. ixed by moving clear_error() from reset_for_next_command() to do_command(), before any memory allocation for the thread. Related changes: - reset_for_next_command() now have an optional parameter if we should call clear_error() or not. By default it's called, but not anymore from dispatch_command() which was the original problem. - Added optional paramater to clear_error() to force calling of reset_diagnostics_area(). Before clear_error() only called reset_diagnostics_area() if there was no error, so we normally called reset_diagnostics_area() twice. - This change removed several duplicated calls to clear_error() when starting a query. - Reset max_mem_used on COM_QUIT, to protect against kill during quit. - Use fatal_error() instead of setting is_fatal_error (cleanup) - Set fatal_error if max_thead_mem_used is signaled. (Same logic we use for other places where we are out of resources)
| * | | | MDEV-13370 Ambiguous behaviour regarding installation of header filesSergei Golubchik2017-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | install all server includes under /usr/include/mysql/server/ and C/C includes under /usr/include/mysql/
* | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-07-121-1/+3
|\ \ \ \ \ | |/ / / /
| * | | | compilation warningSergei Golubchik2017-07-071-1/+3
| | | | |
* | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-06-151-3/+2
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.1 into 10.2Marko Mäkelä2017-05-221-3/+2
| |\ \ \ \ | | |/ / /
* | | | | Changing field::field_name and Item::name to LEX_CSTRINGMonty2017-04-231-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benefits of this patch: - Removed a lot of calls to strlen(), especially for field_string - Strings generated by parser are now const strings, less chance of accidently changing a string - Removed a lot of calls with LEX_STRING as parameter (changed to pointer) - More uniform code - Item::name_length was not kept up to date. Now fixed - Several bugs found and fixed (Access to null pointers, access of freed memory, wrong arguments to printf like functions) - Removed a lot of casts from (const char*) to (char*) Changes: - This caused some ABI changes - lex_string_set now uses LEX_CSTRING - Some fucntions are now taking const char* instead of char* - Create_field::change and after changed to LEX_CSTRING - handler::connect_string, comment and engine_name() changed to LEX_CSTRING - Checked printf() related calls to find bugs. Found and fixed several errors in old code. - A lot of changes from LEX_STRING to LEX_CSTRING, especially related to parsing and events. - Some changes from LEX_STRING and LEX_STRING & to LEX_CSTRING* - Some changes for char* to const char* - Added printf argument checking for my_snprintf() - Introduced null_clex_str, star_clex_string, temp_lex_str to simplify code - Added item_empty_name and item_used_name to be able to distingush between items that was given an empty name and items that was not given a name This is used in sql_yacc.yy to know when to give an item a name. - select table_name."*' is not anymore same as table_name.* - removed not used function Item::rename() - Added comparision of item->name_length before some calls to my_strcasecmp() to speed up comparison - Moved Item_sp_variable::make_field() from item.h to item.cc - Some minimal code changes to avoid copying to const char * - Fixed wrong error message in wsrep_mysql_parse() - Fixed wrong code in find_field_in_natural_join() where real_item() was set when it shouldn't - ER_ERROR_ON_RENAME was used with extra arguments. - Removed some (wrong) ER_OUTOFMEMORY, as alloc_root will already give the error. TODO: - Check possible unsafe casts in plugin/auth_examples/qa_auth_interface.c - Change code to not modify LEX_CSTRING for database name (as part of lower_case_table_names)
* | | | | MDEV-10139 Support for SEQUENCE objectsMonty2017-04-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Working features: CREATE OR REPLACE [TEMPORARY] SEQUENCE [IF NOT EXISTS] name [ INCREMENT [ BY | = ] increment ] [ MINVALUE [=] minvalue | NO MINVALUE ] [ MAXVALUE [=] maxvalue | NO MAXVALUE ] [ START [ WITH | = ] start ] [ CACHE [=] cache ] [ [ NO ] CYCLE ] ENGINE=xxx COMMENT=".." SELECT NEXT VALUE FOR sequence_name; SELECT NEXTVAL(sequence_name); SELECT PREVIOUS VALUE FOR sequence_name; SELECT LASTVAL(sequence_name); SHOW CREATE SEQUENCE sequence_name; SHOW CREATE TABLE sequence_name; CREATE TABLE sequence-structure ... SEQUENCE=1 ALTER TABLE sequence RENAME TO sequence2; RENAME TABLE sequence TO sequence2; DROP [TEMPORARY] SEQUENCE [IF EXISTS] sequence_names Missing features - SETVAL(value,sequence_name), to be used with replication. - Check replication, including checking that sequence tables are marked not transactional. - Check that a commit happens for NEXT VALUE that changes table data (may already work) - ALTER SEQUENCE. ANSI SQL version of setval. - Share identical sequence entries to not add things twice to table list. - testing insert/delete/update/truncate/load data - Run and fix Alibaba sequence tests (part of mysql-test/suite/sql_sequence) - Write documentation for NEXT VALUE / PREVIOUS_VALUE - NEXTVAL in DEFAULT - Ensure that NEXTVAL in DEFAULT uses database from base table - Two NEXTVAL for same row should give same answer. - Oracle syntax sequence_table.nextval, without any FOR or FROM. - Sequence tables are treated as 'not read constant tables' by SELECT; Would be better if we would have a separate list for sequence tables so that select doesn't know about them, except if refereed to with FROM. Other things done: - Improved output for safemalloc backtrack - frm_type_enum changed to Table_type - Removed lex->is_view and replaced with lex->table_type. This allows use to more easy check if item is view, sequence or table. - Added table flag HA_CAN_TABLES_WITHOUT_ROLLBACK, needed for handlers that want's to support sequences - Added handler calls: - engine_name(), to simplify getting engine name for partition and sequences - update_first_row(), to be able to do efficient sequence implementations. - Made binlog_log_row() global to be able to call it from ha_sequence.cc - Added handler variable: row_already_logged, to be able to flag that the changed row is already logging to replication log. - Added CF_DB_CHANGE and CF_SCHEMA_CHANGE flags to simplify deny_updates_if_read_only_option() - Added sp_add_cfetch() to avoid new conflicts in sql_yacc.yy - Moved code for add_table_options() out from sql_show.cc::show_create_table() - Added String::append_longlong() and used it in sql_show.cc to simplify code. - Added extra option to dd_frm_type() and ha_table_exists to indicate if the table is a sequence. Needed by DROP SQUENCE to not drop a table.
* | | | | Adding an alternative grammar file sql_yacc_ora.yy for sql_mode=ORACLEAlexander Barkov2017-04-051-0/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Adding a new grammar file sql_yacc_ora.yy, which is currently almost a full copy of sql_yacc.yy. Note, it's now assumed that sql_yacc.yy and sql_yacc_ora.yy use the same set of %token directives and exactly the same %union directive. These declarations should eventually be moved into a shared included file, to make sure that sql_yacc.h and sql_yacc_ora.h are compatible. - Removing the "-p MYSQL" flag from cmake/bison.cmake, using the %name-prefix directive inside sql_yacc.yy and sql_yacc_ora.yy instead - Adding other CMake related changes to build sql_yacc_ora.o form sql_yacc_ora.yy - Adding NUMBER(M,N) as a synonym to DECIMAL(M,N) as the first Oracle compatibility syntax understood in sql_mode=ORACLE. - Adding prototypes to functions add_virtual_expression() and handle_sql2003_note184_exception(), so they can be used in both sql_yacc.yy and sql_yacc_ora.yy. - Adding a new test suite compat/oracle, with the first test "type_number". Use this: ./mtr compat/oracle.type_number # to run a single test ./mtr --suite=compat/oracle # to run the entire new suite - Adding compat/oracle into the list of default suites, so BuildBot can run it automatically on pushes.
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-03-302-10/+10
|\ \ \ \ | |/ / /
| * | | remove old API for SHA2Sergei Golubchik2017-03-101-1/+1
| | | |
| * | | bugfix: mutex order violation in embeddedSergei Golubchik2017-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | safe_mutex: Found wrong usage of mutex 'LOCK_thread_count' and 'LOCK_status' Mutex currently locked (in reverse order): LOCK_status sql/sql_class.h line 3873 LOCK_thread_count libmysqld/lib_sql.cc line 432
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2016-12-291-2/+3
|\ \ \ \ | |/ / /
* | | | MDEV-9143 JSON_xxx functions.Alexey Botchkov2016-10-191-1/+2
| | | | | | | | | | | | | | | | | | | | strings/json_lib.c added as a JSON library. SQL frunction added with sql/item_jsonfunc.h/cc
* | | | Use sql_mode_t for sql_mode.Monty2016-10-051-0/+1
| | | | | | | | | | | | | | | | This fixed several cases where we where using just ulong for sql_mode
* | | | Merge branch '10.2' into bb-10.2-connector-c-integ-submSergei Golubchik2016-09-212-1/+8
|\ \ \ \
| * \ \ \ Merge branch '10.1' into 10.2Sergei Golubchik2016-09-091-0/+6
| |\ \ \ \ | | |/ / /
| | * | | MDEV-10318 : Fix crash in embedded, in case prepared statement has parameter ↵Vladislav Vaintroub2016-07-111-0/+6
| | | | | | | | | | | | | | | | | | | | placeholders, but does not bind parameters
| * | | | MDEV-8931: (server part of) session state trackingOleksandr Byelkin2016-08-311-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Postreview fixes. New MySQL tests fixes.
| * | | | MDEV-8931: (server part of) session state trackingOleksandr Byelkin2016-08-311-2/+2
| | | | | | | | | | | | | | | | | | | | Transaction tracker
| * | | | MDEV-8931: (server part of) session state trackingOleksandr Byelkin2016-08-312-1/+3
| | | | | | | | | | | | | | | | | | | | initial commit to test
* | | | | restore support for symbol versioning in libmysqldSergei Golubchik2016-09-121-0/+248
| | | | | | | | | | | | | | | | | | | | (and fix compilation failure in c/c)
* | | | | remove libmysql/Sergei Golubchik2016-09-123-2/+4993
| | | | | | | | | | | | | | | | | | | | also disable server's client plugins when C/C has the same
* | | | | MDEV-9293 - Use MariaDB's Connector/C in serverVladislav Vaintroub2016-08-251-2/+2
|/ / / /
* | | | Revert "MDEV-9293 Connector/C integration"Vladislav Vaintroub2016-08-192-11/+11
| | | | | | | | | | | | | | | | This reverts commit 7b89b9f5108c80f4f270da922d7e6c182a663719.
* | | | MDEV-9293 Connector/C integrationVladislav Vaintroub2016-08-192-11/+11
| | | |
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2016-06-301-3/+7
|\ \ \ \ | |/ / /
| * | | Merge branch '10.0' into 10.1Sergei Golubchik2016-06-281-3/+7
| |\ \ \ | | |/ /
| | * | Merge branch '5.5' into bb-10.0Sergei Golubchik2016-06-211-3/+7
| | |\ \ | | | |/
| | | * Restore COMPONENT Embedded for Windows embedded libs.Vladislav Vaintroub2016-05-241-3/+7
| | | |
* | | | MDEV-10138 Support for decimals up to 38 digitsMonty2016-06-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decimals with float, double and decimal now works the following way: - DECIMAL_NOT_SPECIFIED is used when declaring DECIMALS without a firm number of decimals. It's only used in asserts and my_decimal_int_part. - FLOATING_POINT_DECIMALS (31) is used to mark that a FLOAT or DOUBLE was defined without decimals. This is regarded as a floating point value. - Max decimals allowed for FLOAT and DOUBLE is FLOATING_POINT_DECIMALS-1 - Clients assumes that float and double with decimals >= NOT_FIXED_DEC are floating point values (no decimals) - In the .frm decimals=FLOATING_POINT_DECIMALS are used to define floating point for float and double (31, like before) To ensure compatibility with old clients we do: - When storing float and double, we change NOT_FIXED_DEC to FLOATING_POINT_DECIMALS. - When creating fields from .frm we change for float and double FLOATING_POINT_DEC to NOT_FIXED_DEC - When sending definition for a float/decimal field without decimals to the client as part of a result set we convert NOT_FIXED_DEC to FLOATING_POINT_DECIMALS. - variance() and std() has changed to limit the decimals to FLOATING_POINT_DECIMALS -1 to not get the double converted floating point. (This was to preserve compatiblity) - FLOAT and DOUBLE still have 30 as max number of decimals. Bugs fixed: variance() printed more decimals than we support for double values. New behaviour: - Strings now have 38 decimals instead of 30 when converted to decimal - CREATE ... SELECT with a decimal with > 30 decimals will create a column with a smaller range than before as we are trying to preserve the number of decimals. Other changes - We are now using the obsolete bit FIELDFLAG_LEFT_FULLSCREEN to specify decimals > 31 - NOT_FIXED_DEC is now declared in one place - For clients, NOT_FIXED_DEC is always 31 (to ensure compatibility). On the server NOT_FIXED_DEC is DECIMAL_NOT_SPECIFIED (39) - AUTO_SEC_PART_DIGITS is taken from DECIMAL_NOT_SPECIFIED - DOUBLE conversion functions are now using DECIMAL_NOT_SPECIFIED instead of NOT_FIXED_DEC
* | | | MDEV-5535: Cannot reopen temporary tableNirbhay Choubey2016-06-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysqld maintains a list of TABLE objects for all temporary tables created within a session in THD. Here each table is represented by a TABLE object. A query referencing a particular temporary table for more than once, however, failed with ER_CANT_REOPEN_TABLE error because a TABLE_SHARE was allocate together with the TABLE, so temporary tables always had only one TABLE per TABLE_SHARE. This patch lift this restriction by separating TABLE and TABLE_SHARE objects and storing TABLE_SHAREs for temporary tables in a list in THD, and TABLEs in a list within their respective TABLE_SHAREs.
* | | | cleanup: thread_countSergei Golubchik2016-06-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | move thread_count handling into THD: * increment thread_count in THD constructor * decrement thread_count in THD destructor * never modify thread_count directly!
* | | | Reuse THD for new user connectionsMonty2016-06-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - To ensure that mallocs are marked for the correct THD, even if it's allocated in another thread, I added the thread_id to the THD constructor - Added st_my_thread_var to thr_lock_info_init() to avoid a call to my_thread_var - Moved things from THD::THD() to THD::init() - Moved some things to THD::cleanup() - Added THD::free_connection() and THD::reset_for_reuse() - Added THD to CONNECT::create_thd() - Added THD::thread_dbug_id and st_my_thread_var->dbug_id. These are needed to ensure that we have a constant thread_id used for debugging with a THD, even if it changes thread_id (=connection_id) - Set variables.pseudo_thread_id in constructor. Removed not needed sets.
* | | | MDEV-9947: COM_MULTI united responseOleksandr Byelkin2016-05-171-1/+2
| | | |
* | | | Merge commit 'd5822a3ad0657040114cdc185c6387b9eb3a12b2' into 10.2Monty2016-04-281-0/+3
|\ \ \ \ | |/ / /
| * | | Fixed wrong counting of global Memory_usedMonty2016-04-281-0/+3
| | | |
* | | | Merge branch '10.2' into bb-10.2-mdev9543Sergei Petrunia2016-03-282-3/+5
|\ \ \ \
| * \ \ \ Manual merge of branch 'bb-10.2-mdev8789' into 10.2Igor Babaev2016-03-211-0/+1
| |\ \ \ \