An error occurred fetching the project authors.
- 05 Sep, 2007 1 commit
-
-
unknown authored
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. mysql-test/r/udf.result: Test case to check constants passed UDFs. mysql-test/t/udf.test: Test case to check constants passed UDFs. sql/item_func.cc: UDF _init functions are now passed the length of the constants, rather than the max length of the var containing the constant. sql/udf_example.c: Added check_const_len functions. The check_const_len_init functions checks that the lengths of constants are correctly passed. sql/udf_example.def: Add new example functions to windows dll export list.
-
- 18 Jun, 2007 1 commit
-
-
unknown authored
Fixed runtime to no longer allow the caching of queries with UDF calls. mysql-test/r/udf.result: Added a test that turns on caching and checks that querys calling UDFs don't get cached. mysql-test/t/udf.test: Added a test that turns on caching and checks that querys calling UDFs don't get cached. sql/sql_yacc.yy: Fixed code to set safe_to_cache_query=0 regardless if the function call is a UDF or SP. Where it was placed previously -- at the very end of the else testing for UDFs -- it only executed the statement if the function call was a stored procedure call.
-
- 18 Jan, 2007 1 commit
-
-
unknown authored
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. mysql-test/r/udf.result: Bug #25382: Passing NULL to an UDF called from stored procedures crashes server - test case mysql-test/t/udf.test: Bug #25382: Passing NULL to an UDF called from stored procedures crashes server - test case sql/item_func.cc: Bug #25382: Passing NULL to an UDF called from stored procedures crashes server - reliably check null_value
-
- 15 Dec, 2006 1 commit
-
-
unknown authored
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. mysql-test/r/udf.result: Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove the UDF - test case mysql-test/t/udf.test: Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove the UDF - test case sql/sql_udf.cc: Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove the UDF - use the exact function name in deleting from mysql.proc.
-
- 13 Nov, 2006 1 commit
-
-
unknown authored
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. mysql-test/r/udf.result: Verify that various arguments work. --- Added test at Sergei's behest. mysql-test/t/udf.test: Verify that various arguments work. --- Added test at Sergei's behest. sql/item_func.cc: For function-Items, test whether it is constant and set the struct members for the UDF parameter appropriately. Replace tabs with spaces in affected code. sql/udf_example.c: Include a simple function that is useful in testing.
-
- 24 Oct, 2006 1 commit
-
-
unknown authored
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. mysql-test/r/udf.result: Bug #21809: Error 1356 while selecting from view with grouping though underlying select OK. - test cases mysql-test/t/udf.test: Bug #21809: Error 1356 while selecting from view with grouping though underlying select OK. - test cases sql/item.cc: Bug #21809: Error 1356 while selecting from view with grouping though underlying select OK. - Don't print the refs to SUM functions as refs. sql/item_func.cc: Bug #21809: Error 1356 while selecting from view with grouping though underlying select OK. - print the aliases in the udf calls sql/item_func.h: Bug #21809: Error 1356 while selecting from view with grouping though underlying select OK. - print the aliases in the udf calls sql/sql_lex.cc: Bug #21809: Error 1356 while selecting from view with grouping though underlying select OK. - disable aliases for arguments in stored routine calls sql/sql_lex.h: Bug #21809: Error 1356 while selecting from view with grouping though underlying select OK. - disable aliases for arguments in stored routine calls sql/sql_yacc.yy: Bug #21809: Error 1356 while selecting from view with grouping though underlying select OK. - disable aliases for arguments in stored routine calls - fix bison duplicate symbol warnings
-
- 31 Jul, 2006 1 commit
-
-
unknown authored
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. mysql-test/r/udf.result: Added tests for Bug#21269 (DEFINER-clause is allowed for UDF-functions) mysql-test/t/udf.test: Added tests for Bug#21269 (DEFINER-clause is allowed for UDF-functions) sql/sql_yacc.yy: Creating a UDF function with a DEFINER clause is now a syntax error.
-
- 29 Jul, 2006 1 commit
-
-
unknown authored
Converted "udf_example.cc" to C, avoids C++ runtime lib dependency (bug#21336) sql/Makefile.am: "udf_example.cc" converted to C, avoids C++ runtime lib dependency (bug#21336) mysql-test/t/udf.test: "udf_example.cc" converted to C, avoids C++ runtime lib dependency (bug#21336) sql/udf_example.c: Changes to be strict ansi, except long long
-
- 25 Jul, 2006 1 commit
-
-
unknown authored
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. mysql-test/t/udf.test: Added test case for bug#19862: Sort with filesort by function evaluates function twice mysql-test/t/sp.test: Added test case for bug#19862: Sort with filesort by function evaluates function twice mysql-test/r/sp.result: Added test case for bug#19862: Sort with filesort by function evaluates function twice mysql-test/r/udf.result: Added test case for bug#19862: Sort with filesort by function evaluates function twice sql/sql_select.cc: Fixed bug#19862: Sort with filesort by function evaluates function twice If an expression referenced in an ORDER clause contains a SP or UDF function, force the use of a temporary table. sql/item_func.h: Fixed bug#19862: Sort with filesort by function evaluates function twice A new Item_processor function called func_type_checker_processor is added to check whether the expression contains a function of a particular type. sql/item.h: Fixed bug#19862: Sort with filesort by function evaluates function twice A new Item_processor function called func_type_checker_processor is added to check whether the expression contains a function of a particular type. sql/item_func.cc: Fixed bug#19862: Sort with filesort by function evaluates function twice A new Item_processor function called func_type_checker_processor is added to check whether the expression contains a function of a particular type.
-
- 08 Jun, 2006 1 commit
-
-
unknown authored
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. mysql-test/r/udf.result: Add result. mysql-test/t/udf.test: Add test. sql/sql_udf.h: Initialize is_null to false before trying to use it, so that historical NULLs don't affect our operation.
-
- 27 Apr, 2006 1 commit
-
-
unknown authored
Add test to mysql-test-run.pl to see if the udf_example.so is availble. Set 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. mysql-test/include/have_udf.inc: Add check if udf_example.so(or similar) is available mysql-test/lib/mtr_misc.pl: Add funcion "mtr_file_exist" to search for files mysql-test/mysql-test-run.pl: Add checks to find the udf_example.so library mysql-test/r/udf.result: Update result mysql-test/t/disabled.def: Remove udf.test from disabled tests mysql-test/t/udf.test: Use variable UDF_EXAMPLE_LIB when looking for shared library to load mysql-test/r/have_udf_example.require: New BitKeeper file ``mysql-test/r/have_udf_example.require''
-
- 10 Mar, 2006 2 commits
-
-
unknown authored
Remove STANDARD define when compile udf_example.so mysql-test/r/udf.result: Update results mysql-test/t/udf.test: Update test try to create, use and drop a non existing function Disable the result from "reverse_lookup" as it is config dependent sql/Makefile.am: Remove the "STANDARD" define when compiling udf_example.so
-
unknown authored
- Update of test toolsand Makefiles to make it possible to test always test udf's as part of the mysql test suite mysql-test/mysql-test-run.pl: Add the path where mysqld will udf_example.so used by the udf test mysql-test/r/udf.result: Update test results mysql-test/t/udf.test: Update tests The "--error 0" directives should actually be changed to the correct error number returned but that error number is lost. W e do however get the right error message and that is checked in the .result file. sql/Makefile.am: Build shared library udf_example.so sql/share/errmsg.txt: Update the max length of %s string from 64 to 128 sql/sql_udf.cc: Add DBUG_PRINT just before dl_open sql/udf_example.cc: Use isalpha instade of my_isalpha
-
- 15 Feb, 2006 1 commit
-
-
unknown authored
- 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 sql/item_func.cc: Instead of passing a NULL pointer into val_str, use the "buffers" array to provide a temp string buffer. sql/udf_example.cc: Spelling error"on"->"one" mysql-test/include/have_udf.inc: New BitKeeper file ``mysql-test/include/have_udf.inc'' mysql-test/r/have_udf.require: New BitKeeper file ``mysql-test/r/have_udf.require'' mysql-test/r/udf.result: New BitKeeper file ``mysql-test/r/udf.result'' mysql-test/t/udf.test: New BitKeeper file ``mysql-test/t/udf.test''
-