summaryrefslogtreecommitdiff
path: root/sql/udf_example.cc
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-12-09 12:47:20 +0200
committermonty@mysql.com <>2004-12-09 12:47:20 +0200
commit01e4740f4cff58af5f2aeb64c92b539dd51a6571 (patch)
tree704efc4e05901529199765305291c2172efce817 /sql/udf_example.cc
parent475364104879afab9898bda06dfe508de2e50303 (diff)
downloadmariadb-git-01e4740f4cff58af5f2aeb64c92b539dd51a6571.tar.gz
Ensure that we free memory used with --order-by-primary (in mysqldump)
Simple, non critical, fix to mysql_fix_privilege_tables
Diffstat (limited to 'sql/udf_example.cc')
-rw-r--r--sql/udf_example.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/udf_example.cc b/sql/udf_example.cc
index 7e2ee9113b2..50de0f187fe 100644
--- a/sql/udf_example.cc
+++ b/sql/udf_example.cc
@@ -615,10 +615,12 @@ my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
return 1;
}
bzero(initid->ptr,sizeof(longlong));
- // Fool MySQL to think that this function is a constant
- // This will ensure that MySQL only evalutes the function
- // when the rows are sent to the client and not before any ORDER BY
- // clauses
+ /*
+ Fool MySQL to think that this function is a constant
+ This will ensure that MySQL only evalutes the function
+ when the rows are sent to the client and not before any ORDER BY
+ clauses
+ */
initid->const_item=1;
return 0;
}
@@ -635,9 +637,10 @@ longlong sequence(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
ulonglong val=0;
if (args->arg_count)
val= *((longlong*) args->args[0]);
- return ++ *((longlong*) initid->ptr) + val;
+ return ++*((longlong*) initid->ptr) + val;
}
+
/****************************************************************************
** Some functions that handles IP and hostname conversions
** The orignal function was from Zeev Suraski.