summaryrefslogtreecommitdiff
path: root/sql/udf_example.cc
diff options
context:
space:
mode:
authorunknown <msvensson@devsrv-b.mysql.com>2006-03-10 10:41:04 +0100
committerunknown <msvensson@devsrv-b.mysql.com>2006-03-10 10:41:04 +0100
commite52ff5557cbf67e678fc0e429b338dee73e7b241 (patch)
treebbed8496316f7d96b19be754fe3d12b8acde0584 /sql/udf_example.cc
parent79258e4480bfacd94384263240feba68f83a9a79 (diff)
downloadmariadb-git-e52ff5557cbf67e678fc0e429b338dee73e7b241.tar.gz
Bug#17261 Passing a variable from a stored procedure to UDF crashes mysqld
- 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
Diffstat (limited to 'sql/udf_example.cc')
-rw-r--r--sql/udf_example.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/udf_example.cc b/sql/udf_example.cc
index 6ce66157101..03ce76f68dd 100644
--- a/sql/udf_example.cc
+++ b/sql/udf_example.cc
@@ -113,6 +113,8 @@
*/
#ifdef STANDARD
+/* STANDARD is defined, don't use any mysql functions */
+#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef __WIN__
@@ -125,10 +127,10 @@ typedef long long longlong;
#else
#include <my_global.h>
#include <my_sys.h>
+#include <m_string.h> // To get strmov()
#endif
#include <mysql.h>
-#include <m_ctype.h>
-#include <m_string.h> // To get strmov()
+#include <ctype.h>
static pthread_mutex_t LOCK_hostname;
@@ -289,8 +291,8 @@ char *metaphon(UDF_INIT *initid, UDF_ARGS *args, char *result,
for (n = ntrans + 1, n_end = ntrans + sizeof(ntrans)-2;
word != w_end && n < n_end; word++ )
- if ( my_isalpha ( &my_charset_latin1, *word ))
- *n++ = my_toupper ( &my_charset_latin1, *word );
+ if ( isalpha ( *word ))
+ *n++ = toupper ( *word );
if ( n == ntrans + 1 ) /* return empty string if 0 bytes */
{