summaryrefslogtreecommitdiff
path: root/sql/udf_example.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix various spelling errors still found in codeOtto Kekäläinen2021-03-221-2/+2
| | | | | | | | | | | | | | | Reseting -> Resetting Unknow -> Unknown capabilites -> capabilities choosen -> chosen direcory -> directory informations -> information openned -> opened refered -> referred to access -> one to access missmatch -> mismatch succesfully -> successfully dont -> don't
* Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+1
|\
| * Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| |\
| | * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| | |\
| | | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | | | | | * Update wrong zip-code
* | | | MDEV-15073: Generic UDAF parser code in server for windows functionsOleksandr Byelkin2018-11-271-0/+139
|/ / / | | | | | | | | | | | | | | | Added support for usual agreggate UDF (UDAF) Added remove() call support for more efficient window function processing Added example of aggregate UDF with efficient windows function support
* | | Make possible to use clang on Windows (clang-cl)Vladislav Vaintroub2018-02-201-8/+5
| | | | | | | | | | | | | | | | | | -DWITH_ASAN can be used as well now, on x64 Fix many clang-cl warnings.
* | | Windows, compiling : reenable warning C4996 (deprecated functions)Vladislav Vaintroub2018-02-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | But set _CRT_NONSTDC_NO_WARNINGS to silence silly warnings about ANSI C function being non-standard Remove now deprecated GetVersion()/GetVersionEx(),except single case where where it is really needed, in feedback plugin. Remove checks for Windows NT. Avoid old IPv4-only inet_aton, which generated the warning.
* | | 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-1/+1
| | |/
* | | 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-10139 Support for SEQUENCE objectsMonty2017-04-071-11/+11
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge remote-tracking branch 'mysql/5.5' into bb-5.5-merge @ mysql-5.5.42Sergei Golubchik2015-02-111-1/+4
|\
| * Bug #19688008 CREATE_ASYMMETRIC_PUB_KEY: CRASHES IN OPENSSLVamsikrishna Bhagi2014-12-091-8/+0
| | | | | | | | | | | | | | CODE Fixed a failure on pb2 caused by the patch previously pushed.
| * Bug #19688008 CREATE_ASYMMETRIC_PUB_KEY: CRASHES IN OPENSSLVamsikrishna Bhagi2014-12-031-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | CODE Problem: UDF doesn't handle the arguments properly when they are of string type due to a misplaced break. The length of arguments is also not set properly when the argument is NULL. Solution: Fixed the code by putting the break at right place and setting the argument length to zero when the argument is NULL.
| * Updated/added copyright headersKent Boortz2011-06-301-2/+2
| |\
| | * Updated/added copyright headersKent Boortz2011-06-301-2/+4
| | |\
| | | * Updated/added copyright headersKent Boortz2011-06-301-2/+3
| | | |
| * | | Auto-merge from mysql-trunk-merge.Alexander Nozdrin2010-07-291-1/+1
| |\ \ \
| | * \ \ Merge of mysql-5.1-bugteam into mysql-trunk-merge.Davi Arnaut2010-07-201-1/+1
| | |\ \ \ | | | |/ /
| | | * | Bug#45288: pb2 returns a lot of compilation warnings on linuxDavi Arnaut2010-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings flagged by the new warning option -Wunused-but-set-variable that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The option causes a warning whenever a local variable is assigned to but is later unused. It also warns about meaningless pointer dereferences.
| * | | | WL#5498: Remove dead and unused source codeDavi Arnaut2010-07-231-2/+1
| |/ / / | | | | | | | | Remove workarounds for ancient systems.
| * | | Merge of mysql-5.1-bugteam into mysql-trunk-merge.Davi Arnaut2010-07-021-0/+2
| |\ \ \ | | |/ /
| | * | Bug#53445: Build with -Wall and fix warnings that it generatesDavi Arnaut2010-07-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | Merge in fix for bug#42589Magnus Blåudd2010-03-151-1/+1
| |\ \ \
| | * | | Bug#42589 mysql_fix_privilege_tables.sh to be deprecatedMagnus Blåudd2009-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | - Remove remnants of "mysql_fix_privilege_tables.sh"(again)
| * | | | Backport of:Konstantin Osipov2009-11-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---------------------------------------------------------------------- ChangeSet@1.2571, 2008-04-08 12:30:06+02:00, vvaintroub@wva. +122 -0 Bug#32082 : definition of VOID in my_global.h conflicts with Windows SDK headers VOID macro is now removed. Its usage is replaced with void cast. In some cases, where cast does not make much sense (pthread_*, printf, hash_delete, my_seek), cast is ommited.
| * | | | Manual merge from mysql-trunk-merge.Alexander Nozdrin2009-10-141-2/+2
| |\ \ \ \ | | | |/ / | | |/| |
| | * | | Merge from 5.0Staale Smedseng2009-09-171-2/+2
| | |\ \ \ | | | |/ / | | |/| / | | | |/
| | | * Bug #43414 Parenthesis (and other) warnings compiling MySQLStaale Smedseng2009-09-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
| * | | Backport http://lists.mysql.com/commits/57778Vladislav Vaintroub2009-09-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2677 Vladislav Vaintroub 2008-11-04 CMakeLists.txt files cleanup - remove SAFEMALLOC and SAFE_MUTEX definitions that were present in *each* CMakeLists.txt. Instead, put them into top level CMakeLists.txt, but disable on Windows, because a) SAFEMALLOC does not add any functionality that is not already present in Debug C runtime ( and 2 safe malloc one on top of the other only unnecessarily slows down the server) b)SAFE_MUTEX does not work on Windows and have been explicitely disabled on Windows with #undef previously. Fortunately, ntdll does pretty good job identifying l problems with CRITICAL_SECTIONs. DebugBreak()s on using uninited critical section, unlocking unowned critical section) -Also, remove occationally used -D_DEBUG (added by compiler anyway)
| * | | Backport of the patch Vladislav Vaintroub2009-09-301-0/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://lists.mysql.com/commits/57725 Vladislav Vaintroub 2008-11-03 Cleanup CMakeLists.txt(s) - remove winsock2 (ws2_32) from TARGET_LINK_LIBRARIES. Every exe or dll linked with mysys needs ws2_32, because mysys uses winsock function WSAStartup in my_init(). However, there is no need to explicitely add ws2_32 to the list of TARGET_LINK_LIBRARIES multiple times. Visual Studio comes with a handy pragma that tells linker to add library. So patch replaces bunch of ws2_32 in CMakeLists with single pragma comment(lib,"ws2_32") in my_init.c Additionally, reference to non-existing "debug" library has been removed from TARGET_LINK_LIBRARIES. The correct name of the library is "dbug".
| * | Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-131-2/+2
| |\ \ | | |/ | | | | | | | | | | | | - 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-2/+2
| | | | | | | | | | | | | | | - 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
| * | Merge magare.gmz:/home/kgeorge/mysql/work/B30355-5.0-optgkodinov/kgeorge@magare.gmz2007-11-271-6/+4
| |\ \ | | |/ | | | | | | into magare.gmz:/home/kgeorge/mysql/work/B30355-5.1-opt
| | * Bug #30355: Incorrect ordering of UDF resultsgkodinov/kgeorge@magare.gmz2007-11-271-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's currently no way of knowing the determinicity of an UDF. And the optimizer and the sequence() UDFs were making wrong assumptions about what the is_const member means. Plus there was no implementation of update_system_tables() causing the optimizer to overwrite the information returned by the <udf>_init function. Fixed by equating the assumptions about the semantics of is_const and providing a implementation of update_used_tables(). Added a TODO item for the UDF API change needed to make a better implementation.
| * | Merge shellback.(none):/home/msvensson/mysql/mysql-5.0-maintmsvensson@shellback.(none)2007-09-221-2/+2
| |\ \ | | |/ | | | | | | into shellback.(none):/home/msvensson/mysql/my51-bug30843
| | * Bug #29804 UDF parameters don't contain correct string lengthdkatz@damien-katzs-computer.local2007-09-051-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | Previously, UDF *_init functions were passed constant strings with erroneous lengths. The length came from the containing variable's size, not the length of the value itself. Now the *_init functions get the constant as a null terminated string with the correct length supplied too.
| * | Bug#29804 UDF parameters don't contain correct string lengthmsvensson@pilot.(none)2007-08-091-3/+3
| | | | | | | | | | | | | | | - Fix warnings - Export 'check_const_len' from udf_example.dll
| * | Bug #29804 UDF parameters don't contain correct string lengthdkatz@damien-katzs-computer.local2007-08-051-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | Previously, UDF *_init functions were passed constant strings with erroneous lengths. The length came from the containing variable's size, not the length of the value itself. Now the *_init functions get the constant as a null terminated string with the correct length supplied.
| * | Merge olga.mysql.com:/home/igor/mysql-5.0-optigor@olga.mysql.com2007-06-041-1/+2
| |\ \ | | |/ | | | | | | into olga.mysql.com:/home/igor/mysql-5.1-opt-merge
| | * bug#27741: udf test fails on AIX < 5.3mhansson@dl145s.mysql.com2007-05-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | problem #1: udf_example.so does not get built on AIX solution#1: build it yourself using cd sql; gcc -g -I ../include/ -I /usr/include/ -lpthread \ -shared -o udf_example.so udf_example.c; mv udf_example.so \ .libs/ problem#2 (the bug): udf_example fails because it does not recognize the variable LD_LIBRARY_PATH when doing dl_open(), it looks at LIBPATH solution#2: add the library path to LIBPATH problem#3: udf_example returns the wrong result length since it relies on strmov to return a pointer to the end of the string that it copies. On AIX builds, where m_string.h is not included (m_string defines a macro expanding strmov to stpcpy), there is a macro expanding strmov to strcpy, which returns a pointer to the first character. solution#3: define strmov as stpcpy. problem#4: #2 applies on hp-ux as well, but this platform looks at SHLIB_PATH solution#4: added the library path to SHLIB_PATH
| * | Fixed compilations problems and warnings on windowsmonty@mysql.com/narttu.mysql.fi2007-02-231-1/+1
| |/
| * Many files:kent@mysql.com/kent-amd64.(none)2006-12-231-2/+1
| | | | | | | | Changed header to GPL version 2 only
| * Remove warnings by castingtsmith/tim@siva.hindu.god2006-12-191-1/+1
| |
| * Fix netware compile failuremsvensson@neptunus.(none)2006-11-231-3/+4
| | | | | | | | Remove other warnings about unused variables
| * Bug#18761: constant expression as UDF parameters not passed in as constantcmiller@zippy.cornsilk.net2006-11-131-0/+30
| | | | | | | | | | | | | | | | | | The code that set up data to be passed to user-defined functions was very old and analyzed the "Type" of the data that was passed into the UDF, when it really should analyze the "return_type", which is hard-coded for simple Items and works correctly for complex ones like functions. --- Added test at Sergei's behest.
| * Fix for bug #19121: Windows incompatible udf_examplegeorg@lmy002.wdf.sap.corp2006-09-221-0/+11
| |
| * Fix a compilation failiure on QNXkostja@bodhi.local2006-08-021-1/+1
| |