summaryrefslogtreecommitdiff
path: root/mysql-test/r/udf.result
Commit message (Collapse)AuthorAgeFilesLines
* A fix for Bug#32007 select udf_function() doesn't return an error if errorkostja@bodhi.(none)2007-11-011-6/+6
| | | | | | | | | | | during udf initialization. The bug is spotted while working on Bug 12713. If a user-defined function was used in a SELECT statement, and an error would occur during UDF initialization, this error would not terminate execution of the SELECT, but rather would be converted to a warning. The fix is to use a stack buffer to store the message from udf_init instead of private my_error() buffer.
* Manual merge of 5.0-runtime to 5.1-runtimemalff@lambda.hsd1.co.comcast.net.2007-10-161-3/+10
|
* Bug #29804 UDF parameters don't contain correct string lengthdkatz@damien-katzs-computer.local2007-08-051-0/+24
| | | | | | | | 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 damien-katzs-computer.local:/Users/dkatz/mysql50dkatz@damien-katzs-computer.local2007-06-181-0/+23
|\ | | | | | | into damien-katzs-computer.local:/Users/dkatz/mysql51
| * Bug #28921 Queries containing UDF functions are cacheddkatz@damien-katzs-computer.local2007-06-181-0/+23
| | | | | | | | Fixed runtime to no longer allow the caching of queries with UDF calls.
* | Merge recycle.(none):/src/bug23491/my50-bug23491iggy@recycle.(none)2007-03-291-1/+1
|\ \ | |/ | | | | into recycle.(none):/src/bug23491/my51-bug23491
| * Bug#23491 MySQLDump prefix function call in a view by database nameiggy@recycle.(none)2007-03-271-1/+1
| | | | | | | | | | | | | | | | - mysqldump executes a SHOW CREATE VIEW statement to generate the text that it outputs. When the function name is retrieved it's database name is unconditionally prepended. This change causes the function's database name to be prepended only when it was used to define the function.
* | Merge mysql.com:/home/gluh/MySQL/Merge/5.1gluh@eagle.(none)2007-01-241-0/+34
|\ \ | | | | | | | | | into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
| * \ Merge macbook.gmz:/Users/kgeorge/mysql/work/mysql-5.0-optgkodinov/kgeorge@macbook.gmz2007-01-231-0/+34
| |\ \ | | |/ | | | | | | into macbook.gmz:/Users/kgeorge/mysql/work/merge-5.1-opt
| | * Bug #25382: Passing NULL to an UDF called from stored procedures gkodinov/kgeorge@macbook.gmz2007-01-181-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | crashes server Check for null value is reliable only after calling some of the val_xxx() methods. If the val_xxx() method is not called the null_value flag will be set only for certain types of NULL values (like SQL constant NULLs for example). This caused a crash while trying to dereference a NULL pointer that is returned by val_str() for NULL values. Fixed by swapping the order of val_xxx() and null_value check.
* | | Merge siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/51tsmith@siva.hindu.god2007-01-181-1/+1
|\ \ \ | |/ / |/| | | | | into siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/maint/51
| * | errmsg changecmiller@zippy.cornsilk.net2007-01-171-1/+1
| | |
* | | Merge macbook.local:/Users/kgeorge/mysql/work/mysql-5.0-optgkodinov/kgeorge@macbook.local2007-01-081-0/+11
|\ \ \ | |/ / |/| / | |/ into macbook.local:/Users/kgeorge/mysql/work/merge-5.1-opt
| * Bug #15439: UDF name case handling forces DELETE FROM mysql.func to removegkodinov/kgeorge@macbook.gmz2006-12-151-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the UDF When deleting a user defined function MySQL must remove it from both the in-memory hash table and the mysql.proc system table. Finding (and removal therefore) from the internal hash table is case insensitive (or whatever the default charset is), whereas finding and removal from the system table is case sensitive. As a result if you supply a function name that is not in the same character case to DROP FUNCTION the server will remove the function only from the in-memory hash table and will keep the row in mysql.proc system table. This will cause inconsistency between the two structures (that is fixed only by restarting the server). Fixed by using the name in the precise case (from the in-memory hash table) to delete the row in the mysql.proc system table.
| * Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0msvensson@neptunus.(none)2006-11-281-0/+79
| |\ | | | | | | | | | into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
* | \ Merge neptunus.(none):/home/msvensson/mysql/mysql-5.1msvensson@neptunus.(none)2006-12-041-2/+59
|\ \ \ | | | | | | | | | | | | into neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint
| * | | Bug#24736: UDF functions parsed as Stored Functionsmalff/marcsql@weblab.(none)2006-12-011-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this fix, a call to a User Defined Function (UDF) could, under some circumstances, be interpreted as a call to a Stored function instead. This occurred if a native function was invoked in the parameters for the UDF, as in "select my_udf(abs(x))". The root cause of this defect is the introduction, by the fix for Bug 21809, of st_select_lex::udf_list, and it's usage in the parser in sql_yacc.yy in the rule function_call_generic (in 5.1). While the fix itself for Bug 21809 is correct in 5.0, the code change merged into the 5.1 release created the issue, because the calls in 5.1 to : - lex->current_select->udf_list.push_front(udf) - lex->current_select->udf_list.pop() are not balanced in case of native functions, causing the udf_list, which is really a stack, to be out of sync with the internal stack maintained by the bison parser. Instead of moving the call to udf_list.pop(), which would have fixed the symptom, this patch goes further and removes the need for udf_list. This is motivated by two reasons: a) Maintaining a stack in the MySQL code in sync with the stack maintained internally in sql_yacc.cc (not .yy) is extremely dependent of the implementation of yacc/bison, and extremely difficult to maintain. It's also totally dependent of the structure of the grammar, and has a risk to break with regression defects each time the grammar itself is changed. b) The previous code did report construct like "foo(expr AS name)" as syntax errors (ER_PARSER_ERROR), which is incorrect, and misleading. The syntax is perfectly valid, as this expression is valid when "foo" is a UDF. Whether this syntax is legal or not depends of the semantic of "foo". With this change: a) There is only one stack (in bison), and no List<udf_func> to maintain. b) "foo(expr AS name)", when used incorrectly, is reported as semantic error: - ER_WRONG_PARAMETERS_TO_NATIVE_FCT (for native functions) - ER_WRONG_PARAMETERS_TO_STORED_FCT (for stored functions) This is achieved by the changes implemented in item_create.cc
| * | | Merge shellback.(none):/home/msvensson/mysql/mysql-5.1msvensson@shellback.(none)2006-11-291-0/+79
| |\ \ \ | | | | | | | | | | | | | | | into shellback.(none):/home/msvensson/mysql/mysql-5.1-maint
| * \ \ \ Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug18761/my50-bug18761cmiller@zippy.cornsilk.net2006-11-131-0/+35
| |\ \ \ \ | | | |/ / | | |/| | | | | | | into zippy.cornsilk.net:/home/cmiller/work/mysql/bug18761/my51-bug18761
| | * | | Bug#18761: constant expression as UDF parameters not passed in as constantcmiller@zippy.cornsilk.net2006-11-131-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge bk-internal.mysql.com:/home/bk/mysql-5.1kostja@bodhi.local2006-11-291-0/+79
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
| * | | | mergingholyfoot/hf@mysql.com/deer.(none)2006-11-091-12/+12
| | | | |
| * | | | Merge mysql.com:/home/hf/work/mysql-5.0.cleanholyfoot/hf@deer.(none)2006-11-081-0/+79
| |\ \ \ \ | | |/ / / | |/| | / | | | |/ | | |/| into mysql.com:/home/hf/work/mysql-5.1.clean
| | * | Bug #21809: Error 1356 while selecting from view with grouping though underlyinggkodinov/kgeorge@macbook.gmz2006-10-241-0/+79
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | select OK. The SQL parser was using Item::name to transfer user defined function attributes to the user defined function (udf). It was not distinguishing between user defined function call arguments and stored procedure call arguments. Setting Item::name was causing Item_ref::print() method to print the argument as quoted identifiers and caused views that reference aggregate functions as udf call arguments (and rely on Item::print() for the text of the view to store) to throw an undefined identifier error. Overloaded Item_ref::print to print aggregate functions as such when printing the references to aggregate functions taken out of context by split_sum_func2() Fixed the parser to properly detect using AS clause in stored procedure arguments as an error. Fixed printing the arguments of udf call to print properly the udf attribute.
* | | Bug#18239 (Possible to overload internal functions with stored functions)malff/marcsql@weblab.(none)2006-11-141-0/+16
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#21025 (misleading error message when creating functions named 'x', or 'y') Bug#22619 (Spaces considered harmful) This change contains a fix to report warnings or errors, and multiple tests cases. Before this fix, name collisions between: - Native functions - User Defined Functions - Stored Functions were not systematically reported, leading to confusing behavior. I) Native / User Defined Function Before this fix, is was possible to create a UDF named "foo", with the same name as a native function "foo", but it was impossible to invoke the UDF, since the syntax "foo()" always refer to the native function. After this fix, creating a UDF fails with an error if there is a name collision with a native function. II) Native / Stored Function Before this fix, is was possible to create a SF named "db.foo", with the same name as a native function "foo", but this was confusing since the syntax "foo()" would refer to the native function. To refer to the Stored Function, the user had to use the "db.foo()" syntax. After this fix, creating a Stored Function reports a warning if there is a name collision with a native function. III) User Defined Function / Stored Function Before this fix, creating a User Defined Function "foo" and a Stored Function "db.foo" are mutually exclusive operations. Whenever the second function is created, an error is reported. However, the test suite did not cover this behavior. After this fix, the behavior is unchanged, and is now covered by test cases. Note that the code change in this patch depends on the fix for Bug 21114.
* | Merge bodhi.local:/opt/local/work/tmp_mergekostja@bodhi.local2006-08-121-0/+6
|\ \ | |/ | | | | into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
| * Merge bk-internal.mysql.com:/home/bk/mysql-5.0kostja@bodhi.local2006-08-021-0/+6
| |\ | | | | | | | | | into bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
| * | Bug#21269 (DEFINER-clause is allowed for UDF-functions)malff/marcsql@weblab.(none)2006-07-311-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that the grammar allows to create a function with an optional definer clause, and define it as a UDF with the SONAME keyword. Such combination should be reported as an error. The solution is to not change the grammar itself, and to introduce a specific check in the yacc actions in 'create_function_tail' for UDF, that now reports ER_WRONG_USAGE when using both DEFINER and SONAME.
* | | Merge sunlight.local:/local_work/tmp_merge-5.0-opt-mysqlevgen@sunlight.local2006-07-301-0/+6
|\ \ \ | | |/ | |/| | | | into sunlight.local:/local_work/tmp_merge-5.1-opt-mysql
| * | Fixed bug#19862: Sort with filesort by function evaluates function twiceevgen@moonbone.local2006-07-261-0/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there is no index defined filesort is used to sort the result of a query. If there is a function in the select list and the result set should be ordered by it's value then this function will be evaluated twice. First time to get the value of the sort key and second time to send its value to a user. This happens because filesort when sorts a table remembers only values of its fields but not values of functions. All functions are affected. But taking into account that SP and UDF functions can be both expensive and non-deterministic a temporary table should be used to store their results and then sort it to avoid twice SP evaluation and to get a correct result. If an expression referenced in an ORDER clause contains a SP or UDF function, force the use of a temporary table. A new Item_processor function called func_type_checker_processor is added to check whether the expression contains a function of a particular type.
* | Merge zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.0cmiller@zippy.(none)2006-07-031-0/+18
|\ \ | |/ | | | | into zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.1
| * Bug#19904: UDF: not initialized *is_null per rowcmiller@zippy.(none)2006-06-081-0/+18
| | | | | | | | | | | | | | | | The is_null value was initialized once and thereafter only set to indicate NULL, and never unset to indicate not-NULL. Now set is_null to false, in addition to only setting it to true when the value in question is null.
* | Merge mysql.com:/home/jimw/my/mysql-5.0-cleanjimw@mysql.com2006-04-301-8/+8
|\ \ | |/ | | | | into mysql.com:/home/jimw/my/mysql-5.1-clean
| * Add test to mysql-test-run.pl to see if the udf_example.so is availble. Set ↵msvensson@shellback.(none)2006-04-271-8/+8
| | | | | | | | | | | | envioronment variable UDF_EXAMPLE_LIB if it is. Then check in have_udf if that variable is set. Finally use tahe variable when loading the shared library.
* | Bug#11835 CREATE FUNCTION crashes servermsvensson@neptunus.(none)2006-03-211-1/+1
|/ | | | | | - Update for 5.1 - Add "have_dlopen" - Remove requirement to load udf's only in "opt_plugin_dir"
* Update test results for udfmsvensson@neptunus.(none)2006-03-101-7/+8
| | | | Remove STANDARD define when compile udf_example.so
* Bug#17261 Passing a variable from a stored procedure to UDF crashes mysqldmsvensson@devsrv-b.mysql.com2006-03-101-5/+5
| | | | | - Update of test toolsand Makefiles to make it possible to test always test udf's as part of the mysql test suite
* Bug#17261 Passing a variable from a stored procedure to UDF crashes mysqldmsvensson@devsrv-b.mysql.com2006-02-151-0/+86
- Pass "buffers[i]" to val_str() in udf_handler::fix_fields insteead of NULL. - Add testcase for UDF that will load and run the udf_example functions if available