summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-03-20 21:41:27 +0100
committerunknown <msvensson@neptunus.(none)>2006-03-20 21:41:27 +0100
commitc7f8c632eb485566ddb6b98c924a78a15cbef2fc (patch)
tree316670b60bea41e56d82cc81ba41b4049cea2c66 /sql
parent60bc9ad712c846b235d9856cf5cd9663a9ab076a (diff)
parentb1aacfac72065ab4085199522f75bdaf1f44a088 (diff)
downloadmariadb-git-c7f8c632eb485566ddb6b98c924a78a15cbef2fc.tar.gz
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.1
into neptunus.(none):/home/msvensson/mysql/bug11835/my51-bug11835 client/mysqltest.c: Auto merged configure.in: Auto merged mysql-test/mysql-test-run.pl: Auto merged sql/item_func.cc: Auto merged sql/sql_udf.cc: Auto merged sql/share/errmsg.txt: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/Makefile.am9
-rw-r--r--sql/item_func.cc2
-rw-r--r--sql/udf_example.cc12
3 files changed, 13 insertions, 10 deletions
diff --git a/sql/Makefile.am b/sql/Makefile.am
index b0824110792..8545cd7d75a 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -174,10 +174,11 @@ ha_ndbcluster_binlog.o:ha_ndbcluster_binlog.cc ha_ndbcluster_binlog.h
handler.o: handler.cc ha_ndbcluster.h
$(CXXCOMPILE) @ndbcluster_includes@ $(CXXFLAGS) -c $<
-# For testing of udf_example.so; Works on platforms with gcc
-# (This is not part of our build process but only provided as an example)
-udf_example.so: udf_example.cc
- $(CXXCOMPILE) -shared -o $@ $<
+# For testing of udf_example.so
+noinst_LTLIBRARIES= udf_example.la
+udf_example_la_SOURCES= udf_example.cc
+udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
+
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 34fd07e5a16..7937f4093f2 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2608,7 +2608,7 @@ udf_handler::fix_fields(THD *thd, Item_result_field *func,
switch(arguments[i]->type()) {
case Item::STRING_ITEM: // Constant string !
{
- String *res=arguments[i]->val_str((String *) 0);
+ String *res=arguments[i]->val_str(&buffers[i]);
if (arguments[i]->null_value)
continue;
f_args.args[i]= (char*) res->ptr();
diff --git a/sql/udf_example.cc b/sql/udf_example.cc
index 35833e63fab..e6d272d9085 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;
@@ -290,8 +292,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 */
{
@@ -519,7 +521,7 @@ my_bool myfunc_double_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
{
if (!args->arg_count)
{
- strcpy(message,"myfunc_double must have at least on argument");
+ strcpy(message,"myfunc_double must have at least one argument");
return 1;
}
/*