summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-2/+2
| | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
* Change C_STRING_WITH_LEN to STRING_WITH_LENMonty2018-01-301-335/+335
| | | | | | | | | This preserves const str for constant strings Other things - A few variables where changed from LEX_STRING to LEX_CSTRING - Incident_log_event::Incident_log_event and record_incident where changed to take LEX_CSTRING* as an argument instead of LEX_STRING
* Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This was done in, among other things: - thd->db and thd->db_length - TABLE_LIST tablename, db, alias and schema_name - Audit plugin database name - lex->db - All db and table names in Alter_table_ctx - st_select_lex db Other things: - Changed a lot of functions to take const LEX_CSTRING* as argument for db, table_name and alias. See init_one_table() as an example. - Changed some function arguments from LEX_CSTRING to const LEX_CSTRING - Changed some lists from LEX_STRING to LEX_CSTRING - threads_mysql.result changed because process list_db wasn't always correctly updated - New append_identifier() function that takes LEX_CSTRING* as arguments - Added new element tmp_buff to Alter_table_ctx to separate temp name handling from temporary space - Ensure we store the length after my_casedn_str() of table/db names - Removed not used version of rename_table_in_stat_tables() - Changed Natural_join_column::table_name and db_name() to never return NULL (used for print) - thd->get_db() now returns db as a printable string (thd->db.str or "")
* System Versioning pre0.12Aleksey Midenkov2017-11-071-41/+10
|\ | | | | | | Merge remote-tracking branch 'origin/archive/2017-10-17' into 10.3
| * SQL: VTQ testing iface moved to plugin [closes #224]Aleksey Midenkov2017-07-071-159/+10
| |
| * IB, SQL: (0.4) COMMIT_ID-based ordering of transactionsAleksey Midenkov2017-05-051-45/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | IB: * removed CONCURR_TRX from VTQ; * new fields in VTQ: COMMIT_ID, ISO_LEVEL. SQL: * renamed BEGIN_TS, COMMIT_TS to VTQ_BEGIN_TS, VTQ_COMMIT_TS; * new functions: VTQ_COMMIT_ID, VTQ_ISO_LEVEL, VTQ_TRX_ID, VTQ_TRX_SEES, VTQ_TRX_SEES_EQ; * versioned SELECT for IB uses VTQ_TRX_SEES, VTQ_TRX_SEES_EQ. Closes #71
| * IB: 0.2 part IVAleksey Midenkov2017-05-051-0/+88
| | | | | | | | | | | | | | | | | | | | | | * BEGIN_TS(), COMMIT_TS() SQL functions; * VTQ instead of packed stores secs + usecs like my_timestamp_to_binary() does; * versioned SELECT to IB is translated with COMMIT_TS(); * SQL fixes: - FOR_SYSTEM_TIME_UNSPECIFIED condition compares to TIMESTAMP_MAX_VALUE; - segfault fix #36: multiple execute of prepared stmt; - different tables to same stored procedure fix (#39) * Fixes of previous parts: ON DUPLICATE KEY, other misc fixes.
* | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2017-10-301-0/+50
|\ \ | | | | | | | | | TODO: enable MDEV-13049 optimization for 10.3
| * | MDEV-14012 - sql_mode=Oracle: substr(): treat position 0 as position 1halfspawn2017-10-061-0/+50
| | |
* | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-10-041-1/+1
|\ \ \ | |/ /
| * | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-10-021-1/+1
| |\ \
| | * | MDEV-13384 - misc Windows warnings fixedVladislav Vaintroub2017-09-281-8/+7
| | | |
* | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-09-251-25/+2
|\ \ \ \ | |/ / /
| * | | MDEV-11553 Can't restore a PERSISTENT column that uses DATE_FORMAT()Sergei Golubchik2017-09-231-25/+2
| | | | | | | | | | | | | | | | 3-argument form of DATE_FORMAT
* | | | Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2017-09-231-0/+29
|\ \ \ \ | |/ / /
| * | | MDEV-13863 sql_mode=ORACLE: DECODE does not treat two NULLs as equivalentAlexander Barkov2017-09-231-0/+29
| | | |
* | | | Enusure that my_global.h is included firstMichael Widenius2017-08-241-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added sql/mariadb.h file that should be included first by files in sql directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables that must be done before my_global.h is included) - Removed a lot of include my_global.h from include files - Removed include's of some files that my_global.h automatically includes - Removed duplicated include's of my_sys.h - Replaced include my_config.h with my_global.h
* | | MDEV-13003 - Oracle compatibility : Replace functionhalfspawn2017-08-111-1/+26
| | |
* | | MDEV-13415 Wrap the code in sp.cc into a class Sp_handlerAlexander Barkov2017-07-311-1/+1
| | |
* | | MDEV-12932 Remove enum Cast_target and use Type_handler to handle CASTAlexander Barkov2017-05-271-172/+3
| | |
* | | MDEV-12783 : sql_mode=ORACLE: Functions LENGTH() and LENGTHB()halfspawn2017-05-181-2/+1
| | |
* | | MDEV-12784 Change Item_func_length::print() to display octet_length() rather ↵Alexander Barkov2017-05-111-2/+27
| | | | | | | | | | | | than length()
* | | MDEV-12685 Oracle-compatible function CHR()halfspawn2017-05-081-0/+24
| | |
* | | MDEV-12658 Make the third parameter to LPAD and RPAD optionalhalfspawn2017-05-031-8/+60
| | |
* | | Changing field::field_name and Item::name to LEX_CSTRINGMonty2017-04-231-168/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-12478 CONCAT function inside view casts values incorrectly with Oracle ↵Alexander Barkov2017-04-111-0/+35
| |/ |/| | | | | sql_mode
* | MDEV-12143 sql_mode=ORACLE: make the CONCAT function ignore NULL argumentsAlexander Barkov2017-04-051-1/+3
| |
* | MDEV-10342 Providing compatibility for basic SQL built-in functionsAlexander Barkov2017-04-051-23/+0
| | | | | | | | | | | | Adding the Oracle style DECODE function: DECODE(operand, search, result [, search, result ...] [, default_result])
* | MDEV-10342 Providing compatibility for basic SQL built-in functionsAlexander Barkov2017-04-051-0/+24
| | | | | | | | Adding functions NVL() and NVL2().
* | MDEV-12415 Remove sp_name::m_qnameAlexander Barkov2017-03-311-1/+0
|/
* MDEV-11439 No data type JSON, but CAST(something AS JSON) pretends to workSergei Golubchik2017-02-141-3/+0
| | | | | | Use JSON_COMPACT(X) instead of CAST(X AS JSON). Bonus - X is validated to be a valid JSON. Fix a typo in the error message.
* MDEV-11439 No data type JSON, but CAST(something AS JSON) pretends toAlexey Botchkov2017-02-141-5/+20
| | | | | | work. json_detailed() fixed
* MDEV-11557 port MySQL-5.7 JSON tests to MariaDB.Alexey Botchkov2017-02-061-0/+72
| | | | Fixes for issues found.
* MDEV-11042 Implement GeoJSON functions.Alexey Botchkov2017-01-241-0/+125
| | | | ST_AsGeoJSON and ST_GeomFromGeoJSON functions implemented.
* cleanup: old (harmless?) typo fixedSergei Golubchik2016-12-121-1/+1
|
* MDEV-11452 JSON_CONTAINS accepts wrong number of arguments.Alexey Botchkov2016-12-051-3/+3
| | | | Create_func_json_contains::create_native fixed.
* MDEV-11445 JSON_MERGE requires at least two arguments in MySQL, but not in ↵Alexey Botchkov2016-12-051-1/+1
| | | | | | MariaDB. Create_func_json_merge::create_native fixed.
* MDEV-11041 Innodb_gis/ tests taken from MySQL fail.Alexey Botchkov2016-11-291-0/+1
| | | | | Some fixes made in innodb and item_create.cc. Adapted Innodb-GIS tests moved to MariaDB.
* MDEV-9143 JSON_xxx functions.Alexey Botchkov2016-11-151-0/+302
| | | | | The rest of mysql/json functions implemented. CAST AS JSON implemented.
* MDEV-9143 JSON_xxx functions.Alexey Botchkov2016-10-191-0/+474
| | | | | 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-1/+1
| | | | This fixed several cases where we where using just ulong for sql_mode
* MDEV-6152: Remove calls to current_thd while creating ItemMonty2015-09-011-1/+1
| | | | | Part 5: Removing calls to current_thd in net_read calls, creating fields, query_cache, acl and some other places where thd was available
* MDEV-6152: Remove calls to current_thd while creating ItemMonty2015-08-271-6/+6
| | | | | | | | - Part 3: Adding mem_root to push_back() and push_front() Other things: - Added THD as an argument to some partition functions. - Added memory overflow checking for XML tag's in read_xml()
* Stage 2 of MDEV-6152:Monty2015-08-211-2/+2
| | | | | | | | - Added mem_root to all calls to new Item - Added private method operator new(size_t size) to Item to ensure that we always use a mem_root when creating an item. This saves use once call to current_thd per Item creation
* MDEV-8010 - Avoid sql_alloc() in Items (Patch #1)Sergey Vojtovich2015-08-211-258/+258
| | | | | | | Added mandatory thd parameter to Item (and all derivative classes) constructor. Added thd parameter to all routines that may create items. Also removed "current_thd" from Item::Item. This reduced number of pthread_getspecific() calls from 290 to 177 per OLTP RO transaction.
* Moving ST_RELATE() implementation out of Item_func_precise_spatial_rel,Alexander Barkov2015-06-261-1/+1
| | | | | | adding a separte class Item_func_spatial_relate for ST_RELATE(). This is a preparatory patch for: MDEV-8239 Reverse spatial operations OP(const, field) do not get optimized
* - Moving Item_func_spatial_mbr_rel from Item_bool_func2 to Item_bool_func,Alexander Barkov2015-05-051-15/+15
| | | | | | | | as Item_func_spatial_mbr_rel needs nothing from Item_bool_func2. - Renaming Item_func_spacial_rel (the class that implements precise spacial relations) to Item_func_spatial_precise_rel - Adding a new abstract class Item_func_spatial_rel as a common parent for Item_func_spatial_precise_rel and Item_func_spatial_mbr_rel.
* MDEV-7512 GIS: ST_ synonyms for functions are not consistent.Alexey Botchkov2015-03-151-0/+12
| | | | Checked for missing synonims, added those found.
* parser cleanup: don't store field properties in LEX, use Create_field directlySergei Golubchik2014-12-041-5/+4
| | | | | | | | | | | length/dec/charset are still in LEX, because they're also used for CAST and dynamic columns. also 1. fix "MDEV-7041 COLLATION(CAST('a' AS CHAR BINARY)) returns a wrong result" 2. allow BINARY modifier in stored function RETURN clause 3. allow "COLLATION without CHARSET" in SP/SF (parameters, RETURN, DECLARE) 4. print correct variable name in error messages for stored routine parameters
* Merge branch '10.0' into bb-10.1-mergeSergei Golubchik2014-12-021-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .bzrignore VERSION cmake/plugin.cmake debian/dist/Debian/control debian/dist/Ubuntu/control mysql-test/r/join_outer.result mysql-test/r/join_outer_jcl6.result mysql-test/r/null.result mysql-test/r/old-mode.result mysql-test/r/union.result mysql-test/t/join_outer.test mysql-test/t/null.test mysql-test/t/old-mode.test mysql-test/t/union.test packaging/rpm-oel/mysql.spec.in scripts/mysql_config.sh sql/ha_ndbcluster.cc sql/ha_ndbcluster_binlog.cc sql/ha_ndbcluster_cond.cc sql/item_cmpfunc.h sql/lock.cc sql/sql_select.cc sql/sql_show.cc sql/sql_update.cc sql/sql_yacc.yy storage/innobase/buf/buf0flu.cc storage/innobase/fil/fil0fil.cc storage/innobase/include/srv0srv.h storage/innobase/lock/lock0lock.cc storage/tokudb/CMakeLists.txt storage/xtradb/buf/buf0flu.cc storage/xtradb/fil/fil0fil.cc storage/xtradb/include/srv0srv.h storage/xtradb/lock/lock0lock.cc support-files/mysql.spec.sh